the meaning of 'MaxFunEvals' in 'fmincon'

10 次查看(过去 30 天)
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

采纳的回答

Friedrich
Friedrich 2014-5-2
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 个评论
Elvin Su
Elvin Su 2014-5-2
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 2014-5-2
编辑:Friedrich 2014-5-2
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.

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by