SCAZSLD04.03

download SCAZSLD04.03

If you can't read please download the document

description

a

Transcript of SCAZSLD04.03

clcclear allA=[ -8.1994*10^-3 -2.5708*10^1 0 -3.2171*10^1 ; -1.9451*10^-4 -1.2763 1 0; 6.9573*10^-4 1.0218 -2.4052 0; 0 0 1 0]B=[ -6.8094; -1.4968*10^-1; -14.061; 0]Q0=10^-4R0=10^(-2)*eye(2)C=[0 0 1 0;0 0 0 1][L,Y]=lqe(A,B,C,Q0,R0)t=0:0.1:20;csi=randn(201,1)*10^-2%radical din Q0%niu1=10^(-1)*randn(201,1);%tine seama de timpul masini niu1=5*randn(201,1);%niu2=10^(-1)*randn(201,1);%si va genera numere diferiteniu2=5*randn(201,1);norm(niu1-niu2);%Cazul 1, TreaptaU=[ones(201,1) csi];sysq=ss(A,[B B],C(1,:),[0 0]);systeta=ss(A,[B B],C(2,:),[0 0]);q=lsim(sysq,U,t);teta=lsim(systeta,U,t);qp=q+niu1;%perturbattetap=teta+niu2;%perturbathold onplot(t,qp,'b',t,tetap,'r');sysk=ss(A-L*C,[B L],eye(4),zeros(4,3));figure xe=lsim(sysk,[ones(201,1) qp tetap],t)plot(t,qp,'r',t,xe(:,3),'g')figureplot(t,tetap,'b',t,xe(:,4),'r')%eig(Y)