# Difference in vertical stratification of partial pressure due to gravity

Say you have a mixture of two ideal gases in the presence of gravity. There is a vertical pressure gradient on the mixture due to the force balance. This condition is required to prevent the entire gas from accelerating.

$$\frac{dP}{dz} = -g \rho$$

For a mixture of ideal gases the pressure is the sum of the partial pressure of the constituents as per Dalton's law, and I think I can write that the density is the sum of the densities of individual components. I will use variables for the number density $N$ and formula mass $m$.

$$P = P_1 + P_2$$

$$\rho = \rho_1 + \rho_2 = N_1 m_1 + N_2 m_2$$

The equation of state for an single ideal gas is quite simple, $\rho_i = P_i m_i / (RT)$. Since we're at equilibrium, I think I'm fine claiming that $T$ is the same for both of the gasses. I am interested in how the mass fraction of gas #2 changes with vertical position. Let's take a reference point, $z_0$, where this ratio is known. For the surface of the Earth, we can take this point to be sea level, and specify the question to ask what ideal gas laws predict the vertical concentration gradient of Oxygen in Nitrogen gas to be. This is my question.

$$\frac{dP}{dz} = -\frac{g}{RT} \left( P_1 m_1 + P_2 m_2 \right)$$

$$\frac{dP_1}{dz} = ?$$

$$\frac{dP_2}{dz} = ?$$

This question was inspired by the question Why does air remain a mixture?. Although not stated in the same words, I believe the conclusion of that question is effectively the following for the case of $m_2 > m_1$.

$$\frac{1}{P_1} \frac{dP_1}{dz} > \frac{1}{P_2} \frac{dP_2}{dz}$$

for clarity, rewritten with absolute value:

$$\frac{1}{P_1} \left| \frac{dP_1}{dz} \right| < \frac{1}{P_2} \left| \frac{dP_2}{dz} \right|$$

In other words, the ratio of the heavy constituent to the lighter constituent increases as you decrease in altitude.

I ask this question because I realized that although I could easily vocalize the phenomenon of the different vertical gradients of the constituents, I was woefully unequipped to identify the physical laws (is it free energy, really? you sure?), and their corresponding equations that would yield a solution. All the paths I take, again, help me vocalize this just fine, but don't lead to a useful formalization. I have a suspicion that if you take this back to collision theory, you may require the relative cross-sections of the interactions, $\sigma_{12}$, $\sigma_{11}$, and $\sigma_{22}$.

The easiest way would be to use statistical physics. Gases are effectively described with a one-particle distribution function:

$$f \sim \exp \left[-\frac{E}{kT} \right]$$

which leads to a spatial part of $f$ (concentration) in a uniform gravity field to be

$$n_i \sim \exp \left[-\frac{m_i g z}{kT} \right]$$

That's the easiest way to show that "the ratio of the heavy constituent to the lighter constituent increases as you decrease in altitude":

$$\frac{n_1}{n_2} \sim \exp \left[\frac{(m_2-m_1) g z}{kT} \right]$$

But you seem to be interested in some sort of thermodynamic derivation. You should understand that for it you need to know the form of energy and entropy of the substance in hand, you can't get these from thermodynamics itself.

For a simplicity assume the gases to be held in a cylinder of height $h$ and area $F$:

$$U = \sum \left[ C_i N_i T + F \int_0^h n_i(z) m_i g z \, dz \right]$$

$$S = \sum_i \left[S_{0i} + C_i N_i \ln T - F \int_0^h k \, n(z) \ln n_i(z) \, dz \right]$$

Thus Helmholtz free energy $U-TS$ is:

$$A = \sum_i \left[C_i N_i (T - T \ln T) - T S_{0i} + F \int_0^h n_i \left( m_i g z + k T \ln n_i \right) \, dz \right]$$

Note, that $T$, $F$ and $h$ are constant, as the overall number of particles $N_i$. Minimizing this functional will lead you to equations of the form:

$$m_i g z + k T \ln n_i = const_i$$

$$\mu_i + m_i g = const_i$$