# Ideal Gases

In class you saw that the partition function for an ideal gas of $$N$$ particles was given by the following formula $\ln Z = N(\ln V + \ln Z_{\text{int}} - \ln N - \ln v_Q +1)\,,$ in terms of the internal partition function (which includes rotational, vibrational, and other degrees of freedom) and the so-called quantum volume, which is defined as $v_Q = \biggl(\frac{h}{\sqrt{2\pi mkT}}\biggr)^3\,.$ The quantum volume has the interpretation that it is roughly the volume occupied by one de Broglie wavelength of a particle with mass $$m$$ and kinetic energy $$kT$$. Therefore, it is the scale at which quantum effects become non-negligible.

The other two important expressions for an ideal gas are the ideal gas laws, $PV=nRT=NkT\,.$ From these formulas, you can easily take derivatives of the partition function with respect to $$kT$$ to obtain expressions for all of the thermodynamic quantities of interest such as energy, entropy, chemical potential, etc.

Let's review how these computations work by computing some of these quantities for a mole of Nitrogen molecules at room temperature and atmospheric pressure.

• What are the average total thermal energy, the average volume per particle, and the chemical potential?

At room temperature and atmospheric pressure, the vibrational and electronic degrees of freedom have "frozen out", meaning that they only occupy the lowest energy state with any substantial probability. Therefore, we don't need to include them in our calculations. On the other hand, the rotational and kinetic degrees of freedom can be treated in the high-temperature limit. There are two rotational degrees of freedom, so by the equipartition theorem, they both contribute $$NkT/2$$ in this approximation. Similarly, the three kinetic terms each contribute $$NkT/2$$ as well. Therefore the total energy is given by $U=\frac{3}{2}NkT+\frac{2}{2}NkT=\frac{5}{2}NkT=\frac{5}{2}nRT\,.$ Plugging in the numbers, this gives us

n = 1;
R = 8.31; % the ideal gas constant in J/mol K
T = 300; % temperature in K
U = 5/2*n*R*T

U =

6.2325e+03


The volume per particle is easy to compute from the ideal gas law.

P = 101325; % convert atm to N/m^2  (newtons per square meter)
kT = 4.14195*1e-21; % J (joules)

VonN = kT/P

VonN =

4.0878e-26


To compute the chemical potential we need to compute the rotational partition function and the quantum volume. Recall from our discussion of diatomic molecules that the partition function in the high-temperature limit is just $Z_{\text{rot}} = \frac{kT}{2\eps}\,.$ Here the factor of 1/2 comes from the fact that Nitrogen is a homonuclear molecule and we have to avoid double counting its energy states. For a Nitrogen molecule, we have the $$\eps$$ is about .25 meV, so therefore

eps = (.25*1e-3) * (1.602*1e-19); % J

Zint = kT/(2*eps)

Zint =

51.7097


The quantum volume is given by

h = 6.62607*1e-34; % J s
m = (2*14)*(1.66*1e-27); % mass of N_2 in kg

vQ = (h / sqrt(2*pi*m*kT) )^3 % in m^3

vQ =

6.9150e-33


All of these expressions together give us enough to compute the chemical potential using the formula $\mu = -kT\ln\biggl(\frac{VZ_{\text{int}}}{Nv_Q}\biggr)\,.$ Let's express it in eV as well, which is a more convenient unit.

mu = - kT * log(Zint * VonN / vQ) * 1/(1.602*1e-19) % in eV

mu =

-0.5052


## Equilibrium constants for chemical reactions

We can study the chemical equilibrium conditions associated to an ideal gas reaction using these methods and those from chapter 5.6 from the book. Consider the dissociation reaction of a hydrogen molecule into its constituent atoms, $\text{H}_2 \longleftrightarrow 2\text{H}\,.$ A necessary condition for a reaction to be in thermal equilibrium is for the chemical potentials of the reactants to balance a similar equation to the chemical reaction equation, namely $\mu_{\text{H}_2} = 2 \mu_{\text{H}}\,.$ If we rearrange this equation, plug in the formula for the chemical potential in terms of (partial) pressure, and solve for the ratio of pressures, then we get the formula for the equilibrium constant of the reaction, which in this case is given by $K = \frac{P^2_{\text{H}}}{P^\circ P_{\text{H}_2}}\,.$ Recall that $$P^\circ$$ is usually taken to be 1 bar. Although this is called a "constant", it is in fact a function of temperature, but since we are at equilibrium we can always work at a fixed value of the temperature.

We can now compute K from first principles using the methods of Boltzmann statistics and ideal gas laws. Let's take for granted, however, that the dissociation energy of hydrogen is 4.49 eV (as computed in problem 1.53 of the text). Then from the formulas for chemical potential, the equilibrium condition, and the dissociation energy, we have $-kT\ln\biggl(\frac{VZ_{\text{int}}}{Nv_Q}\biggr)\Bigg\vert_{\text{H}_2}-\eps_d = -2kT\ln\biggl(\frac{VZ_{\text{int}}}{Nv_Q}\biggr)\Bigg\vert_{\text{H}}\,,$ where $$\eps_d$$ is the dissociation energy. (This formula for the chemical potential can be found in Eq. 6.93 in the book, and is found by differentiating the Helmholtz free energy with respect to particle number.)

Why do we have a dissociation energy in this expression? This is because the partition function is calculated with respect to a reference potential energy. When there is only one energy in the problem, we can set the reference energy scale to be anything we like. The Boltzmann probability distribution is invariant under an energy shift. But when we are comparing two different energies, we have to take this shift into account.

We can simplify the above expression by realizing that the Hydrogen atom has almost no internal structure; the only states that contribute to its internal partition function are the degeneracies of its nuclear and electronic states. The hydrogen molecule has degeneracy in these states as well, and rotation and vibrational degrees of freedom too. Accurate accounting for these states together with a little bit of algebra yields $\frac{VZ_{\text{rot}}Z_{\text{vib}}}{N_{\text{H}_2} v_{Q,\text{H}_2}} \e^{\eps_d/kT} = \frac{V^2 4}{N_{\text{H}}^2 v^2_{Q,\text{H}}} \,.$

We can simplify this even further by plugging in the ratio of the quantum volume between the two types of hydrogen (we only need to add a factor of $$2^{3/2}$$), and putting everything in terms of pressure by using the ideal gas law, together with dividing by a reference pressure to make things dimensionless. The net result is $K=\frac{\sqrt{2}kT\e^{-\eps_d/kT}}{P^\circ v_{Q,\text{H}}Z_{\text{rot}}Z_{\text{vib}}}\,.$

Now recall that the rotational and vibrational partition functions are given by the formulas $Z_{\text{rot}} \approx \frac{kT}{2\eps_r} \quad \text{and}\quad Z_{\text{vib}} = \frac{1}{1-\e^{-\eps_v/kT}}$ respectively. Here the characteristic energies are given by $$\eps_{\text{rot}}$$ = 7.6 meV and $$\eps_{\text{vib}}$$ = 440 meV, and the rotational partition function expression is valid in the high-temperature limit. Plugging these expressions in and using the form of the quantum volume from above, we obtain $K=\frac{2^{3/2}\e^{-\eps_d/kT}\eps_r (1-\e^{-\eps_v/kT})}{P^\circ v_{Q,\text{H}}} = \frac{2^{3/2}\e^{-\eps_d/kT}\eps_r (1-\e^{-\eps_v/kT})}{P^\circ} \Biggl(\frac{2\pi m_{\text{H}}kT}{h^2}\Biggr)^{3/2}\,.$

Let's try to study this quantity. It is convenient to use a dimensionless temperature $$t$$ by dividing out room temperature of 300 Kelvin. $t = \frac{T}{300 \text{K}\,.}$

• Check that the expression for $$K$$ is equal to the following simplified formula
K = @(t) 34090 * t^(3/2) * (1-exp(-17.0/t)) * exp(-173.7/t) ;


As you can see, the last factor that comes from the dissociation energy is by far the dominant factor. At room temperature, the $$K$$ value is totally negligible, which implies that the hydrogen molecule is never dissociated in equilibrium.

Suppose instead that we are near the surface of the sun, with a temperature of approximately 6000 K, and suppose that the partial pressure of molecular hydrogen is 1 bar.

• Show that the partial pressure of atomic hydrogen is about 17 bar.
• By considering the relative pressures, what fraction of the hydrogen on the surface of the sun is dissociated?
t = 6000/300;
P_H2 = 1; % partial pressure of molecular Hydrogen in bar

P_H = sqrt(K(t)*1*P_H2) % partial pressure of atomic Hydrogen in bar

dissociated_fraction = 1 - (2*P_H2)/P_H

P_H =

17.1823

dissociated_fraction =

0.8836


# Gibbs factor

The Gibbs factor is is the generalization of the Boltzmann factor to the case where the number of particles in the system can change. As you saw in class, the probability of being in a state $$s$$ with energy $$E(s)$$ and $$N(s)$$ particles with chemical potential $$\mu$$ is proportional to the Gibbs factor, being $\P(s) = \frac{1}{\Z} \e^{-[E(s) - \mu N(s)]/kT} \,,$ where the grand partition function, $$\Z$$, is given by the requirement that all the probabilities sum to one, $\Z = \sum_s \e^{-[E(s) - \mu N(s)]/kT} \,.$

One uses the Gibbs factor and the grand canonical ensemble when a system is in both thermal and diffusive equilibrium with a reservoir.

## Semiconductors

A simple example of the grand partition function occurs in semiconductor materials such as phosphorus-doped silicon. Here a silicon crystal has a single lattice site replaced by a phosphorus atom which can easily "donate" an electron to the surrounding silicon lattice. Thus, phosphorus is called a donor, and the electron that is ionized away is called a conduction electron because it is the source of electrical current in the conducting phase of a semiconductor. If we let the ionization energy be $$\eps$$ and the chemical potential for the gas of conduction electrons be $$\mu$$, then we can write down the grand partition function for the system consisting of a single phosphorus ion.

There are three states total: a single ionized state with positive charge, and two degenerate un-ionized states with neutral charge. Remember: each electron has two spin states, that's why we need to count these as degenerate states in the partition function. The ionized state takes more energy than the un-ionized state, so it should have a higher energy. Let's set the energy of the ionized (higher energy) state to be zero. Then the grand partition function is $\Z = 1 \e^{0} + 2 \e^{-(-\eps-\mu \cdot 1)/kT} = 1 + 2 \e^{(\eps+\mu)/kT}\,.$

The fraction of ionized electrons is just $\P(\text{ionized}) = \frac{1}{1 + 2 \e^{(\eps+\mu)/kT}}\,,$ while the fraction of un-ionized (bound) electrons is $\P(\text{un-ionized}) = \frac{2 \e^{(\eps+\mu)/kT}}{1 + 2 \e^{(\eps+\mu)/kT}}\,,$ We can compute the fraction of electrons that are bound to the phosphorus donor from this equation given that we know the ionization energy and the chemical potential. Be careful, though: the chemical potential will in general depend on the temperature and it is not constant.

## Number fluctuations

Just like the analogous formulas for the average total energy using the canonical partition function, we can derive expressions for the averages and fluctuations of the number of particles using derivatives of the grand partition function.

• Check that the following formula correctly computes the average total number of particles, $\avg{N} = \frac{kT}{\Z} \frac{\partial \Z}{\partial \mu}\,.$

Two other relevant expressions are for the average number squared and the standard deviation $$\sigma_N$$ which are defined by $\avg{N^2} = \frac{(kT)^2}{\Z} \frac{\partial^2 \Z}{\partial \mu^2}\,,$ and (implicitly in terms of the square) $\sigma_N^2 = kT \frac{\partial \avg{N}}{\partial \mu}\,$ respectively.

For an ideal gas, the last formula simplifies greatly and we find that the standard deviation is just $$\sigma_N = \sqrt{\avg{N}}$$.