fmincon:initial point is the optimum
Show older comments
Hi everyone! Doing a non linear constraint optimization, fmincon finds the optimum value at the initial given point, which is surely not the minimum. The code is the following:
options = optimoptions('fmincon','Display','iter-detailed','Algorithm','sqp',...
'DiffminChange',0.01, 'DiffmaxChange',0.1,'FunValCheck','on','MaxFunEvals',1000,...
'PlotFcns',plotfunction,'TolCon',1e-2);
And the output is:
Norm of First-order
Iter F-count f(x) Feasibility Steplength step optimality
0 53 2.160003e+05 0.000e+00 0.000e+00
Optimization completed: The final point is the initial point.
The first-order optimality measure, 0.000000e+00, is less than
options.TolFun = 1.000000e-06, and the maximum constraint
violation, 0.000000e+00, is less than options.TolCon = 1.000000e-06.
The values of design vector are around the unity, while the values of the function are in the order of 10^5. I have tried different tolerances, both for Tolx and TolFun, from 10^-10 to 10^-1 but it does not change the result. Any suggestion? Thank you! Thank you!
Answers (1)
Alan Weiss
on 28 Oct 2015
1 vote
As I told you in this thread, fmincon sees no reason to move because it sees that the initial point is both feasible and has zero gradient for the objective function. No setting of tolerances will change that fact.
As I told you in that thread, you should probably follow the documented suggestions, the first of which is to change your initial point. Did you? If so, and if fmincon still stayed put, then your objective function is flat, and every point seems to be a local minimum. If not, then I heartily suggest that you try changing the initial point.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
3 Comments
Giacomo Mingardo
on 28 Oct 2015
Walter Roberson
on 29 Oct 2015
Edited: Walter Roberson
on 29 Oct 2015
Hard to say without a copy of the function and the invocation.
Alan Weiss
on 29 Oct 2015
The only other thing I can suggest at this point is to try patternsearch starting from a variety of initial points, such as
x0 = randn(1,52);
If you are optimizing the result of a simulation or ODE, then it is likely that the reason that fmincon gets stuck is that your objective function is locally flat. The only simple ways around that are to use patternsearch or very large finite difference steps.
Make sure that you look at the objective function for a variety of feasible points before doing anything else, though. If all objective function values are the same, then you have to debug your objective function to see why it returns a constant.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
Categories
Find more on Choose a Solver in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!