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
(Eqn 1) P = ΔQ / Δt
where ΔQ (units of Joules or Calories) is the amount of energy flow and Δt is the time interval.
If the system absorbs a net amount of heat
the temperature of the system will change by an amount
which is given by
(Eqn 2) ΔT = ΔQ / C
where C is called the heat capacity of the object. The heat capacity is the product of the m the mass of the object and c is its specific heat. For water, the specific heat is 1 cal/goC = 4186 J/kgoC
We will use the following algorithm to develop a computer simulation of a heat flow problem:
If you have performed the experiment yourself, use an editor to
make a file called
hotcans.out which has three columns separated
Time, Temperature of Silver Can and Temperature of Black Can.
If you do not have such a data set, you can
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:
ploss.m(which is listed below) will plot the data and calculate the model given by the equations above. To use this program you do the following
ploss.m. You may need to edit
hotcans.outto remove any header lines. It 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 hotcans.out;This will create a matrix
hotcanswith 3 columns containing the experimental data.
timeActual=hotcans(:,1);which will copy the first column of
hotcansto the variable
timeActual. Names in
Matlabare case-sensitive, so make sure that you type this in exactly. Also, make sure that you put the semicolon at the end of the line, or else it will print out the entire column of several hundred times!
timeActual=timeActual*60;to get them into seconds - it will be easier to use seconds since the units on some of the physical constants are in seconds.
TempActual=hotcans(:,2);to copy the data for the silver can (later, to use the data for the black can, enter
plot (timeActual,TempActual). 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)).
Open M-Fileoption to open the file
ploss.mand look it over to understand how it works.
run M-Filemenu option or by typing the file name
axis([0 3600 20 50]);will allow you to display the first 3600 seconds of the data) Why or why doesn't it fit? In particular, what is the fit like in the first 15-20 minutes (make plots). What about the last few hours? When is there the largest deviation between the model and the data?
% PLOSS.M Energy Balance Model for Hot/Cold Cans % This program models the rate at which a hot object loses heat. % Tom Huber 10-JUL-97 % % Before running this, copy the actual Temperature vs. Time into % timeActual and TempActual % Ts = 20.7; % Surrounding Temperature (in Centigrade) m = 0.1; % Mass of Water in can (in kg) c = 4186; % Specific Heat of Water (in J/(kg*DegreeC) ) C = m*c; % Heat Capacity (in J/DegreeC) dt = timeActual(2) - timeActual(1); % Use time step of actual data tMax = max(timeActual); % Use the last time t = 0:dt:tMax; % Make array of times Temp = 0*t; % Initialize Temperatures to 0 Temp(1) = TempActual(1); % Use the actual 1st temperature k = input ('Enter Heat Loss Coefficient '); for i=2:length(Temp) PLoss = k*(Temp(i-1) - Ts); % Calculate the Power Loss dTemp = -PLoss*dt/C; % Calculate the Temperature Change Temp(i) = Temp(i-1)+dTemp; % Store the new temperature end hold off plot(timeActual,TempActual,'b.') % Plot the actual temperature hold on % Allows graphs to be overlayed plot(t,Temp,'y-'); % Plot the calculated Temperature axis ([0 tMax min(TempActual)*.95 max(TempActual)*1.05]); xlabel('Time (Seconds)'); ylabel('Temperature (Centigrade)'); title('Hot Can Cooling Down');