Problemcore
Linear quadratic regulator problem
Also called LQR problem, LQ optimal control.
Minimize the integral or sum of x^T Q x + u^T R u for a linear system. The optimal input is a linear state feedback u = -K x, with K from a Riccati equation.
- Model
- Real RAM
The linear quadratic regulator (LQR) problem asks for the input that drives a linear system , or , toward zero at the smallest value of a quadratic cost. The cost adds a weight on the state and a weight on the input, summed or integrated over a finite or an infinite horizon. The answer is always a linear state feedback . On a finite horizon the gain changes with time and comes from a Riccati recursion or a Riccati differential equation (finite-horizon LQR). On an infinite horizon the gain is constant and comes from the stabilizing solution of an algebraic Riccati equation (infinite-horizon LQR, the CARE and the DARE). This page states the problem. The solution methods and the equations have their own pages.
In plain words
A machine should go back to its rest position after a push. You can apply force to bring it back, but force costs fuel or wear, and being away from rest also costs something. The problem is to choose the force at each moment so that the total cost over time is as small as possible. Two dials set the trade: one says how much you dislike being away from rest, the other how much you dislike using force. For linear machines and costs of this squared form, the best force has a simple shape. It is the measured state multiplied by a fixed table of numbers, the gain. Finding the gain means solving one matrix equation. If you turn the force dial down, the gain gets larger and the machine returns faster. If you turn it up, the controller acts more gently.
Definition
Continuous time. Input: matrices and , weights in and in , an initial state , and either a horizon with a terminal weight , or . The plant is , . The cost is
with no terminal term when . The task is to find an input that minimizes over all square integrable inputs, and the minimum value.
Discrete time. The plant is , and the cost is for a horizon , or the infinite sum with no terminal term.
Cross term. This area also allows a cost with , under the condition that the block matrix is positive semidefinite and . By the Schur complement, that is the same as . The Reductions section removes the cross term, so the rest of the page sets .
What is known about the answer.
- Finite horizon. A minimizer always exists and is unique. It is , where solves the Riccati differential equation with . The minimum is . In discrete time, with the gains of the backward Riccati recursion.
- Infinite horizon, stabilizable. If is stabilizable, some input gives a finite cost, so the minimum is finite for every .
- Infinite horizon, stabilizable and detectable. If also is detectable, the minimizer is with in continuous time and in discrete time. Here is the unique stabilizing solution of the CARE or the DARE (the stabilizing solution theorem), and the minimum is . The closed loop is Hurwitz in continuous time and Schur in discrete time.
Without detectability, the optimal input can leave the state unbounded. The scalar example below shows this.
Variants
- Finite or infinite horizon, continuous or discrete time. These are the four basic cases. In discrete time the data may also come from sampling a continuous plant with a zero-order hold.
- Time-varying data. , , and may depend on time (linear time-varying systems). The finite-horizon solution keeps the same form, with the data of each time in the Riccati equation.
- Output weighting. for an output , so the cost is . Detectability is then the detectability of .
- Stabilizing inputs only. Some texts minimize over inputs for which . If is stabilizable and has no unobservable mode on the imaginary axis (the unit circle in discrete time), the stabilizing solution of the ARE exists and solves this problem even when detectability fails. Its minimum may then be larger than the unconstrained one.
- Discounted cost. The cost with , which reduces to the standard problem (see Reductions).
- Tracking. The state should follow a reference in place of zero. With a constant reference, a shift of coordinates to the steady state, or an integral state, gives a regulator problem again.
- Constraints. With bounds on or , the solution is no longer linear. Linear MPC solves this case online with a quadratic program.
- Noise and output feedback. With process and measurement noise and only measured, the problem becomes LQG control, equivalently the H2 optimal control problem.
Examples
Scalar, continuous time. Take with and . The CARE is , with roots . The stabilizing root is . The gain is , the closed loop is , and the minimal cost from is . Check by hand: with , and the cost is .
Double integrator. Take , , and . Write . The three entries of the CARE give , and . The solution with is
The closed loop has the characteristic polynomial , with roots and damping ratio .
Scalar, discrete time. Take with . The DARE is , so , and , the golden ratio. The gain is , and the closed loop is .
No detectability. Take with and . The input costs nothing, so it is optimal, but grows without bound. The CARE has the solutions , which gives this input, and , which is the stabilizing solution. If only inputs with are allowed, the minimum is , attained by .
Not stabilizable. Take with and . No input acts on the state, the cost is infinite for every , and the infinite-horizon problem has no solution.
Known algorithms
- Finite-horizon LQR: the backward Riccati recursion in discrete time, arithmetic operations and exact in rational arithmetic, or the Riccati differential equation integrated backward.
- Batch least squares: in discrete time, stack into one vector. The cost is a convex quadratic in that vector, so the minimizer solves one least squares problem of size . Dense, this costs , more than the recursion, but it extends to constraints as a quadratic program.
- Infinite-horizon LQR: the finite-horizon recursion run to its limit, which is value iteration in discrete time.
- Schur method: an ordered Schur form of the Hamiltonian matrix gives the stable invariant subspace and , in operations. It is the usual dense method.
- Kleinman iteration: Newton's method on the CARE, one Lyapunov equation per step, from a stabilizing initial gain. Hewer's method is the discrete version.
- Doubling algorithms and the matrix sign function, both with quadratic convergence (Bini, Iannazzo and Meini).
- Semidefinite programming: the stabilizing solution is the largest symmetric that satisfies the linear matrix inequality , so it maximizes over that set. This is slower than the Schur method, but it combines with other LMI constraints.
| Algorithm | Time | Space | Properties | Code |
|---|---|---|---|---|
| Finite-horizon LQR | O(N (n^3 + m^3)) worst | O(N n m + n^2) extra | deterministicexactofflineiterative | 1 language |
| Infinite-horizon LQR | O(j (n^3 + m^3)) worst | O(n^2 + n m) extra | deterministicnot exactofflineiterative | 1 language |
Bounds
- The finite-horizon discrete problem with rational data has a rational solution, and the recursion computes it exactly with operations on rational numbers.
- The infinite-horizon problem has no exact finite algorithm in general. The entries of are algebraic numbers, and the scalar examples above already give and . All practical methods are iterative, with a stopping test on the Riccati residual.
- Monotonicity (a theorem): the minimal cost does not decrease when or increases, and in discrete time the cost of horizon with does not decrease with and is at most the infinite-horizon cost.
- The size of the gain (a rule of thumb): scaling down by a factor makes the gain larger and the closed loop faster, at the price of larger inputs and more sensitivity to noise and unmodeled dynamics.
Reductions
- Cross term to no cross term. Set . Then , and the plant becomes . Solve this problem for ; the optimal input of the original problem is . The same change works in discrete time.
- Discounted to undiscounted. With and , the plant becomes and the cost loses its discount. Detectability and stabilizability are now asked of .
- LQR as a special case. It is the H2 optimal control problem with the full state measured and no noise on the measurement, and a special case of the optimal control problem. The Pontryagin maximum principle and the Hamilton-Jacobi-Bellman equation both give the Riccati solution: the costate is a fixed multiple of (the factor depends on how the Hamiltonian is scaled), and the value function is .
- Duality with estimation. The steady-state Kalman filter for with noise covariances and solves the Riccati equation of the LQR problem for with weights and . So any LQR solver is also a Kalman filter solver.
- Minimum energy control. With and a fixed final state in place of a terminal cost, the problem becomes minimum energy control, which the controllability Gramian solves.
Applications
- State feedback design for aircraft, spacecraft attitude and other multivariable plants, where pole placement leaves too many free parameters and the weights are easier to tune.
- The state feedback half of LQG control, with a Kalman filter as the other half. The margins of the next point are then lost (see the LQR stability margins page).
- A design with guaranteed robustness: in continuous time with one input, the LQR loop has a gain margin of and a phase margin of at least 60 degrees.
- The terminal cost and the local controller of model predictive control: the infinite-horizon cost and the gain are the usual choices.
- Inside iterative methods for nonlinear optimal control, which solve a time-varying LQR problem around the current trajectory at each step.
References
- R. E. Kalman, Contributions to the theory of optimal control, Boletín de la Sociedad Matemática Mexicana 5(2), 102-119, 1960, the statement of the regulator problem with a quadratic cost, its solution by a linear feedback, and the limit of an infinite interval
- Brian D. O. Anderson and John B. Moore, Optimal Control, Linear Quadratic Methods, Prentice Hall, 1990 (Dover reprint, 2007), Chapter 2, The Standard Regulator Problem I
- Daniel Liberzon, Calculus of Variations and Optimal Control Theory, A Concise Introduction, Princeton University Press, 2012, Section 6.1 (the finite-horizon problem) and Section 6.2 (the infinite-horizon problem and the algebraic Riccati equation)
- Dimitri P. Bertsekas, Dynamic Programming and Optimal Control, Volume I, fourth edition, Athena Scientific, 2017, Section 3.1, Linear Systems and Quadratic Cost
- Kemin Zhou, John C. Doyle and Keith Glover, Robust and Optimal Control, Prentice Hall, 1996, Chapter 13 (algebraic Riccati equations) and Chapter 14 (H2 optimal control, with the state feedback case)
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.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag 1TJYDZ Edit this page History Report an error Markdown