Linear-quadratic regulation and Riccati equations
Derive a feedback law from a quadratic value function and select the stabilizing Riccati solution with explicit hypotheses.
On this page
The question for today
What you’ll understand
- Derive finite-horizon Riccati dynamics under a stated cost convention.
- State stabilizability and detectability conditions for infinite-horizon regulation.
- Reject a nonstabilizing algebraic root and verify a scalar optimal policy.
Pole placement selects a spectrum and leaves effort largely unspecified. Linear-quadratic regulation instead balances state deviation against control energy and derives the feedback from that objective. The value function is quadratic, but its matrix satisfies a nonlinear Riccati equation. A finite horizon needs a terminal condition and generally produces time-varying gains; an infinite horizon can yield a constant stabilizing gain under structural assumptions. Solving an algebraic equation without selecting the correct root can produce an unstable controller, even in a one-dimensional example.
Fix the cost convention before differentiating
Consider real finite-dimensional ẋ=Ax+Bu over a fixed interval ending at T, with unrestricted square-integrable controls. Use the cost integral of xᵀQx+uᵀRu plus terminal x(T)ᵀFx(T), with Q and F symmetric positive semidefinite and R symmetric positive definite. There is no factor one half in this convention. Seeking V(t,x)=xᵀP(t)x and minimizing the local quadratic in u gives u*=−R^{-1}BᵀP(t)x. The positive input penalty makes this pointwise minimizer unique.
The matrix P satisfies a differential Riccati equation integrated backward from P(T)=F. With continuous coefficients on a finite interval and R uniformly positive definite, the nonnegative-cost finite-horizon problem has the corresponding positive semidefinite Riccati solution; for the constant matrices used here these hypotheses are immediate. Controllability is not required merely to define this finite-horizon problem with a soft terminal cost. A hard specified terminal state is a different boundary constraint and can be infeasible, so it cannot be silently substituted for the terminal penalty.
The infinite horizon needs stabilizing structure
For constant matrices on the infinite horizon, assume (A,B) stabilizable and (Q^{1/2},A) detectable, with Q≥0 and R>0. Then there is a unique symmetric positive semidefinite stabilizing solution of the algebraic Riccati equation. Its feedback makes A−BR^{-1}BᵀP Hurwitz and gives the finite optimal value x₀ᵀPx₀. Stabilizability permits stable uncontrollable modes; detectability requires every state direction invisible to the running state penalty to be strictly stable. These are weaker than full controllability and a positive-definite Q, respectively.
The word stabilizing is essential because the algebraic equation can have other roots. If detectability is dropped, zero state penalty can make an unstable trajectory cost nothing, so a cost-minimizing law need not stabilize. For example, A=1,B=1,Q=0,R=1 permits u=0 with zero cost while x grows. Under the stated hypotheses, completing the square in the cost supplies the optimality certificate and the Riccati identity links P to a closed-loop Lyapunov equation. The full theorem is being stated here; its detectability step is not replaced by an eigenvalue guess.
Weights encode a model, not actuator limits
Increasing an input penalty generally discourages aggressive commands, but it does not impose a hard amplitude bound. A quadratic regulator can request an arbitrarily large command when the initial state is large. Saturating that command changes the closed-loop system and its exact optimality proof. Units matter as well: weighting a position and a temperature with identical numeric coefficients is not a dimensionless comparison unless the coordinates have been normalized deliberately. The matrices express a chosen tradeoff, not an objective law supplied by the plant itself.
Finite-horizon gains depend on remaining time and terminal penalty. Receding-horizon use of a finite-horizon controller adds repeated optimization and needs a separate stability argument if the terminal construction is changed. Conversely, replacing the finite-horizon Riccati function by an algebraic solution assumes an infinite-horizon stationary problem. Estimation can later be combined with regulation under suitable linear-Gaussian assumptions, but the deterministic full-state calculation here does not by itself establish performance when the state is noisy or hidden. Keep the optimization problem attached to the gain it produced.
Work it through
Choose the stabilizing scalar root
For ẋ=x+u, minimize ∫₀^∞(x²+u²)dt with x(0)=2. Find the LQR gain and value.
The scalar algebraic equation is 2P−P²+1=0, with roots P=1±√2. The pair is controllable and Q=1 observes the state, so the infinite-horizon theorem applies.
Choose P=1+√2>0. Then u=−Px and the closed-loop coefficient is 1−P=−√2. The other root gives coefficient +√2 and is not stabilizing.
The value is P x₀²=4(1+√2). Directly, x(t)=2exp(−√2t) and the cost integral is 4(1+P²)/(2√2)=4P, using P²=2P+1.
The stable feedback is u=−(1+√2)x and the optimal cost is 4(1+√2). Both algebraic roots satisfy the equation, but only one matches the nonnegative stabilizing value.
The living notebook
Explore the model
Interactive lab · function
Read a quadratic value gradient
Pause and Reset, then set a=1.5,x=1. Predict value V=1.5 and gradient 3. For an integrator with R=1, the local LQR minimizer would be u=−gradient/2=−1.5. For a fresh comparison Reset and set a=0.5,x=1; predict gradient 1 and command −0.5. This graph illustrates a candidate value function; it does not solve a Riccati equation or certify that either coefficient matches a specified control problem.
- y at chosen x
- 0.608
- Tangent slope · 2ax
- 1.35
- Signed area · ax³/3
- 0.182
This lab uses only y = ax². Playback traces the curve within the fixed integration interval from 0 to x; it does not estimate numerical error or change the chosen point. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forThe gain comes from minimizing control cost plus the value gradient’s effect on state motion.
Pause & reason
Check your understanding
Your turn
Try it yourself
For ẋ=u on [0,2], x(0)=3, minimize ∫₀²u²dt+x(2)². Compute P(t), the optimal trajectory and the cost.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Here Q=0,R=1,F=1. Solve Ṗ=P² backward from P(2)=1, then solve ẋ=−P(t)x.
Compare with the solution
The solution is P(t)=1/(3−t). The state x(t)=3−t satisfies ẋ=−1=−P(t)x(t), so u(t)=−1 throughout and x(2)=1. The cost is 2+1=3, matching P(0)x(0)²=(1/3)·9=3. The final state is not forced to zero: the problem assigns it a soft penalty. Replacing that penalty by a hard terminal equality would produce a different optimum.
Keep the idea
Take it with you
- Finite-horizon LQR uses a backward Riccati equation with a terminal penalty.
- Infinite-horizon stabilization requires explicit stabilizability and detectability hypotheses.
- The correct Riccati solution is stabilizing; quadratic effort penalties are not hard actuator limits.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.