Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

USE ODE45 APPLICATION TO SOLVE THE FOLLOWING (WITH MATLAB) At time t = 0 a tank

ID: 3142700 • Letter: U

Question

USE ODE45 APPLICATION TO SOLVE THE FOLLOWING (WITH MATLAB)

At time t = 0 a tank contains Q_0 lb of salt dissolved in 100 gallons of water. Assume that water containing 0.25 lb salt/gal is entering the tank at a rate of r gal/min and that the well-stirred mixture is draining from the tank at the same rate. We want to find the amount of salt Q(t) in the tank at any time. Clearly the tank will eventually (after a long time) approach a limiting value of salt, Q_L. We have a couple of specific questions we want answered: a. If r = 3 and Q_0 = 2Q_L, what is the time, tclose, after which the salt level is within 2% of Q_L? b. What flow rate is required if tclose is not to exceed 45 minutes? Remember dQ/dt = rate in - rate out. Obviously rate in = r/4, and because the tank is well mixed the concentration in the tank is Q(t)/100, so we can say the rate out = rQ(t)/100. We can create the DE: dQ/dt = r/4 - rQ/100 where Q(0) = Q_0. Clearly after a long time the limiting value is reached and dQ/dt = 0, so we can find the limiting value, Q_L.

Explanation / Answer

a)

dQ/dt = r/4 - rQ/100

at limiting value the first differentiation has to be 0 so

QL = 25

dQ/dt = r/4 - rQ/100

dQ / (25 - Q) = r/100 dt

Integrating both side

- ln (25 - Q) = r/100 t

ln [(Q - 25) / (Q - Qo)] = - r t /100

(Q - 25) / (Q - Qo) = e-0.01 r t

Q - 25  = Q e-0.01 r t - Qo e-0.01 r t

Q = 25 - Qo e-0.01 r t / ( 1+ e-0.01 r t )  

or

Q   = QL - Qo e-0.01 r t / ( 1+ e-0.01 r t )  

Q   = ( QL - 2QL e-0.01 r t ) / ( 1+ e-0.01 r t )  

1.02 QL = QL ( 1- 2 e-0.01 r t ) / ( 1+ e-0.01 r t ), 0.98 QL = QL ( 1- 2 e-0.01 r t ) / ( 1+ e-0.01 r t )

1.02 = (1 - 2a)/ (1+a) where a is e-0.01 r t , 0.98 = (1 - 2a)/ (1+a) where a is e-0.01 r t

1.02 + 1.02 a = 1 - 2a, 0.98 + 0.98 a = 1 - 2a

a =    -0.02/3.02, a = .02/ 2.98

e-0.01 r t can't be negative so e-0.01 r t = 1/ 149

t = 100 / r * ln (149)

t = 166.798 minutes

b)

t = 100 / r * ln (149)

r = 100 / t * ln (149)

r = 11.11988 gal/ minute