Question C.3.4: Consider again Example C.1.1.Water in a glass measuring cup ...
Consider again Example C.1.1.Water in a glass measuring cup was allowed to cool after being heated to 204°F. The ambient air temperature was 70°F. The measured water temperature at various times is given in the following table.
\begin{array}{l|llllll}\text{Time}( sec ) & 0 & 120 & 240 & 360 & 480 & 600 \\\hline \text{Temperature}\left({}^{\circ}F \right) & 204 & 191 & 178 & 169 & 160 & 153 \\\text{Time}( sec ) & 720 & 840 & 960 & 1080 & 1200 \\\hline \text{Temperature}\left({}^{\circ}F \right) & 147 & 141 & 137 & 132 & 127\end{array}
Obtain a functional description of the water temperature versus time.
Learn more on how do we answer questions.
From Example C.1.1,we learned that the relative temperature, ΔT = T−70 has the exponential form
\Delta T=b e^{m t} (1)
We can find values of m and b by using p = polyfit(x,log(y),1). The first element p_1 of the vector p will be m, and the second element p_2 will be ln b. We can find b from b = e^{p_2} . The following MATLAB program performs the calculations.
% Enter the data.
time = (0:120:1200);
temp = [204,191,178,169,160,153,147,141,137,132,127];
% Compute the relative temperature and its logarithm.
rel_temp = temp - 70;
log_rel_temp = log(rel_temp);
% Fit a first-degree polynomial.
p = polyfit(time,log_rel_temp,1);
% Compute m and b from the polynomial coefficients.
m = p(1),b = exp(p(2))
% Compute DT (delta T) from (1).
DT = b*exp(m*time);
% Compute J, S, and r squared.
J = sum((DT-rel_temp).ˆ2)
S = sum((rel_temp - mean(rel_temp)).ˆ2)
r2 = 1 - J/S
The results are m=-6.9710 \times 10^{-4}\,\,\text{and}\,\,b=1.2916 \times 10^2,and the corresponding function is
\Delta T=b e^{m t}\quad \text{or}\quad T=\Delta T+70=b e^{m t}+70
The quality-of-fit values are J = 47.4850, S = 6.2429×10³, and r² = 0.9924, which indicates a very good fit.