Vous êtes sur la page 1sur 11

EXPERIMENT#12

clc
clear all
close all
a=[0 1 0;0 0 1;-1 -5 -6];
b=[0;0;1];
j=[-2+4i -2-4i -10];
k=acker(a,b,j)
k1=place(a,b,j)
sys=ss(a-b*k,eye(3),eye(3),eye(3));
t=0:0.01:4;
x=initial(sys,[1;0;0],t);
x1=[1 0 0]*x';
x2=[0 1 0]*x';
x3=[0 0 1]*x';
subplot(311);plot(t,x1),grid
title('responce to initial condition')
ylabel('state variable x1')
subplot(312);plot(t,x2),grid
ylabel('state variable x2')

subplot(313);plot(t,x3),grid
ylabel('state variable x3')

OUTPUT:
k=
199

55

k1 =
199.0000 55.0000

8.0000

Experiment#13

clear all
a = [0 1 ; 20.6 0];
b = [0;1];
c = [1 0];
k = [29.6 3.6];
ke = [16; 84.6];
sys = ss([a-b*k b*k; zeros(2,2) a-ke*c],eye(4),eye(4),eye(4));
t = 0:0.01:4;
z = initial(sys,[1;0;0.5;0],t);
x1 = [1 0 0 0]*z';
x2 = [0 1 0 0]*z';
e1 = [0 0 1 0]*z';
e2 = [0 0 0 1]*z';
subplot(221);
plot(t,x1);
grid
title('Response to initial condition')
ylabel('state variable x1')
subplot(222);
plot(t,x2);
grid
title('Response to initial condition')
ylabel('state variable x2')
subplot(223);
plot(t,e1);
grid
title('Response to initial condition')
xlabel('t(sec)')
ylabel('state variable e1')

subplot(224);
plot(t,e2);
grid
title('Response to initial condition')
xlabel('t(sec)')
ylabel('state variable e2')

EXPERIMENT#14
clc
clear all

a=[0 1 0;0 0 1;-35 -27 -9];


b=[0;0;1];
q=[1 0 0;0 1 0;0 0 1];
r=[1];
[k,p,e]=lqr(a,b,q,r)
sys=ss(a-b*k,eye(3),eye(3),eye(3));
t=0:0.01:8;
x=initial(sys,[1;0;0],t);
x1=[1 0 0]*x';
x2=[0 1 0]*x';
x3=[0 0 1]*x';
subplot(311);plot(t,x1);grid
xlabel('t(sec)');ylabel('x1')
subplot(312);plot(t,x2);grid
xlabel('t(sec)');ylabel('x2')
subplot(313);plot(t,x3);grid
xlabel('t(sec)');ylabel('x3')
%ANSWER
k=
0.0143

0.1107

0.0676

2.4957

0.0143

p=
4.2625
2.4957
0.0143

2.8150
0.1107

e=
-5.0958
-1.9859 + 1.7110i
-1.9859 - 1.7110i

0.1107
0.0676

EXPERIMENT#15
clc
close all
clear all
a = [0 1;-5 -2];
b = [0;3];

c = [0 1];
d = 0;
sys = ss(a,b,c,d);
q = [1 0 0; 0 1 0; 0 0 1];
n = [1;1;1];
r= [1];
[K,S,e]= lqi(sys,q,r,n)

%ANSWER

K=

0.8241

1.1008

0.3050

S=

1.0e+007 *

7.1775 -0.0000
-0.0000

0.0000 -0.0000

7.1775 -0.0000

e=

-3.3377
-1.9647

7.1775

7.1775

-0.0000

Vous aimerez peut-être aussi