Идентификация объектов управления. Семенов А.Д - 170 стр.

UptoLike

clear
a11=-1;a21=1;b=1;c=1;d=0;f1=1;f2=0;
A=[a11 0;a21 0];
B=[b;0];
C=[0 c];
D=d;
G=[0;0];
so=ss(A,B,C,D);
sys=ss(A,[B B],C,[D D]);
[nab,L,P]=kalman(sys,2.25,1);
t=0:.01:50;
u=2.25*randn(size(t))+sin(t);
v=.1*randn(size(t));
y=lsim(so,u,t)+v';
un=[u' y];
yn=lsim(nab,un,t);
subplot(3,1,1)
plot(t,u),grid
subplot(3,1,2)
plot(t,y),grid
subplot(3,1,3)
plot(t,y+.2,t,yn(:,1),t,yn(:,2)),grid
clear
a11=-1;a21=1;b=1;c=1;d=0;f1=1;f2=0;
A=[a11 0;a21 0];
B=[b;0];
C=[0 c];
D=d;
G=[0;0];
so=ss(A,B,C,D);
sys=ss(A,[B B],C,[D D]);
[nab,L,P]=kalman(sys,2.25,1);
t=0:.01:50;
u=2.25*randn(size(t))+sin(t);
v=.1*randn(size(t));
y=lsim(so,u,t)+v';
un=[u' y];
yn=lsim(nab,un,t);
subplot(3,1,1)
plot(t,u),grid
subplot(3,1,2)
plot(t,y),grid
subplot(3,1,3)
plot(t,y+.2,t,yn(:,1),t,yn(:,2)),grid