0% found this document useful (0 votes)
40 views6 pages

System Response Graphs

The document contains printouts for Lab 3 which includes: 1) Figures showing step responses as damping varies and step responses with different initial conditions. 2) M-files for running simulations with different damping coefficients and initial conditions and plotting the results. The M-files simulate and plot step responses of an ODE model for a spring-mass-damper system as the damping coefficient and initial conditions are varied.

Uploaded by

Tim McGreal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views6 pages

System Response Graphs

The document contains printouts for Lab 3 which includes: 1) Figures showing step responses as damping varies and step responses with different initial conditions. 2) M-files for running simulations with different damping coefficients and initial conditions and plotting the results. The M-files simulate and plot step responses of an ODE model for a spring-mass-damper system as the damping coefficient and initial conditions are varied.

Uploaded by

Tim McGreal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Printouts for Lab 3:

ODE Analysis
Figure 1:

Fig 1: Step Responses as Damping Varies

Figure 2:

Fig 2: Step Responses With Different ICs

M Files:
Part 2.1:
% Lab 3 M-File
xzero = 0; xprimezero = 0;
m = 1; k = 1; c = 0.3;
sim('Lab3Part2');
y1 = simout;
t = time;
c = 0.5;
sim('Lab3Part2');
y2 = simout;
c = 0.7;
sim('Lab3Part2');
y3 = simout;
c = 1;
sim('Lab3Part2');
y4 = simout;
%subtitle('Fig 1: Step Responses As Damping Varies');
subplot(3.4, 2, 3);
plot(t, y1, 'r');
title('c = 0.3');
xlabel('Time (s)');
ylabel('Output Variable x(t) (no units)');
legend('Damping c = 0.3');
grid;
subplot(3.4, 2, 4);
plot(t, y2, 'k');
title('c = 0.5');
xlabel('Time (s)');
ylabel('Output Variable x(t) (no units)');
legend('Damping c = 0.5');
grid;
subplot(3,2,5);
plot(t, y3, 'g');
title('c = 0.7');
xlabel('Time (s)');
ylabel('Output Variable x(t) (no units)');
legend('Damping c = 0.7');
grid;
subplot(3,2,6);
plot(t, y4, 'b');
title('c = 1.0');
xlabel('Time (s)');

ylabel('Output Variable x(t) (no units)');


legend('Damping c = 1.0');
grid;
Part 2.2:
m = 1; k = 1; c = 0.5; xprimezero = -2; xzero = 0;
sim('Lab3Part2');
y1 = simout;
t = time;
c = 0.5; xprimezero = 0; xzero = -3;
sim('Lab3Part2');
y2 = simout;
c = 0.5; xprimezero = 2; xzero = 3;
sim('Lab3Part2');
t1 = time
y3 = simout;
% c = 1; xprimezero = -2; xzero = 0;
% sim('Lab3Part2');
% y4 = simout;
subplot(2.15, 2, 1);
plot(t, y1, 'b');
title('x(0) = 0, xprime(0) = -2');
xlabel('Time (s)');
ylabel('Output Variable x(t) (no units)');
legend('x(0) = 0, xprime(0) = -2');
grid;
subplot(2.15, 2, 2);
plot(t, y2, 'k');
title('x(0) = -3, xprime(0) = 0');
xlabel('Time (s)');
ylabel('Output Variable x(t) (no units)');
legend('x(0) = -3, xprime(0) = 0');
grid;
subplot(223);
plot(t1, y3, 'r');
title('x(0) = 3, xprime(0) = 2');
xlabel('Time (s)');
ylabel('Output Variable x(t) (no units)');
grid;
legend('x(0) = 3, xprime(0) = 2');
% subplot(224);

% plot(t, y4, 'b');


% title('c = 1.0');
% xlabel('Time (s)');
% ylabel('Output Variable x(t) (no units)');

You might also like