Algorithm Search⌘K

Problemcore

Discrete-time algebraic Riccati equation

Also called DARE.

Find the stabilizing symmetric solution P of the fixed point equation of the discrete Riccati recursion, which gives the discrete LQR gain.

The discrete-time algebraic Riccati equation (DARE) is the matrix equation

P=ATPA−ATPB(R+BTPB)−1BTPA+QP = A^T P A - A^T P B (R + B^T P B)^{-1} B^T P A + Q

in a symmetric unknown P∈Rn×nP \in \mathbb{R}^{n \times n}. The problem is to find its stabilizing solution: the solution for which A−BKA - B K is Schur, with K=(R+BTPB)−1BTPAK = (R + B^T P B)^{-1} B^T P A. This KK is the constant optimal gain of the infinite-horizon discrete LQR problem, and x0TPx0x_0^T P x_0 is the optimal cost. The equation is the fixed point of the backward Riccati recursion of finite-horizon LQR, so running that recursion long enough is one way to solve it (infinite-horizon LQR). With AA and BB replaced by ATA^T and CTC^T, it gives the steady-state gain of the Kalman filter. The continuous-time counterpart is the CARE.

In plain words

A sampled system is steered step by step, and each step costs something for the state and something for the input. The best total cost from a state is a bowl-shaped function, held by a symmetric matrix. If the horizon has no end, one step later the future looks exactly the same as now. So the matrix must reproduce itself: the cost of one step plus the best cost from the next state must give back the same matrix. That condition is the discrete Riccati equation. It has several solutions, and only one belongs to a controller that brings the state to zero. The simplest way to find it is to repeat the one-step update from zero until it stops changing. Faster methods use Newton steps or an eigenvalue problem of twice the size.

Definition

Input: A∈Rn×nA \in \mathbb{R}^{n \times n}, B∈Rn×mB \in \mathbb{R}^{n \times m}, Q=QT≥0Q = Q^T \ge 0 and R=RT>0R = R^T > 0. For symmetric P≥0P \ge 0 the matrix R+BTPBR + B^T P B is positive definite, and the Riccati map is

F(P)=Q+ATPA−ATPB(R+BTPB)−1BTPA.F(P) = Q + A^T P A - A^T P B (R + B^T P B)^{-1} B^T P A.

A solution is a symmetric PP with P=F(P)P = F(P) and R+BTPBR + B^T P B invertible. It is stabilizing if A−BKA - B K is Schur, with K=(R+BTPB)−1BTPAK = (R + B^T P B)^{-1} B^T P A. Output: the stabilizing solution PP and the gain KK, or the report that none exists.

Facts about the answer.

  • The equation has a second form. With AK=A−BKA_K = A - B K, a solution satisfies P=Q+KTRK+AKTPAKP = Q + K^T R K + A_K^T P A_K. This is a Stein (discrete Lyapunov) equation in PP for a fixed KK.
  • A stabilizing solution is positive semidefinite: from the second form, P=∑k≥0(AKT)k(Q+KTRK)AKkP = \sum_{k \ge 0} (A_K^T)^k (Q + K^T R K) A_K^k, and the sum converges because AKA_K is Schur.
  • There is at most one stabilizing solution. Completing the square and summing, as in Lemma 2 of the infinite-horizon LQR proof, shows that x0TPx0x_0^T P x_0 is the minimal cost over all inputs with xk→0x_k \to 0. That minimum does not depend on PP, and x0x_0 is arbitrary, so two stabilizing solutions are equal.
  • If (A,B)(A, B) is stabilizable and (Q1/2,A)(Q^{1/2}, A) is detectable, the stabilizing solution exists. It is the only positive semidefinite solution, and the Riccati recursion from P0=0P_0 = 0 converges to it (the stabilizing solution theorem and the infinite-horizon LQR page).
  • With G=BR−1BTG = B R^{-1} B^T and AA invertible, PP solves the DARE if and only if the column space of [IP]\begin{bmatrix} I \\ P \end{bmatrix} is invariant under the symplectic matrix Z=[A+GA−TQ−GA−T−A−TQA−T]Z = \begin{bmatrix} A + G A^{-T} Q & -G A^{-T} \\ -A^{-T} Q & A^{-T} \end{bmatrix}. Its eigenvalues come in pairs λ\lambda and 1/λˉ1 / \bar\lambda, and the stabilizing solution belongs to the invariant subspace of the eigenvalues with ∣λ∣<1|\lambda| < 1.

Variants

  • Cross term. For the cost xTQx+2xTSu+uTRux^T Q x + 2 x^T S u + u^T R u, the equation is P=ATPA−(ATPB+S)(R+BTPB)−1(BTPA+ST)+QP = A^T P A - (A^T P B + S)(R + B^T P B)^{-1}(B^T P A + S^T) + Q, and the gain is K=(R+BTPB)−1(BTPA+ST)K = (R + B^T P B)^{-1} (B^T P A + S^T).
  • Singular input weight. In discrete time RR may be singular, provided R+BTPBR + B^T P B stays invertible at the solution. This happens in deadbeat-like problems and in sampled-data problems with a cost that is integrated between the samples.
  • Filter form. Σ=AΣAT−AΣCT(CΣCT+V)−1CΣAT+W\Sigma = A \Sigma A^T - A \Sigma C^T (C \Sigma C^T + V)^{-1} C \Sigma A^T + W for the prediction error covariance of the steady-state Kalman filter. It is the DARE of (AT,CT,W,V)(A^T, C^T, W, V).
  • No input. With B=0B = 0 the DARE is the Stein equation P=ATPA+QP = A^T P A + Q, and its solution is stabilizing exactly when AA is Schur.
  • Without A invertible. The symplectic matrix needs A−1A^{-1}. The pencil [A0−QI]−z[IG0AT]\begin{bmatrix} A & 0 \\ -Q & I \end{bmatrix} - z \begin{bmatrix} I & G \\ 0 & A^T \end{bmatrix} does not. It comes from the costate equations xk+1=Axk−Gλk+1x_{k+1} = A x_k - G \lambda_{k+1} and λk=Qxk+ATλk+1\lambda_k = Q x_k + A^T \lambda_{k+1}, and the QZ algorithm handles it.
  • Discounted cost. A discount γ\gamma gives the DARE of (γ A,γ B)(\sqrt\gamma\, A, \sqrt\gamma\, B).

Examples

Scalar. With n=m=1n = m = 1 and b≠0b \ne 0, F(p)=q+a2rp/(r+b2p)F(p) = q + a^2 r p / (r + b^2 p). The DARE becomes the quadratic

b2p2+(r−qb2−a2r) p−qr=0,b^2 p^2 + (r - q b^2 - a^2 r)\, p - q r = 0,

and the closed loop is a−bK=ar/(r+b2p)a - b K = a r / (r + b^2 p).

  • a=b=q=r=1a = b = q = r = 1: p2−p−1=0p^2 - p - 1 = 0, so p=(1+5)/2≈1.618034p = (1 + \sqrt 5) / 2 \approx 1.618034, the golden ratio. K=p/(1+p)≈0.618034K = p / (1 + p) \approx 0.618034 and the closed loop is 0.3819660.381966. The other root (1−5)/2(1 - \sqrt 5)/2 is negative, and its closed loop 1/(1+(1−5)/2)≈2.6180341 / (1 + (1 - \sqrt 5)/2) \approx 2.618034 is not Schur. The Riccati recursion from p0=0p_0 = 0 gives 1,3/2,8/5,21/13,…1, 3/2, 8/5, 21/13, \dots, ratios of Fibonacci numbers.
  • a=2a = 2, b=q=r=1b = q = r = 1: p2−4p−1=0p^2 - 4 p - 1 = 0, so p=2+5≈4.236068p = 2 + \sqrt 5 \approx 4.236068, K≈1.618034K \approx 1.618034 and the closed loop is 2/(1+p)≈0.3819662 / (1 + p) \approx 0.381966.
  • a=2a = 2, b=r=1b = r = 1 and q=0q = 0 (not detectable): p2−3p=0p^2 - 3 p = 0. The root p=0p = 0 gives the closed loop 22. The root p=3p = 3 gives K=3/2K = 3/2 and the closed loop 1/21/2, so it is the stabilizing solution. The recursion from p0=0p_0 = 0 stays at 00 and never finds it.
  • a=b=r=1a = b = r = 1 and q=0q = 0: p2=0p^2 = 0, and the only solution p=0p = 0 gives the closed loop 11. There is no stabilizing solution, because the mode at 11 is unobservable and on the unit circle.

Sampled double integrator. The double integrator sampled with a zero-order hold of period 1 gives A=[1101]A = \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix} and B=[1/21]B = \begin{bmatrix} 1/2 \\ 1 \end{bmatrix}. With Q=IQ = I and R=1R = 1, the stabilizing solution, to six decimals, is

P=[2.3671011.1180341.1180342.587483],K=[0.4344831.028466],P = \begin{bmatrix} 2.367101 & 1.118034 \\ 1.118034 & 2.587483 \end{bmatrix}, \qquad K = \begin{bmatrix} 0.434483 & 1.028466 \end{bmatrix},

where P12P_{12} agrees with 5/2\sqrt 5 / 2 to 59 digits in a computation with 60 digits (a measurement). The closed loop eigenvalues are 0.377146±0.215723i0.377146 \pm 0.215723 i, with modulus 0.4344830.434483. These are the numbers of the infinite-horizon LQR example. In double precision, 22 passes of the recursion give a DARE residual of 2.9×10−152.9 \times 10^{-15} in the 2-norm.

Known algorithms

  • Value iteration: the Riccati recursion Pj+1=F(Pj)P_{j+1} = F(P_j) from P0=0P_0 = 0 (infinite-horizon LQR). Each pass costs O(n3+m3)O(n^3 + m^3). The derivative of FF at the solution is the map D↦AKTDAKD \mapsto A_K^T D A_K, so the convergence is linear with ratio ρ(AK)2\rho(A_K)^2, where ρ\rho is the spectral radius. In the golden ratio example, the ratio is 0.3819662≈0.14590.381966^2 \approx 0.1459.
  • Hewer's method (1971), the discrete version of the Kleinman iteration: from a gain K0K_0 with A−BK0A - B K_0 Schur, solve the Stein equation Pk=Q+KkTRKk+(A−BKk)TPk(A−BKk)P_k = Q + K_k^T R K_k + (A - B K_k)^T P_k (A - B K_k) and update Kk+1=(R+BTPkB)−1BTPkAK_{k+1} = (R + B^T P_k B)^{-1} B^T P_k A. The iterates decrease to the solution and converge quadratically.
  • Schur methods: an ordered Schur form of the symplectic matrix, or an ordered QZ form of the pencil above when AA is singular or badly conditioned. They cost O(n3)O(n^3).
  • Doubling and cyclic reduction. A doubling pass doubles the horizon that the recursion covers, so kk passes reach the horizon 2k2^k, and the convergence is quadratic (see Bini, Iannazzo and Meini).
AlgorithmTimeSpacePropertiesCode
Kleinman iterationO(k (n^6 + m^3)) worstO(n^4 + m^2) extradeterministicnot exactiterativeiterative1 language
Schur method for Riccati equationsO(c n^3) worstO(n^2) extradeterministicnot exactiterativeiterative1 language

Bounds

  • Exactness (a theorem): the entries of PP are algebraic numbers, and (1+5)/2(1 + \sqrt 5)/2 shows that they can be irrational even for integer data. There is no exact finite rational algorithm in general.
  • Cost: O(n3+m3)O(n^3 + m^3) arithmetic operations per pass or per Newton step with dense methods. Newton steps in Kronecker form cost O(n6)O(n^6) each.
  • Count: as for the CARE, the solutions correspond to nn-dimensional invariant subspaces of the symplectic matrix with a nonsingular top block, so there are at most (2nn)\binom{2n}{n} when its eigenvalues are distinct.
  • Sensitivity (a rule of thumb): the DARE is badly conditioned when the symplectic matrix has eigenvalues close to the unit circle, that is, when the optimal closed loop is close to the edge of the unit disk.

Reductions

  • DARE to a fixed point. It is the fixed point of the finite-horizon recursion, so its solution is the limit of finite-horizon costs under the hypotheses above.
  • DARE to a sequence of Stein equations. Newton's method, as in Hewer's method.
  • DARE to an eigenvalue problem. The stabilizing solution is P=X2X1−1P = X_2 X_1^{-1} for a basis [X1X2]\begin{bmatrix} X_1 \\ X_2 \end{bmatrix} of the stable deflating subspace of the pencil, or of the stable invariant subspace of ZZ.
  • Filter to regulator. The Kalman filter equation for (A,C,W,V)(A, C, W, V) is the DARE of (AT,CT,W,V)(A^T, C^T, W, V).
  • CARE and DARE. A Cayley transform maps one into the other, under invertibility conditions, so a solver for one can solve the other.
  • Sampled-data LQR. A continuous cost integrated between samples, with a zero-order hold input, gives a DARE with a cross term SS and a full weight QQ computed from matrix exponentials.

Applications

  • The constant gain of discrete-time LQR, used whenever the controller runs on a computer with a fixed sample time.
  • The steady-state gain and error covariance of the Kalman filter.
  • The terminal cost and the local controller of linear MPC: xTPxx^T P x with PP from the DARE makes the finite-horizon cost equal the infinite-horizon cost near the origin.
  • Discrete-time H2 and H-infinity synthesis, and the discrete bounded real lemma.
  • Econometric and economic models with quadratic loss, where the same equation appears in linear quadratic dynamic programming.

References

  1. Brian D. O. Anderson and John B. Moore, Optimal Control, Linear Quadratic Methods, Prentice Hall, 1990 (Dover reprint, 2007), the discrete-time regulator and its Riccati equation
  2. Dimitri P. Bertsekas, Dynamic Programming and Optimal Control, Volume I, fourth edition, Athena Scientific, 2017, Section 3.1, Linear Systems and Quadratic Cost, with the convergence of the Riccati recursion to the algebraic equation
  3. Kemin Zhou, John C. Doyle and Keith Glover, Robust and Optimal Control, Prentice Hall, 1996, Chapter 21, Discrete Time Control
  4. Peter Lancaster and Leiba Rodman, Algebraic Riccati Equations, Clarendon Press, Oxford, 1995, the discrete-time equation and its symplectic matrix
  5. G. A. Hewer, An iterative technique for the computation of the steady state gains for the discrete optimal regulator, IEEE Transactions on Automatic Control 16(4), 382-384, 1971, Newton's method for the DARE, one discrete Lyapunov equation per step
  6. Dario A. Bini, Bruno Iannazzo and Beatrice Meini, Numerical Solution of Algebraic Riccati Equations, SIAM, 2012, the discrete-time equation, cyclic reduction and doubling

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a contract.yaml