[Math] newtons law of cooling with decreasing ambient temperature

ordinary differential equations

A cup of hot coffee initially at $90$ C cools to $80$ C in five minutes while sitting in a room of temperature $20$ C. Determine when the temperature of the coffee is $50$ C given that the room temperature is decreasing at the rate of $1$ C.

How do you alter $T = (T_o-M) e^{(-kt)}$ + M to accomodate the decreasing room temperature??? I was given the hint $\frac{dT}{dt} = K[20 – t -T]$. Why $\frac{dT}{dt}$? I figured you would need to find dM/dt since its the rate of the ambient temperature M that is decreasing

Best Answer

Assuming Newton's law of cooling as $$ \dot{T} = K (T_R - T) = K \left(20- t - T\right) $$ where $T_R$ is the room temperature and $T$ the coffee temperature. This gives \begin{align} \dot{T} + K T &= K \left( 20 - t \right) \iff \\ e^{Kt}\left[\dot{T} + K T\right] &= e^{Kt} K \left( 20 - t \right) \iff \\ \frac{d}{dt} \left( e^{Kt}T \right) &= K e^{Kt} \left( 20 - t \right) \iff \\ T &= T_0 e^{-Kt} + K e^{-Kt} \int\limits_0^t e^{K\tau} \left( 20 - \tau \right) d\tau \\ &= T_0 e^{-Kt} + K e^{-Kt}\left[20 \,e^{K\tau} +e^{K\tau}\frac{1-K\tau}{K^2} \right]_0^t \\ &= T_0 e^{-Kt} + 20\left(1 - \,e^{-Kt}\right) + \frac{1}{K}\left(1-Kt- e^{-Kt}\right) \\ &= (20 - t) + \frac{1}{K} + \left(T_0 - 20 -\frac{1}{K}\right) e^{-Kt} \end{align}

We know $T(0) = 90$ and $T(5) = 80$: $$ 80 = 15 + \frac{1}{K} + \left(70-\frac{1}{K}\right) e^{-5K} $$ I see only a numerical solution, which gives: $K = 0.0296568$ (via WA).

This could be used to solve $T(t) = 50$ for $t$. Again using some numerical method this gives $t = 22.3937$ minutes (via WA). Otherwise we could have read it from the cooling curve.

Trying to verify the solution

The cooling rate is: $$ \dot{T} = -\left( 1 + \left[ K(T_0 -20)-1 \right] e^{-Kt} \right) $$ Plotting a graph of $\dot{T}/K+T$ gave $20-t$.