You are on page 1of 2

1

m = 1;
k = 2000;
Wn = sqrt (k/m);
E= 2000;
t = 0.4; % duration of step response

figure()
for Z = 0:0.1:1.5
A = [0 1 ; - E -2*Z.*Wn ]

B = [0 ; E]

C = [1 0]

system = ss(A,B,C,0);
y=step(system)

[y,t] = step(system,t); % create the step


plot(t,y)

hold on
end

xlabel('Time (sec)')
ylabel('Step response (y)')
title('Effect of damping on second order system')
legend('z=0.0','z=0.1','z=0.2','z=0.3','z=0.4','z=0.5','z=0.6','z=0.7', ...
' z=0.8','z=0.9','z=1.0','z=1.1','z=1.2','z=1.3');

m = 1;
k = 2000;
Wn = sqrt (k/m);
E= 2000;
t = 0.35; % duration of step response

figure()
for Z = 0:0.1:1.5
A = [0 1 ; - E -2*Z.*Wn ]

B = [0 ; E]

C = [1 0]

system = ss(A,B,C,0);
y=impulse(system)

[y,t] = impulse(system,t);
plot(t,y)
hold on
end

xlabel('Time (sec)')
ylabel('Impulse response (y)')
title('Effect of damping on second order system')
legend('z=0.0','z=0.1','z=0.2','z=0.3','z=0.4','z=0.5','z=0.6','z=0.7', ...
' z=0.8','z=0.9','z=1.0','z=1.1','z=1.2','z=1.3');

You might also like