[Math] Newton’s law of cooling problem Differential Equation

ordinary differential equations

Suppose that a building loses heat in accordance with Newton's law of cooling which states that the rate of change of temperature within the building is proportional to the difference between the inside temperature and the outside temperature. Assume the inside temperature $u$ is $70^{\circ} \text{F}$ when the heating system fails. After $2$ hours the building is $40^{\circ}\text{F}$. If the external temperature is $10^{\circ}\text{F}$, compute the interior temperature $u(t)$ as function of time after heating failure.

From what I know that the law is like this:
$$\frac{\Bbb dT}{T}-R=k \space \Bbb dt$$

Anti-differentiate both sides to get $\ln(T-R)=kt+c$
Then solve for T but I'm not sure how to do that.

Best Answer

I shall use $u$ for the temperature as indicated in the problem. Formulating the statement, we have $$\frac{{du}}{{dt}} = - h(u - {u_{{\rm{external}}}})$$ which could easily be solved (first order ODE) to yield $$u(t) = {u_{{\rm{external}}}} + A{e^{ - ht}}$$ where $A$ is a constant. To obtain this constant ($A$) and also the conduction constant ($h$), note that (we have chosen the unit of time to be hour) $${u_{{\rm{external}}}} = 10,u(0) = 70,u(2) = 40$$ so that $$\begin{array}{l}70 = 10 + A\\40 = 10 + A{e^{ - 2h}}\end{array}$$ which would yield $$A = 60,h = \frac{{\ln 2}}{2}$$ Summarizing, the answer could be stated as $$u(t) = 10 + 60{e^{ - \frac{{\ln 2}}{2}t}}$$ Below I have plotted the variation of the inside temperature with time from the moment of heating failure to 20 hours later enter image description here

Related Question