# Finding $p(z), \rho(z)$ of an ideal classical gas in a box

We have a classical ideal gas of particles of mass $m$ at fixed chemical potential $\mu$ and fixed temperature $T$. We have a potential energy $U(z)=mgz$ and the gas is in a rectangular box of height $h$ and base area $A$. How do we calculate quantities like the pressure $p(z)$ and density $\rho(z)$?

I have calculated the grand partition function to be $$\mathcal{Z}(T,\mu,\mathbf{x})=\exp \left( e^{\beta\mu}\left( \frac{2m\pi}{\beta \hbar^2} \right)^{3/2}A(1-e^{-h}) \right)$$

So the grand potential will be $$\Phi=-k_BT\left[e^{\beta\mu}\left( \frac{2m\pi}{\beta \hbar^2} \right)^{3/2}A(1-e^{-h}) \right]$$

I thought this may be possible to do from $d\Phi=-SdT-Nd\mu+\mu dN-pdV$ as we have that $$\frac{\partial \Phi}{\partial V}=-p$$ but this doesnt seem very computable from the given and I have no reason to believe that $p$ will be a function of $z$ alone.

• you don't really have to do it this way, or you intentionally try to do it this way? Commented May 11, 2015 at 8:57
• @Timo I dont mind if you do it a different way, I was just showing my thinking Commented May 11, 2015 at 8:57

The density is directly given by \begin{equation*} \begin{split} \rho(z)&=\frac{\int dpAe^{-\beta(p^2/2m+mgz)}}{\int dp\int_0^hdzAe^{-\beta(p^2/2m+mgz)}}\\ &=\frac{e^{-\beta mgz}}{\int_0^hdze^{-\beta mgz}}=\frac{\beta mg}{1-e^{-\beta mgh}}e^{-\beta mgz} \end{split} \end{equation*} since the momentum is homogeneous throughout the system.

Suppose there are N particles in total, then starting from a height $z$ till the top $h$, the total gravitational force would be given by $$F(z)=\int_z^h dz' A\rho(z')Nmg$$ after which you can obtain the pressure to be $F(z)/A$.

EDIT: normally when we talk about chemical potential, we need to have a "particle bath", but in this case it's more favorable to think of it as a closed equilibrium system and therefore the grand partition approach is not so convenient.

• Could we have used the Maxwell Boltzmann distribution some how as well? Commented May 12, 2015 at 10:03
• Sorry I dont understand your the first half of your solution Commented May 12, 2015 at 10:19
• @sandstone the $\rho(z)$ is calculated based on the phase-space argument, which in this case already has the M-B distribution included, as you can see the Boltzmann factor inside the integration. The denominator is the total phase-space volume and the numerator is the sub-space volume with fixed $z$ and with all the other degrees of freedom $(x,y,p)$integrated over (you can see that $A$ is just the integration over $x$ and $y$). Consequently, the ratio gives the probability density for a particle being located at height $z$ Commented May 13, 2015 at 2:12
• Yes, this is a single-particle phase space, meaning each point in this phase space represents a possible state for a single particle and the phase space density (which is proportional to the Boltzmann factor) determines how likely a single particle will be found in that (p,q) state. This single particle approach works because the particles are assumed to be a non-interacting ideal gas, which means all the particles are independent from each other but each of them are governed by the same probability distribution given by the same single-particle phase space density. Commented May 13, 2015 at 13:20
• this is just like when you flip $N$ coins, you know that very likely you will get roughly half heads and half tails, because for each coin P(head)=P(tail)=1/2 and when the $N$ coins are tossed they are completely independent from each other. Commented May 13, 2015 at 13:23