Documente Academic
Documente Profesional
Documente Cultură
clear all
close all
B=[0;-1;0;.5];
c=[0 0 1 0];
T=.05;
.....continous to discontinous
[G,H]= c2d(A,B,T);
G;
eig(G)
% .......//////////..method #1....///////////..........%%
Gpoly=poly(G)
a4=Gpoly(5);
a3=Gpoly(4);
a2=Gpoly(3);
a1=Gpoly(2);
zpoly=poly(Z1)
b4=zpoly(5)
b3=zpoly(4)
b2=zpoly(3)
b1=zpoly(2)
...controllabilty check.....
S1=G*H;
S2=G*S1;
S3=G*S2;
M1=[H S1 S2 S3]
rank(M1)
....transformation matrix....
T1=M1*W1;
I1=inv(T1);
Km1=[b4-a4,b3-a3,b2-a2,b1-a1]*I1
Q=polyvalm(poly(Z1),G)
I2=inv(M1)
.........gain Km2.............
Km2=[0 0 0 1]*I2*Q;
I=eye(4);
......eigon vector #1 is E1
O1=[G-p(1)*I];
I3=inv(O1);
E1=I3*H;
......eigon vector #2 is E2
O2=[G-p(2)*I];
I4=inv(O2);
E2=I4*H;
......eigon vector #3 is E3
O3=[G-p(3)*I];
I5=inv(O3);
E3=I5*H;
......eigon vector #4 is E4
O4=[G-p(4)*I];
I6=inv(O4);
E4=I6*H;
E=[E1 E2 E3 E4];
I7=inv(E);
Km3=[1 1 1 1]*I7;
Km3r=real([1 1 1 1]*I7)
% ////////////.....Method #4 ...//////////////....................%%
Km4=place(G,H,p)
Gscv=G-H*Km4;
eig(Gscv)
for k=0:1:500;
X=(Gscv^k)*G_int;
x1(k+1)=X(1);
x2(k+1)=X(2);
x3(k+1)=X(3);
x4(k+1)=X(4);
end
k=0:1:500;
figure(1)
plot(k,x1)
figure(2)
plot(k,x3)
figure(3)
plot(k,x3)
figure(4)
plot(k,x4)
syms k0 z
C=[0 0 1 0];
Gtrans=(C*inv(z*eye(4)-Gscv)*H*k0);
Ytrans=Gtrans*10;
yfinal1=yfinal*(1/10);
k0=1/yfinal1;
[num, den]=ss2tf(Gscv,H,C,0);
r0=10*ones(1,100);
yout=filter(k0*num,den,r0);
figure(5)
plot(yout)