MATLAB: How to know which constarints are active at the optimum, while using the functions from the Optimization Toolbox

constraintconstraintsfminconlambdaoptimizationOptimization Toolboxorder

I would like to know which constarints are active at the optimum, while using the functions from the Optimization Toolbox.

Best Answer

At the optimum, all the active constraints (exactly satisfied) are listed as numbers. These numbers correspond to constraints (numbered by some rule). This is explained in the Related Solution listed below.
One way to determine which constraints are active is to check the Lagrange multipliers specified in the LAMBDA output parameter of FMINCON. Any nonzero component of LAMBDA indicates an active constraint (not strictly, see below).
Unfortunately, there can be active constraints with zero multipliers (in theory, this situation is described as "violation of the strict complementary slackness"). Hence you must check your constraints directly in order to be sure that this does not occur.