Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

11. Nonlinear Constrained Optimization

The nonlinear constraint solvers work on the standard form

$$ \min f(x)\quad\text{s.t.}\quad h(x)=0,\quad g(x)\ge 0 $$

with the Lagrangian and KKT conditions of section 1.4. nlopt4r provides four entry families: SQP with restoration, the legacy SQP, the exact equality methods (Newton–Lagrange and Lagrange SQP), and PHR augmented Lagrangian.

11.1 SQP model and active-set subproblem

At iterate \(x_k\), SQP builds a subproblem from a quadratic model and linearized constraints:

$$ \min_d\ \tfrac12 d^\top B_k d+g_k^\top d \quad\text{s.t.}\quad h(x_k)+J_h d=0,\quad g(x_k)+J_g d\ge0. $$

quadratic::minimize solves the subproblem, and the active-set method returns the step \(d_k\) with multiplier estimates. The subproblem requires a consistent linearization; when the linearization is infeasible, the legacy SQP returns Infeasible and the restoration entry starts its restoration phase.

The Hessian model \(B_k\) uses the Powell damped BFGS update. With

$$ \theta=\begin{cases} 1, & s^\top y\ge0.2\,s^\top B s,\\ \dfrac{0.8\,s^\top B s}{s^\top B s-s^\top y}, & \text{otherwise}, \end{cases} $$

the update is

$$ B_{k+1}=B_k+\frac{zz^\top}{s^\top z}-\frac{(B_k s)(B_k s)^\top}{s^\top B_k s}, \qquad z=\theta y+(1-\theta)B_k s. $$

Multipliers interpolate along the step:

$$ \mu_{k+1}=(1-\alpha_k)\mu_k+\alpha_k\mu_k^{\text{QP}},\qquad \lambda_{k+1}=(1-\alpha_k)\lambda_k+\alpha_k\lambda_k^{\text{QP}}. $$

The line search uses the \(l_1\) exact penalty function

$$ \phi_\pi(x)=f(x)+\pi\,\ell_1(x),\qquad \ell_1(x)=\sum_j|h_j(x)|+\sum_i\max(0,-g_i(x)), $$

with penalty parameter \(\pi\ge\max(\lVert\mu\rVert_\infty,\lVert\lambda\rVert_\infty)+1\); each iteration sets it to the larger of its current value and the current multiplier bound plus one.

11.2 Feasibility restoration

constrained::sqp_with_restoration runs a constraint-specific restoration phase when the subproblem is infeasible. The restoration objective is

$$ \theta(x)=\tfrac12\Bigl(\|h(x)\|^2+\|\min(g(x),0)\|^2\Bigr). $$

The restoration iteration:

  1. assemble residuals and Jacobian rows from the equality rows and the currently violated inequality rows;
  2. solve a damped augmented QR system for the direction;
  3. backtrack on the actual nonlinear objective \(\theta\);
  4. end restoration when the objective decrease reaches the configured ratio restoration_reduction (default 0.1) or feasibility reaches tolerance.

Restoration resets the Hessian model and multipliers, and the same SQP continues. Each restoration records a RestorationEvent: triggering subproblem error, outer iteration number, violation before and after restoration, restoration iteration count and failure information. max_subproblem_evaluations and max_subproblem_iterations bound the subproblem budget; max_restoration_iterations bounds restoration iterations.

11.3 Exact equality methods

Method::NewtonLagrange and Method::LagrangeSqp of constrained::minimize handle the equality-constrained subset. Both methods solve Newton steps on the KKT system

$$ \nabla_x L(x,\mu)=0,\qquad h(x)=0 $$

with the Lagrangian Hessian supplied by the caller. LagrangeSqp adds the stabilization term

$$ \nabla^2_{xx}L+\tfrac{1}{3.1}\,J_h^\top J_h. $$

The line-search merit function is

$$ \psi(x,\mu)=\|\nabla_x L(x,\mu)\|^2+\|h(x)\|^2, $$

and multipliers interpolate along the direction. Inequality constraints are rejected explicitly by these two methods (InvalidInput).

11.4 PHR augmented Lagrangian

constrained::augmented_lagrangian uses the Powell–Hestenes–Rockafellar multiplier method. The augmented objective is

$$ \Phi_\rho(x,\mu,\lambda)=f(x)-\mu^\top h(x)+\frac{\rho}{2}\|h(x)\|^2 +\frac{\bigl\|\max(0,\lambda-\rho g(x))\bigr\|^2-\|\lambda\|^2}{2\rho}. $$

Figure 11-1 Quadratic-penalty minimizer path for the equality constraint \(x_1^2+x_2^2=1\) and objective \((x_1-2)^2+(x_2-1)^2\): with \(\rho=0.25,0.5,1,4,16\), \(x(\rho)\) approaches \(x^*=(0.894,0.447)\) along the feasible curve; with no multiplier update the augmented objective reduces to this penalty. Sections 9.1 and 9.3 of the textbook derive the exterior penalty and multiplier methods, and section 9.4 lists the multphr.m program.

The outer flow:

  1. inner BFGS minimization of \(\Phi_\rho\) with inner tolerance \(0.1,\tau_g\) (lower bound \(10^{-12}\)) and iteration cap max_inner_iterations (default 1000);
  2. multiplier updates
$$ \mu\leftarrow\mu-\rho\,h(x),\qquad \lambda\leftarrow\max(0,\lambda-\rho\,g(x)); $$
  1. residual \(r=\max(\text{violation},\text{complementarity})\) triggers a penalty doubling when \(k\ge2\) and \(r>0.8,r_{\text{prev}}\);
  2. convergence when three KKT diagnostics meet their tolerances simultaneously.

Inner objective calls share the strict outer budget. initial_penalty supplies the initial penalty parameter (default 2).

11.5 Report and restoration state

The four entry families report a ConstrainedSolution: objective and iteration status, equality and inequality multipliers, constraint violation, complementarity and inner iteration count. sqp_with_restoration additionally returns the list of restoration events; on failure, SqpError carries the complete last_constrained checkpoint, including multipliers.

The convergence test checks stationarity, feasibility and complementarity together; solution.converged() is true when all three meet their thresholds.

Software interface

References

  • 马昌凤, 最优化方法及其 Matlab 程序设计 (in Chinese), 2010, chapters 9 and 12.
  • M. J. D. Powell, “A method for nonlinear constraints in minimization problems,” in Optimization, Academic Press, 1969.
  • M. R. Hestenes, “Multiplier and gradient methods,” J. Optim. Theory Appl. 4 (1969), 303–320.
  • J. Nocedal, S. J. Wright, Numerical Optimization, 2nd ed., 2006, Chapters 15, 18.