%Program tugas akhir
%parameter kendalian;
J1=1;J2=0.1;k=0.155;
b=0.038*(sqrt(k/10));
%plant kendali sikap satelit
A=[0 0 1 0 ; 0 0 0 1 ; -k/J1 k/J1 -b/J1 b/J1 ; k/J2 -k/J2 b/J2 -b/J2];
B=[0;0;1/J1;0];
C=[1 1 0 0];
D=[0];
%stabilisasi model
%pole yang diinginkan
%a=poly([-0.8,-0.8,-0.5,-0.5]);
a=poly([-2,-1,-0.05+0.1i,-0.05-0.1i]);
K=[0 0 0 1]*inv([B A*B A*A*B A*A*A*B])*(A^4+a(2)*A^3+a(3)*A^2+a(4)*A+a(5)*eye(4))
K1=K(1)
K2=K(2)
K3=K(3)
K4=K(4)
%matriks baru adalah
Am=A-B*K
Bm=B
%Menghitung matriks P
Q=eye(4);
P=lyap(Am',Q)
p1=P(1,1);
p2=P(2,2);
p3=P(3,3);
p4=P(4,4);
p5=P(2,1);
p6=P(3,2);
p7=P(4,3);
p8=P(3,1);
p9=P(4,2);
p10=P(4,1);
gam=15;
