Why are the upper and lower bounds violated during iterations with the FMINCON function from the Optimization Toolbox?

26 views (last 30 days)
The upper and lower bounds of my system of equations are violated during iterations with the FMINCON function from the Optimization Toolbox.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Feb 2019
The Active Set (medium scale) algorithm used by FMINCON may violate the bounds in certain cases. More information on why this may occur is available below. In such cases, use the Interior Point algorithm (for releases R2008a and above) to ensure FMINCON remains feasible with respect to the bounds. The algorithm selection can be made using the OPTIMSET function. More information on the algorithm can be found at,
There are generally 3 reasons why FMINCON can violate bounds.
1) During gradient finite differencing, FMINCON picks a value outside the bounds specified (between upper and lower bounds).
2) In certain instances, the objective function does NOT returns real values for all feasible X. This causes the optimization routine to hang or give infeasible iterates.
You MUST check your function to ensure that any X satisfying the bounds does NOT provide complex or NaN values.
Ideally, the Optimization Toolbox should check the objective and constraint functions internally to return real values. This issue has been reported to our development staff for further investigation.
3) Another uncommon issue is described below:
A problem having the following:
variables: 2
nonlinear equalities: 2
bounds: 4 (2 lower and two upper)
and the initial iterate x0 is feasible with respect to the bounds.
The feasible region of the QP that determines the first step "s" (from x0 to x1: x1 = x0 + s), consists of
**One linearized equality constraint and the bounds on the variables (1)
If you plot the region (1) (a simple 2D plot), the box determined by the bounds and the linearized constraint could be disjoint; (1), therefore, is empty.
In this case, the first QP is infeasible, and the QP solver, QPSUB, generates a solution that satisfies the linearized constraint but which violates the bounds by a significant amount.
The problem functions, but when evaluated at x1, an error is generated.
This example is interesting, in that it shows that fmincon-med-scale can actually violate the bounds beyond small amounts caused by finite precision.
For this case, one possible workaround is to find a feasible starting point. Using the user starting point, first call the nonlinear least squares routine, to find a point that both satisfies the bounds and the nonlinear equality constraint as best possible. Use this point as a starting point for the optimization. You may still have to fine-tune the stopping tolerances.
Additional Notes:
You might have to play around with the stopping tolerances of LSQNONLIN to obtain the best answer. Please take a look at the help for LSQNONLIN.
You may also notice that during the LSQNONLIN run, reports are provided indicating that the constraint took on complex values once. This indicates that LSQNONLIN also violated the bounds once. This does not seem to be a problem as the process moves forward and in subsequent iterates, no subsequent reports are made, as the iterates fall within the bounds.

More Answers (0)

Products


Release

R2008a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!