ArticleslgStudy

computer science

Sequential quadratic programming

Sequential quadratic programming is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Sequential quadratic programming rather than just read about it. In short: Sequential quadratic programming (SQP) is an iterative method for constrained nonlinear optimization, also known as Lagrange-Newton method. SQP methods are used on mathematical problems for which the objective function and the constraints are twice continuously differentiable, but not necessarily convex.

Sequential quadratic programming — main illustration
Sequential quadratic programming — illustration

Key takeaways

  • Sequential quadratic programming belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Sequential quadratic programming to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Sequential quadratic programming from memory before moving on to harder problems.

Reference excerpt

Sequential quadratic programming (SQP) is an iterative method for constrained nonlinear optimization, also known as Lagrange-Newton method. SQP methods are used on mathematical problems for which the objective function and the constraints are twice continuously differentiable, but not necessarily convex. SQP methods solve a sequence of optimization subproblems, each of which optimizes a quadratic model of the objective subject to a linearization of the constraints. If the problem is unconstrained, then the method reduces to Newton's method for finding a point where the gradient of the objective vanishes. If the problem has only equality constraints, then the method is equivalent to applying Newton's method to the first-order optimality conditions, or Karush–Kuhn–Tucker conditions, of the problem.

Algorithm basics

Consider a nonlinear programming problem of the form:

minxf(x)subject toh(x)≥0g(x)=0. where x∈ℝn, f:ℝn→ℝ, h:ℝn→ℝmI and g:ℝn→ℝmE. The Lagrangian for this problem is

ℒ(x,λ,σ)=f(x)+λh(x)+σg(x), where λ and σ are Lagrange multipliers.

The equality constrained case If the problem does not have inequality constraints (that is, mI=0), the first-order optimality conditions (aka KKT conditions) ∇ℒ(x,σ)=0 are a set of nonlinear equations that may be iteratively solved with Newton's Method. Newton's method linearizes the KKT conditions at the current iterate [xk,σk]T, which provides the following expression for the Newton step [dx,dσ]T: [dxdσ]=−[∇xx2ℒ(xk,σk)]−1∇xℒ(xk,σk)=−[∇xx2ℒ(xk,σk)∇g(xk)∇gT(xk)0]−1[∇f(xk)+σk∇g(xk)g(xk)], where ∇xx2ℒ(xk,σk) denotes the Hessian matrix of the Lagrangian, and dx and dσ are the primal and dual displacements, respectively. Note that the Lagrangian Hessian is not explicitly inverted and a linear system is solved instead. When the Lagrangian Hessian ∇2ℒ(xk,σk) is not positive definite, the Newton step may not exist or it may characterize a stationary point that is not a local minimum (but rather, a local maximum or a saddle point). In this case, the Lagrangian Hessian must be regularized, for example one can add a multiple of the identity to it such that the resulting matrix is positive definite. An alternative view for obtaining the primal-dual displacements is to construct and solve a local quadratic model of the original problem at the current iterate: mindxf(xk)+∇f(xk)Tdx+12dxT∇xx2ℒ(xk,σk)dxs.t.g(xk)+∇g(xk)Tdx=0. The optimality conditions of this quadratic problem correspond to the linearized KKT conditions of the original problem. Note that the term f(xk) in the expression above may be left out, since it is constant under the mind operator.

The inequality constrained case In the presence of inequality constraints (mI>0), we can naturally extend the definition of the local quadratic model introduced in the previous section: mindf(xk)+∇f(xk)Td+12dT∇xx2ℒ(xk,λk,σk)ds.t.h(xk)+∇h(xk)Td≥0g(xk)+∇g(xk)Td=0.

The SQP algorithm The SQP algorithm starts from the initial iterate (x0,λ0,σ0). At each iteration, the QP subproblem is built and solved; the resulting Newton step direction [dx,dλ,dσ]T is used to update current iterate: [xk+1,λk+1,σk+1]T=[xk,λk,σk]T+[dx,dλ,dσ]T. This process is repeated for k=0,1,2,… until some convergence criterion is satisfied.

Practical implementations Practical implementations of the SQP algorithm are significantly more complex than its basic version above. To adapt SQP for real-world applications, the following challenges must be addressed:

The possibility of an infeasible QP subproblem. QP subproblem yielding a bad step: one that either fails to reduce the target or increases constraints violation. Breakdown of iterations due to significant deviation of the target/constraints from their quadratic/linear models. To overcome these challenges, various strategies are typically employed:

Use of merit functions, which assess progress towards a constrained solution, non-monotonic steps or filter methods. Trust region or line search methods to manage deviations between the quadratic model and the actual target. Special feasibility restoration phases to handle infeasible subproblems, or the use of L1-penalized subproblems to gradually decrease infeasibility These strategies can be combined in numerous ways, resulting in a diverse range of SQP methods.

Alternative approaches Sequential linear programming Sequential linear-quadratic programming Augmented Lagrangian method

Implementations SQP methods have been implemented in well known numerical environments such as MATLAB and GNU Octave. There also exist numerous software libraries, including open source:

SciPy (de facto standard for scientific Python) has scipy.optimize.minimize(method='SLSQP') solver. NLopt (C/C++ implementation, with numerous interfaces including Julia, Python, R, MATLAB/Octave), implemented by Dieter Kraft as part of a package for optimal control, and modified by S. G. Johnson. ALGLIB SQP solver (C++, C#, Java, Python API) acados (C with interfaces to Python, MATLAB, Simulink, Octave) implements a SQP method tailored to the problem structure arising in optimal control, but tackles also general nonlinear programs. and commercial

LabVIEW KNITRO (C, C++, C#, Java, Python, Julia, Fortran) NPSOL (Fortran) SNOPT (Fortran) NLPQL (Fortran) MATLAB SuanShu (Java)

See also Newton's method Secant method Model Predictive Control

Notes

References Bonnans, J. Frédéric; Gilbert, J. Charles; Lemaréchal, Claude; Sagastizábal, Claudia A. (2006). Numerical optimization: Theoretical and practical aspects. Universitext (Second revised ed. of translation of 1997 French ed.). Berlin: Springer-Verlag. pp. xiv+490. doi:10.1007/978-3-540-35447-5. ISBN 978-3-540-35445-1. MR 2265882. Jorge Nocedal and Stephen J. Wright (2006). Numerical Optimization. Springer. ISBN 978-0-387-30303-1.

External links Sequential Quadratic Programming at NEOS guide

Worked examples

Example 1 — a first encounter with Sequential quadratic programming

Start with the simplest possible case. Write down what Sequential quadratic programming claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Sequential quadratic programming before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Sequential quadratic programming ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Sequential quadratic programming

In research
Sequential quadratic programming appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Sequential quadratic programming in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Sequential quadratic programming is common in secondary-school and first-year university syllabi. It links to neighbouring topics Optimization algorithms and methods, so understanding it makes those chapters shorter.
In everyday life
Look for Sequential quadratic programming outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Sequential quadratic programming” →

How to study Sequential quadratic programming in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Sequential quadratic programming means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Sequential quadratic programming out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Sequential quadratic programming in simple terms?

Sequential quadratic programming (SQP) is an iterative method for constrained nonlinear optimization, also known as Lagrange-Newton method. SQP methods are used on mathematical problems for which the objective function and the constraints are twice continuously differentiable, but not necessarily c…

Why does Sequential quadratic programming matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Sequential quadratic programming?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Sequential quadratic programming.

Tags

  • Optimization algorithms and methods

Keep exploring