Skip to Main Content Skip to Search
Product Documentation

lqr - Linear-Quadratic Regulator (LQR) design

Syntax

[K,S,e] = lqr(SYS,Q,R,N)
[K,S,e] = LQR(A,B,Q,R,N)

Description

[K,S,e] = lqr(SYS,Q,R,N) calculates the optimal gain matrix K.

For a continuous time system, the state-feedback law u = –Kx minimizes the quadratic cost function

subject to the system dynamics

In addition to the state-feedback gain K, lqr returns the solution S of the associated Riccati equation

and the closed-loop eigenvalues e = eig(A-B*K). K is derived from S using

For a discrete-time state-space model, u[n] = –Kx[n] minimizes

subject to x[n + 1] = Ax[n] + Bu[n].

[K,S,e] = LQR(A,B,Q,R,N) is an equivalent syntax for continuous-time models with dynamics

In all cases, when you omit the matrix N, N is set to 0.

Tips

lqr supports descriptor models with nonsingular E. The output S of lqr is the solution of the Riccati equation for the equivalent explicit state-space model:

Limitations

The problem data must satisfy:

See Also

care | dlqr | lqgreg | lqi | lqrd | lqry

  


Free Control Systems Interactive Kit

Learn more about resources for designing, testing, and implementing control systems.

Get free kit

Trials Available

Try the latest control systems products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS