What is the ordering of the constraints in the FMINCON function in the Optimization Toolbox?

2 views (last 30 days)
The active constraints listed at the end of FMINCON's execution are numbers. Which constraint specified in the call to FMINCON corresponds to which constraint number?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
As of the Optimization Toolbox 2.3 (R13+), the active constraint indices correspond to the original constraints supplied by the user (instead of showing the indices that the code uses internally), and prints them separately under lower, upper, ineqlin and ineqnonlin headers. This helps to clarify the ordering. If you are using a previous version, read the following:
Here is the ordering used for constraints in FMINCON:
linear equalities
nonlinear equalities
lower bounds
upper bounds
linear inequalities
nonlinear inequalities
One way to remember it is that equalities must come before inequalities, and within those two groups it goes from "simplest" to "hardest" (bounds, linear, nonlinear). This assumes none of your constraints were dependent; dependent constraints are removed during the preprocessing of the problem and will offset the numbering of your constraints by the number of dependent constraints removed.
Two other ways to determine which constraints are active are to check the Lagrange multipliers specified in the LAMBDA output parameter of FMINCON or to simply evaluate the constraints at the point returned by FMINCON.

More Answers (0)

Categories

Find more on Problem-Based Optimization Setup 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!