I have been asked to design a CT LQG optimal feedback that corresponds to a cheap control strategy with the given A B and C matrices and analyse the resulting close-loop system (margins).
I have tried different implementations, but so far the response to the impulse stay the same as the original system, so I guess I'm missing something.
Here one of the scripts I coded so far:
A = [-(500/290) -(2350/290) (500/290) (2350/290);
1 0 0 0 ;
(500/40) (2350/40) -(500/40) -((2350+19000)/40) ;
0 0 1 0];
B_u = [ 1/290;0; -1/40;0];
C = [1 0 -1 0; 0 1 0 -1];
D = [0;0];
CTsys = ss(A,B_u,C,D);
%weigth matrices
Q = [10000 0 0 0;
0 10000 0 0;
0 0 10000 0;
0 0 0 10000;];
R = 1;
%optimal gain
K = lqr(A,B_u,Q,R)
[kest,L,P] = kalman(CTsys,100,R);
regulator = lqgreg(kest, K);
feedin = [1];
feedout = [1];
cl_sys = feedback(CTsys, regulator, feedin, feedout, +1);
impulse(CTsys,'r--',cl_sys,'b-')
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…