# Calculating air density lapse with altitude (specifically, pressures)

This might be a bit more of an engineering question, but I'm calculating air density drop-off with altitude, and I'm having some problems calculating the pressure (I'll run through my method). This has been very useful in explaining, but the last bit lost me a little.

$$pV = nRT$$ and using $$\frac{\rho V}{n} = M$$ where M is molar mass, you can calculate density to be:

$$\rho = \frac{pM}{RT}$$ which implies a solution dependent only on pressure (p) and temperature (T).

Then define temperature using the Universal Standard Atmosphere lapse rate, $$T = T_0 - Lh$$ where L = 0.0065K/m and h is height in metres

Now at this point I'm a bit stuck. Wikipedia suggests the following equation:

$$p = p_0 \left(1 - \frac{L h}{T_0} \right)^\frac{g M}{R L}$$

Which, when calculated, provides values within a 5% tolerance - but where has it come from? I can't find any reference to its source or how it was derived. Can anyone help?

To derive it, you need to consider hydrostatic equilibrium for an air slab of thickness $dz$ at height $z$:

$$P(z+dz)A-P(z)A=-mg$$

where $m$ is the mass of air with cross-section area $A$ and height $dz$. For $dz<<z$, we can write:

$$P(z+dz)=P(z)+\dot{P}(z)dz$$

and substituting this in the first equation above finally gives:

$$dP=-\rho g dz$$ Using the definition of $\rho$ that you wrote in your post and solving the differential equation finally gives you the desired result.

If you work through page 5 to 12 of this document you will know where the term comes from.

It is a bit of a long story, but the short version is that you integrate the pressure over the height in a hydrostatic equilibrium equation that reads as follows:

$$\frac{dP}{P}=\frac{-g\cdot M}{R^*\cdot T}\cdot dZ$$

[Small pointer]: also note that $1-\frac{Lh}{T_0}=\frac{T}{T_0}$ according to your equation for the temperature.