The Linear-Quadratic Regulator Baseline
LQR is the unconstrained closed-form limit of MPC; its Riccati solution is the baseline gain and the terminal cost that makes MPC provably stable.
The clean special case
Strip constraints and use an infinite horizon with a linear model and quadratic cost, and MPC collapses to the linear-quadratic regulator (LQR), which has a closed-form optimal feedback gain. LQR is both the fast inner-loop baseline (e.g. vertical stabilization) and the source of the terminal cost that certifies constrained MPC stability.
LQR problem (infinite horizon):
min sum_{k=0}^inf x_k' Q x_k + u_k' R u_k
s.t. x_{k+1} = A x_k + B u_k
Optimal feedback: u_k = -K x_k
K = (R + B' P B)^-1 B' P A
P solves the discrete algebraic Riccati equation (DARE):
P = A'P A - A'P B (R + B'P B)^-1 B'P A + Q
The Riccati solution
The matrix P solving the algebraic Riccati equation is the cost-to-go: x' P x is the optimal cost from state x under LQR. It yields the stabilizing gain K and, reused as the MPC terminal weight, guarantees that the finite-horizon plan behaves well beyond the horizon. Existence of a stabilizing P requires the pair (A,B) controllable and (A,Q^1/2) observable.
# LQR gain via the discrete Riccati equation
from scipy.linalg import solve_discrete_are
P = solve_discrete_are(A, B, Q, R)
K = inv(R + B.T@P@B) @ (B.T@P@A)
# u = -K x stabilizes; x'Px is the optimal cost-to-go
eig_cl = eigvals(A - B@K) # all inside unit circle
Where LQR is used directly
For fast, near-linear loops that rarely hit constraints - vertical position, resistive-wall-mode feedback - LQR runs directly at high bandwidth because it is a single matrix multiply. MPC takes over where constraints bind or targets change: shape control at delta -0.30, plug-density regulation. The two are co-designed so LQR's authority and MPC's plans do not conflict over shared actuators.
- Closed-form gain: cheapest possible optimal linear feedback.
- Riccati P: reused as MPC terminal cost for stability guarantees.
- Direct use: vertical stabilization, RWM feedback.
- Requires controllability/observability of the linearized model.
LQR is the mathematical anchor of the control layer: fast where it suffices, and the certificate that the constrained planner inherits its stability from.