MatLab codes for the used by forensics to determine the exact time of death.
3 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Davide Masiello
2022 年 10 月 11 日
編集済み: Davide Masiello
2022 年 10 月 13 日
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 件のコメント
その他の回答 (1 件)
Sam Chak
2022 年 10 月 13 日
The equation derived from Newton's Law of Cooling is given by
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1155248/image.png)
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1155253/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1155258/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1155263/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1155268/image.png)
k = - log(2.5/2)
Substituting this value back to the equation when the 1st temperature is taken, and solve for ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1155273/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1155273/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1155278/image.png)
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 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!