# labr10 - seconds will yield a final of 13 calculated data...

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

Doug Rivas M5-7 ME 218- Lab 10 10.1 Falling.m: CLF; p= 1.4; g= 32; C= g/p; v= C*exp(-p*t)-g/p; plot(t,v); xlabel( 'Time (s)' ); ylabel( 'Velocity (m/s)' ); title( 'Doug Rivas' ); 10.2 Falling.m: clear all ; g = 32; % in feet per second rho = 1.0; % the drag coefficient from the problem above deltat = 0.5; % the time step v(1) = 0; % initial condition t(1) = 0; % initial time dvdt(1) = -rho*v(1) - g;

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

View Full Document
v(2) = v(1) + deltat * dvdt(1); t(2) = deltat; dvdt(2) = -rho*v(2)- g; v(3) = v(2) + deltat*dvdt(2); t(3) = 2*deltat; dvdt(3) = -rho*v(3)- g; v(4) = v(3) + deltat*dvdt(3); t(4) = 3*deltat; v MATLAB: >> falling v = 0 -16 -24 -28 10.3 I was a little confused because the rho value for the first two parts is different, and my figure has a different range from the lab example for the plotted points, so any difference is due to using different rho values as followed in the lab. 10.4 Using a step size of .25 seconds over the given time interval in problem 1 (3

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: seconds) will yield a final of 13 calculated data points. 10.5 Falling.m: CLF; p= 1.4; g= 32; C= g/p; va= C*exp(-p*ta)-g/p; g = 32; % in feet per second rho = 1.4; % the drag coefficient given in the first problem stoptime = 3.0; %the time elapsed given in the first problem deltat = 0.2; % the time step v(1) = 0; % initial condition t(1) = 0; % initial time t=[0:deltat:3]; for i=1:round(stoptime/deltat) dvdt(i)= -rho*v(i)-g; v(i+1)= v(i)+deltat*dvdt(i); end deltatw = 0.5; vw(1)=0; tw=[0:.5:3]; for i=1:round(stoptime/deltatw) dvdt(i)= -rho*vw(i)-g; vw(i+1)= vw(i)+deltatw*dvdt(i); end plot(ta,va); hold on ; scatter(t,v, 'r.' ); hold on ; scatter(tw,vw, 'b' ); xlabel( 'Time (s)' ); ylabel( 'Velocity (m/s)' ); title( 'Doug Rivas' ); This graph shows the actual solution with Euler’s method and a step size of .2 (red) and .5 (blue circles). 10.6...
View Full Document

## This note was uploaded on 04/07/2008 for the course ME 218 taught by Professor Unknown during the Spring '08 term at University of Texas.

### Page1 / 4

labr10 - seconds will yield a final of 13 calculated data...

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

View Full Document
Ask a homework question - tutors are online