fmincon stuck in a local min
19 views (last 30 days)
Show older comments
Hi,
I am trying to use fmincon to optimize a process and continually receive the following message:
Initial point is a local minimum that satisfies the constraints.
Optimization completed because at the initial point, the objective function is non-decreasing in feasible directions to within the default value of the function tolerance, and constraints are satisfied to within the default value of the constraint tolerance.
And my optimization is the same as my initial condition. This is true regardless of initial condition, however, I know it is indeed not the optimal solution. I have adjusted all of my tolerances but continue to receive this message. I know this is a very general question, but has anyone encountered this before and is anyone willing to share tips/strategies to overcome this?
I am happy to provide more details of my specific code if that would be helpful but I wanted to start with a very general question. Thank you.
2 Comments
José-Luis
on 15 Oct 2014
Try different starting points. There are NO algorithms that can guarantee to find the global optimum. If they claim to do so, they are lying, or at least stretching reality to fit their assumptions.
Answers (1)
Matt J
on 15 Oct 2014
Edited: Matt J
on 15 Oct 2014
It is typically because your objective function contains quantizing operations, like round(), floor(), ceil() ... making the function piecewise constant, and hence locally optimal, almost everywhere. The function f(x)=ceil(x)^2 is a simple 1D example of this, which is flat everywhere except at the integers. The following will not progress from any non-integer initial point x0,
x = fmincon(@(x) ceil(x).^2,x0,[],[],[],[],-10,10)
and won't do well with integer x0 either.
Piecewise constant functions are "illegal" for other reasons too. They are non-differentiable, violating the differentiability asssumptions of fmincon and other Optimization Toolbox solvers.
2 Comments
Matt J
on 19 Oct 2014
Edited: Matt J
on 19 Oct 2014
It's still a little hard to analyze your function because I don't know what the dimensions are of everything in the expression and which are unknowns. rho_1? rho_ideal?
In any case, the function does look like it has a constant region, because the function real((x)^.5)^2 is constant for x<0.
x=linspace(-2,2,1000);
plot(x,real((x.^.5)).^2);
It is also non-differentiable at x=0, which is also bad for fmincon, as I mentioned.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!