By Ingo Dahn, (Koblenz, Germany [email protected]) and Ambjörn Naeve (Stockholm, Sweden [email protected])
Weather balloons are a simple, but important mean to explore the atmosphere. They carry radiosondes high up in the air (how high?) These radiosondes measure several parameters of the atmosphere during their flight, for instance air temperature and air pressure. Weather balloons collect many data. With a good understanding of atmospheric phenomena, we should be able to predict these data to a certain extent. Can you do it?
This notebook lets you perform your own experiments with real weather balloons. We have started in Part I with a simple method for calculating the air temperature in various height and check it against the measurements of a real weather balloon. In Part II an analysis of the air pressure data from a balloon flight led us to attempt finding a way to calculate the height of an airplane or a balloon from the air pressure it actually measures.
In this part we are combining temperature and pressure towards a general model to calculate height from pressure. Then, comparing with the real balloon data, we can evaluate the quality of these calculations. On the way, we shall explore why a ballon flies at all.
You can repeat all this yourself with data from many balloon risings! Can you come up with a better model?
This notebook is made of a sequence of cells:
Text cells, explaining what we do. The text cells analyze a specific default balloon flight. They do not change and, depending on your working environment, you may not be able to change the content of text cells.
Hovering the mouse over the SageMath icon will reveal some additional explanations on the code - try it
Don't worry, if you don't understand the content of the code cells! We start simple and so you don't need to know a lot of Math, Physics or Programming - just go and experiment! Whenever you run into trouble - have a look at our .
License: This document is made available under a Creative Commons Attribution Share Alike License 4.0.
Let's go to the weather station in Idar-Oberstein/Germany. It is located 105 km (ca 65 miles) southwest of Frankfur/Main at a height of 376 m.
The following cell prepares the environment by downloading data from weather balloon flights "
If it has in line 2 `randomBalloon=False` (the default) it uses a specific sample balloon flight which is discussed in the comments. You may change it to `randomBalloon=True` in order to select data from a randomly selected balloon flight.
This cell must be executed first.
# Change the value of randomBalloon to True in order to select a flight by chance randomBalloon=False load('https://raw.githubusercontent.com/ingodahn/sageutils/master/weather.py') station=station() if randomBalloon: flight=station.getFlight('random') else: flight=station.getFlight() press=flight.dataPoints('height','pressure') temp=flight.dataPoints('height','temperature')
Note: Different notebooks use distinct computational environments. Therefore, if you use a randomly selected flight in this book, it is probably different from a flight you used in part I or II. If you want to continue working with the same flight, you should paste the output of the last code cell from of Part I into the following cell and execute it.
#Paste status below this line # Paste status above this line print('Status restored')
We have seen in Part II that experimental data are not a reliable base for calculating the height of an airplane from the pressure it measures. So we need a better founded model.
So far we have explored the dependency of temperature from height and of pressure from height. After a critical look at what we have done so far, height looks somewhat suspicious: While temperature and pressure are properties of the air, height is the distance between the air and something completely different: The earth!
We move on as simple as possible, ignoring the earth and looking at the relation between the two properties of the air: Temperature and Pressure.
To explore the relation between two magnitudes of different nature, it is often a promising first shot to look at their quotient, in our case temperaturepressure. If we are lucky, both could be proportional. Given the irregular dependency of temperature from height vs. the regular development of pressure, proportionality is unlikely, but it's woth an attempt.
Note that the minimal pressure is 0, but we have measured temperature in °C which is rather arbitrary. That did not matter as long as we were only interested in differences of temperature, but it makes a difference when we use temperature in a quotient (consider t=0°C). So, we better change to absolute temperature in °K (degree Kelvin) by adding 273.15.
qpt=[(press[i][1]/(temp[i][1]+273.15),press[i][0]) for i in range(0,len(press))] show(list_plot(qpt),axes_labels=["mbar/K","m"])
This is not a constant function, so temperature and pressure are not proportional.
What is the meaning of this quotient TP? The ideal gas law tells us that the quotient of pressure P and temperature T is proportional to the density of air ρ.
TP=ρ⋅Rspecific
The proportionality factor Rspecific is the gas constant. Each gas has it's specific proportionality factors, therefore this factor is called specific gas constant, which is given as 287.058kgKJ for dry air.
Tip: Calculating with units requires some care. To compare magnitudes measured in different unit, it is always a good idea to convert them to a representation using a standard scale. This Unit Calculator can help!
A real gas is a complex mixture, the properties of which change with height and temperature. To find formulas that allow to approximately calculate properties of the air, mathematical models must assume some simplifications. But it is by no means obvious
One of these simplifications concerns the compression of air. Unlike liquids, air is compressible. Under the weight of the atmosphere above it, the same amount of air molecules needs a smaller volume at sea level than high up. This is described by the ideal gas law. But real air is a mixture of gas and liquid, it may contain incompressible water in the form of fog or clouds. The ideal gas law does not take this into account. Also, gas may heat up when compressed which will expand it's volume, acting against the effect of compression. The ideal gas formula ignores this too.
The density of air is an especially important property. As will be discussed later, air density affects the available buoyancy of flying objects. Weather balloons do not measure air density, but the ideal gas law allows us to calculate it approximately. Weather balloons, however, do measure what is called the dew point of the air, indicating it's moisture and thus allowing for better approximations than the ideal gas law allows, but this is currently beyond the limits of this notebook.
Before we calculate air density from our weather balloon's data, we need to have a look at the units used to express the gas constant. Since 1 J =1 N m , we get Rspecific = 287.058 kgKN m
Therefore ρ=t K⋅287.058kg KN mp mbar=tp⋅287.0581N mmbar kg.
Since 1 mbar=100 Pa=100 m2N we have ρ=tp⋅2.870581 m3kg where p is the pressure in mbar and t is the temperature in K.
rho=[(q[0]/2.87058,q[1]) for q in qpt] rhoPlot=list_plot(rho) show(rhoPlot,axes_labels=["Air Density (kg/m^3)","Height (m)"])
According to Archimedes' Principle a balloon should float in the air as long as it's density is less than the density of the air. This is discussed in detail in the notebook May the Force be With You, Part 1: Buoyancy
Let's check this. The German weather station at Idar-Oberstein uses radio sondes of type RS41 carried by Kaymont ballons. These balloons vary greatly but they all use Helium gas as filling, which is lighter (i.e. of lower density) than air. In fact, the density of Helium amounts to 0.1785 m3kg.
At which height did our balloon meet an air density that equals the density of it's helium inside?
Why does the balloon fly so much higher than predicted by our model based on Archimedes' principle? In fact, the density of the balloon is even higher than the density of helium, because the mass of the balloon hull and of the equipment must be added to the mass of the helium.
The only way to keep the low density of the balloon with a constant mass is expanding it's volume. With increasing height, the air pressure decreases until it is less than the pressure of the helium in the balloon and the balloon expands, increasing it's volume and decreasing thus it's density, flying higher and higher until it bursts.
For example, an average balloon, which has a diameter of 1.5 m when started, may expand to a diameter of 7 m when it bursts after flight of about two hours at a height of 33 km.
Let's get back to our problem to find a reliable way of calculating the height of an airplane from the pressure of the air it meets. Barometric formulas are model that provide a function calculating the dependency of the pressure from height. Inverting these functions than provide ways to calculate height from pressure.
There are more than one competing barometric formulas. On which assumptions are thy based? How do they differ? Which will best predict the data from our flight?
The following video derives the Second Barometric Formula.
This derivation is based on the ideal gas law and on some considerations on the development of pressure and temperature with height. That is not as straightforward as it may seem - let us consider it with a critical eye.
We have already discussed the simplifications on which the ideal gas law is based. A further simplification, made in this video, assumes that the temperature of the air is the same at all heights. We have seen from our balloon data in Part I that in fact the temperature of the air may vary by as much as 70°, so this assumption is quite crude.
The video derives in line (3) from P=ρgh that for a small change dh of height the change of the air pressure can be calculated as dP(z) = −ρ g dz. That is plausible only if it is assumed that the air density is more or less constant during small changes of height, i. e. independent of the change of height. A constant density of the air means, that air is incompressible, just like in a hydrostatic model that describes liquids - an assumption that directly conflicts the assumption of compressibility made by the ideal gas law.
How can that be justified? A closer inspection of the argument in the video shows that the invariance of air density is used only for slight changes of height, while it is still allowed, that the density has different values at different heights. So, in fact, it is only assumed that the air density changes much slower than the height does.
We cannot really check the equation above since we only have a sparse set of discrete datapoints at quite different heights. But isn't it puzzling that, according to the equation above, (dP/dh)/rho
is the gravitational constants? Towards the end of the above video, this is approximately checked with data from a weather balloon flight, as a confirmation, that the atmosphere is tied to the earth by gravity. Let's see, whether we can confirm that too with our ballon flight data.
Recall that press[i][1]
is the pressure pi in millibar at the datapoint with index i, press[i][0]
is the height hi in m at datapoint i. rho[i][0]
is the density ρi of the air at datapoint i in kg/m^3 as calculated above from the ideal gas law using the specific gas constant of dry air.
To translate the mbar of the pressure into the standard units of kg,m,s we use the fact that 1 Pa=1 m2N and 1 N=1 s2kg×m. Recall that you can convert units with the Units Calculator
Hence we get x mbar = x⋅100 Pa = x⋅100 ⋅m2N= x⋅100 s2kg×m.
Therefore, we must multiply the pressure values pi (i.e. p[i][1]
in the code) with 100 to have them in s2kg×m, which then gives the quotient dhρdP in s2m, which is the SI unit for acceleration.
With this adaptation the following diagram plots the quotient (hi+1−hi)((ρi+1+ρi)/2)100⋅(pi+1−pi) in s2m.
The horizontal axis shows the height hi (of the corresponding datapoint i) in meters.
ph=[(press[i][0],100*(press[i+1][1]-press[i][1])/((press[i+1][0]-press[i][0])*(rho[i][0]+rho[i+1][0])/2)) for i in range(0,len(press)-1)] p_data=list_plot(ph) ph_mean=mean([ph[i][1] for i in range(0,len(ph)-1)]) p_mean=plot(ph_mean,(0,35000),color='red') show(p_data+p_mean,axes_labels=['Height','g-Quotient']) print('Mean value (red):',ph_mean)
If you keep in mind that the difference of height between 2 successive points can be easily several 100 m (which is far from being a small change), we should not expect high accuracy and so our values of (hi+1−hi)((ρi+1+ρi)/2)100⋅(pi+1−pi) vary reasonably around −g=−9.80665, though with great variability.
The second barometric formula, derived in the video above calculates the pressure in dependence of the height as P=P0e−k2⋅h with k2=RTMg where P0=1013.25 mbar is the pressure at sea level, M=0.02896molkg is the middle molar constant, g=9.80665s2m is the gravitational constant, R=8.314K molJ is the universal gas constant, Rspecific=MR is the specific gas constant and T=288.15 °K is the standard temperature.
That does not look very accurate, around heights of about 15 000 m. Let's look at the difference between the measured data and the data from the formula.
Recall that press[i][0]
is the height of datapoint i and press[i][1]
is the pressure measured at this height. If a pilot uses the inverse of the barometric formula Hbar2(P)=−k2ln(P0P) the difference between the real value press[i][0]
and the value calculated from the real pressure H_bar(press[i][1]
is plotted by the next cell
That's a big difference and it keeps growing with height. You probably wouldn't like to fly with a pilot using the second barometric formula for calculating his height if his calculations provide values which are too low for a few kilometers.
Let's see whether we can improve the model with the first barometric formula:
As in the derivation of the second barometric formula we start from the ideal gas law
P(z) = ρ(z) Rspecific T(z) = ρ(z) Rs T(z), where we have introduced the notation Rs = Rspecific and z is a variable for the height.
We also keep our assumption that small changes in pressure are hydrostatic and we have: dP(z) = −ρ g dz, and dividing dP(z) by the P(z) expression above we get:
P(z)dP(z) = −RsT(z)g dz,
But, instead of a constant temperature, we now assume a linear temperature change T(z) = T(0) + L z with a constant lapse rate L and temperature T(0) at sea level. In Part I of this notebook series, we have learned that L=−6.5K/km is a popular value, but a linear change of temperature occurs only in the region above the weather zone and below the tropopause and even there the lapse rate may deviate from the value of −6.5K/km.
From the equation above we get dzdT=L and hence dz = L1 dT(z). Hence we have:
P(z)dP(z) = −RsLgT(z)dT(z).
Integrating this expression from the surface level (z=0) to the altitude z=h, and remembering that RsLg is a constant, we get:
0∫hP(z)dP(z)dz = −RsLg0∫hT(z)dT(z)dz,
[ lnP(z) ]0h = −RsLg[ lnT(z) ]0h ,
lnP(h)−lnP(0) = −RsLg( lnT(h)−lnT(0) ) ,
lnP(0)P(h) = −RsLglnT(0)T(h)= RsLglnT(h)T(0),
P(0)P(h) = [T(h)T(0)]RsLg.
Hence we have:
P(h) = P(0) [ T(0)+LhT(0) ] RsLg.
This equation is called the first barometric formula. Let's see, how it fits our ballon data.
L=-0.0065 R_s=R/M P_bar1(x)=P_0*(T_s/(T_s+L*x))^(g/(R_s*L)) Plot_bar1=plot(P_bar1,(0,35000),color='green',legend_label='1st Barometric Formula') show(Plot_bar2+Plot_bar1+Plot_balloon,axes_labels=['Height (m)','Pressure (mbar)'])
It looks like the First Barometric Formula has a much better match with the balloon data than the Second. Let's calculate it
The height Hbar1(x) for pressure x is calculated by the inverse of the First Barometric Formula. With the shorthand P0=P(0), Ts=T(0), k1=RsLg we can write the first barometric formula for pressure x and height h as
x = P0(Ts+LhTs)k1,
TsTs+Lh = (xP0)k11,
Hbar1(x)=LTs⋅((xP0)k11−1) = LTs⋅((xP0)gRsL−1).
TL=T_s/L kk=(R_s*L)/g H_bar1(x)=TL*((P_0/x)^kk-1) Plot_H1D=list_plot([(press[i][0],(press[i][0]-H_bar1(press[i][1]))) for i in range(0,len(press)-1)],color='green',legend_label='1st Barometric Formula') show(Plot_H1D+Plot_H2D,axes_labels=['Height (m)','Height Difference (m)'])
For great heights, the values of the first barometric formula also deviate considerably from the values measured by our balloon, but the deviation is less than that of the values of the Second Barometric Formula. In particular, the First Barometric Formula shows a much better match in the region up to a height of 13 km which is essential for commercial aircrafts.
Thus, replacing the assumption of constant temperature for the Second Barometric Formula by assuming a linear decrease of the temperature with height in the derivation of the First Barometric Formula has made the determination of height from pressure viable for a much larger business field.
Question: Can you guess, why even the First Barometric Formula behaves so badly above 13 km?
Answer: Recall from Part I that the temperature of the air rises again in the tropopause and the tropopause starts roughly at about 13 km.
You may use the following cell for your own experiments.