Differential EquationsModeling with First-Order Equations3 of 6
Modeling with First-Order Equations · 3
Mixing and Compartment Problems
When salt water flows into a tank and mixes with the water already inside, the concentration leaving through the drain changes every instant, so we need a differential equation to track how much salt is in the tank at any time t.
1
Setting Up a Mixing Problem
Suppose a tank initially holds 100 L of pure water. A pipe at the top pumps in salt water at a concentration of 2 g/L and a flow rate of 5 L/min, while a drain at the bottom lets the well-mixed water out at 5 L/min. We want to set up a differential equation for the amount of salt S(t) in grams inside the tank at time t.
Setting Up a Mixing Problem
Text solution
Find Rate In from the incoming pipeMultiply the incoming flow rate by the incoming concentration so the liters cancel and leave grams per minute.
Rate In=5 L/min×2 g/L=10 g/min
Find Rate Out from the current tank concentrationBecause 5 L/min enters and 5 L/min leaves, the volume stays at 100 L, and the drain carries out water at the tank's current concentration of 100S g/L.
Subtract Rate Out from Rate InCombine the two pipe rates with the pure-water starting condition to get the differential equation for S(t).
dtdSS(0)=Rate In10−Rate Out20S,=0
So the salt in the tank builds up at 10 g/min minus one-twentieth of the salt currently in the tank.
2
Equilibrium and Solving the Constant-Volume Tank
Now we want to find the equilibrium amount of salt where the amount in the tank stops changing, solve dtdS=10−20S for S(t), and find how much salt is in the tank at t=12 minutes.
Equilibrium and Solving the Constant-Volume Tank
Text solution
Set the rate of change to zero to find equilibriumThe salt level stops changing at the amount where Rate Out equals Rate In.
10−20S=0⟹20S=10⟹equilibriumS=200 g
Factor out the coefficient of S to see the gap to equilibriumRewriting the right side shows that the distance between S and 200 g shrinks at a rate proportional to that gap.
dtdS=−201gap toequilibrium(S−200)
Write the exponential decay of the gapBecause dtdS=−201(S−200) has the same separable form as Newton's Law of Cooling, the gap S−200 decays exponentially.
S−200⟹S(t)=Ae−t/20=200+Ae−t/20
Use S(0)=0 to find A and evaluate at t=12Plugging in t=0 gives the starting gap of −200 g, which we then use to find the amount of salt at 12 minutes.
So after 12 minutes, the tank contains about 90 g of salt on its way toward the 200 g equilibrium. (You can go straight from dtdS=−201(S−200) to S(t)=200+Ae−t/20, or separate variables and write ∫S−2001dS=∫−201dt first if you want to show every integration step.)
Because Rate Out is 20S while Rate In stays fixed at 10 g/min, any starting amount below 200 g makes Rate Out smaller than Rate In so S(t) rises, any starting amount above 200 g makes Rate Out larger than Rate In so S(t) drops toward 200 g, and starting right at 200 g balances the two pipes so S(t) stays constant.
Because the drain carries out whatever salt mix is currently in the tank, every starting amount settles toward 200 g, where Rate Out matches Rate In.
3
Mixing When Volume Changes
When the incoming and outgoing flow rates do not match, the volume of water in the tank changes with time, which puts t into the denominator of Rate Out, and with salt still flowing in, that makes the differential equation non-separable. Suppose our 100 L tank still starts with pure water (S(0)=0), but the top pipe now pumps in 2 g/L salt water at 6 L/min while the bottom drain lets water out at 4 L/min. We want to find the formula for S(t) at any time t before the tank overflows.
Mixing When Volume Changes
Moving the S term to the left side puts the equation into the first-order linear form dtdS+P(t)S=Q(t), which we can solve using an integrating factor.
Text solution
Write the volume V(t) at time tWith 6 L/min entering and 4 L/min leaving, the tank gains 2 L/min on top of its starting 100 L.
V(t)=100+(6−4)t=100+2t
Set up Rate In and Rate Out using V(t) in the denominatorDividing the current salt S by the changing volume 100+2t gives the concentration leaving the drain at time t.
Multiply by (50+t)2 and integrate both sidesThe integrating factor turns the left side into the derivative of (50+t)2S, which we integrate and divide by (50+t)2.
If the tank has a maximum capacity of 200 L, this formula gives the grams of salt in the tank for 0≤t≤50 minutes, right up to the moment V(50)=100+2(50)=200 L when the tank begins to overflow.
Whether the tank is filling, holding steady, or draining, the concentration V(t)S(t) approaches the incoming pipe's 2 g/L. The total salt S(t), however, only levels off when the flow rates match: it keeps climbing toward a slanted line as a filling tank rises toward overflow, and it rises and then drops back to zero as a draining tank runs dry.
No matter how fast the tank drains, the water inside still approaches the incoming pipe’s 2 g/L, while the total amount of salt only levels off when the two pipes match.
4
Chaining Compartments Together
When one tank or organ drains directly into a second one, we want to track the amount in both compartments at the same time. For a 500 mg pill swallowed into the stomach, where x(t) is the medicine in the stomach and y(t) is the medicine in the bloodstream, we write a balance equation for each compartment.
Chaining Compartments Together
Text solution
Write the balance equation for the first compartment x(t)After the pill is swallowed, no new medicine enters the stomach, and medicine leaves into the blood at rate k1x.
Use the first compartment's Rate Out as the second compartment's Rate InEvery milligram leaving the stomach enters the bloodstream at rate k1x, while the kidneys filter medicine out of the blood at rate k2y.
Because dtdx=−k1x depends only on x, we always solve the first compartment for x(t) first and plug that function into the second compartment's equation for dtdy.
The stomach amount x(t) decays exponentially at the exact same rate regardless of how fast the kidneys work, whereas the bloodstream amount y(t) rises whenever stomach inflow k1x is greater than kidney removal k2y, peaks at the moment those two rates match, and then drains back to zero.
Because medicine only flows one way from the stomach into the blood, changing how fast the kidneys clear the blood never changes what's in the stomach, while the amount in the blood rises as long as stomach inflow tops kidney outflow, peaks the moment the two rates match, and then drains to zero.
Key concepts
Every mixing or compartment problem starts from the same balance equation for the total amount S(t) inside the tank:
Always track the total grams S(t) rather than concentration. If a problem gives or asks for a concentration C, convert between them using S=C×V(t). When pure water flows into a tank, Cin=0, so Rate In is 0 (flushing a 400 L tank with pure water at 8 L/min gives dtdS=0−8(400S)=−50S).
How you solve the differential equation depends on whether the volume changes:
Constant volume (Flowin=Flowout), close the gap to equilibrium
You do not need an integrating factor when the two flow rates match and V(t)=V0 is constant. Set dtdS=0 to find the equilibrium Seq, and the gap decays exponentially: for dtdS=10−20S,Seq=200 and S(t)=200+Ae−t/20.
Write V(t)=V0+(Flowin−Flowout)t first, move the S term to the left side to get dtdS+P(t)S=Q(t), and multiply by M(t)=e∫P(t)dt. For dtdS+50+t2S=12, multiplying by M(t)=(50+t)2 turns the left side into dtd[(50+t)2S]=12(50+t)2. Keep in mind that the equation only holds until the tank overflows (V(t)=Vmax) or runs dry (V(t)=0).
Chained compartments, solve the first compartment first
Set Rate In of the second compartment equal to Rate Out of the first. Solve the first compartment's equation for x(t) first, then substitute that formula for x(t) into the second compartment's equation dtdy+P(t)y=Q(t) and solve it as a first-order linear equation using an integrating factor.
5
Practice
1
A 200 L tank initially contains 500 g of salt dissolved in water. Salt water with a concentration of 1 g/L is pumped in at 4 L/min, and the well-mixed water drains out at 4 L/min. Write the differential equation for the amount of salt S(t) in grams, find the equilibrium amount of salt, and solve for S(t).
Compare the incoming and outgoing flow rates to see whether the 200 L volume changes, then express each pipe's rate in g/min.
Set up Rate In and Rate OutBecause 4 L/min enters and 4 L/min leaves, the volume stays constant at 200 L.
Find the equilibrium amountSet dtdS=0 to find where Rate Out matches Rate In.
4−50S=0⟹50S=4⟹S=200 g
Solve for S(t) using the initial condition S(0)=500Factoring out −501 gives dtdS=−501(S−200), so the gap to 200 g decays exponentially. (Be careful to solve 500=200+Ae0 for A=300; simply placing the initial 500 g in front of the exponential without subtracting the 200 g equilibrium gives the wrong answer 200+500e−t/50.)
A 400 L tank holds water with an initial pollutant concentration of 0.5 g/L. To flush the tank, pure water is pumped in at 8 L/min while the well-mixed water drains out at 8 L/min. How long does it take to reduce the pollutant concentration in the tank to 0.05 g/L?
Be sure to use ln(10)≈2.303 rather than base-10 log10(10)=1, which would give 50 minutes.
Convert the starting and target concentrations into total grams of pollutant in the 400 L tank, and notice how much pollutant enters through a pure-water pipe.
Convert concentrations into grams of pollutantMultiply each concentration by the constant 400 L volume to get the starting amount S(0) and target amount.
Set up and solve the differential equationPure water has concentration 0 g/L, so Rate In=8×0=0 g/min. (Watch out: using the water flow rate 8 L/min as Rate In gives dtdS=8−50S, which makes the pollutant climb toward 400 g instead of flushing out.)
dtdSS(t)=0−8×400S=−50S=200e−t/50
Solve for t when S(t)=20Set the pollutant equal to 20 g and take the natural logarithm. (Be sure to use ln(10)≈2.303 rather than base-10 log10(10)=1, which would give 50 minutes.)
A tank with a maximum capacity of 150 L initially holds 50 L of pure water. Salt water containing 3 g/L of salt flows in at 4 L/min, and the well-mixed solution drains out at 2 L/min. Find the formula for the amount of salt S(t) in the tank at time t, and find how much salt is in the tank at the exact moment it begins to overflow.
Write the changing volume V(t) first to set up the linear differential equation, and find the time t when V(t) reaches the 150 L capacity.
Write the volume V(t) and set up the linear differential equationThe tank starts at 50 L and gains 4−2=2 L/min, so V(t)=50+2t.
dtdSdtdS+25+t1S=4×3−2×50+2tS=12−25+t1S=12
Find the integrating factor and integrateWith P(t)=25+t1, the integrating factor is M(t)=e∫25+t1dt=25+t.
Use S(0)=0 to find CPlugging in t=0 and S=0 gives C. (With the antiderivative 6(25+t)2,S(0)=0 does not make C=0; dropping the C term leaves S(t)=6(25+t) and gives the wrong overflow amount of 450 g. If you multiply out 12(25+t)=300+12t before integrating, as the solution film does, the antiderivative is 300t+6t2+C instead, and then C=0 is right.)
Find the overflow time and evaluate S(t)The tank reaches 150 L when V(t)=50+2t=150, which is at t=50 minutes (dividing the full 150 L capacity by 2 L/min without subtracting the initial 50 L gives t=75 minutes and 562.5 g).
S(50)=6(25+50)−25+503750=450−50=400 g
4
Tank A and Tank B each hold 100 L of water. Tank A starts with 50 g of dissolved salt, and Tank B starts with pure water. Pure water is pumped into Tank A at 5 L/min; well-mixed water flows from Tank A into Tank B at 5 L/min, and well-mixed water drains from Tank B at 5 L/min. Let x(t) and y(t) be the grams of salt in Tank A and Tank B at time t. Write the system of differential equations for dtdx and dtdy, and solve for both x(t) and y(t).
Set up each tank with Rate In−Rate Out, solve Tank A's equation for x(t) first, and substitute that function into Tank B's equation to get a first-order linear differential equation for y(t).
Write the differential equations for Tank A and Tank BBoth tanks stay at a constant 100 L, and Tank A's Rate Out (5×100x=20x) becomes Tank B's Rate In.
Solve Tank B's linear equation with the integrating factor M(t)=et/20Multiply every term by et/20. (Notice that on the right side, et/20⋅e−t/20=e0=1; adding the exponents with the wrong sign to get e−t/10 leads to the wrong answer 25e−t/20−25e−3t/20.)