I'm using FMINCON to solve a constrained optimization problem. When I examine the output structure generated by FMINCON, I get inconsistent results for the first-order optimality measure.
For example, when I look in output.message, I see
'Local minimum found that satisfies the constraints.
Optimization completed because the objective function is non-decreasing in
feasible directions, to within the default value of the optimality tolerance,
and constraints are satisfied to within the default value of the constraint tolerance.
Stopping criteria details:
Optimization completed: The relative first-order optimality measure, 9.417002e-07,
is less than options.OptimalityTolerance = 1.000000e-06, and the relative maximum constraint
violation, 1.110223e-16, is less than options.ConstraintTolerance = 1.000000e-06.
Optimization Metric Options
relative first-order optimality = 9.42e-07 OptimalityTolerance = 1e-06 (default)
relative max(constraint violation) = 1.11e-16 ConstraintTolerance = 1e-06 (default)'
This indicates a first-order optimality measure of 9.47e-07. However, if I look at output.firstorderopt, I see
Does anyone have any idea what's going on? The code that generates this is a little complicated to summarise here, but I can upload it somewhere if someone would like to take a closer look.