Categories: Physics, Thermodynamic ensembles, Thermodynamics.

Canonical ensemble

The canonical ensemble or NVT ensemble builds on the microcanonical ensemble, by allowing the system to exchange energy with a very large heat bath, such that its temperature TT remains constant, but internal energy UU does not. The conserved state functions are the temperature TT, the volume VV, and the particle count NN.

We refer to the system of interest as AA, and the heat bath as BB. The combination A ⁣+ ⁣BA\!+\!B forms a microcanonical ensemble, i.e. it has a fixed total energy UU, and eventually reaches an equilibrium with a uniform temperature TT in both AA and BB.

Assuming that this equilibrium has been reached, we want to know which microstates AA prefers in that case. Specifically, if AA has energy UAU_A, and BB has UBU_B, which UAU_A does AA prefer?

Let cB(UB)c_B(U_B) be the number of BB-microstates with energy UBU_B. Then the probability that AA is in a specific microstate sAs_A is as follows, where UA(sA)U_A(s_A) is the resulting energy:

p(sA)=cB(UUA(sA))DDsAcB(UUA(sA))\begin{aligned} p(s_A) = \frac{c_B(U - U_A(s_A))}{D} \qquad \quad D \equiv \sum_{s_A} c_B(U - U_A(s_A)) \end{aligned}

In other words, we choose an sAs_A, and count the number cBc_B of compatible BB-microstates.

Since the heat bath is large, let us assume that UBUAU_B \gg U_A. We thus approximate lnp(sA)\ln{p(s_A)} by Taylor-expanding lncB(UB)\ln{c_B(U_B)} around UB=UU_B = U:

lnp(sA)=lnD+ln ⁣(cB(UUA(sA)))lnD+lncB(U)(d(lncB)dUB)UA(sA)\begin{aligned} \ln{p(s_A)} &= -\ln{D} + \ln\!\big(c_B(U - U_A(s_A))\big) \\ &\approx - \ln{D} + \ln{c_B(U)} - \bigg( \dv{(\ln{c_B})}{U_B} \bigg) \: U_A(s_A) \end{aligned}

Here, we use the definition of entropy SBklncBS_B \equiv k \ln{c_B}, and that its UBU_B-derivative is 1/T1/T:

lnp(sA)lnD+lncB(U)UA(sA)k(SBUB)lnD+lncB(U)UA(sA)kT\begin{aligned} \ln{p(s_A)} &\approx - \ln{D} + \ln{c_B(U)} - \frac{U_A(s_A)}{k} \Big( \pdv{S_B}{U_B} \Big) \\ &\approx - \ln{D} + \ln{c_B(U)} - \frac{U_A(s_A)}{k T} \end{aligned}

We now define the partition function or Zustandssumme ZZ as follows, which will act as a normalization factor for the probability:

ZsAexp(βUA(sA))=DcB(U)\begin{aligned} \boxed{ Z \equiv \sum_{s_A}^{} \exp(- \beta U_A(s_A)) } = \frac{D}{c_B(U)} \end{aligned}

Where β1/(kT)\beta \equiv 1/ (k T). The probability of finding AA in a microstate sAs_A is thus given by:

p(sA)=1Zexp(βUA(sA))\begin{aligned} \boxed{ p(s_A) = \frac{1}{Z} \exp(- \beta U_A(s_A)) } \end{aligned}

This is the Boltzmann distribution, which, as it turns out, maximizes the entropy SAS_A for a fixed value of the average energy UA\Expval{U_A}, i.e. a fixed TT and set of microstates sAs_A.

Because A ⁣+ ⁣BA\!+\!B is a microcanonical ensemble, we know that its thermodynamic potential is the entropy SS. But what about the canonical ensemble, just AA?

The solution is a bit backwards. Note that the partition function ZZ is not a constant; it depends on TT (via β\beta), VV and NN (via sAs_A). Using the same logic as for the microcanonical ensemble, we define “equilibrium” as the set of microstates sAs_A that AA is most likely to occupy, which must be the set (as a function of T,V,NT,V,N) that maximizes ZZ.

However, TT, VV and NN are fixed, so how can we maximize ZZ? Well, as it turns out, the Boltzmann distribution has already done it for us! We will return to this point later.

Still, ZZ does not have a clear physical interpretation. To find one, we start by showing that the ensemble averages of the energy UAU_A, pressure PAP_A and chemical potential μA\mu_A can be calculated by differentiating ZZ. As preparation, note that:

Zβ=sAUAexp(βUA)\begin{aligned} \pdv{Z}{\beta} = - \sum_{s_A} U_A \exp(- \beta U_A) \end{aligned}

With this, we can find the ensemble averages UA\Expval{U_A}, PA\Expval{P_A} and μA\Expval{\mu_A} of the system:

UA=sAp(sA)UA=1ZsAUAexp(βUA)=1ZZβPA=sAp(sA)UAV=1ZsAexp(βUA)UAV=1ZβVsAexp(βUA)=1ZβZVμA=sAp(sA)UAN=1ZsAexp(βUA)UAN=1ZβNsAexp(βUA)=1ZβZN\begin{aligned} \Expval{U_A} &= \sum_{s_A} p(s_A) \: U_A = \frac{1}{Z} \sum_{s_A} U_A \exp(- \beta U_A) = - \frac{1}{Z} \pdv{Z}{\beta} \\ \Expval{P_A} &= - \sum_{s_A} p(s_A) \pdv{U_A}{V} = - \frac{1}{Z} \sum_{s_A} \exp(- \beta U_A) \pdv{U_A}{V} \\ &= \frac{1}{Z \beta} \pdv{}{V}\sum_{s_A} \exp(- \beta U_A) = \frac{1}{Z \beta} \pdv{Z}{V} \\ \Expval{\mu_A} &= \sum_{s_A} p(s_A) \pdv{U_A}{N} = \frac{1}{Z} \sum_{s_A} \exp(- \beta U_A) \pdv{U_A}{N} \\ &= - \frac{1}{Z \beta} \pdv{}{N}\sum_{s_A} \exp(- \beta U_A) = - \frac{1}{Z \beta} \pdv{Z}{N} \end{aligned}

It will turn out more convenient to use derivatives of lnZ\ln{Z} instead, in which case:

UA=lnZβPA=1βlnZVμA=1βlnZN\begin{aligned} \Expval{U_A} = - \pdv{\ln{Z}}{\beta} \qquad \quad \Expval{P_A} = \frac{1}{\beta} \pdv{\ln{Z}}{V} \qquad \quad \Expval{\mu_A} = - \frac{1}{\beta} \pdv{\ln{Z}}{N} \end{aligned}

Now, to find a physical interpretation for ZZ. Consider the quantity FF, in units of energy, whose minimum corresponds to a maximum of ZZ:

FkTlnZ\begin{aligned} F \equiv - k T \ln{Z} \end{aligned}

We rearrange the equation to βF=lnZ\beta F = - \ln{Z} and take its differential element:

d(βF)=d(lnZ)=lnZβdβlnZVdVlnZNdN=UAdββPAdV+βμAdN=UAdβ+βdUAβdUAβPAdV+βμAdN=d(βUA)β(dUA+PAdVμAdN)\begin{aligned} \dd{(\beta F)} = - \dd{(\ln{Z})} &= - \pdv{\ln{Z}}{\beta} \dd{\beta} - \pdv{\ln{Z}}{V} \dd{V} - \pdv{\ln{Z}}{N} \dd{N} \\ &= \Expval{U_A} \dd{\beta} - \beta \Expval{P_A} \dd{V} + \beta \Expval{\mu_A} \dd{N} \\ &= \Expval{U_A} \dd{\beta} + \beta \dd{\Expval{U_A}} - \beta \dd{\Expval{U_A}} - \beta \Expval{P_A} \dd{V} + \beta \Expval{\mu_A} \dd{N} \\ &= \dd{(\beta \Expval{U_A})} - \beta \: \big( \dd{\Expval{U_A}} + \Expval{P_A} \dd{V} - \Expval{\mu_A} \dd{N} \big) \end{aligned}

Rearranging and substituting the fundamental thermodynamic relation then gives:

d(βFβUA)=β(dUA+PAdVμAdN)=βTdSA\begin{aligned} \dd{(\beta F - \beta \Expval{U_A})} &= - \beta \: \big( \dd{\Expval{U_A}} + \Expval{P_A} \dd{V} - \Expval{\mu_A} \dd{N} \big) = - \beta T \dd{S_A} \end{aligned}

We integrate this and ignore the integration constant, leading us to the desired result:

βTSA=βFβUA    F=UATSA\begin{aligned} - \beta T S_A &= \beta F - \beta \Expval{U_A} \quad \implies \quad F = \Expval{U_A} - T S_A \end{aligned}

As was already suggested by our notation, FF turns out to be the Helmholtz free energy:

FkTlnZ=UATSA\begin{aligned} \boxed{ F \equiv - k T \ln{Z} = \Expval{U_A} - T S_A } \end{aligned}

We can therefore reinterpret the partition function ZZ and the Boltzmann distribution p(sA)p(s_A) in the following “more physical” way:

Z=exp(βF)p(sA)=exp ⁣(β(F ⁣ ⁣UA(sA)))\begin{aligned} Z = \exp(- \beta F) \qquad \quad p(s_A) = \exp\!\Big( \beta \big( F \!-\! U_A(s_A) \big) \Big) \end{aligned}

Finally, by rearranging the expressions for FF, we find the entropy SAS_A to be:

SA=klnZ+UAT\begin{aligned} S_A = k \ln{Z} + \frac{\Expval{U_A}}{T} \end{aligned}

This is why ZZ is already maximized: the Boltzmann distribution maximizes SAS_A for fixed values of TT and UA\Expval{U_A}, leaving ZZ as the only “variable”.


  1. H. Gould, J. Tobochnik, Statistical and thermal physics, 2nd edition, Princeton.