Sequential quadratic programming
Derive a constrained Newton model and see why satisfying a tangent constraint does not guarantee nonlinear feasibility.
On this page
The question for today
What you’ll understand
- Form an SQP subproblem with linearized constraints and a Lagrangian curvature model.
- Relate equality-constrained SQP to a Newton step on the KKT equations.
- Separate local fast convergence from merit, filter, and restoration safeguards.
Sequential quadratic programming, SQP, replaces one difficult nonlinear constrained problem by a sequence of local quadratic programs. The objective supplies a local gradient, the constraints supply tangent approximations, and the Lagrangian supplies the appropriate curvature. This combination is more precise than taking an unconstrained Newton step and clipping its coordinates afterward. It also creates a central difficulty: a point feasible for a tangent model can violate the original curved constraints. A practical algorithm therefore needs both a local step construction and a strategy for judging nonlinear progress.
The model must remember constraint curvature
For equalities h=0 and inequalities g≤0, construct a quadratic in the displacement with gradient equal to the current objective gradient and matrix B approximating the Hessian of the Lagrangian. Impose the linearized equalities and inequalities on that displacement. Using only the objective Hessian can miss important curvature from active constraints. The QP multipliers also supply estimates for the nonlinear problem's multipliers, while a line search or trust-region strategy decides how much of the computed displacement to use.
For equality constraints, differentiating the KKT stationarity and feasibility equations yields a saddle-point Newton system. With an exact Lagrangian Hessian, the QP step and its updated multiplier solve that same system. This connection explains why SQP can be locally fast. It also explains why a poorly conditioned constraint Jacobian or an incorrect multiplier sign can damage both primal motion and dual estimates. The notation below uses row Jacobians, so the transpose in stationarity is essential.
A tangent solution can leave the curve
A linearized equality removes its first-order residual but generally leaves a second-order nonlinear residual after the step. Large tangent motions can therefore move far away from the true feasible set. A merit function combines objective and constraint violation with a chosen penalty scale, whereas a filter treats them as separate progress measures with safeguards. Neither device should be reduced to accepting any objective decrease: that would permit excellent objective values at useless, highly infeasible points.
The linearized QP may itself be infeasible, especially far from a solution or when constraint gradients are degenerate. Elastic variables, feasibility-restoration phases, or trust-region modifications can recover a meaningful next task. Another subtlety is the Maratos effect: even near a regular solution, a full fast local step can be rejected by some merit-function searches because the second-order constraint error is penalized too strongly. A second-order correction can address that specific mismatch without replacing the entire SQP framework.
State a local theorem before promising speed
For an equality-constrained problem with sufficiently smooth derivatives, full-row-rank constraint Jacobian, and positive-definite reduced Lagrangian Hessian at a KKT solution, the KKT Jacobian is nonsingular. If its derivative is locally Lipschitz, exact Newton/SQP steps from sufficiently close primal and multiplier estimates converge quadratically. This is a local result for exact systems and accepted full steps. Inequality versions need careful active-set regularity, often including strict complementarity in simple statements; they cannot be imported without their extra assumptions.
Quasi-Newton SQP replaces the exact curvature with updates, so its convergence rate requires separate approximation conditions. Globalization also changes the sequence away from the solution. Evaluate a solver using primal residuals, Lagrangian gradient residuals, complementarity, and accepted step lengths rather than objective values alone. In a design problem, returning an inexpensive design that violates a safety equality is a failure even if the optimizer's internal quadratic program was solved to machine precision.
Work it through
An exact tangent step that misses the circle
Minimize on . At (0,1) take λ=0 and B=I. Solve the SQP model and evaluate the full nonlinear trial.
The objective gradient is (−2,1), the equality value is zero, and its row Jacobian is (0,2). The model constraint is therefore . Substituting p_y=0 into the strictly convex quadratic leaves , minimized at p_x=2.
The full trial is (2,1). Its objective is 0.5, down from 2.5, but its nonlinear equality residual is . The tangent equation was satisfied exactly even though the original constraint is badly violated.
The QP stationarity equations are , giving multiplier estimate ν=−0.5. For a merit function f+|h|, the current value is 2.5 and the full trial value is 4.5. This particular full trial fails a decrease requirement for that merit function despite improving f.
Solving the QP accurately does not justify accepting the full displacement. Nonlinear feasibility must be checked using the original constraint.
The living notebook
Explore the model
Interactive lab · vectors
A normal and a tangent are different directions
Pause, Reset, and set angle=90° and magnitude=2 to inspect the circle normal (0,2) at (0,1). Repeat from Reset with both angle=0° and magnitude=2 to inspect the SQP displacement (2,0). Predict their zero dot product from the projections. This one-vector instrument shows each separately and does not draw the circle or certify nonlinear feasibility.
- x component
- 1.393
- y component
- 0.975
- Magnitude
- 1.7
Playback traces a fixed vector and its projections. Angle and magnitude set the geometry; the moving marker does not change them. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forA displacement can be orthogonal to the current constraint normal and still leave the curved feasible set after a finite move.
Pause & reason
Check your understanding
Your turn
Try it yourself
For f(x,y)=(x²+y²)/2 subject to x+y=1, form and solve the SQP subproblem at (0,0), using B=I. Find its equality multiplier and check the nonlinear trial.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Here the equality is affine, so its linearization is exact. Solve pₓ+pᵧ=1 by symmetry or a one-variable substitution.
Compare with the solution
The objective gradient at the start is zero. The QP minimizes subject to pₓ+pᵧ=1, giving p=(1/2,1/2). Stationarity p+ν(1,1)=0 yields ν=−1/2. The trial (1/2,1/2) is exactly feasible because the equality is affine, and its value is 1/4. Strict convexity on the affine line gives the unique global constrained minimum; that global claim follows from this problem's structure, not from the SQP name.
Keep the idea
Take it with you
- SQP couples linearized constraints to a quadratic Lagrangian model.
- Tangent feasibility does not imply feasibility after a finite nonlinear step.
- Fast local convergence requires regular KKT systems, accurate curvature, and suitable accepted steps.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.