MATLAB QUESTION (need code to solve) Newton\'s Law of Cooling, which said that i
ID: 3572142 • Letter: M
Question
MATLAB QUESTION (need code to solve)
Newton's Law of Cooling, which said that if you have a body with a variable temperature T(t) in an environment with a constant ambient temperature Ta, then the rate of change in the temperature of the body will be proportional to the difference between the T(t) and Ta.
Assume units here are minutes and °C. T '(t) = k (Ta – T(t))
(a) Explain why k must be positive.
(b) find the solution to this equation when T(0) = 96, and Ta = 0 . Plot the time it takes for T to reach 10 as a function of k.
(c) Now assume you don’t know Ta, but you know that k = 0.05, T(0) = 96 and T(10) = 42. Determine Ta.
Explanation / Answer
a) k should be positive because the change in temp should be negative in cooling and Ta-T(t) is negative.
b)
%dt = (@T) k*(Ta-T);
%Hence, T(t) = A + (T0 - A)*exp(k*t);
T0 = 96;
Ta = 0;
t = 0;
%T = @(k) Ta + (T0 - Ta)*exp(-k*t);
k = 1;
%10 = 0 + 96*exp(k*t); ===== log(10/96) = -k*t ===== t = 1/k*log(96/10) ====== t = 0.982271233/k
for i=1:1:100
k = i;
ks(end+1) = k;
t = 0.982271233/k;
ts(end+1) = t;
end;
plot(ks, ts);
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.