lqr

Control Systems

Continuous-time Linear Quadratic Regulator. Solves the algebraic Riccati equation via matrix sign function iteration and returns the optimal gain K, Riccati solution S=P, and closed-loop eigenvalues e.

Syntax

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

Examples

[K, S, e] = lqr([[0,1],[0,0]], [[0],[1]], eye(2), 1)
▶ Run
[K, _, _] = lqr(A, B, eye(4), 10)
▶ Run

See Also

Try SimLab — Free MATLAB® Alternative

466 functions. Runs in your browser. No install.

Open SimLab

Stay Updated

Get notified about new simulations and tools. We send 1-2 emails per month.