Computational Mechanics Project #01 - Heat Transfer in Forensic Science

import numpy as np
import matplotlib.pyplot as plt
plt.style.use('fivethirtyeight')

Computational Mechanics Project #01 - Heat Transfer in Forensic Science#

We can use our current skillset for a macabre application. We can predict the time of death based upon the current temperature and change in temperature of a corpse.

Forensic scientists use Newton’s law of cooling to determine the time elapsed since the loss of life,

\(\frac{dT}{dt} = -K(T-T_a)\),

where \(T\) is the current temperature, \(T_a\) is the ambient temperature, \(t\) is the elapsed time in hours, and \(K\) is an empirical constant.

Suppose the temperature of the corpse is 85\(^o\)F at 11:00 am. Then, 45 min later the temperature is 80\(^{o}\)F.

Assume ambient temperature is a constant 65\(^{o}\)F.

1. Use Python to calculate \(K\) using a finite difference approximation, \(\frac{dT}{dt} \approx \frac{T(t+\Delta t)-T(t)}{\Delta t}\).

2. Change your work from problem 1 to create a function that accepts the temperature at two times, ambient temperature, and the time elapsed to return \(K\).

3. A first-order thermal system has the following analytical solution,

\(T(t) =T_a+(T(0)-T_a)e^{-Kt}\)

where \(T(0)\) is the temperature of the corpse at t=0 hours i.e. at the time of discovery and \(T_a\) is a constant ambient temperature.

a. Show that an Euler integration converges to the analytical solution as the time step is decreased. Use the constant \(K\) derived above and the initial temperature, T(0) = 85\(^o\)F.

b. What is the final temperature as t\(\rightarrow\infty\)?

c. At what time was the corpse 98.6\(^{o}\)F? i.e. what was the time of death?