Borrar filtros
Borrar filtros

the meaning of 'MaxFunEvals' in 'fmincon'

21 visualizaciones (últimos 30 días)
Elvin Su
Elvin Su el 2 de Mayo de 2014
Editada: Friedrich el 2 de Mayo de 2014
Hello,
The description of the argument 'MaxFunEvals' for 'fmincon' is 'Maximum number of function evaluations allowed.' I don't know which function it is referring to. Can someone help explain it in more details?
Thanks a lot!
Sincerely
Elvin

Respuesta aceptada

Friedrich
Friedrich el 2 de Mayo de 2014
Hi,
it refers to the objective function, e.g.
fmincon(@myfun,....)
and setting MaxFunEvals to 1000 would mean that the fmincon function stops optimizing after calling 1000 times myfun (as long no other stop creatia was hit).
  2 comentarios
Elvin Su
Elvin Su el 2 de Mayo de 2014
Thanks a lot Friedrich!!
Please forgive me as I have a further question. I am using the option 'SQP' method for fmincon. Based on my basic understanding, during each iteration, 'SQP' solves a quadratic programming problem. Is it the case that for each iteration, the objective function is called once? Or it is called multiple times?
Thanks very much!
Sincerely
Elvin
Friedrich
Friedrich el 2 de Mayo de 2014
Editada: Friedrich el 2 de Mayo de 2014
Hi,
it can be called multiple times and each call counts as function evaluation. You also can call the objective function to calcualte the finite differences (gradient). Maybe have a look here.
Whenever, MATLAB starts an optimization routine, a solver begins at an initial value x0, performs some intermediate calculations that eventually lead to a new point x1, and then repeats the process to find successive approximations x2, x3, ... of the local minimum. Processing stops after some number of iterations k.
At any step, intermediate calculations may involve evaluating the objective function and constraints, if any, at points near the current iterate xi. For example, the solver may estimate a gradient by finite differences. At each of these nearby points, the function count (F-count) is increased by one.
It's important to note that there are no checks for MaxFunEvals throughout each step of an optimization algorithm. Doing so adds unnecessary time. Rather, most (all) algorithms check at the beginning or end of an iteration.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by