Hot air balloons are exotically beautiful devices,
and have captured the imagination of young and old alike since
1783, when two Frenchmen flew the first one over Paris. There
are hundreds of web pages describing hot air balloons, and for
those interested we have compiled a set of **links**
to some of them. We feel that the best web overview of hot air
ballons is the **Wikipedia**
site.

This exercise is the first of a sequence of programming exercises based on a common theme, in which we wish to evaluate the lifting capability of hot air balloons. In this first exercise we develop and test the basic payload vs. altitude function that we will use with minor changes throughout this exercise sequence.

The principle of operation the hot air balloon
is intuitively simple. Because of the opening at the base of the
balloon envelope (the *mouth*) the air inside the balloon
is at the same pressure as the surroundings. The pressure P[Pa],
density ρ [kg/m^{}3] (pronounced "rho") and temperature
T[°C] of air are related by the ideal gas equation of state:

where R is the gas constant of air. Thus as
we increase the temperature of the air inside the balloon its
density decreases, and the balloon "floats" on the surrounding
air. Standard balloons are designed to fly with a crown temperature
of 100°C (373K) without fabric deterioration. If we could
determine the density of the surrounding air, we would be able
to evaluate the lifting capability of the balloon at various altitudes,
however we find this to be a challenging exercise. The earth's
atmosphere is a dynamically changing system, constantly in a state
of flux. The pressure and temperature of the atmosphere depend
on altitude, location, time of day, season, solar sunspot activity
-- it becomes totally impractical to take all these variations
into account. We resolve this by defining a *standard atmosphere*
in order to relate aircraft design and testing to a common reference.

The **International
Standard Atmosphere** (ISA) is based on a defined temperature
distribution with altitude, as shown below.

The relevant pressure distribution is obtained
by considering the earth's gravitational field, and the density
distribution is obtained from the ideal gas equation of state.
We will limit our balloon flights to an altitude of 11km, using
the constant temperature lapse rate of -6.5°C/km. For those
of you who would like to delve deeper into the development of
the various equations we refer you to an excellent text: "Introduction
to Flight" by John D. Anderson, Jr., McGraw-Hill, 3rd Edition,
1989, as well as the web link **balloon_eqns.html**
in which we develop the pressure equation at altitude z(m). The
complete sequence of 5 equations relating payload (kg) to altitude
(m) that we will use in this exercise sequence is shown below:

Notice that we have used SI units throughout,
thus volume (V) is in cubic meters (1 cubic meter equals 35.3
cubic feet), mass (m) is in kilograms, pressure (P) is in Pascals
(The ISA sea level pressure is 101,325Pa, which is equivalent
to 14.7psi), and temperature (T) is in degrees Celsius (The ISA
sea level temperature is 15°C). We convert from Celsius temperature
to absolute (Kelvin) temperature by adding 273°C. In the US
"units" is an ongoing battle causing much confusion
in the global economy. Even the **NCEES**
is confused at this point - the Fundamentals of Engineering (FE)
Reference Handbook and exam contain exclusively SI units and then,
when you reach maturity and are ready to take the Professional
Engineering (PE) exam, you find that the English system of units
(USCS) is acceptable, and in some cases used exclusively. This
confusion reached a new climax when in the Fall of 1999, NASA's
$125 million **Mars
Climate Orbiter** broke up in the Martian atmosphere, because
scientists in one of NASA's subcontractors failed to convert critical
data from the English sytem to the SI system of units.

Our first exercise will be to use the above
equation set to evaluate the payload mass (m_{p}) that can be lifted to a certain altitude (z)
under specified conditions. Note that we cannot solve the equation
set explicitly for altitude - thus we cannot ask, "to what
altitude will the balloon lift me and my spouse, a payload of
150kg?" We will develop techniques for answering that question
in forthcoming exercises. This first exercise is much less ambitious:

There are two parts to this exercise, the computer program to evaluate the payload mass as a function of altitude, and a graph which you will plot by hand on regular graph paper.

- Write a program that defines a class
**Balloon**based on the equation sequence defined in the diagram above. The various relevant parameters used in the equation should be declared as private or public variables, as shown in the structure diagram below. For the balloon volume (V) we will consider this a 1-4 person balloon having a volume between 1000 and 2000m^{}3. Choose a value 1*abc*, where*abc*represents the first three digits of your OU email address. The value of mb represents the empty mass of the balloon, including the envelope, propane tanks and burner, and basket. Choose a value*de.f*being the fourth and fifth and sixth digits of your Oak email address (however if*d*= 0, choose 1*de.f*). Thus (for example) if your Oak email address is iu123456@ohio.edu then your balloon volume should be 1123.0m^{}3, and your balloon empty mass should be 45.6kg. The main function should first obtain respective values for the balloon volume V and the balloon empty mass mb from the keyboard. It should then create an object of the class**Balloon**, assigning these values to the private variables, as well as initializing the public variables as shown, including the atmospheric conditions R, Po, To, a, and the gravitational acceleration g. Notice in the flow diagram below that we seldom use abreviated mathematical and Greek symbols in programming, however usually spell out the variable name in a meaningful self-explanetary manner. Thus (for example) the lapse rate (a) is represented as**lapse**.

Subsequently the main function should get a value of altitude from the keyboard, and invoke a Balloon class method**find_payload**to evaluate and return the payload mass that can be lifted to that altitude using the equation sequence shown in the square above. The method**find_payload**should have only one argument, being the main independent variable**altitude**. A typical flow diagram of the program is shown below. Try to relate the various private and public variables to the equation set above.

We have to standardize the order of entering data on the keyboard, since your programs will be tested automatically. The first data item should be the balloon volume, followed by the balloon empty mass, and the last item should be the altitude.

A typical program execution output follows:

enter balloon volume (typically 1000 cu.m):1000enter balloon empty mass (typ. 100)[kg]100balloon initialised as follows:balloon volume: 1000[cu.m]balloon empty mass: 100[kg]standard atmospheric conditions:temperature lapse rate: -0.0065[deg C/m]temperature at sea level: 15[deg C]standard pressure at sea level: 101325[Pa]evaluate balloon payload mass as a function of altitudeenter altitude[m]3000value entered is 3000.0[m]for altitude of 3000.0[m]payload mass is 154.8[kg]The source code should be in your home directory by 10:00am of the due date and named

balloon.cpp

- You will need to execute the program as many
times as required to obtain enough data points in order to plot
a suitable payload vs. altitude graph. For each execution, the
values of balloon volume and balloon empty mass should remain
the same, according to the value of your oak email address.

Decide on a payload mass that is suitable for you. Depending on the size of the balloon and the altitude which you would like to attain, it may be yourself alone or with a number of friends, pets, camera equipment, etc, and draw the relevant horizontal line on your graph. Then from your graph determine and write down the value of altitude that you can attain with this payload.

Notice in this exercise that we have used the computer in a very unsophisticated role - as a mere calculator. In the coming exercises we will successively (and joyfully) relinquish all the manual tasks defined above (multiple execution of the program, drawing the graph, determining the altitude which you can attain with a specified payload, and more) to the computer.