Matlab fmincon(function based) optimality issue :: constrained nonlinear optimization
Show older comments
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
More Answers (0)
Categories
Find more on Solver Outputs and Iterative Display 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!