Hot-Cold Cans



Overview

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.

Energy-Balance Model

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)

where 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)

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 4186 J/kgoC

We will use the following algorithm to develop a computer simulation of a heat flow problem:

  1. Set initial conditions (such as temperature) and parameters (mass, specific heat) for the system
  2. Request user input for unknown parameters (such as the heat-loss coefficient)
  3. Set the temperature to its first value
  4. Use the current temperature to calculate the power gained (PGain) and lost (PLoss) by system
  5. The net heat flow during a time interval t is (PGain-PLoss)*t, so the change in temperature is

    T = (Pgain - Ploss)t / C (3)

  6. The new temperature is the old temperature plus T.
  7. The new temperature can be stored in an array, printed or put onto a graph of temperature vs. time.
  8. If the experiment is not over (not at the last time interval), continue from step 4 above using the new temperature to calculate the power, etc.
  9. If the experiment is over (at the last time interval), make plots of temperature vs. time and see how well they represent the data. If they do not, run the program again using a different estimate for the parameters in step 2.

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)

where T is the temperature of the system, TS is the temperature of the surroundings, and k is the heat-loss coefficient. In other words, the larger the difference between the temperature of the object and its surroundings, the faster heat is lost from the object. The heat-loss coefficient, k, can sometimes be estimated from physical equations, but it is often found empirically by doing a measurement. This is what we are going to do.

Exercises

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:

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:

  1. Start Matlab. If the M-file is in your path, you should see the header to the file when you type help heatloss. The header explains the inputs and the output
  2. Save the files 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.
  3. Type
    load cooled_cans.dat;
    This will create a matrix 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.
  4. To plot the data, type, e.g.,
    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)).
  5. Run the program as explained in its header to produce theoretical temperature time-series for various heat-loss coefficients (kappa). To compare it to the actual data, type (assuming you have stored theory in temp_th and time axis in time_out):
    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.
  6. Repeat the procedure for the black can.

As you are working on the problem, some questions you can be asking yourself:

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

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.

Acknowledgement

This model is completely based on that described by Tom Huber.