44.07.02 · optimization-control / optimal-control-pontryagin

The Linear-Quadratic Regulator: Differential and Algebraic Riccati Equations

shipped3 tiersLean: none

Anchor (Master): Anderson-Moore 1990 Optimal Control: Linear Quadratic Methods (Prentice-Hall) Ch. 3-5 (existence and uniqueness of the stabilising ARE solution under stabilisability and detectability, the Hamiltonian matrix and its stable invariant subspace, closed-loop stability); Lancaster-Rodman 1995 Algebraic Riccati Equations (Oxford University Press) Ch. 7-9 (the solution set of the ARE, the Hamiltonian/symplectic structure, and the stabilising solution); Kwakernaak-Sivan 1972 Linear Optimal Control Systems (Wiley-Interscience) Ch. 3 (the continuous- and discrete-time regulator)

Intuition Beginner

Imagine balancing a tall pole on your hand, or steering a drone back to a hover after a gust. At every instant you are off from where you want to be, and you can push to correct it. Two things annoy you. First, being off-target is bad: a leaning pole, a drifting drone. Second, pushing hard is also bad: it burns energy, strains motors, and feels jerky. The linear-quadratic regulator is the recipe for the best trade-off between these two annoyances, when the system responds in a straight-line way to your pushes and the penalties grow with the square of how far off you are and how hard you push.

Why square the penalties? Squaring makes small errors cheap and large errors very expensive, so the recipe works hard to kill big deviations and tolerates tiny ones. Squaring also has a clean payoff: the best control turns out to be a simple rule. You measure how far the system is from its target, multiply by a fixed table of numbers, and push by that amount. That rule is called feedback, and the table is the gain.

The deep surprise is where the gain comes from. To know the best push right now you would think you need to plan the entire future. It collapses into one object: a matrix that records how costly it is to be in each state, given that you will steer optimally from here on. Computing that matrix is the whole game, and it satisfies a special equation named after Riccati.

The Riccati equation is the bridge from "what do all my future choices cost" to "what single push is best now." Solve it once, read off the gain table, and you have an autopilot.

Visual Beginner

The picture shows the loop the regulator runs and where the gain table sits inside it.

Read the table left to right as one cycle, repeated forever. The system has a current state (how far off you are). The gain table turns that state into a push. The push, plus the system's own drift, produces the next state, and the cycle repeats. The gain table is fixed once you have solved the Riccati equation, so running the autopilot is cheap.

stage what happens object
measure read how far off you are state
decide multiply state by the gain table push
act push moves the system, which also drifts on its own changes
repeat the new state feeds back to measure loop closes

The takeaway: the optimal controller is just "push in proportion to the error," and the only hard work, finding the proportion, is done in advance by solving the Riccati equation. Once you have the gain, controlling the system costs one multiplication per step.

Worked example Beginner

Take the simplest possible system: a single number that drifts according to , where is your push. There is no built-in motion, so and . You pay for being off-target at rate squared and for pushing at rate squared, so the state penalty is and the control penalty is . We want the steady, long-run best rule.

Step 1. Guess the cost-to-go has the form for some single positive number , recording how expensive it is to sit at state and steer optimally forever after.

Step 2. The steady Riccati equation in this scalar case reads . Plug in , , , :

Step 3. Pick the positive root (the cost-to-go must be a cost, so it cannot be negative).

Step 4. Read off the gain. The rule is with . So the best push is : push back by exactly your current error.

Step 5. Check it stabilises. With the system becomes , which decays smoothly to zero. The error shrinks; the autopilot works.

What this tells us: even with the future stretching to infinity, the answer is one number and one gain . The Riccati equation turned an infinite planning problem into solving , and the resulting controller drives the state to rest.

Check your understanding Beginner

Formal definition Intermediate+

Let the plant be the linear time-invariant system of 02.06.03, with state , control , , . Fix symmetric weight matrices on the state and on the control (the positive-semidefinite and positive-definite cones of 01.01.13), and a terminal weight .

Definition (finite-horizon LQR). Over the cost of a state-control trajectory is

The linear-quadratic regulator is the control minimising subject to the dynamics and the initial condition .

Definition (value function / cost-to-go). The value function is

the least cost achievable from state at time steering optimally to .

Definition (matrix Riccati differential equation, RDE). The Riccati differential equation for the symmetric matrix is the terminal-value problem

Its solution , run backward from , is the Hessian of the value function: . The associated time-varying gain is , and the optimal control is the state feedback .

Definition (continuous-time algebraic Riccati equation, CARE). Letting with and , constant gives the infinite-horizon LQR, minimising . Its value function is with the steady solution , i.e. the symmetric solution of the continuous-time algebraic Riccati equation

The constant optimal gain is and the optimal control is the static feedback , producing the closed-loop matrix .

Definition (stabilisability, detectability). The pair is stabilisable when there exists with Hurwitz (every uncontrollable mode is already stable); equivalently for every with . The pair , with , is detectable when is stabilisable (every unobservable mode is already stable). These are the hypotheses under which the CARE has a unique stabilising solution.

Definition (discrete-time LQR and DARE). For with cost , the steady value Hessian solves the discrete-time algebraic Riccati equation

with optimal gain and closed loop .

Notation: are the system matrices; , the state and control weights; the Riccati matrix; the feedback gain; the value function; the closed-loop matrix; (introduced below) the Hamiltonian matrix; the Loewner order on symmetric matrices.

Counterexamples to common slips

  • Positive-definiteness of is not optional. If is only positive-semidefinite, some control directions are free, fails to exist, and the gain is undefined; the minimisation can have no finite optimum. The state weight may be merely semidefinite, but is structural.

  • The CARE has many symmetric solutions; the regulator wants exactly one. The equation is quadratic in , so it generally has a whole lattice of symmetric solutions (one per Lagrangian invariant subspace of the Hamiltonian). Only the stabilising solution — the one making Hurwitz — is the optimal cost-to-go; picking the wrong root gives an unstable closed loop.

  • Stabilisability is weaker than controllability and is the right hypothesis. A system with a stable but uncontrollable mode is not controllable, yet the infinite-horizon regulator is still well posed because the offending mode decays on its own. Demanding full controllability would needlessly exclude such systems.

Key theorem with proof Intermediate+

Theorem (LQR optimality via dynamic programming and the Riccati equation; Bertsekas §4.1 [source pending]; Anderson-Moore Ch. 2-3 [source pending]). For the finite-horizon problem with , , , let be the symmetric solution of the Riccati differential equation with . Then exists, is symmetric and positive-semidefinite on all of , the value function is the quadratic form , and the unique optimal control is the linear feedback .

Proof. The value function obeys the Hamilton-Jacobi-Bellman (HJB) equation: writing the running cost , the principle of optimality gives, for the value ,

with the gradient in . Adopt the quadratic ansatz with ; then and the partial in time is . The bracketed expression to minimise becomes

This is strictly convex in because ; setting its -gradient to zero, , yields the minimiser

Substitute back. The control terms collapse: . The HJB equation reads

where symmetrises the cross term. Matching the symmetric quadratic forms gives exactly the Riccati differential equation with terminal data .

Existence on the whole interval: the right-hand side is a quadratic (hence locally Lipschitz) field in , so a local solution exists backward from . Finite escape is excluded because is sandwiched: , where solves the linear Lyapunov equation obtained by fixing any stabilising feedback and evaluating its (finite) cost-to-go. The lower bound holds because as the minimum of a non-negative cost; the upper bound holds because the optimal cost cannot exceed the cost of a fixed admissible policy, which is the finite quadratic form . A solution bounded in the Loewner order on a compact interval cannot blow up, so extends to all of .

Optimality and uniqueness: for any admissible with resulting trajectory , the function has derivative, using the dynamics and the RDE,

after completing the square (the algebra is the same collapse as above, with the leftover ). Integrating from to and using ,

with equality iff almost everywhere. So is the unique optimal control and .

Bridge. This completion-of-squares identity builds toward the infinite-horizon theory of the Advanced results, where letting sends the Riccati matrix to a constant solving the algebraic Riccati equation, and the same square-completion certifies that the resulting static feedback is optimal over the infinite horizon. The Riccati differential equation is exactly the Bellman recursion of dynamic programming written in continuous time, so this is the foundational reason a single backward sweep yields the optimal policy at every state at once rather than one trajectory at a time. The argument generalises the scalar of the Beginner worked example to a matrix quadratic, and the structure of that matrix quadratic is dual to the Lyapunov equation of 43.06.12: dropping the quadratic term leaves the closed-loop Lyapunov equation that the optimal also satisfies. The central insight is that quadratic cost plus linear dynamics forces a quadratic value function, collapsing an infinite-dimensional minimisation over control functions into a finite-dimensional matrix equation; putting these together, the bridge is the recognition that the cost-to-go Hessian is simultaneously the object that prices every future and the object whose feedback acts now. The Riccati matrix appears again in the Kalman filter, the estimation dual treated downstream.

Exercises Intermediate+

Advanced results Master

Theorem (existence and uniqueness of the stabilising CARE solution; Anderson-Moore Ch. 3-5 [source pending]; Lancaster-Rodman Ch. 7-9 [source pending]). Let be stabilisable and detectable, with , . Then the continuous-time algebraic Riccati equation has a unique symmetric positive-semidefinite solution that is stabilising, meaning is Hurwitz. This is the maximal symmetric solution in the Loewner order, equals the infinite-horizon value Hessian, and the static feedback minimises . If detectability is strengthened to observability of , then .

Stabilisability is what makes the infinite-horizon cost finite for at least one policy, so the value function is well defined; detectability is what forces the optimal closed loop to be stable rather than merely cost-finite, by ruling out an undetected unstable mode that contributes zero running cost. Under both, the finite-horizon Riccati solution converges monotonically as to the stabilising , independent of the terminal weight , which is how the algebraic equation inherits its solution from the differential one.

Theorem (Hamiltonian / invariant-subspace construction; Lancaster-Rodman Ch. 7-9 [source pending]). Form the Hamiltonian matrix

Under stabilisability and detectability has no eigenvalues on the imaginary axis, so it has an -dimensional stable invariant subspace; choosing a basis \begin{psmallmatrix} X \\ Y\end{psmallmatrix} for it with invertible, the stabilising solution is , which is symmetric, and the eigenvalues of the optimal closed loop are exactly the stable eigenvalues of . The eigenvalues of come in pairs by the Hamiltonian symmetry , with \mathcal J = \begin{psmallmatrix} 0 & I \\ -I & 0\end{psmallmatrix}, so the imaginary axis splits the eigenvalues into stable and unstable.

This reduces solving a quadratic matrix equation to a linear-algebra computation: a real Schur reduction of that orders the stable eigenvalues first, after which the leading Schur columns furnish \begin{psmallmatrix} X \\ Y\end{psmallmatrix} and follows by one triangular solve. This is the Schur method of Laub (1979), built on the same real Schur form of [43.06] that the Bartels-Stewart solver of 43.06.12 uses; it is the production route in LAPACK/SLICOT, numerically preferable to iterating the Riccati equation. The ordered Schur form is what selects the stabilising root from the lattice of symmetric solutions: each Lagrangian -invariant subspace gives a different symmetric solution, and the stable one alone yields the Hurwitz closed loop.

Theorem (Newton-Kleinman iteration; Anderson-Moore Ch. 3 [source pending]). Start from any stabilising feedback (so Hurwitz). Iterate: given , solve the Lyapunov equation for , then set . The iterates decrease monotonically, , and converge quadratically to the stabilising solution , with every Hurwitz along the way.

Each Newton-Kleinman step is exactly one Lyapunov solve of 43.06.12 — a Bartels-Stewart / Hammarling computation — so the entire CARE solver is a short loop over the matrix-equation solver of the numerical-analysis spine. The iteration is Newton's method applied to the Riccati operator , whose Fréchet derivative at in direction is the Lyapunov operator ; the Hurwitz closed loop makes that derivative invertible (its spectrum avoids zero by 43.06.12), which is the source of the quadratic local rate.

Theorem (discrete-time regulator and the DARE; Kwakernaak-Sivan Ch. 3 [source pending]). For with stabilisable and detectable, the discrete-time algebraic Riccati equation has a unique stabilising symmetric positive-semidefinite solution, the optimal gain is , and the closed loop has spectral radius below one. The discrete solution arises from the stable deflating subspace of the symplectic matrix pencil \lambda \begin{psmallmatrix} I & BR^{-1}B^{\mathsf T} \\ 0 & A^{\mathsf T}\end{psmallmatrix} - \begin{psmallmatrix} A & 0 \\ -Q & I\end{psmallmatrix}, whose eigenvalues are symmetric under about the unit circle rather than the imaginary axis; the unit circle plays the role the imaginary axis plays in continuous time.

Synthesis. The linear-quadratic regulator is one object — the value function of a quadratic cost over linear dynamics — and the Riccati matrix is the central insight that organises every face of it: the differential equation is the continuous-time Bellman recursion, its steady state is the algebraic equation, its gain is the controller, and its Hamiltonian converts the quadratic solve into a linear invariant-subspace computation. This is exactly why dropping the quadratic term recovers the Lyapunov equation of 43.06.12: the optimal satisfies the closed-loop Lyapunov identity , so is simultaneously the optimal cost-to-go and a Lyapunov function certifying that is Hurwitz, and the foundational reason LQR guarantees stability is that optimality and the Lyapunov stability test of 02.12.08 are the same equation viewed from two sides.

The construction generalises the scalar quadratic to a matrix quadratic whose stabilising root is selected by the stable invariant subspace of , and that selection is dual to the eigenvalue split: the left-half-plane eigenvalues of become the closed-loop poles. Putting these together, the entire solver pipeline rides on the numerical-linear-algebra spine — the Schur form of [43.06] orders the Hamiltonian spectrum, and each Newton-Kleinman step is a Bartels-Stewart Lyapunov solve of 43.06.12 — so the bridge from optimal control to computation is the recognition that a quadratic matrix equation is an eigenvalue problem in disguise, and its conditioning is governed by the same separation that conditions the Lyapunov solve underneath it.

Full proof set Master

Proposition 1 (the HJB ansatz reduces LQR to the Riccati equation). The value function of the finite-horizon LQR is with solving the RDE , , and the optimal control is .

Proof. This is the Key theorem. The HJB equation with has inner minimiser from the first-order condition and the Hessian ; substituting collapses the control terms to and matching symmetric quadratic forms yields the RDE. The completion-of-squares identity integrates to , proving optimality and uniqueness of .

Proposition 2 (the optimal solves a closed-loop Lyapunov equation). If solves the CARE and , , then .

Proof. Expand . With and , , both and equal , so the sum is . The CARE gives , hence the sum equals . Since , this is .

Proposition 3 (stabilising CARE solution implies a Hurwitz closed loop, given detectability). Let solve the CARE with detectable, and suppose is non-increasing along . Then is Hurwitz.

Proof. By Proposition 2, , so is a Lyapunov function and the closed loop is at least marginally stable. Suppose had an eigenvalue with and eigenvector . Along the mode the LaSalle argument forces , hence and on this trajectory; with the closed-loop dynamics reduce to , so has an unobservable mode at with , contradicting detectability. Therefore every eigenvalue of has strictly negative real part.

Proposition 4 (Hamiltonian invariant subspace yields the symmetric solution). If \begin{psmallmatrix} X \\ Y\end{psmallmatrix} spans an -invariant subspace with invertible and the subspace is Lagrangian (i.e. ), then is symmetric and solves the CARE.

Proof. Invariance gives \mathcal H\begin{psmallmatrix} X \\ Y\end{psmallmatrix} = \begin{psmallmatrix} X \\ Y\end{psmallmatrix}M for some . The top block reads , so . The bottom block reads . Right-multiply by and write : , which rearranges to the CARE . Symmetry is the Lagrangian condition : , and invertible forces . Selecting the stable invariant subspace makes similar to Hurwitz, so is the stabilising solution.

Proposition 5 (Hamiltonian eigenvalue symmetry). The spectrum of is symmetric about the imaginary axis: .

Proof. With \mathcal J = \begin{psmallmatrix} 0 & I \\ -I & 0\end{psmallmatrix}, a direct block computation gives (the defining property of a Hamiltonian matrix; here ). Thus and are similar, so they share a spectrum. Since and always share a spectrum, , the claimed symmetry. With no eigenvalues on the imaginary axis (guaranteed under stabilisability and detectability), the eigenvalues split into in the open left half-plane and in the open right half-plane, and the stable invariant subspace of Proposition 4 is well defined.

Connections Master

The Riccati equation is the quadratic enrichment of the Lyapunov equation of 43.06.12: deleting its quadratic term leaves the closed-loop Lyapunov equation that the optimal cost-to-go also satisfies, and every Newton-Kleinman step solves exactly one such Lyapunov equation by the Bartels-Stewart / Hammarling algorithm of that unit, so the conditioning of the regulator solve is governed by the separation that conditions the underlying matrix-equation solve.

The LQR closed-loop guarantee is the algebraic face of the Lyapunov direct method of 02.12.08: the value function built from the stabilising CARE solution is a quadratic Lyapunov function whose derivative along is , so optimality and asymptotic stability are the same statement, and detectability of is exactly the observability condition that upgrades the non-strict decrease to strict asymptotic stability.

The flow and the cost integrals rest on the matrix-exponential theory of 02.06.03: the infinite-horizon cost of any stabilising feedback is the convergent Gramian , the same exponential representation that solves the Lyapunov equation, and the Riccati matrix is the minimum of these costs over all stabilising feedbacks.

The positive-semidefinite structure of , , and is the spectral/PSD theory of 01.01.13: the weights live in the positive cone, the CARE solution is selected to be the maximal positive-semidefinite root, and the principal-axes decomposition of is what diagonalises the value function into independent quadratic costs along the eigendirections, the geometric content of the cost-to-go.

The Hamiltonian construction forward-links to the Pontryagin maximum principle of this chapter (44.07.01) and to the dynamic-programming / HJB framework of [44.08]: the Hamiltonian matrix is the linear-quadratic specialisation of the Pontryagin costate dynamics, and the value function is the linear-quadratic instance of the HJB value function, so LQR is simultaneously the worked example that makes both general theories concrete and the case where they are solvable in closed form.

The estimation dual forward-links to the Kalman filter (a downstream statistics/estimation unit): the filter's error-covariance recursion is a Riccati equation with replaced by the transposed/observation data, so the CARE solver and its Hamiltonian-subspace machinery transfer verbatim to optimal linear estimation by duality.

Historical & philosophical context Master

The Riccati equation descends from the scalar nonlinear differential equation studied by Jacopo Riccati in the 1720s, whose defining feature — a quadratic nonlinearity linearisable by a change to a second-order linear equation — is the same structure that lets the matrix Riccati equation be solved through the linear Hamiltonian system [Riccati 1724]. The control-theoretic matrix version emerged from Rudolf Kalman's 1960 reformulation of optimal control and filtering in state-space terms; his work on the linear-quadratic regulator and, with Richard Bucy, on the dual filtering problem established the Riccati equation as the central computational object of modern control [Kalman 1960].

The dynamic-programming derivation used here is Richard Bellman's, whose principle of optimality and the resulting Hamilton-Jacobi-Bellman equation reduce the search over control functions to a backward recursion on the value function [Bellman 1957]. The existence-uniqueness theory under stabilisability and detectability, the maximal-solution characterisation, and the closed-loop stability guarantee were systematised by Wonham, Kucera, and Willems in the 1960s and 1970s, and consolidated in the monographs of Anderson and Moore and of Kwakernaak and Sivan [Willems 1971]. The numerically stable Hamiltonian-Schur solver was given by Alan Laub in 1979, replacing direct iteration of the Riccati equation with an ordered real Schur reduction; it and the Newton-Kleinman iteration are the algorithms behind the Riccati routines of LAPACK, SLICOT, and the control toolboxes.

Bibliography Master

@book{Bertsekas2017DP,
  author    = {Bertsekas, Dimitri P.},
  title     = {Dynamic Programming and Optimal Control, Volume I},
  edition   = {4th},
  publisher = {Athena Scientific},
  address   = {Belmont, MA},
  year      = {2017}
}

@book{AndersonMoore1990,
  author    = {Anderson, Brian D. O. and Moore, John B.},
  title     = {Optimal Control: Linear Quadratic Methods},
  publisher = {Prentice-Hall},
  address   = {Englewood Cliffs, NJ},
  year      = {1990}
}

@book{KwakernaakSivan1972,
  author    = {Kwakernaak, Huibert and Sivan, Raphael},
  title     = {Linear Optimal Control Systems},
  publisher = {Wiley-Interscience},
  address   = {New York},
  year      = {1972}
}

@book{LancasterRodman1995,
  author    = {Lancaster, Peter and Rodman, Leiba},
  title     = {Algebraic Riccati Equations},
  publisher = {Oxford University Press},
  address   = {Oxford},
  year      = {1995}
}

@article{Kalman1960,
  author  = {Kalman, Rudolf E.},
  title   = {Contributions to the Theory of Optimal Control},
  journal = {Bolet\'in de la Sociedad Matem\'atica Mexicana},
  volume  = {5},
  year    = {1960},
  pages   = {102--119}
}

@book{Bellman1957,
  author    = {Bellman, Richard E.},
  title     = {Dynamic Programming},
  publisher = {Princeton University Press},
  address   = {Princeton, NJ},
  year      = {1957}
}

@article{Willems1971,
  author  = {Willems, Jan C.},
  title   = {Least Squares Stationary Optimal Control and the Algebraic Riccati Equation},
  journal = {IEEE Transactions on Automatic Control},
  volume  = {16},
  number  = {6},
  year    = {1971},
  pages   = {621--634}
}

@article{Laub1979,
  author  = {Laub, Alan J.},
  title   = {A Schur Method for Solving Algebraic Riccati Equations},
  journal = {IEEE Transactions on Automatic Control},
  volume  = {24},
  number  = {6},
  year    = {1979},
  pages   = {913--921}
}

@article{Kleinman1968,
  author  = {Kleinman, David L.},
  title   = {On an Iterative Technique for Riccati Equation Computations},
  journal = {IEEE Transactions on Automatic Control},
  volume  = {13},
  number  = {1},
  year    = {1968},
  pages   = {114--115}
}