Fmincon / Multistart: Local minimum found, but one nonlinear constraint is violated
1 view (last 30 days)
i am trying to find an optimal point with multistart / fmincon. Matlab finds a local minima, for which the following message is given in the output struct:
Local minimum found that satisfies the constraints.
Optimization completed because the objective function is non-decreasing in feasible directions,
to within the value of the optimality tolerance,and constraints are satisfied to within the value of the
constraint tolerance.<stopping criteria details>
Optimization completed: The relative first-order optimality measure, 7.337955e-07,
is less than options.OptimalityTolerance = 1.000000e-06, and the relative maximum constraintviolation, 7.082693e-07,
is less than options.ConstraintTolerance = 1.000000e-06.
i have 13 nonlinear constraints, of which one is violated.
This is the constraint:
ceq(10) = (L_1 - (L_2 - L_3)) - 0.001;
I want to achieve:
abs(L_1 - (L_2 - L_3)) <= 0.001;
If i check this constraint by hand, I get
abs(L_1 - (L_2 - L_3)) = 0.0011;
which is larger than the desired value 0.001
The constraint tolerance in optimoptions is set to 1e-6 by default.
How can this happen? The output clearly says, that all the constraints are met, but in reality this one is not.
Matt J on 22 Mar 2021
Edited: Matt J on 22 Mar 2021
If the exit message says constraints were satisfied within tolerance, then that is what should have happened. However, the tolerance is relative for all fmincon algorithms except 'active-set'. Relative to what, the documentaiton does not seem to say, but it might be relative to the initial point. This means that if your initial point violated one of the constraints by say, 8000, then 0.0011 would be within the 1e-6 tolerance, because 0.0011/8000 < 1e-6.
A simple solution might be to reduce the ConstraintToleance to say, 1e-12. Or, use the active-set algorithm, if it applies to your problem.