ME 218 Exam 3

# ME 218 Exam 3 - Greg Gangluff ME 218 T1-3 Exam 3 Problem 1...

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

Greg Gangluff ME 218 T1-3 Exam 3 Problem 1 A) 6gpm-8gpm+α = 0 => α = 2gpm 7gpm- β = 0 => β = 7gpm B) There is no water input to the system because all the equations only contain terms for flushing out the contaminants. C) Graphs of Contaminants at various different time intervals: Time from 0 -30 minutes Time from 0 -240 minutes

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

View Full Document
Time from 0 – 1440 minutes m.file test 1.m: function dz=test1(t,z) x=z(1); y=z(2); c=z(3); xprime=[-6*(x/800)+(y/400)+2*(c/600)]; yprime=[6*(x/800)-8*(y/400)+2*(c/600)];
zprime=[7*(y/400)-7*(c/600)]; dz=[xprime;yprime;zprime]; mfile 2: test1b.m tspan = [0 30]; x0=1600; y0=500; z0=250; options=odeset( 'test1' [t,z]=ode45( 'test1' , tspan, [x0,y0,z0]); z y=z(:,1); plot(t,z); xlabel( 'time(minutes)' ); ylabel( 'Contaminants(ounces)' ); D) Doubling the Step using odeset: tspan = [0 1440]; x0=1600; y0=500; z0=250; a=odeset( 'maxstep' ,288); [t,z]=ode45( 'test1' , tspan, [x0,y0,z0],a); z y=z(:,1); plot(t,z); xlabel( 'time(minutes)' ); ylabel( 'Contaminants(ounces)' ); Time from 0 - 30 minutes at double the step size Time from 0 – 240 minutes at double the step size

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

View Full Document
Time from 0 – 1440 minutes at double step size
E) a. How much time elapses before all contaminants below 75 ounces: CODE: clear all tspan = [0 1440]; x0=1600; y0=500; z0=250; a=odeset( 'maxstep' ,288); [t,z]=ode45( 'test1' , tspan, [x0,y0,z0],a); plot(t,z); xlabel( 'time(minutes)' ); ylabel( 'Contaminants(ounces)' ); i=1; while (z(i,1)>75) i=i+1; end u=t(i-1,1); u i=1; while (z(i,2)>75) i=i+1; end

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

View Full Document
p=t(i-1,1); p i=1; while (z(i,3)>75) i=i+1; end r=t(i-1,1); r time=u; if (u<p) time=p; else if (p<r) time=r; end end time Outputs : u = 1.2197e+003 minutes p = 999.5757 minutes r = 1.2965e+003 minutes time = 1.2965e+003 minutes b) Maximum values of contaminants in ounces: clear all tspan = [0 1440]; x0=1600; y0=500; z0=250; a=odeset( 'maxstep' ,288); [t,z]=ode45( 'test1' , tspan, [x0,y0,z0],a); plot(t,z); xlabel( 'time(minutes)' ); ylabel( 'Contaminants(ounces)' ); i=1; while (z(i,1)>75) i=i+1;
end u=t(i-1,1); u i=1; while (z(i,2)>75) i=i+1; end p=t(i-1,1); p i=1; while (z(i,3)>75) i=i+1;

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.

## 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 / 18

ME 218 Exam 3 - Greg Gangluff ME 218 T1-3 Exam 3 Problem 1...

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

View Full Document
Ask a homework question - tutors are online