# 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? May 11, 2015 at 8:57
• @Timo I dont mind if you do it a different way, I was just showing my thinking May 11, 2015 at 8:57

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$.
• @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$ May 13, 2015 at 2:12
• 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. May 13, 2015 at 13:23