# Linear–quadratic regulator

The **linear–quadratic regulator** (LQR) is an optimal feedback controller for a linear system whose performance criterion is quadratic in the state and the control input; it computes a state-feedback law that drives the state toward zero while penalizing control effort.<sup>[1](https://uw-ctrl.github.io/lmc-book/lectures/lqr.html)</sup> The name decomposes exactly: the dynamics are *linear*, the cost is *quadratic*, and the controller is a *regulator* that penalizes deviations from the zero state and zero control effort.<sup>[1](https://uw-ctrl.github.io/lmc-book/lectures/lqr.html)</sup> MIT's underactuated-control course notes call it likely the most important and influential result in optimal control theory.<sup>[2](https://underactuated.mit.edu/lqr.html)</sup>

| Key fact | Detail |
|---|---|
| Problem class | Linear dynamics \( \dot{x} = Ax + Bu \) (or discrete-time \( x_{t+1} = Ax_t + Bu_t \)) with quadratic cost in state and input; unconstrained control<sup>[3](https://liberzon.csl.illinois.edu/teaching/cvoc/node107.html)</sup> |
| Optimal law | Linear state feedback \( u^* = -Kx \), with \( K = R^{-1}B^TP \) in continuous time<sup>[1](https://uw-ctrl.github.io/lmc-book/lectures/lqr.html)</sup> |
| Finite horizon | Solved by the dynamic Riccati equation, iterated backward in time from the terminal condition \( P_T = Q_T \); the gains \( K_t \) are time-varying<sup>[1](https://uw-ctrl.github.io/lmc-book/lectures/lqr.html)</sup> |
| Infinite horizon | \( P \) converges to a constant solving the algebraic Riccati equation: DARE in discrete time, CARE in continuous time<sup>[1](https://uw-ctrl.github.io/lmc-book/lectures/lqr.html)</sup> |
| Stability guarantee | The value function \( V(x,t) = x^TP_tx \) is a valid Lyapunov function for the closed-loop system, so LQR guarantees stability to the origin under basic assumptions<sup>[1](https://uw-ctrl.github.io/lmc-book/lectures/lqr.html)</sup> |
| Existence conditions | The pair (A, B) must be stabilizable and R must be positive definite<sup>[4](https://www.mathworks.com/help/control/ref/lti.lqr.html)</sup> |
| Historical role | Developed in the early 1960s alongside the Kalman filter; their combination is the Linear Quadratic Gaussian (LQG) methodology<sup>[5](https://ntrs.nasa.gov/api/citations/20000097938/downloads/20000097938.pdf)</sup> |

## Problem formulation

In the finite-horizon continuous-time form, the system is linear and time-varying, \( \dot{x} = A(t)x + B(t)u \) with \( x \in \mathbb{R}^n \) and unconstrained \( u \in \mathbb{R}^m \), the target is a fixed final time with free endpoint, and the cost is

\[ J(u) = \int_{t_0}^{t_1} \left( x^T Q(t) x + u^T R(t) u \right) dt + x^T(t_1) M x(t_1), \]

with Q symmetric positive semidefinite and R symmetric positive definite.<sup>[3](https://liberzon.csl.illinois.edu/teaching/cvoc/node107.html)</sup> The matrix Q weights state deviations and R weights control effort, so the designer trades regulation speed against actuator usage; MATLAB's documentation describes Q, R, and the optional cross-term N as defining exactly this tradeoff.<sup>[4](https://www.mathworks.com/help/control/ref/lti.lqr.html)</sup><sup> • </sup><sup>[6](https://www.mathworks.com/help/control/getstart/linear-quadratic-gaussian-lqg-design.html)</sup>

## Solution via the Riccati equation

**Dynamic programming.** In discrete time, the [Bellman equation](https://www.edgepedia.org/bellman-equation) with the LQR assumptions gives a value function that is quadratic in the state, \( V(x,t) = x^T P_t x \). Minimizing the resulting expression, which is quadratic in \( u \), yields the recursion

\[ P_{t-1} = Q + A^T P_t A - A^T P_t B (B^T P_t B + R)^{-1} B^T P_t A, \quad P_T = Q_T, \]

with gain \( K_t = (B^T P_{t+1} B + R)^{-1} B^T P_{t+1} A \) and control \( u_t^* = -K_t x_t \). This update is the dynamic [Riccati equation](https://www.edgepedia.org/riccati-equation); all \( P_t \) and gains \( K_t \) can be computed offline by iterating backward from the horizon, so the online step is only a lookup and a multiplication.<sup>[1](https://uw-ctrl.github.io/lmc-book/lectures/lqr.html)</sup>

**Continuous time.** The same structure follows from the [Hamilton–Jacobi–Bellman equation](https://www.edgepedia.org/hamilton-jacobi-bellman-equation), which reduces to the Riccati differential equation

\[ -\dot{P}(t) = Q + A^T P(t) + P(t)A - P(t)BR^{-1}B^T P(t), \quad P(T) = Q_T, \]

with \( K(t) = R^{-1}B^T P(t) \).<sup>[1](https://uw-ctrl.github.io/lmc-book/lectures/lqr.html)</sup> Even when A, B, Q, and R are time-invariant, the finite-horizon gain \( K_t \) is time-varying.<sup>[7](https://solmaz.eng.uci.edu/Teaching/MAE274/Lecture7.pdf)</sup>

**Infinite horizon.** As the horizon grows, \( P_t \) converges to a constant \( P_\infty \). Setting \( \dot{P} = 0 \) gives the algebraic Riccati equations: the discrete-time algebraic Riccati equation (DARE),

\[ P_\infty = Q + A^T P_\infty A - A^T P_\infty B (B^T P_\infty B + R)^{-1} B^T P_\infty A, \]

and the continuous-time algebraic Riccati equation (CARE),

\[ 0 = Q + A^T P_\infty + P_\infty A - P_\infty B R^{-1} B^T P_\infty. \]

Both have well-established numerical solution methods and built-in functions in control software packages.<sup>[1](https://uw-ctrl.github.io/lmc-book/lectures/lqr.html)</sup> The infinite-horizon result is a constant-gain feedback law, which is why it is the easier form to implement for time-invariant systems.<sup>[1](https://uw-ctrl.github.io/lmc-book/lectures/lqr.html)</sup>

## Stability and the Lyapunov connection

The Riccati equations resemble Lyapunov equations with extra terms. For the closed-loop dynamics \( x_{t+1} = (A - BK_t)x_t \), the value function \( V(x,t) = x^T P_t x \) is a valid [Lyapunov function](https://www.edgepedia.org/lyapunov-function), which means LQR provides a constructive method for finding a control Lyapunov function for linear dynamics and guarantees stability to the origin when basic assumptions are met.<sup>[1](https://uw-ctrl.github.io/lmc-book/lectures/lqr.html)</sup>

The infinite-horizon solution also serves as a tool for stabilizing trajectories of nonlinear systems: a finite-time trajectory that ends at a stabilizable fixed point can be stabilized by initializing the finite-horizon Riccati equation with the infinite-horizon solution, \( S(t_2) = S_\infty \), and solving backward.<sup>[2](https://underactuated.mit.edu/lqr.html)</sup>

## Extensions

**Tracking.** The standard formulation drives the state to zero, but a linear quadratic tracking version penalizes deviations from a reference trajectory \( x_d(t), u_d(t) \). The value function then includes linear and constant terms alongside the quadratic one, integrated backward from terminal conditions tied to \( Q_f \).<sup>[2](https://underactuated.mit.edu/lqr.html)</sup>

**Strict final conditions.** A hard terminal constraint can be imposed by letting the terminal weight \( Q_f \) go to infinity; integrating the Riccati equation backward from an infinite condition is impractical, so one instead solves for \( P(t) = S(t)^{-1} \) with terminal condition \( P(t_f) = 0 \). With \( Q = 0 \) this inverse equation becomes a linear ODE, a relationship used in deriving the controllability Gramian.<sup>[8](https://underactuated.csail.mit.edu/lqr.html)</sup>

**LQG.** LQR assumes the full state is measured. When it is not, LQR is paired with a [Kalman filter](https://www.edgepedia.org/kalman-filter), and the combination is the Linear Quadratic Gaussian (LQG) controller; the separation principle allows the two designs to be carried out independently.<sup>[5](https://ntrs.nasa.gov/api/citations/20000097938/downloads/20000097938.pdf)</sup><sup> • </sup><sup>[9](https://ocw.mit.edu/courses/2-154-maneuvering-and-control-of-surface-and-underwater-vehicles-13-49-fall-2004/2609f8b1bdebe4566891080afe007f51_1349_notes.pdf)</sup> This pairing has a known limitation: although LQR and the Kalman filter each possess good robustness properties, there exist plants for which no robustness guarantee holds for the combined LQG compensator.<sup>[9](https://ocw.mit.edu/courses/2-154-maneuvering-and-control-of-surface-and-underwater-vehicles-13-49-fall-2004/2609f8b1bdebe4566891080afe007f51_1349_notes.pdf)</sup>

## Practical design and software

Control packages implement LQR directly. MATLAB's `lqr` function returns the optimal gain matrix K, the Riccati solution S, and the closed-loop poles \( P = \mathrm{eig}(A - BK) \) for continuous-time or discrete-time state-space models, with `dlqr` for discrete-time plants.<sup>[4](https://www.mathworks.com/help/control/ref/lti.lqr.html)</sup> The input data must satisfy existence conditions: (A, B) must be stabilizable, R must be positive definite, and the block matrix formed from Q, N, and R must be positive semidefinite with no unobservable mode on the imaginary axis (or unit circle in discrete time).<sup>[4](https://www.mathworks.com/help/control/ref/lti.lqr.html)</sup>

A common starting point for choosing Q and R is Bryson's rule, which normalizes each state and input by its maximum acceptable value; MATLAB's inverted-pendulum example uses it to set Q and R before calling `lqr`, and notes that the result is usually just the starting point of an iterative tuning procedure.<sup>[4](https://www.mathworks.com/help/control/ref/lti.lqr.html)</sup>

## Applications

LQR is used wherever a linearized plant needs regulation. A NASA study of the [International Space Station](https://www.edgepedia.org/international-space-station) used the infinite-horizon LQR technique, minimizing a scalar quadratic performance index, to obtain linear control laws for Earth-pointing spacecraft orientations, including torque equilibrium attitude and attitude held relative to a local-vertical-local-horizontal frame, with variants using flywheels, control moment gyroscopes, and thrusters.<sup>[10](https://ntrs.nasa.gov/api/citations/20030038806/downloads/20030038806.pdf)</sup> The [inverted pendulum](https://www.edgepedia.org/inverted-pendulum) on a cart is a standard teaching example.<sup>[4](https://www.mathworks.com/help/control/ref/lti.lqr.html)</sup>

## References

1. [Linear Quadratic Regulator, Linear Multivariable Control lecture notes (University of Washington)](https://uw-ctrl.github.io/lmc-book/lectures/lqr.html)
2. [Ch. 8, Linear Quadratic Regulators, Underactuated Robotics (MIT, Russ Tedrake)](https://underactuated.mit.edu/lqr.html)
3. [6.1 Finite-horizon LQR problem, Daniel Liberzon, Calculus of Variations and Optimal Control Theory](https://liberzon.csl.illinois.edu/teaching/cvoc/node107.html)
4. [lqr, Linear-Quadratic Regulator (LQR) design, MATLAB documentation](https://www.mathworks.com/help/control/ref/lti.lqr.html)
5. [NASA Technical Report on LQG controller design history](https://ntrs.nasa.gov/api/citations/20000097938/downloads/20000097938.pdf)
6. [Linear-Quadratic-Gaussian (LQG) Design, MATLAB documentation](https://www.mathworks.com/help/control/getstart/linear-quadratic-gaussian-lqg-design.html)
7. [Optimal Control Lecture 7, MAE274 (UC Irvine)](https://solmaz.eng.uci.edu/Teaching/MAE274/Lecture7.pdf)
8. [Ch. 8, Linear Quadratic Regulators, Underactuated Robotics (MIT CSAIL mirror)](https://underactuated.csail.mit.edu/lqr.html)
9. [Loop Transfer Recovery notes, MIT OCW 2.154 Maneuvering and Control of Surface and Underwater Vehicles](https://ocw.mit.edu/courses/2-154-maneuvering-and-control-of-surface-and-underwater-vehicles-13-49-fall-2004/2609f8b1bdebe4566891080afe007f51_1349_notes.pdf)
10. [NASA Technical Report on LQR attitude control and momentum management for the ISS](https://ntrs.nasa.gov/api/citations/20030038806/downloads/20030038806.pdf)

---
*Topic: Encyclopedia › Technology and the built world › Engineering and manufacturing › Engineering methods and systems engineering*

*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

*Copyright 2026 EdgeChat AI, a subsidiary of Biostate AI.*

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license
