필터 지우기
필터 지우기

Newtons law of cooling

조회 수: 21 (최근 30일)
Habiba
Habiba 2023년 12월 25일
댓글: Dyuman Joshi 2023년 12월 27일
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
Torsten
Torsten 2023년 12월 25일
편집: Torsten 2023년 12월 25일
Hint:
You can compute k from the condition that it cools down from 100 to 75 in 2 min. This can be done either numerically or - since the general solution of this simple ODE is known - analytically.

댓글을 달려면 로그인하십시오.

채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 12월 25일
편집: Sulaymon Eshkabilov 2023년 12월 27일
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)
k = 
t=2;
k=subs(k, t);
k=double(k)
k = -0.2209
% 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
At t = 4 minutes, T = 58.93 At t = 5 minutes, T = 53.19 At t = 8 minutes, T = 41.96
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
At t = 2 minutes, T = 75.00 At t = 2.500000e+00 minutes, T = 70.29 At t = 3 minutes, T = 66.08 At t = 3.500000e+00 minutes, T = 62.31 At t = 4 minutes, T = 58.93 At t = 4.500000e+00 minutes, T = 55.90 At t = 5 minutes, T = 53.19 At t = 5.500000e+00 minutes, T = 50.77 At t = 6 minutes, T = 48.60 At t = 6.500000e+00 minutes, T = 46.65 At t = 7 minutes, T = 44.91 At t = 7.500000e+00 minutes, T = 43.35 At t = 8 minutes, T = 41.96 At t = 8.500000e+00 minutes, T = 40.70 At t = 9 minutes, T = 39.59 At t = 9.500000e+00 minutes, T = 38.58 At t = 10 minutes, T = 37.69
plot(time, T)
  댓글 수: 6
Habiba
Habiba 2023년 12월 27일
편집: Habiba 2023년 12월 27일
@dyuman Don't you have any other work except poking your nose into others matter. I have accepted the answer that helped me more and also voted to sam chak who had made an effort. I don't know that the code is giving wrong answer because I have made my own code not just copied it.
Dyuman Joshi
Dyuman Joshi 2023년 12월 27일
Lol.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Sam Chak
Sam Chak 2023년 12월 25일
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
is expressed as (according to the Schaum's Outline of Mathematical Handbook of Formulas and Tables)
,
then you can determine the value of k such that .
By now, you probably have noticed that at , . Since and are known, can you solve the algebraic equation and determine k?
  댓글 수: 2
Habiba
Habiba 2023년 12월 26일
Yes, Thankyou, now I get it.
Sam Chak
Sam Chak 2023년 12월 26일
@Habiba, good to hear that! If you find the proposed approach helpful, please consider clicking 'Accept' ✔ on the answer and voting 👍 for it. Thanks a bunch! By the way, you can also vote for other helpful answer as a token of appreciation.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by