Mixing Problems (Tank Problems)
Problem
A 100-litre tank initially contains pure water. Brine at 5 g/L flows in at 2 L/min; the well-stirred mixture drains at 2 L/min. Find the salt amount S(t) at time t.
Explanation
Why mixing problems are the canonical applied first-order ODE
A tank of liquid with something dissolved in it — salt, pollutant, drug, dye — receives inflow of one concentration and loses outflow of current concentration. The "current concentration" part is what makes it a first-order linear ODE instead of plain algebra: the rate of change depends on how much is in the tank right now.
The template is
where is the amount of salt (grams), is the volume of liquid, is inflow concentration (g/L), and are flow rates (L/min).
When inflow and outflow rates are equal, stays constant and you get a clean first-order linear ODE in .
The given problem
- Tank holds L of pure water → g.
- Inflow: L/min of brine at g/L.
- Outflow: L/min of well-stirred mixture.
Because flows match, forever. Perfect.
Step-by-step
Step 1 — Set up the ODE.
Rate in: g/min.
Rate out: g/min.
Rearrange into standard first-order linear form (#174):
Step 2 — Solve via equilibrium + transient.
For with constants, the equilibrium is g.
General solution:
Step 3 — Interpret the two pieces.
- g is the equilibrium. At that level, in-rate exactly cancels out-rate. Reachable only asymptotically.
- Time constant minutes. After one , the gap to equilibrium has shrunk to . After min, the gap is under 1%.
Equilibrium concentration: — exactly the inflow concentration. Makes physical sense: given infinite time, the tank becomes indistinguishable from the inflow.
Verification
✓. . Plug in: . ✓
When inflow ≠ outflow — changing tank volume
If , the volume becomes and the ODE gets messier — still linear in , but with time-varying coefficient: Solve using the integrating factor .
Also, watch for the tank overflowing (filling case) or emptying (draining case); those impose natural stopping times.
Where mixing ODEs actually show up
- Pharmacokinetics: drug concentration in the bloodstream under continuous IV infusion + renal clearance.
- Pollution in lakes/rivers: pollutant mass in a well-mixed body of water with inflow and outflow streams.
- HVAC / indoor air: contaminant concentration with ventilation.
- Chemical reactors: CSTR (continuous stirred-tank reactor) — the bread and butter of chemical engineering.
Same ODE, different units. The story of "well-mixed" is everywhere in process engineering.
Common mistakes
- Wrong concentration in the out-rate. It's the current concentration , not the inflow concentration .
- Forgetting the initial condition. The ODE alone has infinitely many solutions; picks one.
- Units. If you mix L and gallons or minutes and hours, your time constant will be off. Pick one system.
- Assuming equal flow rates without checking. Keep the tracker alive until you know the tank stays filled.
Try it in the visualization
Animate the tank filling with coloured fluid proportional to . Slide to change the equilibrium concentration; slide the flow rate to see the time constant shrink or grow. Overlay the curve next to the tank so you can read off how close you are to equilibrium.
Interactive Visualization
Parameters
Got your own math or physics problem?
Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.