Starting from:

$30

Computational Project 3


Computational Project 3

Be sure to comment your code thoroughly and only submit one m file named cp3_MEID (no
dash) to D2L. Also publish your code and turn in a hard copy.
Newton’s Law of Cooling
The file cooling.txt contains 4 temperature measurements (°C) for each of the 6796 times (s)
provided. These data describe the temperature of a glass of water as a function of time. You’ll
have to rearrange these data to make them useful. Try
T = [data(:,2); data(:,3); data(:,4); data(:,5)];
and something similar to create a single corresponding time vector of equal size. Plot temperature
vs. time to check if it looks reasonable. Be sure to plot data points (not a line). The size of the
data points can be reduced via
plot( t, T, '*', 'markersize', 1)
From our knowledge of heat transfer, we can expect the rate of heat loss (W) to be
q

= −hA T −T ( ∞ )
where h is the convective heat transfer coef. (W/ m2
K), A is the surface area, T = T(t) is the
temperature of the water, and T∞ = 26.5!
C is the temperature of the surroundings. The rate of
change of T with time is related to the rate of heat loss via the specific heat capacity (J/kgK) and
mass (kg) of water,
q

= mc
dT
dt
.
By integrating the above equations, you will be able to determine a model for T as a function of
time with fitting parameters T0 (initial temperature) and τ = hA
mc
(thermal time constant). In this
analysis, we will invoke lumped capacitance (our glass + water system has a homogenous T at
any given time) and neglect the heat capacity of the glass. We will also neglect latent effects at
the water’s surface, which will introduce discrepancies at early times.
1. From the model you obtain, predict T0 and h based on a regression of the data. Do
not use built-in functions. The cylindrical glass is 16 cm high and 7 cm wide.
2. Plot the model prediction out to 5 hours on top of the actual data and predict the
system temperature at 10,000s.
3. Now use a Lagrange interpolating polynomial based on the first 25 data points to
predict the system temperature at 1.5 seconds. Test that your prediction is
working by checking that it accurately predicts the provided T at 1 and 2 seconds
(since the polynomial is defined to pass through integer time values exactly).
Explain. Would using Newton’s polynomial improve the estimate? Spline
interpolation?

More products