Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
23 views

Matlab Code

The document simulates the step and impulse responses of a second order system for different damping ratios (Z) from 0 to 1.5 in increments of 0.1. It creates state space models for the system, applies a step or impulse input, and plots the response for each Z value on the same graph. The plots show the effect of increasing damping on the step and impulse responses of the second order system.

Uploaded by

marotty
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Matlab Code

The document simulates the step and impulse responses of a second order system for different damping ratios (Z) from 0 to 1.5 in increments of 0.1. It creates state space models for the system, applies a step or impulse input, and plots the response for each Z value on the same graph. The plots show the effect of increasing damping on the step and impulse responses of the second order system.

Uploaded by

marotty
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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