<< lqed | Control System functions | lqry >> |
[K, S, P] = lqr(sys, Q, R, N) |
[K, S, P] = lqr(A, B, Q, R, N) |
LTI model
State-cost weighted matrix
Input-cost weighted matrix
Optional cross term matrix: 0 by default.
State matrix: n x n matrix.
Input-to-state matrix: n x m matrix.
Optimal gain: row vector.
Solution of the Algebraic Riccati Equation.
Poles of the closed-loop system: column vector.
In the context of continuous-time state-space matrices A and B, the command [K, S, P] = lqr(A, B, Q, R, N) computes the optimal gain matrix K, the solution S to the associated algebraic Riccati equation, and the closed-loop poles P.
This syntax is applicable exclusively to continuous-time models.
When applied to a continuous-time or discrete-time state-space model represented by sys, the command [K, S, P] = lqr(sys, Q, R, N) computes the optimal gain matrix K, the solution S to the associated algebraic Riccati equation, and the closed-loop poles P.
The weight matrices Q and R govern the importance of states and inputs, and the cross term matrix N is zero by default when not specified.
A = [-0.313 56.7 0; -0.0139 -0.426 0; 0 56.7 0];
B = [0.232; 0.0203; 0];
C = [0 0 1];
D = 1;
Ts = 1.2;
sys1 = ss(A, B, C, D, Ts);
sys2 = ss(A, B, C, D);
P = 2;
Q = P * C' * C;
R = 2;
[K1, S1, e1] = lqr(sys1, Q, R)
[K2, S2, e2] = lqr(sys2, Q, R)
Version | Description |
---|---|
1.0.0 | initial version |
Allan CORNET