Matlab fmincon(function based) optimality issue :: constrained nonlinear optimization

Hi,
I trying to optimize my problem.
Now i am using matlab fmincon with constrainted problem ('sqp' algorithm).
But , in my case, optimality is very large even though the objective fval is converge (please check img.)
So, when I see the exitflag = -2,2 , just keep trying rerun from final result.
My question is
1.
Why did objective function value is converge, but optimality is so great? I have tried a lot to solve this problem.
2.
Is it ok if I rerun to the last value even if exitflag didn't get 1?
( Ex. reulst is exitflag = -2( Constrint is not satisfied.) --> I try to make optimalityTolerence be small for obtaining exitflag = 1.)
I mean this approach is trick ?
3.
If I don't get an exitflag of 1 through sqp and rerun it doesn't work, is this a good approach to get the result using a nonderivative method instead of the sqp algorithm?
(Ex. pattern search )
Please help me.
Thank you for reading.
the below fig is exitflag = 2 situation.
My solver option is
options = optimoptions('fmincon',...
'StepTolerance',1e-20,'Display','iter',...
'Algorithm','sqp','Display','iter', 'MaxFunEvals',1e4,'MaxIter',1e4,...
'FiniteDifferenceType','central','ConstraintTolerance',1.0e-3); % 'FiniteDifferenceStepSize',1e-2, , 'ScaleProblem','obj-and-constr' 'FiniteDifferenceType','central',
ConstraintTolerance is adjusted whenver the exitflag isnot 1.
1,1 = x axis : iter , y axixs :current Variable value --> 6 variable
1,2 = (x axis : iter , y axis : function value)
2,1 = x axis: iter ,y axis : optimality
2,2 = x axis : iter , y axis : constraint violate

 Accepted Answer

But , in my case, optimality is very large even though the objective fval is converge (please check img.)
Your plots are uninterpretable to many in the forum (and definitely to me), because they are not labelled in English. A few thoughts I can offer, however:
(1) It may be that fval is converging, but it is converging to something non-optimal. That could explain why the optimality measure is large, and is especially likely if fmincon is telling you that it cannot find even a feasible point.
(2) It is important to keep in mind that the optimality measure is not a normalized quantity and therefore you often can't be sure what to consider "very large" or "very small". For example, the point x0=1e-6 is quite close to the minima of both these functions: f(x)=x.^2 and g(x)=1e20*x^2. However, the gradients and the value of g(x0) are quite a bit larger than for f(x0).
Is it ok if I rerun to the last value even if exitflag didn't get 1?
I wouldn't have a lot of faith in it. It would be better to pursue improved initial guess strategies. If it is very hard to devise a good initial guess, it often means that the problem is infeasible and there is just no point trying to solve it.
If I don't get an exitflag of 1 through sqp and rerun it doesn't work, is this a good approach to get the result using a nonderivative method instead of the sqp algorithm?
Questions like that are not answerable without seeing the objective function and constraints.

4 Comments

Thank you for replying.
I wonder something about your help.
Is it ok if I rerun to the last value even if exitflag didn't get 1?
Ask about improved initial guess strategies ::
Rerun approach is also about one of initial guess strategies. isn`t it ?
Because when I set x0 = low boundary. and the result is fail(exit flag = -2).
and If i rerun from the above result( = thus the init value is changed ), I also obtain some value. and do it again. is it different from what you are saying ?
If I don't get an exitflag of 1 through sqp and rerun it doesn't work, is this a good approach to get the result using a nonderivative method instead of the sqp algorithm?
What I really wonder is related question 2. When I get the result (fail) through gradient based method(Ex. sqp), can I use the function based method ( patteren search) ?
The last thing is ::
Can a slight change in the cost change the convergence characteristic of the initial value? For example, when I used a cost of "A set"( some boundary ), optimality and fcn val converged well for various initial values, but when I change the cost into another value, the optimality isn`t satisfied. is it possible ?
Thank you for your help again.
and If i rerun from the above result( = thus the init value is changed ), I also obtain some value. and do it again. is it different from what you are saying ?
No, I am saying you should find a way to initialize so that it finds a feasible solution and converges in the first attempt. How are you choosing your very first initial point?
I just try any value & and I can find some init value with satisfied constraint.
Is there any method to find init value ?
and in that how can i proof my solution is global?
In my case, I try to show the same convergence at differenct init valu.e
We have to see the optimization problem to answer these questions.

Sign in to comment.

More Answers (0)

Asked:

on 15 Oct 2019

Commented:

on 16 Oct 2019

Community Treasure Hunt

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

Start Hunting!