MatLab codes for the used by forensics to determine the exact time of death.
4 views (last 30 days)
Show older comments
Evalistus Simon
on 11 Oct 2022
Hello:
Please help me write MatLab codes for the solution of the model used by forensics to determine the exact time of death derived from Newton's law of cooling given that T(t)= 70+10e^kt and T(0)=80. I need it for my project and am not so familiar with MATLAB
Those are the only informations i was given
Here I was trying but i do not really have a clue on how to continue
clc; clear ; close all;
%T(t)=70+10e^kt T(0)=80
F = @(t,T(t)) 70+10*exp(k*t);
T_0 = 80;
plot(t,T_0)
Thank you for your help.
0 Comments
Accepted Answer
Davide Masiello
on 11 Oct 2022
Edited: Davide Masiello
on 13 Oct 2022
if you already have an expression for T, why would you solve the ODE?
anyways, the correct syntax is
clear,clc
k = 0.5
F = @(t,T) k*(70-T);
tspan = [0 5];
T0 = 80;
[t,T] = ode45(F,tspan,T0);
plot(t,T)
legend('k = 0.5')
You could even solve it analytically
syms t T(t) k
eqn = diff(T,t) == k*(70-T);
sol = dsolve(eqn,T(0)==80)
%Solution for several values of k
for n = 0.1:0.2:1
solk = subs(sol,k=n);
fplot(solk,[0 5]),hold on
end
legend([repmat('k = ',5,1),num2str((0.1:0.1:0.5)')],'Location','best')
4 Comments
More Answers (1)
Sam Chak
on 13 Oct 2022
The equation derived from Newton's Law of Cooling is given by
The ambient temperature is 70°F. Suppose that the coroner measured the body's temperature when they first arrive at the scene at 8:15 AM. Then, an hour later a second temperature is taken.
If the first temperature is 72.5°F, and the second temperature is 72.0°F, then the coroner can solve for the cooling rate k.
k = - log(2.5/2)
Substituting this value back to the equation when the 1st temperature is taken, and solve for
fun = @(t) 70 + 10*exp(-0.2231*t) - 72.5
tsol = fsolve(fun, 10)
The coroner can postulate that the person died about 6 hours 13 minutes before 8:15 AM, which would be around 2:00 AM.
t = 2:0.01:9;
T = 70 + 10*exp(-0.2231*(t - 2));
plot(t, T), grid on, xlabel('Time (Clock hour)'), ylabel('Body temperature')
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!