the meaning of 'MaxFunEvals' in 'fmincon'

11 views (last 30 days)
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

Accepted Answer

Friedrich
Friedrich on 2 May 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 Comments
Elvin Su
Elvin Su on 2 May 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 on 2 May 2014
Edited: Friedrich on 2 May 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.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!