next up previous
Next: Higher order: Taylor's series Up: Euler's method Previous: Euler's method

Exercise 1.1: Newton's law of cooling

If the temperature difference between an object and its surroundings is small, the rate of change of the temperature of the object is proportional to the temperature difference:

\begin{displaymath}
\frac{dT}{dt}=-r(T-T_s),
\end{displaymath} (4)

where $T$ is the temperature of the body, $T_s$ is the temperature of the environment, and $r$ is a ``cooling constant'' that depends on the heat transfer mechanism, the contact area with the environment and the thermal properties of the body. The minus sign appears because if $T>T_s$, the temperature must decrease.

Write a program to calculate the temperature of a body at a time $t$, given the cooling constant $r$ and the temperature of the body at time $t=0$. Plot the results for $r=0.1\frac{1}{min}$; $T_0=83^{\circ} C$ using different intervals $\Delta t$ and compare with exact (analytical) results.



Adrian E. Feiguin 2004-06-01