THE RICCATI EQUATION

The quadratic matrix equation at the heart of optimal control and estimation. Give it a linear plant and a quadratic cost, and it returns the one symmetric, positive-definite cost-to-go that steers the system home. This page solves the continuous algebraic Riccati equation live, from real logic, and lets a red team try to break it.

SOURCE J. Riccati (1720s), quadratic differential equation · algebraic form in optimal control: R. E. Kalman, “Contributions to the theory of optimal control,” Bol. Soc. Mat. Mex. 5:102–199 (1960). No stable open link — cited by author/title/year. Rendered, not quoted.

Blue Team · builds & defends
3

The Model

A constructed linear time-invariant plant — the double integrator — with a quadratic cost. Every number below is closed-form checkable.

Continuous ARE: AᵀP + PA − P·B·R⁻¹·Bᵀ·P + Q = 0. Solve for the unique symmetric positive-definite stabilizing P.

System: A = [[0,1],[0,0]] (poles 0,0), B = [0;1], Q = I, R = 1. Controllable & observable, so a stabilizing P exists and is unique.

Known solution: P = [[√3, 1],[1, √3]], gain K = [1, √3], closed loop at −√3/2 ± i/2.

5

The Lineage

The ARE is the continuous fixed point of the-bellman-equation: iterate the value recursion in continuous time and its limit is this equation.

It is the one equation that the-lqr regulator and the-kalman filter (its exact dual, on the estimation-error covariance) both solve — a quadratic recursion whose limit is the optimal quadratic cost.

7

The Witness

Live re-check. It re-solves from Q, recomputes the true ARE residual (with the quadratic term intact) and confirms symmetry, positive-definiteness and a Hurwitz closed loop. If window 6 tampers, it flips red.

witness idle
The Machine
4

IN ↓ Data In

Plant matrix A

B (input)[0 ; 1]
Q (state cost)I₂
R (input cost)1
↓ ↓ ↓
0

LIT The Panel — live solver

Steady state of the Riccati recursion Pₖ₊₁ = Pₖ + dt·(AᵀP+PA−PBR⁻¹BᵀP+Q), started from P₀=Q:

true ARE residual ‖·‖_F
eig(P)
gain K = R⁻¹BᵀP
eig(A−BK) — closed loop
↓ ↓ ↓
8

OUT ↓ Data Out

Proven, closed-form, to 1e−8:

P[[√3, 1],[1, √3]]
eig(P)√3−1, √3+1 > 0
K[1, √3]
poles−√3/2 ± i/2
verifying…
Red Team · attacks & breaks
1

WALL The Adversary

“Just integrate the Riccati ODE backward and read off the steady state.” — but the ODE is stiff for fast modes, and a single sign flip lands you on the anti-stabilizing manifold. Up to 2ⁿ symmetric solutions exist; only one is stabilizing.
A stabilizing PD solution exists only if (A,B) is stabilizable and (A,Q½) detectable. Violate either and the fixed point is not positive-definite — or does not exist.
If the Hamiltonian matrix has eigenvalues on the imaginary axis, the stabilizing solution is lost or non-unique. The tidy answer is not guaranteed.
2

The Graveyard

  • “The Riccati equation is linear in P.” → The −PBR⁻¹BᵀP term is quadratic; drop it and you get the Lyapunov equation, which here has no PD solution (A is not Hurwitz).
  • “Any symmetric solution will do.” → Only the maximal, positive-definite, stabilizing solution yields a Hurwitz closed loop; the others push poles into the right half-plane.
  • “Riccati is a control-only trick.” → Its dual is the Kalman–Bucy filter covariance equation; estimation and control share the same fixed point.
6

The Tamper

The disclosed planted void: drop the quadratic term −PBR⁻¹BᵀP from the recursion, turning the ARE into a linear Lyapunov equation. The solved P then solves the wrong equation — its true ARE residual explodes. The witness (7) catches it live.