Atmospheric Model

The basis of our simulation is a model of Earth’s atmosphere, of which there are several. The International Standard Atmosphere (ISA) is used by ICAO, is relatively simple, and accurate enough for our purposes.

The ISA is a mathematical model of the atmosphere that assumes a linear temperature gradient against altitude, and derives pressure and density from the ideal gas law and hydrostatic equilibrium.

Symbols used

Since the primary source upon which the models in this package are built from is the ISA, I will use the symbols defined in the paper that defined it.

from preamble import *
symbol_table
## WIP

Hydrostatic equation

Our model begins by noting that since the atmosphere is not floating away into space, nor sinking to the ground, it must be at equilibrium: all vertical forces must sum to zero. That is to say, it is at hydrostatic equilibrium. For a column of air in the atmosphere, the 3 forces we’ll model are from the surrounding air pressure - air pushing up from below, air pushing down from above - and the weight of the column of air itself:

\[ \require{action} \texttip{math}{tip} \]
\[ F_{below} + F_{above} + F_{weight} = 0 \]

Replacing with the definitions of pressure and weight gives us (For reasons that will become apparent, we will refer to the pressure at the base of the cylinder as \(P_b\) and the pressure at the top simply as \(P\)):

Eq((A*P_b) - (A*P) - (m*g), 0)
\[\displaystyle - A P + A P_{b} - g m = 0\]
# The mass of a column of air is its volume multiplied by its density:
# m = V * rho
_.replace(m, V*rho)
\[\displaystyle - A P + A P_{b} - V g \rho = 0\]
# The volume is its area multiplied by its height.
_.replace(V, A * h)
\[\displaystyle - A P + A P_{b} - A g h \rho = 0\]
# We can simplify by removing the area:
_ / A
\[\displaystyle P - P_{b} + g h \rho = 0\]
_.replace(P-P_b, diff(P))
\[\displaystyle P - P_{b} + g h \rho = 0\]
_.solve(P)
\[\displaystyle P = P_{b} - g h \rho\]

Ideal Gas Law

The first useful equation for us is the ideal gas law, which relates the pressure and volume of an ideal gas to it’s temperature. In short: as the temperature of a gas increases, it’s pressure and/or volume must also increase. It is commonly stated as \(PV = nR^*T\), but since it can be hard to count the number of molecules in some volume of gas, it is useful to transform into the molar form through some simple substitutions. The molar form is convenient in atmoshpheric science as we can more easily measure air pressure, temperature, and density.

# pV = nRT
ideal_gas_law = Eq(P * V, n * R_universal * T)
ideal_gas_law
\[\displaystyle P V = R^{*} T n\]
# The amount of substance in a thing is equivalent to its mass / molecular mass:
# n = m / M
ideal_gas_law.subs(n, m / M)
\[\displaystyle P V = \frac{R^{*} T m}{M}\]
# Density is defined as mass / volume:
# rho = m / V
_.solve(P).subs(m/V, rho)
\[\displaystyle P = \frac{R^{*} T \rho}{M}\]
# Finally, the specific gas constant of a gas is defined as the universal gas constant / molecular mass:
# R_sp = R / M
molar_gas_law = _.subs(R_universal/M, R)
molar_gas_law
\[\displaystyle P = R T \rho\]

Burst Altitude

The maximum diameter of a given balloon is given by its manufacturer. If we know the volume of gas that we’ve put into the balloon, we can use the ideal gas law to determine the pressure at which the balloon will burst.

r = symbols('r')

volume_of_sphere = Eq(V, Rational(4,3)*pi*r**3)
volume_of_sphere

foo = ideal_gas_law.subs(volume_of_sphere.lhs, volume_of_sphere.rhs)
display(foo)

solved = next(iter(solveset(foo, P)))

from sympy.printing.pycode import pycode

display(solved)
pycode(solved)
\[\displaystyle \frac{4 \pi P r^{3}}{3} = R^{*} T n\]
\[\displaystyle \frac{3 R^{*} T n}{4 \pi r^{3}}\]
'(3/4)*R^**T*n/(math.pi*r**3)'
from sympy import *

F_b, m, g = symbols('F_b m g')
rho, V, r = symbols('rho V r')
rho_air, rho_gas = symbols('rho_air rho_gas')

bouyancy = Eq(F_b, m*g)
bouyancy = bouyancy.subs({
    m: rho*V,
    rho: (rho_gas - rho_air),
    V: (Rational(4,3)*pi*r**3)
})

bouyancy
\[\displaystyle F_{b} = V g \left(- \rho_{air} + \rho_{gas}\right)\]

By SEA7 Aerospace
© Copyright 2021.

SymbolDescription
$A$Area
$C_{d}$Coefficient of drag
$D$Diameter
$F$Force
$F_{d}$Force of drag
$F_{g}$Force of gravity
$g$Acceleration due to gravity
$H$Geopotential height
$h$Geometric height
$P$Pressure
$P_{b}$Pressure at the base of an atmospheric layer
$M$Molecular mass
$m$Mass
$n$Amount of substance
$R^{*}$Universal gas constant
$R$Specific gas constant
$T$Thermodynamic temperature
$V$Volume
$v$Velocity
$\rho$Density