Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

2.3. Ensemble Averages

See also: Course-wide Conventions & Notation

Run the code: Notebook for Section 2.3, in which you can change and rerun the Python cells of this section in your browser.

Overview and Learning Objectives

Once microstate probabilities are known, thermodynamic properties follow as ensemble averages. This section derives canonical expressions for internal energy, heat capacity, and pressure in terms of derivatives of ln⁡Q\ln Q. A recurring theme is that fluctuations are not a nuisance—they encode response functions such as CVC_V. A response function measures how strongly a property of the system changes when a controlled variable changes; CVC_V is the response of UU to a change in TT.

Section 2.1 emphasized that macroscopic properties are expectation values of microscopic properties, with the expectation taken over the microstate probabilities. Section 2.2 derived the canonical probability distribution for a closed system’s microstates. Here, we connect these results by computing ensemble averages that determine macroscopic properties.

Learning objectives:

Core Ideas and Derivations

Thermodynamic Equilibrium

Recall from Section 1.1 that thermodynamic equilibrium is a state of simultaneous mechanical, thermal, and chemical equilibrium. Below are working definitions of each type of equilibrium:

Thermal contact
A state in which two systems can exchange energy.
Chemical contact
A state in which two systems can exchange matter.
Mechanical equilibrium
A state in which there are no unbalanced forces. Across a movable boundary, the pressure of the system equals that of its surroundings.
Thermal equilibrium
A state in which there is no net exchange of energy between systems in thermal contact.
Chemical equilibrium
A state in which there is no net exchange of matter between systems in chemical contact.

Internal Energy

The internal energy UU of a macroscopic system at thermodynamic equilibrium is defined as the ensemble average ⟨E⟩\langle E \rangle of the microstate energy EE:

U  =  ⟨E⟩  =  ∑i=1MEi pi,U \;=\; \langle E \rangle \;=\; \sum_{i=1}^M E_i\,p_i,

where EiE_i is the energy of microstate ii, pip_i is the probability of that microstate, and MM is the total number of microstates.

For the canonical ensemble, using the Boltzmann factor and the partition function QQ, we have

U  =  1Q∑i=1MEi e−βEi,U \;=\; \frac{1}{Q} \sum_{i=1}^M E_i\,e^{-\beta E_i},

where β=1/(kBT)\beta = 1/(k_{\mathrm B} T) and

Q  =  ∑i=1Me−βEi.Q \;=\; \sum_{i=1}^M e^{-\beta E_i}.

Partial Derivative of the Partition Function

Taking the partial derivative of QQ with respect to β\beta gives

(∂Q∂β)N,V=  ∑i=1M∂∂β(e−βEi)=  −∑i=1MEi e−βEi.\left(\frac{\partial Q}{\partial \beta}\right)_{N,V} =\; \sum_{i=1}^M \frac{\partial}{\partial \beta}\left(e^{-\beta E_i}\right) =\; -\sum_{i=1}^M E_i\,e^{-\beta E_i}.

Substituting this result into the expression for UU yields

U=  −1Q (∂Q∂β)N,V=  −(∂ln⁡Q∂β)N,V.U =\; -\frac{1}{Q}\,\left(\frac{\partial Q}{\partial \beta}\right)_{N,V} =\; -\left(\frac{\partial \ln Q}{\partial \beta}\right)_{N,V}.

Example: Two-State System

For a two-state system with energies E1E_1 and E2E_2, the partition function is

Qtwo-state=e−βE1+e−βE2.Q_{\text{two-state}} = e^{-\beta E_1} + e^{-\beta E_2}.

Then the internal energy is

Utwo-state=  −∂∂β ln⁡(e−βE1+e−βE2)=  E1 e−βE1+E2 e−βE2e−βE1+e−βE2,U_{\text{two-state}} =\; -\frac{\partial}{\partial \beta}\,\ln\left(e^{-\beta E_1} + e^{-\beta E_2}\right) =\; \frac{E_1\, e^{-\beta E_1} + E_2\, e^{-\beta E_2}}{e^{-\beta E_1} + e^{-\beta E_2}},

which is the ensemble average ⟨E⟩\langle E\rangle.

Figure 2.3.1 shows Utwo-stateU_{\text{two-state}}, measured from E1E_1, as a function of temperature for an energy gap of 0.01 eV0.01\ \mathrm{eV}, together with the heat capacity at constant volume, which the next subsection defines.

Source
Loading...

Figure 2.3.1:Two-state system with an energy gap E2−E1=0.01 eVE_2 - E_1 = 0.01\ \mathrm{eV} (10 meV10\ \mathrm{meV}) as a function of temperature. (a) Internal energy measured from E1E_1. The dashed line is its high-temperature limit, (E2−E1)/2(E_2 - E_1)/2. (b) Heat capacity at constant volume in units of kBk_{\mathrm{B}}.

Heat Capacity at Constant Volume

From Section 1.1, heat is energy transferred due to a temperature difference. The heat capacity at constant volume, CVC_V, measures how much heat is required to change a system’s temperature at fixed NN and VV:

CV  =  (∂U∂T)N,V.C_V \;=\; \left(\frac{\partial U}{\partial T}\right)_{N,V}.

Panel (b) of Figure 2.3.1 shows CVC_V for the two-state system.

Heat Capacity and Energy Fluctuations

In the canonical ensemble, the energy of the system is not fixed, because the system exchanges energy with the heat bath (Section 2.2); the internal energy U=⟨E⟩U = \langle E\rangle is its average. In statistics, the variance σX2\sigma_X^2 of a random variable XX is σX2=⟨(X−⟨X⟩)2⟩\sigma_X^2 = \langle (X - \langle X\rangle)^2\rangle. In statistical mechanics, σE2\sigma_E^2 quantifies fluctuations in the total energy:

σE2=  ⟨E2⟩−⟨E⟩2,\sigma_E^2 =\; \langle E^2\rangle - \langle E\rangle^2,

where ⟨E2⟩=∑i=1MEi2 pi\langle E^2\rangle = \sum_{i=1}^M E_i^2\,p_i. One can show that

σE2=  (∂2ln⁡Q∂β2)N,V=  kB T2 CV,\sigma_E^2 =\; \left(\frac{\partial^2 \ln Q}{\partial \beta^2}\right)_{N,V} =\; k_{\mathrm B}\,T^2\,C_V,

which implies

CV=  σE2kB T2.C_V =\; \frac{\sigma_E^2}{k_{\mathrm B}\,T^2}.

Fluctuations and System Size

How large are these fluctuations? For independent particles, both UU, measured from the lowest energy of the system, and CVC_V are proportional to the number of particles NN. The standard deviation σE=kBT2CV\sigma_E = \sqrt{k_{\mathrm B} T^2 C_V} is then proportional to N\sqrt{N}, so the width of the energy distribution relative to its mean falls as

σEU  ∝  1N.\frac{\sigma_E}{U} \;\propto\; \frac{1}{\sqrt{N}}.

Figure 2.3.2 shows this for NN independent two-state particles with E1=0E_1 = 0 and E2=εE_2 = \varepsilon. Each particle is in state 2 with probability p2p_2, so the number of particles in state 2 follows the binomial distribution, and

U=Nε p2,σE2=Nε2 p1p2,σEU=p1Np2.U = N \varepsilon\, p_2, \qquad \sigma_E^2 = N \varepsilon^2\, p_1 p_2, \qquad \frac{\sigma_E}{U} = \sqrt{\frac{p_1}{N p_2}}.

The energy of 10 particles is spread over a wide range around UU. For one mole of particles, σE/U\sigma_E/U is about 10-12. The energy of a macroscopic system in contact with a heat bath never stops fluctuating, but the fluctuations are far too small to measure, and this is why thermodynamics can speak of the internal energy of the system.

Source
Loading...

Figure 2.3.2:Energy of NN independent two-state particles with E1=0E_1 = 0 and E2=ε=0.01 eVE_2 = \varepsilon = 0.01\ \mathrm{eV} at 300 K300\ \mathrm{K}, the conditions of the worked example below. (a) Distribution of the energy per particle, E/NE/N, for three values of NN. Each distribution has an area of 1, and the dashed line marks U/N=4.04 meVU/N = 4.04\ \mathrm{meV}. (b) Relative width σE/U\sigma_E/U of the distribution against NN on logarithmic axes. The filled points are the three systems of panel (a), and the open point is one mole of particles.

The simulation in Figure 2.3.3 follows the same particles in time. In each step, a tenth of the particles exchange energy with the heat bath, so the energy EE of the system moves around its average UU. The simulation collects the energies that the system visits and compares them with the binomial distribution.

Figure 2.3.3:NN independent two-state particles with E1=0E_1 = 0 and E2=ε=0.01 eVE_2 = \varepsilon = 0.01\ \mathrm{eV} in contact with a heat bath. The energy per particle E/NE/N is shown in successive steps around U/NU/N, with a band that reaches one standard deviation σE/N\sigma_E/N to either side. The bars are the energies that the system has visited, and the line is the binomial distribution. The relative width σE/U\sigma_E/U is given as its exact value and as measured from the visited energies.

Three things to try:

  1. Increase the number of particles from 10 to 10,000 in steps, and compare how far the energy strays from UU in each system.

  2. Each time NN grows by a factor of 100, note the factor by which σE/U\sigma_E/U changes, and compare it with Eq. (2.3.18).

  3. Change the temperature at a fixed number of particles, and relate the changes of U/NU/N and of σE/U\sigma_E/U to the probabilities p1p_1 and p2p_2.

Pressure

The pressure follows from two results that are derived in later sections:

  1. A=−kB Tln⁡QA = -k_{\mathrm B}\,T\ln Q, where AA is the Helmholtz free energy (Section 4.3).

  2. P=−(∂A∂V)N,TP = -\left(\frac{\partial A}{\partial V}\right)_{N,T}, where PP is pressure (Section 5.1).

Combining these expressions gives

P=  kB T(∂ln⁡Q∂V)N,T.P =\; k_{\mathrm B}\,T \left(\frac{\partial \ln Q}{\partial V}\right)_{N,T}.

Section 2.5 applies this formula to NN particles in a cube and recovers the ideal gas law.

Worked Example

Two-state internal energy and heat capacity

Consider a two-state system with E1=0E_1=0 and E2=εE_2=\varepsilon. Let x≡βεx\equiv \beta\varepsilon.

  1. Partition function

    Q=1+e−x.Q=1+e^{-x}.
  2. Internal energy

    U=0⋅1+εe−x1+e−x=εe−x1+e−x.U=\frac{0\cdot 1+\varepsilon e^{-x}}{1+e^{-x}} =\varepsilon\frac{e^{-x}}{1+e^{-x}}.
  3. Heat capacity at constant volume

    Differentiate UU with respect to TT (holding NN and VV fixed). Using x=ε/(kBT)x=\varepsilon/(k_{\mathrm B}T) and dx/dT=−x/Tdx/dT=-x/T,

    CV=(∂U∂T)N,V=kB x2 e−x(1+e−x)2.C_V=\left(\frac{\partial U}{\partial T}\right)_{N,V} = k_{\mathrm B}\,x^2\,\frac{e^{-x}}{(1+e^{-x})^2}.
  4. Numerical illustration

    For ε=0.010 eV\varepsilon=0.010\ \mathrm{eV} at T=300 KT=300\ \mathrm{K}, x=0.3868x=0.3868 and e−x=0.6792e^{-x}=0.6792, so

    U=0.010 eV×0.67921.6792=4.04×10−3 eV,CVkB=(0.3868)2 0.67921.67922=3.60×10−2.U = 0.010\ \mathrm{eV}\times \frac{0.6792}{1.6792}=4.04\times 10^{-3}\ \mathrm{eV}, \qquad \frac{C_V}{k_{\mathrm B}}=(0.3868)^2\,\frac{0.6792}{1.6792^2}=3.60\times 10^{-2}.

Result. UU interpolates between 0 and ε/2\varepsilon/2, while CVC_V peaks when thermal energy is comparable to ε\varepsilon.

Concept Checks

  1. Why is UU obtained from a derivative of ln⁡Q\ln Q rather than from QQ directly?

  2. What does it mean physically when CVC_V is large? When it is small?

  3. In the two-state model, why does CV→0C_V\to 0 both as T→0T\to 0 and as T→∞T\to\infty?

  4. How do fluctuations in energy relate to the system’s ability to exchange heat with a reservoir?

Key Takeaways