**Path:**Release / RisingPressure.ipynb

**Description:**Learning Materials released by the MathTrek Team

**Views:**1359

**License:**OTHER

**Image:**ubuntu2004

**Project:**MathTrek

Edit | Raw | Embed | Download

# Rising Up in the Air - Experimenting with Radio Balloons

# Part II: Pressure

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 started in

Part IThis 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.

**Code cells**with Sage code. You must _execute_ these cells to actually run the code. Depending on your environment, you execute cells by pressing the*Execute*button, by clicking into the cell and pressing*Shift+Return*or by selecting a*Run*item from the*Cell*menu. You can modify the content of code cells and you should do this in the places indicated in order to perform your own live experiments with real weather data!**Note:**Code cell calculations mostly use the results of calculations of previous cells. Therefore it is important that they are__executed in the given order__.Hovering the mouse over the SageMath icon will reveal some additional explanations on the code - try it

**Interactive questions**from Wamap. Many of these questions come with written examples, explaining the underlying Math.

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.0The 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 1. 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 temp = [(376, 15.0), (500, 13.9), (767, 11.4), (996, 9.9), (1000, 9.9), (1373, 7.4), (1469, 6.8), (1500, 6.6), (1785, 5.2), (1795, 5.2), (1845, 4.2), (1885, 3.4), (1936, 5.0), (1966, 5.4), (1976, 5.6), (2000, 5.8), (2007, 5.8), (2048, 6.5), (2111, 7.6), (2280, 6.0), (2647, 2.8), (2960, 0.1), (3052, -0.7), (3077, -0.9), (3250, -1.1), (3356, -1.9), (3546, -3.3), (3643, -2.3), (3816, -3.5), (3991, -3.5), (4119, -3.7), (4275, -5.2), (4634, -8.7), (4895, -9.9), (4937, -10.1), (5366, -12.5), (5395, -12.8), (5513, -13.9), (5680, -15.3), (5815, -16.1), (6563, -22.2), (6798, -24.1), (6832, -24.3), (7320, -27.5), (7558, -28.9), (8448, -36.9), (8694, -39.1), (8757, -39.7), (9055, -42.1), (9077, -42.3), (9320, -44.3), (9729, -47.7), (10063, -50.7), (10136, -51.1), (10510, -54.5), (10617, -55.7), (11319, -61.1), (11347, -61.3), (11461, -61.9), (11910, -63.7), (11999, -64.3), (12093, -63.4), (12489, -59.6), (12523, -59.3), (12880, -58.4), (13220, -57.5), (13418, -58.6), (13620, -59.7), (13700, -58.7), (13786, -58.6), (13872, -58.4), (14702, -57.0), (15164, -56.3), (15326, -56.0), (15549, -55.7), (16081, -56.7), (16270, -57.1), (16609, -57.0), (16847, -57.0), (17037, -57.0), (17247, -56.9), (17435, -56.9), (17675, -56.8), (18237, -56.7), (18530, -56.7), (18599, -56.4), (18833, -55.5), (18978, -55.6), (19197, -55.8), (19878, -56.3), (20223, -56.6), (20660, -56.9), (20767, -57.0), (20870, -57.2), (21358, -57.8), (21886, -58.5), (23890, -57.1), (24557, -56.9), (25070, -56.7), (25628, -56.5), (26241, -56.4), (26460, -56.3), (26923, -56.4), (27456, -56.5), (27682, -56.5), (27721, -56.5), (28121, -55.2), (28419, -54.3), (28732, -53.3), (29063, -52.4), (29413, -51.3), (29730, -50.4), (29952, -49.8), (30300, -48.8), (30733, -47.6), (30930, -47.1), (30997, -46.9), (32406, -47.7), (34448, -40.7)] # Paste status above this line print('Status restored')

## Part II: Pressure

Pressure is, beside temperature and volume, one of the basic properties of any gas.

From the daily weather reports we know how important regions of high or low pressures are for understanding the development of the weather. For example, wind is nothing but air streaming from a region of higher pressure to a region of lower pressure.

But what is pressure? Watch this video from

finsciencedemos### The Weight of the Air

Side-Question: How can we know this?. Above your head there is a column of air which is several kilometers high. That should sum up to something! At sea level that approximately causes as much pressure as a column of 10 m of water.

Wikipedia

Atmospheric pressure, also known as barometric pressure (after the barometer), is the pressure within the atmosphere of Earth. The standard atmosphere (symbol: atm) is a unit of pressure defined as 101,325 Pa (1,013.25 hPa; 1,013.25 mbar), which is equivalent to 760 mm Hg, 29.9212 inches Hg, or 14.696 psi. The atm unit is roughly equivalent to the mean sea-level atmospheric pressure on Earth, that is, the Earth's atmospheric pressure at sea level is approximately 1 atm.

The mean sea-level pressure is 1013.25 mbar. mbar (millibar) is the unit in which our weather balloon measures the pressure. Pilots use the air pressure to determine their height. In order to get correct values during the flight it is crucial that they calibrate their barometric altimeter at the departure airport, which deviates from sea-level pressure as the airport is usually above sea level. Similarly, our calculations have to take into account, that our weather station in Idar-Oberstein is located 376 m above sea level.

Let's explore atmospheric pressure with our weather balloon from Idar-Oberstein in order to develop a model for the dependency of pressure from height.

What would you expect? Does air pressure decrease linearly with height?

Let's see, what our weather balloon tells us.

press_inv=invert(press) balloonPressurePlot=list_plot(press_inv,axes_labels=['Pressure (mbar)','Height (m)'],gridlines=True) balloonPressurePlot

That's a nice, rather smooth decrease of pressure, but it is not linear. We have to consider more complex formulas to model the decrease of air pressure with height. We note, that for the minimal height of the ballon the pressure is slightly below 1000 mbar, as it was to be expected.

As we want to explore the dependency of pressure from height, let's turn around the diagram.

pressurePlotInv=list_plot(press,axes_labels=['Height (m)','Pressure (mbar)'], gridlines=True) pressurePlotInv

These points can probably be connected by a regular curve described by a function. If we could find a formula (i.e. a mathematical model) for calculating this function, we could predict the pressure at a particular height.

From a first look it seems that this function is injective (1-1), i.e. it has an inverse function, allowing us to calculate the height from the pressure of the air. That provides a simple method for a balloon or airplane pilot to determine his height. In fact that was the main way to determine height before Radar and GPS devices became so small that they could be used anywhere.

### Preparing the Pressure Model

It has a non-zero value at height 0, then a steep descend until it levels out towards 0. Similar curves are the function graphs of exponential functions $a e^{-c x}$ for $c > 0$.

In this way we can determine an exponential function through two data points - but that's not necessary the best fit w.r.t. all data points!

Exponential Regression

Unfortunately, as many iterative procedures, exponential regression can go wrong if the initially guessed values are too far from the optimal ones - which we don't know yet.

Since for our model $P(x)=a e^{-k x}$ of the pressure $a=P(0)$, it is probably a good guess to take the mean pressure at sea level of 1013.5 mbar as starting value for $a$.To get an initial guess for $k$, we can take the pressure at another height and calculate $k$ for the function passing through this data point as well, as we have seen working on the previous question.

Let's take for this other data point some point pressInv[i] in the middle of our data series:

i=round(len(press)/2) x1=0 y1=1013.25 x2=press[i][0] y2=press[i][1] a0=y1 k0=ln(y2/y1)/(x1-x2) print("Let's start with an initial guess of a=%f and k=%f"%(a0,k0))

We use exponential regression to determine an exponential function that fits best to the data:

var('x,a,k') f_exp(x)=a*e^(-k*x) q=find_fit(press, f_exp, variables=[x],parameters=[a,k],initial_guess=[a0,k0],solution_dict = True) a_p=q[a];k_p=q[k] P(x)=f_exp(x,a=a_p,k=k_p) show('P(x)=',P(x)) show(list_plot(press)+plot(P(x),0,35000, color='red'),axes_labels=['Height (m)','Pressure (mbar)'],gridlines=True)

That doesn't look bad, but how good is our model really? If a pilot would rely on our model to calculate the altitude of her plane - how would it deviate from the professional height measurement in the

weather balloonOur function $P(x)$ calculates the pressure from the height - the pilot would need the inverse of $P$.

P_inv(x)=-ln(x/a_p)/k_p show(list_plot(press_inv)+plot(P_inv,0,1000,color='red'),axes_labels=['Pressure (mbar)','Height (m)'],gridlines=True)

### Using Our Model

From this diagram, a pilot could read the height given the local atmospheric pressure from both, our model and the weather balloon data. What do you think, how big will the difference be?

d_p=[(p[1],P_inv(p[1])-p[0]) for p in press] show(list_plot(d_p),axes_labels=['Pressure (mbar)','Height Difference (m)'],gridlines=True)

Our pilot starts at the right of the diagram, with a pressure of ca. 1000 mbar, and moves up. Initially, our model predicts a height which is about 300 m too high, then it becomes better and for pressure between 750 mbar and 250 mbar the height given by our model is up to 250 m too low. Below that, the error of the model grows of up to 3.5 km - we still have a lot to learn!

Obviously, having data from a single weather balloon flight isn't enough for a pilot to calculate height from pressure. Maybe there is too much influence of the local conditions when we rely on experimental data only? In order to get a calculation with more solid foundations, we shall need a bit more theory.

So far we have considered temperature (in

Part ILet us see whether we can gain new insights when we explore the relation between temperature and pressure in Part III !

The following cell prints some basic status data from this notebook for re-use in other notebooks. Execute it and copy it's output into the input cell of another notebook, designated by a green border, or save it for later use in a text file.

print('temp =',temp) print('press =',press)

You may use the following cell for your own experiments.