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

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full DocumentRight Arrow Icon
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)];
Background image of page 2
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
Background image of page 3

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

View Full DocumentRight Arrow Icon
Time from 0 – 1440 minutes at double step size
Background image of page 4
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
Background image of page 5

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

View Full DocumentRight Arrow Icon
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;
Background image of page 6
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;
Background image of page 7

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

View Full DocumentRight Arrow Icon
Image of page 8
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 Right Arrow Icon
Ask a homework question - tutors are online