Error message of fminsearchbnd

2 views (last 30 days)
alpedhuez
alpedhuez on 3 Aug 2020
Commented: alpedhuez on 3 Aug 2020
I go the error message
Exiting: Maximum number of function Evaluatoion has been exceeded
Increase MaxFun Evals Option
Current function value: NaN
Why does this problem occur? What iis the next step?

Accepted Answer

Walter Roberson
Walter Roberson on 3 Aug 2020
fmincon is an iterative process. There is a built in limit on the number of steps that it will take. Sometimes that is not enough to find the minimum to within flatness criteria. You can increase the amount of searching.
https://www.mathworks.com/help/optim/ug/current-and-legacy-option-name-tables.html
optimset or optimoptions with appropriate option name and pass that to fmincon
Note: one of the ways that fmincon can run out of steps is if it is following an asymptotic curve. When that happens it is not uncommon that the region is exploring is quite a distance from the actual minimum. fmincon just sees that the value keeps decreasing (asymptotic), and does not know that it could do better by looking in a different area. Therefore you do always want to let it run for thousands of iterations.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!