**Meteorology 101 Laboratory - Simulating the Simulation of the Weather
by Computer**

When computers of reasonable size began to appear in the
1950s, meteorologists were some of
the first users to simulate the weather on computers. The idea was to use the laws
of physics to
calculate the weather of the future. At first it was pure research. The people
running the
simulations could change the energy or water vapor concentration by millions of joules
by typing
a few numbers on a computer card. The scientists could make two runs, one with and
one
without the change, in a matter of minutes or hours. After a decade of improvements
in both
computers and the simulations, the forecasters wanted to see the results each day.
Today, the
results of these models are an integral part of the weather forecasting process.

These physical simulations, sometimes called models, take the data directly
from the
communications lines, perform an analysis of the data at regularly spaced grid points,
and then
integrate the meteorological values in time using the laws of physics to simulate
the weather.
Computer contouring programs calculate the familiar weather maps for people to interpret.

Since the model results are a big part of the present forecast process,
let's look at how a simple
model is constructed. Calculating a simple process, such as the temperature of a
cup of hot
liquid as it cools, offers an insight into how the more complicated weather simulations
work.
Here, you'll use the physics of cooling of a hot body, often referred to as Newton's
Law of
Cooling, to simulate how the meteorological models work. One advantage to this approach
is
that Newton's Law of Cooling has an easy analytic solution so we can check on the
accuracy of
the method of calculating.

Take a cup of hot coffee and set it on a table. The temperature starts
at the boiling point and then
goes down rapidly at first and then more slowly. The temperature change over a given
time is
proportional to the difference between the coffee temperature, the room temperature
and the time
you measure it. After an hour or two, the cup's temperature would be very close
to the room
temperature. What happens during the cooling process is what we're after.

Coffee cups or mugs insulate the coffee. The temperature of the hot coffee would
not change in a
perfectly insulating cup; however, real cups do cool. Suppose a minute after you
put the boiling
water in the (preheated) cup, the temperature drops to 90 degrees C, then you have
a measure of
the insulation value of the cup. The new temperature 'T' at one minute from the
start can be
forecast by subtracting the change in temperature from the starting temperature 'T_{i}'.
The change
is represented by the expression on the right of the equation which is made up of
alpha '', the
insulation factor, the difference in temperature between the coffee 'T_{i}'
and the room temperature
'T_{room}', and the forecast time step 't' in minutes.

That's simple enough to do with a calculator or program on a computer.

Putting in some numbers, the coffee started at the boiling point,
100 Celsius and the room
temperature is 20 C, then the difference is 80 degrees [100F - 20 C = 80 C]. Multiplying
the 80-times alpha (For purposes of the first part of this laboratory, assume the
insulation of the cup ''
is 0.1 per minute.), yields 8 C/min. After one minute the coffee temperature should
be 100-8 or
92 degrees C.

T_{f} = 100 C - 0.1 per min (100 C - 20 C)(1 min) = 92 C.

If you wanted to calculate the temperature after two minutes, simply start at 92
C and repeat the
calculation.

T_{f} = 92 C - 0.1 per min (92 C - 20 C)(1 min).

Using a hand calculator the temperature at 2 minutes is 83.8 degrees C. Finding
the temperature
after three minutes is done simply by using 83.3 degrees C for the starting temperature.
Complete Table 1 using the same method for calculation.

Table 1. Calculation Sheet for 0.1 Insulated Cup with | |||||

Time(t) | Cup T | Room T | T_{c}- T_{r} = T |
O.1 x T*t=F | T_{c} - F |

1min | 100C | 20 | 80 | 8 | 92 |

2 | 92 | 20 | 72 | 7.2 | 84.8 |

3 | 84.8 | 20 | . | . | . |

4 | . | 20 | . | . | . |

5 | . | 20 | . | . | . |

6 | . | 20 | . | . | . |

7 | . | 20 | . | . | . |

8 | . | 20 | . | . | . |

9 | . | 20 | . | . | . |

10 | . | 20 | . | . | . |

11 | . | 20 | . | . | . |

12 | . | 20 | . | . | . |

13 | . | 20 | . | . | . |

14 | . | 20 | . | . | . |

If you've had a college physics course, you know that an exact solution to this equation exists. That solution is

Figure 1 shows the analytic solution for the temperature over a period.

Plot the values for the temperature of the cup (Cup T) you calculated in Table 1 on Figure 1. Notice that they don't quite agree but they are close. If we can live with a little error, we can now simulate the temperature of a coffee cup over time with a simple adding machine. We don't need to put the pot on, perk the coffee, pour and measure the temperature change with time. We can do it with a simple calculator and a formula. Of course, you can't drink the calculation (Paper doesn't have a pleasant taste.), but if you had a 10,000 cups which you had to know about you could do the simulation on a small computer. That would be much more comfortable way to learn about the cooling of the bodies.

The real point is that the weather simulations use the calculation procedure because we have found out that we can't build a big enough stove to heat the atmosphere enough to do anything to it. And, going out and experimenting on the weather, like seeding clouds, causes lawyers to sharpen their pencils. So, a weather simulation is really all we have to work with if we want to change the temperatures to see what happens.

It would significantly improve the effort if there were fewer calculations to perform, so lets try the calculations again but using a 5 minute time step.

Table 2. Calculation Sheet for 0.1 Insulated Cup with | |||||

Time(t) | Cup T | Room T | T_{c}- T_{r} = T |
O.1 x T*t=F | T_{c} - F |

5min | 100C | 20 | 80 | 40 | 60 |

10 | 60 | 20 | 40 | 20 | 40 |

15 | 40 | 20 | . | . | . |

20 | . | 20 | . | . | . |

25 | . | 20 | . | . | . |

30 | . | 20 | . | . | . |

35 | . | 20 | . | . | . |

40 | . | 20 | . | . | . |

That's more like it. It took a lot less effort to do this and we could use the time we saved to do other things. But wait. Plot these calculations on Figure 1 to see the effect of saving this effort.

**Question 1** - How do the cheaper calculations compare to the calculations of Table 1?

**Question 2** - How do both of the calculations compare to the analytic solution?

It would be easier on the computers if we could further lengthen the time step. Then we wouldn't have to do as many calculations as we did before. This saves graphite and wear and tear on your calculator finger, or, if you're doing it with a computer, saves computer resources. Try doing the simulation with a time step of 15 minutes.

Table 3. Calculation Sheet for 0.1 Insulated Cup with | |||||

Time(t) | Cup T | Room T | T_{c}- T_{r} = T |
O.1 x T*t=F | T_{c} - F |

15min | 100C | 20 | . | . | . |

30 | . | 20 | . | . | . |

45 | . | 20 | . | . | . |

Plot these calculations on Figure 1.

**Question 3 **- How do these compare to the calculations of Tables 1 and 2?

**Changing the Insulation Value of the Coffee Cup**

The next step is to change cups. In the calculation approach you've been using its easy. Simply change the value of alpha ''; in the real world, you need to go to the cupboard and select a new one. Replacing the highly insulated cup with a more heat conductive cup, you can do the same type of calculation for the new cup even though it may not have been manufactured yet. Figure 2 is the analytic solution for the cup with an insulating value of 0.3.

Repeat the calculations for a cup with an insulating value of 0.3 and graph the values on Figure 2. By now you the procedure should be easy. Table 4 is for filling in the blanks for the one minute time step.

Table 4. Calculation Sheet for 0.3 Insulated Cup with | |||||

Time(t) | Cup T | Room T | T_{c}- T_{r} = T |
O.3 x T*t=F | T_{c} - F |

1min | 100C | 20 | 80 | 24 | 76 |

2 | 76 | 20 | 56 | 16.8 | 59.2 |

3 | 59.2 | 20 | . | . | . |

4 | . | 20 | . | . | . |

5 | . | 20 | . | . | . |

6 | . | 20 | . | . | . |

7 | . | 20 | . | . | . |

8 | . | 20 | . | . | . |

9 | . | 20 | . | . | . |

10 | . | 20 | . | . | . |

I've included Table 5 to assist you when repeating the calculation with a time step of 5 minutes.
Plot the values of Cup Temperature on Figure 2.

Table 5. Calculation Sheet for 0.3 Insulated Cup with | |||||

Time(t) | Cup T | Room T | T_{c}- T_{r} = T |
O.1 x T*t=F | T_{c} - F |

5min | 100C | 20 | . | . | . |

10 | . | 20 | . | . | . |

15 | . | 20 | . | . | . |

20 | . | 20 | . | . | . |

25 | . | 20 | . | . | . |

30 | . | 20 | . | . | . |

35 | . | 20 | . | . | . |

Exploring the time and effort factor again, try plotting the values every 15 minutes. Table 6 is given below as a convenience for doing calculations if you haven't gotten tired of doing it step by step and have gone to a computer program.

Table 6. Calculation Sheet for 0..3 Insulated Cup with | |||||

Time(t) | Cup T | Room T | T_{c}- T_{r} = T |
O.1 x T*t=F | T_{c} - F |

15 min | 100C | 20 | . | . | . |

30 | . | 20 | . | . | . |

14 | . | 20 | . | . | . |

**Question 4 **- What must be done to make the numerical simulation as accurate as possible?

**Question 5 **- How does the accuracy change with the value of ,
which represents the insulation
of the cup, as you change the time step?

**Summary**:

Although this laboratory exercise required quite a bit of hand calculation, the techniques used are
the same as those used in forecasting the weather. Of course, the weather problem uses one
vector equation and four scalar equations which describe the wind velocity, air temperature, air
density, air pressure, and moisture content. These equations must be solved at each grid point
and at each elevation. The number of calculations which go into a simulation of the weather tax
the biggest and latest generation of comuters to their limits. The scientists and mathematical
engineers which program the weather models are very aware of the types of errors you found and
have developed some methods of eliminating some of them and minimizing the effect of the rest.

Economists have also applied these techniques to their problems and have dealt with the same
types of errors found in this lab.

**Question 6 **- If you were trying to apply the same technique to forecasting to a new problem,
what are some of the things you should watch for and how would you minimize the errors?

**Appendix**

If you wish to try out a computer program, enter QBASIC
(it comes with DOS and is usually
found in the DOS directory) and type in this program:

CLS : REM Temperature of a Cup of Coffee

T = 100: TS = T: TR = 20: etime = 0: REM T is temperature of the water,

REM TR is the temperature of the room and etime is elapsed time

INPUT ; "Type in the value of alpha (between 0 and 1)", alpha: PRINT

INPUT ; "Type in the value of delta t in minutes", deltat: PRINT

REM start calculations

70 dT = T - TR

F = alpha * dT * deltat

T = T - F

etime = etime + deltat

TA = TR + (TS - TR) * EXP(-alpha * etime): REM Analytic Solution

PRINT etime; T; TA

IF etime < 45 GOTO 70 ELSE END

When you press F5 and type in the appropriate values of alpha and delta t, the program
should
give you the values. QBASIC comes with recent releases of DOS; however, older releases
use
GWBASIC. In GWBASIC, you will need to type line numbers before each statement.