# Example: The one atom gas

## Understanding the situation

With all the abstract talk about "microstates" and "macrostates" it's hard to see how the idea that systems spontaneously tend to states that minimizes their free energy actually tells you what a system is going to do. A very nice example was given in the February 2016 issue of The Physics Teacher* — a one atom gas.

While we're used to working with toy models to get insight, taking a one atom gas seems almost ridiculous.  But this highly simplified model allows you to see how the pieces of the free energy work with each other to give you a sensible result.

[It also illustrates a deep and highly technical result: you don't actually need a large number of particles to get a thermodynamic result if you have a chaotic system and can time average.**]

Let's work it through as a sample problem. We start with a simple problem that does not need us to use free energy.

## Part 1 of the sample problem: Force balance for a gas in a cylinder

A. Consider a system that consists of a gas of $N$ particles and mass $m$ in a sealed cylinder. Near the top of the cylinder is a piston of mass $M$, much heavier than an individual molecule. Above the piston is vacuum (so we don't have to bother always talking about "gauge-pressure", $p - p_0$). If there were no gas in the cylinder, the piston would slide down to the bottom, but since the molecules of the gas are moving fast, they create pressure and hold the piston up. The cylinder sits on a large metal block that keeps the cylinder and everything in it at a fixed temperature, $T$ ("heat sink").

When the system is at equilibrium, at what height, $h$, does the piston come to rest?

## Solving this problem

The force of gravity acts on the piston so it starts to slide down, but this compresses the gas in the part of the cylinder below increasing the pressure. When the pressure is high enough, it will exert an upward force that balances the piston's weight. Drawing a free body diagram for the piston, it feels a downward force of $Mg$ from the earth pulling on it by gravity and an upward force $pA$ from the gas pushing up on it. By Newton's 2nd law, the piston will be able to remain at rest when these forces balance:

$$pA = Mg$$

But we are asked for $h$. We have to rewrite our equation to show how the variables depend on $h$. The weight of the piston doesn't depend on $h$, but the pressure of the gas, $p$, does.

If the piston slides down to a different value of $h$, the pressure will change by the ideal gas law. The pressure is given by

$$pV = Nk_BT$$

Both $N$ and $T$ are fixed and given, and we know that $V=Ah$. Putting these into the ideal gas law we get

$$p(Ah) = Nk_BT$$

or

$$pA = Nk_BT/h$$

Putting this into our force balance equation gives

$$Mg = Nk_BT/h$$

Solving for h we get the equilibrium value of $h$

$$h = Nk_BT/Mg$$

That seems pretty straightforward.

But the example of the gas didn't seem to show much about free energy or entropy. It's not even clear where those concepts could have come in. But part of the issue is that when we consider a gas, we are mentally imaging (or should be) over many, many molecules hitting the piston very fast. We can't keep track of them so we mentally average, defining a stable quantity — the pressure — instead of thinking about the wildly fluctuating individual collisions of gas molecules with the piston that is holding it up.

To see the averaging explicitly — and to rewrite what we are doing in terms of free energy, let's consider as the second part of our problem the simplest possible example: the one atom gas.

## Part 2 of the sample problem: The one-atom gas and time averaging

B. Now imagine a single atom in the cylinder below the piston. It is much, much lighter than the piston ($m << M$), but it is moving very, very fast. Because the piston is so massive, it doesn't respond quickly. The one atom hits it very often before it has a chance to fall much. So we will look at the average of the effect of the one molecule on the piston. Since the force fluctuates so wildly, it is easier to consider averages in terms of energies.

The average energy of the system is the PE of the piston, the average KE of the molecule, and the average PE of the molecule:

$$U = Mgh + mg\langle y\rangle + \langle ½mv^2\rangle$$

(Remember that "$\langle...\rangle$ means "take the average of whatever's inside".) The average height of the molecule, $\langle y\rangle$, is probably about $½$ of $h$ — maybe a bit different since it's going faster below the middle and slower above it — but since $m << M$, we're going to neglect that term since whatever value we put in for $\langle y\rangle$, we'll have $Mgh >> mg\langle y\rangle$.

Divide the height into $B = h/L$ bins, where $L$ is a small distance. Considering each small bin of height as a possible microstate, calculate the free energy of the piston + molecule system, $F = U - TS$. Find what value of $h$ minimizes this free energy. (We use the Helmholtz free energy, $F$, rather than the Gibbs free energy, $G$, since we are considering the system as a function of volume instead of as a function of pressure.)

Let's start by calculating the entropy. We know Boltzmann's statistical definition of entropy: $S = k_B\ln W$, where $W$ is the number of microstates.

How many microstates are there? We've divided our height into $B$ bins. The molecule can be in each bin in two ways: going up or going down. So there are $2B = 2h/L$ microstates. So our entropy is
$$S = k_B\ln (2h/L).$$

What can we say about the average KE? Our KE is fluctuating wildly, but we know the temperature is constant, so its average must be fixed by that. Since there is only one direction, our analysis of kinetic theory tells us that

$$\langle ½mv^2\rangle = ½k_BT.$$

Putting these equations together, our free energy is

$$F = U - TS = Mgh + ½k_BT - k_BT \ln (2h/L).$$

Now we are asked to minimize $F$ as a function of $h$. Let's differentiate with respect to $h$ and set the result to 0.

$$\frac{dF}{dh} = \frac{d}{dh} \bigg( Mgh - k_BT \ln\frac{2h}{L} \bigg) = Mg - k_BT \frac{L}{2h} \big(\frac{2}{L}\big) = Mg - \frac{k_BT}{h}$$

{We've used the chain rule to differentiate the logarithm, but you can make it easier (if you are willing to suppress the units) by using $\ln (a/b) = \ln(a) - \ln(b)$. With this, $\ln(2h/L) = \ln(h) - \ln(2/L)$. When we take the derivative,
$d(\ln h)/dh = 1/h$ and the second term, a constant independent of $h$, has derivative 0.}

Setting this equal to 0 gives

$$Mg = \frac{k_BT}{h}$$

$$h = \frac{k_BT}{Mg}$$

This is the SAME result as we had from our pressure argument when we set $N = 1$.

From the structure of eq. (10), we can see here, however, how the tendency to reduce the free energy by making $h$ smaller (in the first term) is compensated by the need to make the entropy larger (in the second term) by making $h$ higher. The result seen from the energy side is a balance of the dependence on energy and entropy. Both the force and the energy analysis give the same result. Nice!

J. Prentis & M. Obsniuk, "Free energy in introductory physics," The Physics Teacher (2016) 91-95; doi: 10.1119/1.4940172

** In fact, it is a very deep and important result in advanced statistical physics that in many particle physical systems with the right characteristics (satisfied by most real physical systems), that the average over microstates gives the same result as the long time average of the system. This is known as the ergodic theorem.

Article 610
Last Modified: May 27, 2019