Skip to content
Permalink
b8e0405614
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
365 lines (365 sloc) 57.6 KB
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Computational Mechanics Project #01 - Heat Transfer in Forensic Science\n",
"\n",
"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. \n",
"\n",
"Forensic scientists use Newton's law of cooling to determine the time elapsed since the loss of life, \n",
"\n",
"$\\frac{dT}{dt} = -K(T-T_a)$,\n",
"\n",
"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. \n",
"\n",
"Suppose the temperature of the corpse is 85$^o$F at 11:00 am. Then, 2 hours later the temperature is 74$^{o}$F. \n",
"\n",
"Assume ambient temperature is a constant 65$^{o}$F.\n",
"\n",
"1. Use Python to calculate $K$ using a finite difference approximation, $\\frac{dT}{dt} \\approx \\frac{T(t+\\Delta t)-T(t)}{\\Delta t}$. "
]
},
{
"cell_type": "code",
"execution_count": 186,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.6111111111111112\n"
]
}
],
"source": [
"T1 = 85 \n",
"T2 = 74\n",
"t = 2\n",
"Ta = 65\n",
"dTdt = (T2-T1)/t #differential of the temperature over time\n",
"K = dTdt/-(T2-Ta) #newton's law rearranged for K \n",
"print(K)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"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$. "
]
},
{
"cell_type": "code",
"execution_count": 187,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.6111111111111112"
]
},
"execution_count": 187,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def measure_K(Temp_t1,Temp_t2,Temp_ambient,delta_t):\n",
" ''' Determine the value of K based upon temperature of corpse \n",
" when discovered, Temp_t1\n",
" after time, delta_t, Temp_t2\n",
" with ambient temperature, Temp_ambient\n",
" Arguments\n",
" ---------\n",
" your inputs...\n",
" \n",
" Returns\n",
" -------\n",
" your outputs...\n",
" \n",
" '''\n",
" dTdt = (Temp_t2-Temp_t1)/delta_t #differential of the temperature over time\n",
" K = -dTdt/(Temp_t2-Temp_ambient) #newton's law rearranged for K \n",
" return K\n",
" \n",
"measure_K(85,74,65,2)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"3. A first-order thermal system has the following analytical solution, \n",
"\n",
" $T(t) =T_a+(T(0)-T_a)e^{-Kt}$\n",
"\n",
" 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. \n",
"\n",
" 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. \n",
"\n",
" b. What is the final temperature as t$\\rightarrow\\infty$?\n",
" \n",
" c. At what time was the corpse 98.6$^{o}$F? i.e. what was the time of death?"
]
},
{
"cell_type": "code",
"execution_count": 148,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nO3deXxU1fn48c+TmclKFghJSAJIWGQX0AgIFFGEsrj/0EJbRdFqW9Fq7bfV2tal1VqXWlvrVhesWlAUilVUXKtUtoDIjuyQhCWsARKyzfP7405ClgmZhIQJk+f9es1r5p57zp1nQnjm5txzzxFVxRhjTOgKC3YAxhhjmpYlemOMCXGW6I0xJsRZojfGmBBnid4YY0KcO9gB+NO2bVvt1KlTsMMwxpjTxtKlS/eqapK/fc0y0Xfq1ImsrK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U946qmnWLx4Mdu2beP666+v92fZt28fqampte7fvn07o0ePZuDAgTz33HOkpaURHh7O+PHjKz7HqRZ6iR44EteVjvu2s+fwMZJjI4MdjjEtXnlf/FVXXVVj35tvvlmlq+NENm7cyNdff83777/PmDFjKsoLCwvrbHvVVVdx2223MXPmTD777DMGDRpEr169AvwExyUmJp7wwuoHH3xAQUEBc+bMISYmBnAuCO/fv7/e79VYQq7rBkCSe9JVclidE5wLH8aY444cOcK7777LpEmT+Oyzz6o8/vznP7N7924+++yzgI5VntAjIiIqyrZt21brhdjKoqKimDRpEn//+9+ZNWtWjbP58i6lus66R44cyddff11lxFD1GMPCwqp0Cb355puUlpbWGWNTCclEn3BGX2KlkO1bgtMfZow5bs6cORQUFPCzn/2MESNGVHlMnTqVxMTEgMfU9+jRg/bt23PnnXfy3nvvMWPGDEaPHk16ut/Zz2u44YYbWLZsGarKxIkTq+zr0aMHAE8++SRLlixh/Xr/N15ee+219O3bl9GjR/Pss8/y2Wef8dJLL3HXXc4CehdeeCFlZWVcf/31fPLJJ/z1r3/lrrvuqtEldSqFZKKPTOsDwOHtK4MciTFm+vTpdOvWjUGDBtXY5/F4uPrqq5k1axZFRUV1HisiIoJZs2bhdruZMGECv/3tb7n77rs5//zzA4olMzOT9PR0rrzySuLj46vs+853vsP//d//8eSTTzJo0CBuvvlmv8eIjIzk008/5ZJLLuF3v/sdY8eO5ZFHHiEtLQ2Avn378vLLL7No0SIuvvhi/vWvfzFz5swa73cqSeVxpc1FZmamZmVlNfwABfvhkQye9lzHT+95svECMyYI1q5dS8+ePYMdRkhYs2YNvXv35uOPP2bkyJHBDqfeTvS7ICJLVTXT376QPKMnug0FnkSSCjeTf8zW2DSmpdu3bx9fffUVt956K3369Kkx7j3UhWaiB4ranEm3sOyg3VRijGk+/vOf/zBs2DB27txZMdVCSxKyiT4irRfdJIfVOQeDHYoxJsiuu+46vF4va9asOe0nKGuIkE300el9iJEicrfZyBtjTMsWUKIXkTtEZLWIrBKR6SISKSKPis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": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"import numpy as np\n",
"import math\n",
"import matplotlib.pyplot as plt\n",
"\n",
"\n",
"t=np.linspace(0,15,35)\n",
"T = 74\n",
"T_amb= 65 #initial values given in the problem\n",
"To = 85\n",
"\n",
"temp_analytical = T_amb + (To - T_amb)*np.exp(-K*t) #the equation for the temperature solved analytically \n",
"\n",
"temp_num= np.zeros(len(t))\n",
"temp_num[0] = To\n",
"for i in range(1, len(t)): #for loop on order to iterate through euler integration method\n",
" temp_num[i] = temp_num[i-1] + -K*(temp_num[i-1]-T_amb)*(t[i]-t[i-1])\n",
" \n",
"\n",
"plt.plot(t, temp_analytical, label='Analytical');\n",
"plt.plot(t,temp_num, label=('Numerical'));\n",
"plt.legend(loc='best',prop={'size': 15});\n"
]
},
{
"cell_type": "code",
"execution_count": 149,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Time: 0 hours 50 minutes 56 seconds\n",
"Time of death was: 10:09:04 am\n"
]
}
],
"source": [
"temp = 98.6\n",
"time = np.log((temp-T_amb)/(To-T_amb))/K*3600 #creating time values to be plugged in\n",
"hour = math.floor(time/3600)\n",
"minute = math.floor((time/3600-hour)*60) #converting the time stamps into hours minutes and seconds\n",
"second = int(round(((time/3600-hour)*60-minute)*60,0))\n",
"print('Time:',hour,'hours',minute,'minutes',second,'seconds')\n",
"print('Time of death was: 10:09:04 am')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"__Part B__\n",
"\n",
"The final temperature as t approaches infinity is the ambient temperature which was set to 65 degrees\n",
"\n",
"__Part C__\n",
"\n",
"The time that the corpse was at 98.6 degrees was 10:09:04 am"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"4. Now that we have a working numerical model, we can look at the results if the\n",
"ambient temperature is not constant i.e. T_a=f(t). We can use the weather to improve our estimate for time of death. Consider the following Temperature for the day in question. \n",
"\n",
" |time| Temp ($^o$F)|\n",
" |---|---|\n",
" |8am|55|\n",
" |9am|58|\n",
" |10am|60|\n",
" |11am|65|\n",
" |noon|66|\n",
" |1pm|67|\n",
"\n",
" a. Create a function that returns the current temperature based upon the time (0 hours=11am, 65$^{o}$F) \n",
" *Plot the function $T_a$ vs time. Does it look correct? Is there a better way to get $T_a(t)$?\n",
"\n",
" b. Modify the Euler approximation solution to account for changes in temperature at each hour. \n",
" Compare the new nonlinear Euler approximation to the linear analytical model. \n",
" At what time was the corpse 98.6$^{o}$F? i.e. what was the time of death? \n",
" \n",
" "
]
},
{
"cell_type": "code",
"execution_count": 185,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"65"
]
},
"execution_count": 185,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAD4CAYAAAD1jb0+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nO3deXhV9bn28e8DIYQEQoCESQgQCCAyhoBAg3OVqqfOQ1HLUY9oW6njcWj72reeetSqdaptpVqHqlREsadaEQ+2R5AKZZYhkDCHISQBQiBk3M/7R3Z9PQgSIDsre+f+XBdXsneys+8Fyc3Kb6/1LHN3REQk+rQIOoCIiBwfFbiISJRSgYuIRCkVuIhIlFKBi4hEqbjGfLLU1FTv3bt3Yz6liEjUW7x4cbG7px16f6MWeO/evVm0aFFjPqWISNQzs82Hu19LKCIiUUoFLiISpVTgIiJRSgUuIhKlVOAiIlFKBS4iEqVU4CIiUUoFLiISIZU1tczPL+bRWbkU7qto8K/fqCfyiIjEMndnbWEZ8/KK+SSvmIUbS6ioDhHXwsju1YEuyQkN+nwqcBGRE7BrXwXz8ouZl1fM3PxiisoqAchIS+LqUenk9EtlTN9OtG3d8HWrAhcROQYHq2pZsLGkrrDzillbWAZAh8RW5GSmMb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3sIzPLC7/tEGTGhnaEbb4i/G8dMrOYOrTuCNv7mJnlmtkKM5tpZjF1gdsjbPN/hLd3mZnNNrPuDfFcTb7Azewk4IdAtrsPBloCVwebKnLMbDBwEzAaGAZcaGaZwaaKmJeBCYfcdx8wx90zgTnh27HkZb66zSuBS4FPGj1N5L3MV7f3I2Cwuw8F1gH3N3aoCHuZr27zY+4+1N2HA+8BDzTEEzX5Ag+LA9qYWRyQCGwPOE8knQx85u7l7l4D/A9wScCZIsLdPwF2H3L3RcAr4fdfAS5u1FARdrhtdvc17r42oEgRdYTtnR3+3gb4DOjR6MEi6AjbvO9LN5OABjl6pMkXuLtvAx4HtgA7gFJ3nx1sqohaCZxmZp3MLBE4H+gZcKbG1MXddwCE33YOOI9E1g3AB0GHaAxm9pCZbQWuobnsgYfXQC8C+gDdgSQzuzbYVJHj7muAR6n7NXMWsByo+doHiUQhM/sxdd/brwedpTG4+4/dvSd123trQ3zNJl/gwDnARncvcvdq4B1gXMCZIsrdX3T3LHc/jbpfxfKCztSICs2sG0D47a6A80gEmNkk4ELgGm9+J6O8AVzWEF8oGgp8CzDGzBLNzICzgTUBZ4ooM+scfptO3Ytb04JN1Kj+C5gUfn8S8KcAs0gEmNkE4F7g2+5eHnSexnDIgQjfBqEewXYAAACxSURBVHIb5OtGw39+ZvYz4Crqft1aCvybu1cGmypyzGwu0AmoBu509zkBR4oIM5sGnEHdmM1C4KfAu8B0IJ26/7yvcPdDX+iMWkfY5t3As0AasBdY5u7nBZWxIR1he+8HWgMl4U/7zN1vCSRgBBxhm88HBgAh6kZq3xJ+fe/EnisaClxERL4qGpZQRETkMFTgIiJRSgUuIhKlVOAiIlFKBS4iEqVU4CIiUUoFLiISpf4ft6Ohj7HAk1wAAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"#PART A\n",
"def ambient_temp(hour):\n",
" ''' Determine the temperature based on the hour of the day\n",
" hour represents the hour of the day, with 11am being 0.\n",
" mening input of 0 will be 11am, input of 1 will be noon, \n",
" input of -1 will be 10am\n",
" the output is the temperature at the input index'''\n",
" \n",
" \n",
" options = [8,9,10,11,12,13]\n",
" time=hour+3 #in order to output the correct value in the array, we need to add 3 since 11am is mapped to 0\n",
" temp_a = [55,58,60,65,66,67]\n",
" temperature = temp_a[time]\n",
" \n",
" plt.plot(options,temp_a)\n",
" return temperature\n",
" \n",
"ambient_temp(0)\n"
]
},
{
"cell_type": "code",
"execution_count": 183,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Time: 0 hours 42 minutes 39 seconds\n",
"Time of death was: 10:17:21\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nO3deXxU5dn/8c81M9lDgJAFkiAECEF2JQKCCsgiuKDyYIU+KhWttj+p1scu+rQqtY+tlbq17rWKdQE3EFRUUHEXMCD7vpOEJWwJkJBtrt8fM8QAE7IQcpLJ9X695jVz1rkGku+c3Oc+9xFVxRhjTPByOV2AMcaYM8uC3hhjgpwFvTHGBDkLemOMCXIW9MYYE+Q8ThcQSFxcnLZv397pMowxptFYvHjxXlWND7SsQQZ9+/btyczMdLoMY4xpNERkW2XLrOnGGGOCnAW9McYEOQt6Y4wJchb0xhgT5CzojTEmyFUr6EXkThFZJSIrRWSaiISLyGQRyRaRpf7HpZVsO1JE1onIRhG5u27LN8YYU5Uqu1eKSDJwO9BVVQtF5E1gnH/xY6r691Ns6waeAoYDWcD3IjJbVVeffunGNB35+fns2bOHkpISp0sxDggJCSEhIYGYmJhabV/dfvQeIEJESoBIIAdoX43t+gIbVXUzgIhM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56233sLtdjNy5EhmzZrFP//5TzZs2EBqaioAy5Yt4+WXXy4P+ldffZWVK1eyatWq8iaYYcOGkZ6eziOPPMKUKVN+/JitW/PGG2+csoY//elPNG/enK+++oqIiAgAhg8fXr48Pj6eZ555pny6tLSU1NRULrjgArZv385ZZ51V689fE9XqdaOq96tqF1XtrqrXq2qRqnZS1bb+bpO9VfUX/nVz/CGPqm5W1V7+RzdVrffGOVfi2YRLCfuyrOeNMQ3Bddddx1lnnXXaJzUHDx6M2/3jPaE7depE+/bty0P+2Lzc3FyKi30XTX7yySf06dOH1NRUSktLy2/vN2jQIE68B8Zll11WZQ2fffYZ1157bXnIB/LKK69wzjnnEB0dTUhICBdccAEA69fXXyYF53j0Ffl73uietahqkxue1ASpWh5RNwQej4ff/e533H777UyePLnW+znx1nyhoaEB56kqxcXFhIaGsnfvXhYsWEBISMhJ++vYseNx04mJiVXWsG/fPtq0aVPp8pkzZ3LDDTfwy1/+kr/85S/Exsayc+dOrr766irvTVuXmkDQ+3reJJdsJSfvKMktKv/mNcbUj4kTJ/J///d//O1vfztufnh4ePnR9zEnnkw9HbGxsWRkZBzXnHJMxRuOA9U6KGzVqhU7d+6sdPlbb71Fv379ePrpp8vnffHFFzWouG4E71g3x4THUByVRGdXFmtybCgEYxqCsLAwfvOb3/Diiy8eF5QpKSkcOnSI7Ozs8nlz55542U7tDR06lI0bN3LWWWeRkZFx3ONYz5qa7u/NN9+s9Oi8sLDwpC+Q116rrCf6mRP8QY+vnb6zZLM8O8/pUowxfrfeeivNmjXj22+/LZ83cuRIIiIimDhxInPnzuW5557joYfqrpnqhhtuIDU1lcGDB/Piiy/y+eef88477/D73/+exx57rMb7u//++8nLy+Oiiy7ijTfe4JNPPmHKlCm8+OKLgO/E7JdffsmDDz7IJ598wv/8z//w6aef1tnnqa4mEfSexLPp5Mph6ba9TpdijPGLjIzkzjvvPG5eXFwc77zzDllZWVx11VW8+uqrvP7663X2nuHh4cyfP5/hw4dz//33M2LECO644w42bNhA3741v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JgBb7fMUcvkxeRacB3QLqIZInITcBDwHAR2YCvx8hDDbDGJ4FmwDz/78uzDbDGRsGGQDDGmCAXFEf0xhhjKmdBb4wxQc6C3hhjgpwFvTHGBDkLemOMCXIW9MYYE+Qs6I0xJsj9fzvJ65Yj1fn4AAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"#PART B\n",
"\n",
"import numpy as np\n",
"import math\n",
"import matplotlib.pyplot as plt\n",
"\n",
"\n",
"t=np.linspace(0,15,45)\n",
"T = 74\n",
"T_amb= [55,58,60,65,66,67]\n",
"To = 85\n",
"\n",
"T_a = np.zeros(len(T_amb))\n",
"temp_num= np.zeros(len(t))\n",
"temp_num[0] = To\n",
"temp_analytical = np.zeros(len(T_amb))\n",
"\n",
"for i in range(1,len(T_amb)): #analytical equation now including the change in temperature T_a\n",
" T_a = T_amb[i]\n",
" temp_analytical = T_a + (To - T_a)*np.exp(-K*t)\n",
"\n",
"for i in range(1, len(t)):\n",
" temp_num[i] = temp_num[i-1] + -K*(temp_num[i-1]-T_a)*(t[i]-t[i-1])\n",
"\n",
"plt.plot(t, temp_analytical, label='Analytical');\n",
"plt.plot(t,temp_num, label=('Numerical'));\n",
"plt.legend(loc='best',prop={'size': 15});\n",
"\n",
"\n",
"\n",
"temp = 98.6\n",
"time = np.log((temp-60)/(To-60))/K*3600\n",
"hour = math.floor(time/3600)\n",
"minute = math.floor((time/3600-hour)*60)\n",
"second = int(round(((time/3600-hour)*60-minute)*60,0))\n",
"print('Time:',hour,'hours',minute,'minutes',second,'seconds')\n",
"print('Time of death was: 10:17:21')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}