wikillm

Concept · 6 papers · updated 2026-10-25

Quadratic programming

Minimise a quadratic objective under linear equality and inequality constraints. Legged-robot MPC and whole-body control reduce to QPs solved at high rates, and QPs also appear in teleoperation IK and trajectory smoothing. Solver families trade warm starts, sparsity, accuracy and code generation. A review maps them to problem shape; its ratings are its own judgements.

optimizationquadratic-programmingcontrolreal-time

Markdown9 min read

AI-compiled overview, updated 2026-10-25, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.

Overview

A quadratic program (QP) asks for the decision vector that minimises a quadratic function subject to linear constraints. The review writes the convex case as minimising ½xᵀHx + qᵀx subject to Ax = b and Cx ≤ u, with H positive semi-definite 2510.21773 §2. Equality rows are A and b; inequality rows are C and u.

QPs appear inside larger controllers. Model predictive control (MPC) and whole-body control (WBC) on legged robots both reduce to QPs that must be solved within tight time and energy budgets. MPC gives sparse problems with optimal-control structure over long horizons. WBC gives small-to-medium dense problems at 100 to 1000 Hz 2510.21773 §1. A walking controller that solves one such QP per control step reports an average control rate of 1 kHz on a simulated humanoid 1311.1839 §1 1311.1839 §5. That is author-reported, from one model.

Other robotics cards use a QP as one part of a larger method:

  • Inverse kinematics for teleoperation. A QP-based solve picks joint velocities from weighted task errors, a regulariser and a collision term 2411.07534 §II eq. 3. The printed task term is a norm, and a QP needs the squared form, so check which one is meant before implementing.
  • Whole-body control on a humanoid. A momentum-based controller, framed as a QP, outputs joint accelerations and contact wrenches [arxiv:2411.01014 §2.8]. The paper gives no gains, task weights or rates.
  • Contact forces on a quadruped. A regularised least-squares problem with force bounds and a friction cone gives the stance forces 2412.09816 §3 eq. 12 eq. 13 eq. 14. The paper solves it with its own method, not a generic QP solver (see Variants).
  • Trajectory smoothing. After a search planner, a quadratic cost on the squared n-th derivative is minimised under equality constraints at the endpoints and waypoints 1709.05401 §4 eq. 13.

When the problem is nonlinear, sequential quadratic programming (SQP) solves a QP built around the current iterate at each step 2510.21773 §2. The review does not say how the Hessian approximation in that QP is formed.

The first five subsections under Variants follow the review's solver taxonomy. The last two cover a direct solve for equality-only problems, and a cone constraint handled by projection, which is not a solver family in the review.

Variants

Active-set methods

These guess which inequalities hold with equality at the solution, and solve an equality-constrained system on that guess. They warm-start well when the guessed set changes slowly, but their timing can jitter when the set switches 2510.21773 §2 2510.21773 tab. 1. Named solvers include qpOASES, Eiquadprog, qpmad and DAQP 2510.21773 §2. See Active-set method.

In a humanoid walking controller, one QP per control step is solved by a custom active-set solver that starts from the previous step's active set. The paper reports one linear solve in about 97% of steps 1311.1839 §1 fig. 2, and an average QP solve of 0.2 ms, against 1.0 ms for Gurobi's dual simplex and 2.2 ms for CVXGEN on the same walk 1311.1839 tab. 1. These are author-reported, from one simulated 34-DOF model on a laptop [arxiv:1311.1839 §5.1]. QP setup took about 0.8 ms of a 1 ms control step, so the solve is not the main cost 1311.1839 §5. The paper cannot guarantee finite termination. It falls back to an interior-point solver that it does not name 1311.1839 §4.

Card: Real-Time QP Solvers: A Concise Review and Practical Guide Towards Legged Robots. Card: An Efficiently Solvable Quadratic Program for Stabilizing Dynamic Locomotion.

Interior-point methods

These replace each inequality with a logarithmic barrier weighted by a parameter μ > 0, so iterates stay strictly inside the constraints 2510.21773 §2 eq. 3. Named solvers include HPIPM, which exploits block structure, along with qpSWIFT and PIQP 2510.21773 §2. See Interior-point method. Card: Real-Time QP Solvers: A Concise Review and Practical Guide Towards Legged Robots.

Operator splitting (ADMM)

Each inequality gets a slack variable s ≥ 0, so that Cx + s = u 2510.21773 §2 eq. 4. The review gives this reformulation only. It does not give the ADMM iterations, the penalty update or a termination test 2510.21773 §2. OSQP is the representative solver 2510.21773 §2. Card: Real-Time QP Solvers: A Concise Review and Practical Guide Towards Legged Robots.

Augmented Lagrangian and proximal methods

These use a penalised Lagrangian with multipliers for equalities and inequalities, and penalty weights ρ_e and ρ_i > 0. The review gives the multiplier updates for both, with the inequality multiplier kept non-negative 2510.21773 §2 eq. 5 2510.21773 §2 eq. 6 2510.21773 §2 eq. 7. ProxQP is the representative solver 2510.21773 §2. Card: Real-Time QP Solvers: A Concise Review and Practical Guide Towards Legged Robots.

Code generation

For a problem whose structure is fixed and only its numbers change, a code generator emits specialised C code. CVXGEN, CVXPYgen and FORCESPRO are the named tools 2510.21773 §2. The review rates CVXGEN and CVXPYgen for tiny problems whose layout never changes 2510.21773 tab. 1.

Conic solver

When conic constraints or optimality certificates are needed, the review proposes Clarabel, a conic solver that includes QPs as a special case 2510.21773 §2. See Interior-point method for where it sits in the family.

Equality-only problems (direct solve)

With only equality constraints, the QP reduces to one linear KKT system for the decision and the multipliers 2510.21773 §2 eq. 1. The review rates this direct solve as real-time, and names equality-only QPs with fixed structure as its case 2510.21773 tab. 1. A planner's refinement step is of this kind: it minimises the integral of the squared n-th derivative, with equality constraints at the endpoints and waypoints 1709.05401 §4 eq. 13.

Cone constraints by projection (not a generic QP)

A generic QP solver needs a polyhedral stand-in for a cone. One quadruped controller keeps the exact friction cone and solves its contact-force problem with a custom projected-gradient method, GPGD 2412.09816 §4. Each pass takes a Newton-type step with the Hessian 2Q, then projects each stance foot's force onto the normal-force bounds and the friction cone [arxiv:2412.09816 alg. 1]. Against qpOASES, the paper reports GPGD 2.47 times faster, with lower residual and constraint violation 2412.09816 tab. 1 §6.1.2. The comparison is not like for like. The GPGD implementation is naive, the qpOASES one is optimised, and the two use different constraint sets, a cone and a linear pyramid 2412.09816 §6.1.2. As printed, alg. 1 never reassigns its iterate, so an implementation must add that update 2412.09816 alg. 1. The other paper keeps a polyhedral friction cone inside a QP 1311.1839 §3 eq. 9.

When to use which

The review's ratings are its own qualitative judgements, not measurements. Its tables label real-time suitability as scenario-dependent 2510.21773 tab. 1. The table below records what its guidance supports, and what the other cards report.

SituationUseWhy
Small or medium dense QP at high rate, e.g. whole-body controlDense active-set solver (qpmad, DAQP, qpOASES) or ProxQPThe review's advice for dense WBC. Active-set solvers are rated warm-start capable 2510.21773 §4 2510.21773 tab. 1
One QP per tick on a humanoid, active set changes little between ticksActive-set solver warm-started from the previous active setAuthor-reported 0.2 ms average solve on one simulated 34-DOF model, one linear solve in about 97% of steps 1311.1839 tab. 1 fig. 2
Long-horizon, sparse optimal-control QP (MPC)Structure-exploiting interior-point solver (HPIPM)Recommended for long-horizon MPC, and rated warm-startable and real-time 2510.21773 §4 2510.21773 tab. 1
Large sparse QP, solved repeatedly, moderate accuracy acceptableOperator splitting (OSQP)Rated for repeated solves with warm start, but not for high accuracy 2510.21773 tab. 1. Relayed benchmarks say OSQP is robust but slower at high accuracy 2510.21773 §3
Ill-conditioned sparse QP, or embedded constraintsPIQPRated for these cases 2510.21773 tab. 1. ProxQP is rated for small-to-medium WBC and inverse dynamics, not these cases 2510.21773 tab. 1
Fixed structure, tiny, hard real-time embeddedCode generator (CVXGEN, CVXPYgen, FORCESPRO)Emits specialised C code for fixed-structure problems 2510.21773 §2 2510.21773 tab. 1
Conic constraints or optimality certificatesClarabelNamed for this case 2510.21773 §2 2510.21773 tab. 1
Offline checks or high-accuracy referenceGeneric primal-dual interior-point (Gurobi, MOSEK)Rated not real-time and not warm-startable 2510.21773 tab. 1
Exact friction cone at high rate, e.g. quadruped contact forcesCustom projection (GPGD), or a polyhedral cone inside a QPGPGD is author-reported 2.47 times faster than qpOASES on a pyramid, a comparison the paper says is not like for like 2412.09816 §6.1.2. The other paper uses a polyhedral cone within a QP 1311.1839 §3
Smoothing a planned trajectory through waypointsEquality-only QP (direct KKT solve)The form of 1709.05401 §4 eq. 13. The paper says the refined trajectory might be unsafe or infeasible, and describes no check 1709.05401 §4
Teleoperation IK that must return a best-effort command near self-collisionQP-based IK with a relaxed-barrier term in the costThe paper says the soft term returns best-effort solutions instead of failing 2411.07534 §II. Barrier form and weights are not given, and there is no code 2411.07534 §II eq. 4
Battery-powered robotMeasure energy per solveThe review argues speed alone misses energy use, and names a metric (SFPW). It gives no formula for it 2510.21773 §1 2510.21773 §3

Many of the review's timing claims are relayed from one benchmark it cites for both MPC and WBC, plus a dense-QP benchmark 2510.21773 §3. The review measures none of them itself. Check the original benchmark before choosing on a timing number.

Implementation sketch

The review does not give a general QP solver loop. The sketch below encodes its solver-selection advice by problem shape. It is the review's advice, not an algorithm the review states 2510.21773 §3 2510.21773 §4.

Pseudocode
# Candidate solver families by problem shape  [arxiv:2510.21773 §3] [§4]
# Input:  shape, one of 'ocp', 'dense_wbc', 'large_sparse', 'fixed',
#         'conic', 'ill_conditioned'
# Output: candidate solver names (suggestions, not a ranking)

def candidate_solvers(shape):
    # Sparse optimal-control structure over a long horizon  [§4]
    if shape == 'ocp':
        return ['HPIPM']
    # Small or medium dense problems at high rate  [§3] [§4]
    if shape == 'dense_wbc':
        return ['qpmad', 'DAQP', 'qpOASES', 'ProxQP']
    # Large sparse problems, repeated solves, moderate accuracy  [§3]
    if shape == 'large_sparse':
        return ['OSQP']
    # Fixed structure, tiny, generated C code  [tab. 1]
    if shape == 'fixed':
        return ['CVXGEN', 'CVXPYgen', 'FORCESPRO']
    # Conic constraints or certificates  [§2]
    if shape == 'conic':
        return ['Clarabel']
    # Ill-conditioned sparse problems  [tab. 1]
    if shape == 'ill_conditioned':
        return ['PIQP']
    return []

Notes on the sketch. The review's own tables disagree on some solver properties (see Contradictions), so the list is a starting set to test, not a ranking. Solver timings are not in the sketch because the review gives them only for specific hardware and problem sizes 2510.21773 §3. The sketch covers only the review's shapes. It has no entry for a cone handled by projection 2412.09816 §4, because that method is not a solver in the review.

Contradictions

  • Gurobi and warm start. The walking-controller paper reports its Gurobi baselines as warm-started, with both the barrier and dual simplex methods 1311.1839 §5.1. The review's table marks Gurobi, an interior-point solver, as not warm-startable 2510.21773 tab. 2. This page does not resolve it. Check the solver version and settings before comparing timings.
  • qpOASES matrix support. The review's first table describes qpOASES as small-to-medium dense 2510.21773 tab. 1. Its second table lists it as dense or sparse 2510.21773 tab. 2. The review does not reconcile the two, so check the solver's own documentation before choosing it for sparse input.

Papers

Source and license

Compiled from the papers listed on this page, all published under CC BY, CC BY-SA or CC0, with citations. See each paper's page for its authors and license.