Having weighing matrices G
and Rin
using lqry
[K,~,~] = lqry(mysys,G,Rin);
I got the following error:
Error using ss/lqry (line 96) The "lqry" command failed to stabilize the plant or find an optimal feedback gain. To remedy this problem:
1. Make sure that all unstable poles of A are controllable through B (use MINREAL to check)
2. Modify the weights Q and R to make [C D;0 I]'*[Q N;N' R]*[C D;0 I] positive definite (use EIG to check positivity).
If I want to use minreal
for stabilizing the plan, how should I modify G
and Rin
?
mysys=minreal(mysys);
G=?????
Rin=?????
[K,~,~] = lqry(mysys,G,Rin);
If your state representation is nonminimal and after passing through
minreal
some of the states are removed, then yourQ
and if you are usingN
matrix needs to comply with the new size.Say you have a 2x2 system. If you had initially 5 states and you would have a 5x5 Q matrix, 2x2 R matrix and if you are using 3x2 N matrix.
Then suppose two of these states are removed after
minreal
. In that case the Q matrix would be 3x3, ,if you are using, N must be 3x2 for the new system.