Cooling and mixing · Mathematics Class 11–12 | StemPy Lab
Course 13.3·Lesson 2 of 3
Cooling and mixing
Newton's law of cooling says that an object loses heat at a rate proportional to the gap between its temperature and the temperature of its surroundings: dtdT=−k(T−Ts)
Lesson 2 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
write and solve Newton's law of cooling, and find k from two readings;
set up a mixing problem for a tank of constant volume and for a tank whose volume changes;
find the steady state of a model and say what it means.
Newton's law of cooling
A cup of tea cools fast when it is very hot and slowly when it is nearly at room temperature. Newton's idea was that the rate of cooling is proportional to the gap between the temperature T of the object and the temperature Ts of its surroundings:
dtdT=−k(T−Ts),k>0.
The sign matters. If T>Ts the right side is negative and the object cools. If T<Ts the right side is positive and the object warms. In both cases T moves towards Ts.
To solve, let u=T−Ts. Since Ts is constant, dtdu=dtdT=−ku. This is the decay equation, so u=u0e−kt. Putting back T:
T=Ts+(T0−Ts)e−kt.
The gap shrinks by the same factor in equal times. The law is a good model when the temperature difference is small, or when air or water moves past the object. It is a poor model for a very hot object that also loses heat by radiation.
A graph of the temperature T in degrees Celsius against the time t in minutes, from 0 to 40 minutes. A red curve starts at 90 degrees and falls, quickly at first and then slowly, towards a grey dashed line at the room temperature of 22 degrees. A blue curve starts at 4 degrees and rises towards the same dashed line, also quickly at first and then slowly. Both curves have the same constant k of 0.08 per minute, and neither reaches 22 degrees.
Example 1. A cup of coffee at 85∘C stands in a room at 21∘C. The constant is k=0.05min−1. Find its temperature after 12 minutes.
T=21+(85−21)e−0.05×12=21+64e−0.6.
e−0.6=0.5488, so T=21+35.12=56.1∘C.
Example 2. The constant is not always given. A thermometer reads 95∘C at t=0 and 75∘C at t=5min in a room at 20∘C. When does it read 40∘C?
The gap falls from 75 to 55 in 5 minutes. So e−5k=7555 and k=51ln5575=0.0620min−1.
For 40∘C the gap is 20. Then e−kt=7520 and t=k1ln2075=21.3min.
Two readings are enough. The program below does the same work.
Mixing problems
A tank holds a well-stirred liquid. Brine with a known concentration flows in. The mixture flows out. We follow the amount Q of salt in the tank, in kilograms. The idea is a balance:
dtdQ=(salt in each minute)−(salt out each minute).
Salt in each minute is the inflow rate times the concentration of the brine that enters. Salt out each minute is the outflow rate times the concentration in the tank. The concentration in the tank is VQ, because the liquid is stirred. So
dtdQ=rincin−routVQ.
Constant volume. If the inflow and outflow rates are both r, the volume V does not change. The equation is dtdQ=rc−VrQ. With u=Q−cV this becomes dtdu=−Vru. So
Q=cV+(Q0−cV)e−rt/V.
The salt moves towards the steady statecV, the amount that makes the tank as salty as the brine. The ratio rV is the time scale: a bigger tank settles more slowly.
Two pictures side by side. On the left is a tank drawn as an open box. A green arrow brings in brine at 6 litres per minute with 0.5 kilograms of salt in each litre, and a red arrow takes out the well-mixed liquid at 4 litres per minute. The tank is labelled with V litres and Q kilograms of salt. On the right is a graph of the salt Q in kilograms against the time in minutes, from 0 to 120. The blue curve starts at 20 kilograms and rises steadily, bending slightly downwards, to about 204 kilograms at 120 minutes.
Example 3. A tank holds 400L of pure water. Brine of 0.25kg/L enters at 8L/min, and the mixture leaves at 8L/min. Find the salt after 30 minutes, and the time to reach 80kg.
Here cV=0.25×400=100kg and Vr=0.02min−1. So Q=100(1−e−0.02t)kg.
At t=30: Q=100(1−e−0.6)=45.12kg.
For 80kg: e−0.02t=0.2, so t=50ln5=80.5min.
When the volume changes
If the inflow is rin and the outflow is rout, the volume is V=V0+(rin−rout)t. The concentration VQ now has a changing denominator, and the equation is linear:
dtdQ+V0+(rin−rout)troutQ=rincin.
Multiply by an integrating factor (the method of the first-order course) and integrate. The tank in the program has V0=200L, 6L/min of 0.5kg/L brine entering, 4L/min leaving and 20kg of salt at the start. Its solution is
Q=100+t−(200+2t)23.2×106kg.
Check it. At t=0, Q=100−80=20kg, as required. Its derivative is 1+(200+2t)312.8×106. The right side of the equation is 3−200+2t4Q, which equals 3−2+(200+2t)312.8×106 after the substitution. The two sides agree.
The same equation in other places
A capacitor charged through a resistor follows dtdq=RE−q/C. A drug given at a steady rate I and removed at a rate proportional to the amount D in the body follows dtdD=I−kD. Both have the form dtdy=a−by, the same shape as cooling, and they settle to the steady state ba.
Practise with new numbers
Try it in Python
The program finds k from two readings of a cooling object, predicts other readings and finds the time to reach a target.
Now follow a tank step by step. The next program uses Euler's method for the tank with the changing volume and compares it with the exact formula.
Common mistakes
Using T instead of the gap. The rate is proportional to T−Ts, not to T.
Mixing up the sign of k. In dtdT=−k(T−Ts) the constant k is positive, and the minus sign makes the object move towards Ts.
Dividing by the wrong volume. The concentration in the tank is VQ. When the volume changes, V is a function of time.
Using the inflow concentration for the outflow. The liquid that leaves has the concentration of the tank, not of the brine that enters.
Mixing units. Keep litres with litres and minutes with minutes in k and in the rates.
. A mixing problem balances the salt, or any dissolved substance, flowing in against the salt flowing out. Both give a first-order equation whose solution settles to a steady state.
about 35 min2 simulations1 practice question2 Python programs5 questions to check yourself
This lesson is free to read. Enroll free to keep your place and take the tests.