Category:
Distribution function of molecules in presence of gravity is as function of height is derived.
Gas molecules in presence of gravity
\begin{align*}
E =& \frac{p^2}{2m}+mgz\\
f(\vec{r},\vec{p})=&Ad^3rd^3p\exp\left(-\beta\left(
\frac{p^2}{2m}+mgz\right)\right),
\end{align*}
The velocity distribution is obtained by integrating over volume, and is Maxwellian
\begin{align*}
P(z)dz=&\int dx\int dy\int d^3pf(\vec{r},\vec{p})\,(dz)\\
=& c^\prime\exp(-\beta mgz)dz\\
P(z) = & P(0)\exp(-\beta mgz)
\end{align*}
Probability of finding a molecule at height $z$ decreases exponentially with the height. The canonical partition is \(Z = \mathfrak{z}^N\) where
\begin{equation}
\mathfrak{z}=\left(\frac{2\pi}{\beta
m}\right)^{3/2}\left(\frac{A}{\beta mg}\right)\left(1-\exp(\beta
mgL)\right)
\end{equation}
is the single particle canonical partition function. Note that $Z$ is not a function of $V$ and hence $p$, being equal to $kt\frac{\partial}{\partial V}(mz)$, is not defined.