The following experiment illustrates the flow of energy into and out of a system. We will develop a MATLAB model of this experiment and explore the strengths and limitations of the model.
This simple experiment illustrates several important points.
Our goal is to develop a Matlab model to describe the hot/cold can experiment. This type of a model is often called an energy balance model. In an energy balance model, there can be heat flowing into or out of the system by a variety of physical processes. In the Steady State (or Equilibrium) case, these heat flows into and out of the system are equal and the temperature of the system is constant. If the heat flows are not equal (as is the case when the can is heating up or cooling down), the system will be gaining or losing energy and this will result in a temperature change.
We need to define a few terms before we can proceed with developing a mathematical model:
The Power (P) is the amount of energy
flowing into/out of the system during some time period. We can
write this as a mathematical equation:
P = Q/ t |
(1) |
Q (units of Joules) is the amount of energy flow and
t is the time interval.
If the system absorbs a net amount of heat
Q
the temperature of the system will change by an amount
T
which is given by
T = Q/C |
(2) |
We will use the following algorithm to develop a computer simulation of a heat flow problem:
t is
(PGain-PLoss)*
t,
so the change in temperature is T =
(Pgain - Ploss) t / C |
(3) |
T.
For the can filled with hot water, it will lose
heat by Convection, Conduction and Radiation. For an object near
room temperature, we often group these together and approximate
these in an equation called Newton's Law of Cooling:
| PLoss = k (T - TS) | (4) |
Cooled Cans If you have performed the experiment yourself, use
an editor to make a file called, say, cans.dat which has
three columns separated by spaces: Time, Temperature of Silver Can
and Temperature of Black Can. If you do not have such a data set,
you can use the data set cooled_cans.dat for the
temperature vs. time for silver and black cans filled with water
which start from a temperature of about 45oC. The
situation for this data set is as follows:
t = 60 seconds for the data (but we can choose a larger or
smaller
t in our computer model
The MATLAB program
heatloss.m will calculate the model given by the
equations above. Put this M-file somplace in your MATLABPATH, or
modify that path to include location of M-file. Look at the
proram to see how it works. To use this program
you do the following:
help
heatloss. The header explains the inputs and the output
cooled_cans.dat and hot_cold_can.m someplace
from where you can access them with Matlab. Each
should have three columns of numbers separated by spaces, the
first being the time followed by the temperature of the silver
and black cans respectively.
load cooled_cans.dat;cooled_cans with 3 columns
containing the experimental data. Similarly for
heated_cans.dat. You may extract the data by collecting
the columns of each array into vectors, e.g. execute command
time_cool = cooled_cans(:,1);
temp_silver_cool = cooled_cans(:,2);
temp_black_cool = cooled_cans(:,3);
Make sure the times are in seconds.
figure
plot(time_cool,temp_silver_cool)
xlabel('Time (Seconds)');
ylabel('Temperature (Centigrade)');
title('Hot Can Cooling Down');
It should plot a
smooth curve going from the initial to final temperature (for my
data set this is 45oC to 21oC over a
period of about 36,000 seconds (10 hours)).
hold
plot(time_out,temp_th,'r--')
Run the program several times until you can find a value
for the heat-loss coefficient which fits the data for the silver can.
As you are working on the problem, some questions you can be asking yourself:
axis([0 3600 20 50]); will allow
you to display the first 3600 seconds of the data).
Heated Cans: When the cold can absorbs energy
from the light bulb, it will gain energy at a constant value. The
terms that would physically come into play would be
PGain = Pbulb * f(SolidAngle) *
(1-
)
where
is the fraction of the
light which is reflected from the surface without being
absorbed. This will depend on factors such as the "color" and
"roughness" of the surface. In the global climate model we
will study later, this factor is called the Albedo.
Make a new program heatgain.m (start by modifying
the old one) to allow you to put in a
constant value for PGain and try to use this to model
the temperature vs. time data for cold cans heating up (either use
your own data set, or you can use the file heated_cans.dat). You can
probably use the same heat-loss coefficient as you did from the
cooling can experiment.
This model is completely based on that described by Tom Huber.