# exam3 - Doug Rivas ME 218 Exam 3 M5-7 PROBLEM 1 a. Ѳ 1...

This preview shows pages 1–5. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Doug Rivas ME 218 Exam 3 M5-7 PROBLEM 1 a. Ѳ 1 ’= v 1 Ѳ 2 ’= v 2 (-g(2m1+ m2)sin( Ѳ 1 )-m2gsin( Ѳ 1-2 Ѳ 2 )-2sin( Ѳ 1- Ѳ 2 )m2(v 2 2 a 2- v 1 2 a 1 cos( Ѳ 1- Ѳ 2 ) v 1 ’= a 1 (2m1+m2-m2cos(2( Ѳ 1- Ѳ 2 ))) (2sin( Ѳ 1- Ѳ 2 )( v 1 2 a 1 (m1+m2)+g(m1+m2)cos( Ѳ 1 )+v 2 2 a 2 m2cos( Ѳ 1- Ѳ 2 ) v 2 ’= a 2 (2m1+m2-m2cos(2( Ѳ 1- Ѳ 2 ))) b. theta1.m: function dz= theta1(t,z) a1 = 0.25; m1 = 4.0; a2 = 0.5; m2 = 7.0; g = 9.81; v1 = z(1); v2 = z(2); theta1 = z(3)*pi/180; theta2 = z(4)*pi/180; theta1prime = v1; theta2prime = v2; v1prime = (-g*(2*m1 + m2)*sin(theta1) - m2*g*sin(theta1 - 2*theta2) - 2*sin(theta1 - theta2)*m2*(v2^2*a2 - v1^2*a1*cos(theta1 - theta2)))/ (a1*(2*m1+m2-m2*cos(2*(theta1-theta2)))); v2prime = (2*sin(theta1 - theta2)*(v1^2*a1*(m1 + m2) + g*(m1 + m2)*cos(theta1) + v2^2*a2*m2*cos(theta1 - theta2)))/(a2*(2*m1+m2- m2*cos(2*(theta1-theta2)))); dz= [v1prime; v2prime; theta1prime; theta2prime]; prob1.m clear all ; clf tspan = [0 2]; %INITIAL CONDITIONS v10 = 0; v20 = 0; theta10 = 5; theta20 = 0; [t, z] = ode45( 'theta1' , tspan, [v10, v20, theta10, theta20]); theta1 = z(:,3); theta2 = z(:,4); subplot(2,1,1), plot(t, theta1, t, theta2); xlabel( 'Time (seconds)' ); ylabel( 'Theta (degrees)' ); title( 'Doug Rivas- Prob 2- Angles v. Time' ); legend( 'Theta 1' , 'Theta 2' ); tspan2 = [0 10]; [t, z] = ode45( 'theta1' , tspan2, [v10, v20, theta10, theta20]); theta1 = z(:,3); theta2 = z(:,4); subplot(2,1,2), plot(t, theta1, t, theta2); xlabel( 'Time (s)' ); ylabel( 'Angle (degrees)' ); legend( 'Theta 1' , 'Theta 2' ); c. prob1.m clear all ; clf tspan = [0 2]; %INITIAL CONDITIONS v10 = 0; v20 = 0; theta10 = 45; theta20 = 45; [t, z] = ode45( 'theta1' , tspan, [v10, v20, theta10, theta20]); theta1 = z(:,3); theta2 = z(:,4); subplot(2,1,1), plot(t, theta1, 'b.' , t, theta2, 'r.' ); xlabel( 'Time (seconds)' ); ylabel( 'Theta (degrees)' ); title( 'Doug Rivas- Prob 2- Angles v. Time' ); legend( 'Theta 1' , 'Theta 2' ); tspan2 = [0 10]; [t, z] = ode45( 'theta1' , tspan2, [v10, v20, theta10, theta20]); theta1 = z(:,3); theta2 = z(:,4); subplot(2,1,2), plot(t, theta1, 'b.' , t, theta2, 'r.' ); xlabel( 'Time (s)' ); ylabel( 'Angle (degrees)' ); legend( 'Theta 1' , 'Theta 2' ); The chart does indeed show adaptive step sizing when using the zoom in tool. The time between the next successive point varies across the two plots. Below is a zoomed-in version of the two plots above at places where Matlab’s use of adaptive step size is fairly clear. d. prob1.m clear all ; clf tspan = [0 10]; %INITIAL CONDITIONS v10 = 0; v20 = 0; theta10 = 180; theta20 = 0; [t, z] = ode45( 'theta1' , tspan, [v10, v20, theta10, theta20]); theta1 = z(:,3); theta2 = z(:,4); plot(t, theta1, 'b.' , t, theta2, 'r.' ); xlabel( 'Time (seconds)' ); ylabel( 'Theta (degrees)' ); title( 'Doug Rivas- Prob 2- Angles v. Time' ); legend( 'Theta 1' , 'Theta 2' ); There are a few reasons that this problem behaves in this matter considering the initial condition of Ѳ 1 =180 degrees. As the plot illustrates, the pendulum remains motionless. =180 degrees....
View Full Document

## This note was uploaded on 06/23/2011 for the course ME 218 taught by Professor Unknown during the Fall '08 term at University of Texas.

### Page1 / 21

exam3 - Doug Rivas ME 218 Exam 3 M5-7 PROBLEM 1 a. Ѳ 1...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online