New Text Document

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

D = [0 -3 -4 ]

N = [-1 -3]
a =poly(N)
b =poly(D)
[num1 den1] =cloop(a,b)
tf(num1,den1)
num1 =[1 4 3];
den1 =[1 8 16 3];
[A,B,C,D] =tf2ss(num1,den1);
printsys(A,B,C,D)
[num1,den1]=ss2tf(A,B,C,D);
printsys(num1,den1)

r = 3
I = 1
c = 0.5
a =[0 -1/c;1/1 -r/1]
b =[1/c;0]
c =[0 r]
d =[0]
x0 =[1 1]
t =[0:0.01:5]
u =0*t
[y,x] = lsim(a,b,c,d,u,t,x0)
size(y)
size(x)
subplot(3,1,1);
plot(t,x(:,1))
plot(t,x(:,1))
xlabel('time');
ylabel('x1');
subplot(3,1,2);
plot(t,x(:,2))
xlabel('time');
ylabel('x2');
subplot(3,1,3);
plot(t,y);
xlabel('time');
ylabel('output');

r = 3
I = 4
c = 2
a =[0 -1/c;1/1 -r/1]
b =[1/c;0]
c =[0 r]
d =[0]
x0 =[1 1]
t =[0:0.01:5]
u =0*t
[y,x] = lsim(a,b,c,d,u,t,x0)
size(y)
size(x)
plot(t,y);
xlabel('time');
ylabel('output');
title('Over Damped');

r = 2
I = 2
c = 2
a =[0 -1/c;1/1 -r/1]
b =[1/c;0]
c =[0 r]
d =[0]
x0 =[1 1]
t =[0:0.01:5]
u =0*t
[y,x] = lsim(a,b,c,d,u,t,x0)
size(y)
size(x)
plot(t,y);
xlabel('time');
ylabel('output');
title('Critically damped');

r = 2
I = 2
c = 0.6
a =[0 -1/c;1/1 -r/1]
b =[1/c;0]
c =[0 r]
d =[0]
x0 =[1 1]
t =[0:0.01:5]
u =0*t
[y,x] = lsim(a,b,c,d,u,t,x0)
size(y)
size(x)
plot(t,y);
xlabel('time');
ylabel('output');
title('Under damped');

You might also like