Newtons law of cooling
21 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Habiba
am 25 Dez. 2023
Kommentiert: Dyuman Joshi
am 27 Dez. 2023
At time t=0, T=100 which cools down to T=75 in 2 min,then further I need to find T at t=4,5,8.The issue is I am not given cooling constant K and it is not to be assumed 1/min Equation is dT/dt = k*(T-T_0) where T_0 is 30
1 Kommentar
Akzeptierte Antwort
Sulaymon Eshkabilov
am 25 Dez. 2023
Bearbeitet: Sulaymon Eshkabilov
am 27 Dez. 2023
Is this what you want to compute:
% Given intial data:
T0 = 30;
T_initial = 100;
T_target = 75;
time_step = 2;
% How to calculate the constant k:
syms k t
EQN = T_target==((T_initial - T0)) *exp(k*t)+T0;
k = solve(EQN, k)
t=2;
k=subs(k, t);
k=double(k)
% Diff EQN:
dT = @(T) k * (T - T0);
% Solve the Diff EQN @ t = 4, 5, 8:
t_vals = [4, 5, 8];
for i = 1:length(t_vals)
t = t_vals(i);
% Solution T at given time t:
[time, T] = ode45(@(t, T) dT(T), [0 t], T_initial);
fprintf('At t = %d minutes, T = %.2f\n', t, T(end));
end
If you want more detailed calcs with smaller steps
% Solve the Diff EQN @ t = 4, 5, 8:
t_vals = 2:.5:10;
for i = 1:length(t_vals)
t = t_vals(i);
% Solution T at given time t:
[time, T] = ode45(@(t, T) dT(T), [0 t], T_initial);
fprintf('At t = %d minutes, T = %.2f\n', t, T(end));
end
plot(time, T)
6 Kommentare
Weitere Antworten (1)
Sam Chak
am 25 Dez. 2023
Hi @Habiba
I understand that you are grappling with a certain problem. That's why you've outlined the challenge of not knowing the rate of heat loss, denoted as k. More importantly, you haven't explicitly requested us to solve the problem for you, and this is greatly appreciated. It suggests that you have a keen interest in acquiring knowledge and derive satisfaction from the process of learning how to solve problems.
People perceive and grasp mathematical concepts differently. A math teacher views the world of differential equations through a distinct lens, as they stand on the shoulders of Newton, while a student may be positioned at the feet of Newton.
For instance, if you possess the key to solving first-order linear ordinary differential equations, wherein the solution to
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1575992/image.png)
is expressed as (according to the Schaum's Outline of Mathematical Handbook of Formulas and Tables)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1575997/image.png)
then you can determine the value of k such that
.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1576002/image.png)
By now, you probably have noticed that at
,
. Since
and
are known, can you solve the algebraic equation and determine k?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1576007/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1576012/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1576017/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1576022/image.png)
2 Kommentare
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!