You are on page 1of 9

Lecture 5: Generalized Ensembles

5.1 Recommended textbook chapters for this section


• Chandler - Ch 3.5

5.2 Topics in this lecture


• Generalized ensembles

• Gibbs entropy

• Recipe for the generalized ensemble

5.3 Announcements
• Pset 1 due today, Pset 2 assigned today.

• Final exam: Tuesday, December 17, 10 AM - 12 PM

• Make up lecture: Wednesday, November 6, 1 PM - 2:15 PM

5.4 Generalized ensembles


5.4.1 Preliminary notes: natural variables
In the preceding three lectures, we presented derivations to describe the microcanonical (N V E)
and canonical (N V T ) ensembles. In each case, we found a relationship for a normalizing constant
for the probability that could be equated to a thermodynamic potential. What should also be
noticed, however, is that the thermodynamic potential corresponding to each statistical ensemble
is exactly the potential that has the same natural variables as the parameters held constant for each
microstate of the corresponding ensemble. Recall that we can write as the fundamental relation for
the entropy and its relationship to the microcanonical ensemble:

1 P µ
dS = dE + dV − dN (5.1)
T T T
S = kB ln Ω(N, V, E) (5.2)

1
University of Wisconsin-Madison Lecture 5
CBE 710, Fall 2019 - Prof. R. C. Van Lehn September 19, 2019

From inspection, we see that N V E are the natural variables of the entropy, and these are the
same parameters held constant for each microstate of the microcanonical ensemble. Similarly, we
can write for the Helmholtz free energy:

dF = −SdT − P dV + µdN (5.3)


F = −kB T ln Z(N, V, T ) (5.4)

Again, we see that N V T are the natural variables of the Helmholtz free energy, and these are
the same parameters held constant for microstate of the canonical ensemble. These observations
suggest that there may be some general recipe for relating the normalizing constant of a statistical
ensemble to a thermodynamic potential with corresponding natural variables.
Based on this reasoning, we might like to have statistical ensembles to solve a problem where
some other variable is held constant. This leads to the idea of deriving a generalized ensemble
- that is, a statistical ensemble appropriate for any system that permits the exchange of some
extensive variable with the environment. For example, consider the adsorption of a gas to a surface;
equilibrium is established when the chemical potential of the gas in the bulk is equal to the chemical
potential of the gas at the surface, and hence it would be intuitive to use a statistical ensemble
in which the chemical potential (rather than the number of particles) is fixed in each microstate.
While our example to date (polymer adsorption) has demonstrated that we can solve a particular
problem using any statistical ensemble, it is also apparent that solutions can be obtained more
easily if we choose an appropriate ensemble. Typically, it will be easier to solve problems if we
choose an ensemble with the same natural variables as the variables that are constant for the system
of interest. It is thus convenient to derive a generalized ensemble appropriate for any given set of
natural varables.

5.4.2 Derivation of the generalized ensemble


First, let us consider again the derivation of the canonical ensemble presented in the previous
lecture. We considered a single system embedded within a bath; the total combined system had
fixed N V E, but the energy of the system of interest was allowed to exchange with the energy
of the bath such that the system of interest and bath were instead at fixed temperature. Here,
will consider the same system, but now we assume that in addition to exchanging energy with
the environment the system can also exchange some extensive property X with the bath with the
associated work given by f dX. This notation matches the generalized definition of work from
Lecture 1. At equilibrium, the temperature of the bath is equal to the temperature of the system
and in addition the generalized force, f , is the same for the system and the bath since intensive
variables are equal at equilibrium. For example, f might be the chemical potential, µ, and X might
be the number of particles, N , in which case f dX = µdN would be chemical work. Alternatively, f
might be the negative pressure, −P , and X might be the volume, V , in which case f dX = −P dV
would be expansion-contraction work. Both forms of work will lead to similar partition functions,
motivating the derivation of a generalized ensemble.

2
University of Wisconsin-Madison Lecture 5
CBE 710, Fall 2019 - Prof. R. C. Van Lehn September 19, 2019

We can now follow the same derivation performed previously for the canonical ensemble to
obtain a partition function for this generalized system in which E and X can exchange between
the system and bath. We first write constraints reflecting the exchange of material between the
system and bath, recognizing again that the combined system is isolated and described by the
microcanonical ensemble:

ES + EB = ET = constant (5.5)
XS + XB = XT = constant (5.6)

The probability that the system samples a particular microstate with Ej and Xj (ignoring other
mechanical variables, such as the volume, V ) is written as:

ΩB (ET − Ej , XT − Xj )
pj (Ej , Xj ) = (5.7)
C1
As in the derivation of the canonical ensemble, this expression states that the probability of
finding the system in a particular microstate j is proportional to the number of microstates that
the bath can sample when the system is in microstate j with C1 as a normalization factor. We now
consider the subset of bath states in which the bath energy and value of X are fixed to the values
ET − Ej and XT − Xj respectively, so this subset of states is a microcanonical ensemble. We now
take the logarithm of both sides:

ln pj (Ej , Xj ) = ln ΩB (ET − Ej , XT − Xj ) − ln C1 (5.8)

Again assuming that EB  Ej and XB  Xj , we expand ln ΩB (ET − Ej , XT − Xj ) as a Taylor


series around the point where ET − Ej = ET and XT − Xj = XT (hence we Taylor expand in 2
variables, and ignore second-order and higher terms):

3
University of Wisconsin-Madison Lecture 5
CBE 710, Fall 2019 - Prof. R. C. Van Lehn September 19, 2019

 
∂ ln ΩB (ET − Ej , XT − Xj )
ln ΩB (ET − Ej , XT − Xj ) ≈ ln ΩB (ET , XT ) − Ej (5.9)
∂(ET − Ej ) X,V
 
∂ ln ΩB (ET − Ej , XT − Xj )
− Xj
∂(XT − Xj ) E,V
   
Ej ∂SB Xj ∂SB
= ln ΩB (ET , XT ) − − (5.10)
kB ∂EB X,V kB ∂XB E,V

We have substituted in expressions for the entropy of the bath microcanonical ensemble (for
the given values of the system energy and number of particles). So far the equations should all look
familiar. We can now write the fundamental relation in the entropy representation while adding
the generic work term f dX to obtain expressions for the two partial derivatives:

dE = T dS − P dV + f dX (5.11)
1 P f
dS = dE + dV − dX (5.12)
T
  T T
   
∂S ∂S ∂S
= dE + dV + dX (5.13)
∂E X,V ∂V E,X ∂X E,V

We thus see that:

 
∂SB 1
= (5.14)
∂EB X,V TB
 
∂SB fB
=− (5.15)
∂XB E,V TB

Substituting these relationships into the derivation above and letting TB = TS = T and fB =
fS = f by the conditions of equilibrium gives:

Ej f Xj
ln ΩB (ET − Ej , XT − Xj ) = ln ΩB (ET , XT ) − + (5.16)
kB T kB T
Substituting back into the original expression for the probability yields:

ln pj (Ej , Xj ) = ln ΩB (ET − Ej , XT − Xj ) − ln C1 (5.17)


Ej f Xj
= ln ΩB (ET , XT ) − + − ln C1 (5.18)
kB T kB T
   
Ej f Xj
∴ pj = C2 exp − exp (5.19)
kB T kB T
P
We now invoke the normalization condition pj = 1 to finalize the derivation:

   
E fX
exp − kBjT exp kB Tj
pj (Ej , Xj ) = P     (5.20)
microstates Ej f Xj
j exp − kB T exp kB T

4
University of Wisconsin-Madison Lecture 5
CBE 710, Fall 2019 - Prof. R. C. Van Lehn September 19, 2019

The partition function for the generalized ensemble, which we will give the symbol Φ is thus:
microstates    
X Ej f Xj
Φ= exp − exp (5.21)
kB T kB T
j
This general partition function looks quite similar to the canonical partition function except
that there is now the new work term appears in the exponential. Note one subtlety, here - we include
in this derivation terms for both the internal energy, E, and various work terms. When defining
a problem, you might think to include a work term as part of the energy, which would lead to
overcounting. Thus, when using the general ensemble approach, it is important that contributions
to the internal energy (e.g., translational degrees of freedom for particles) do not also include work
terms (e.g., expansion-contraction work) that are separately included in the partition function.

5.5 Thermodynamic connection for the generalized ensemble


Having established an expression for the generalized ensemble partition function, we can now derive
a relationship between a thermodynamic potential and this generalized partition function, just as
we have a relationship between the Helmholtz free energy and the canonical partition function.
Doing so requires a new definition of the entropy, referred to as the Gibbs entropy:
X
S = −kB pj ln pj (5.22)
j
You will shows this expression’s equivalence to the Boltzmann definition of the entropy on
Problem Set 2. We now have the expressions:

exp (−βEj ) exp (βf Xj )


pj (Ej , Xj ) = (5.23)
Φ
microstates
X
Φ= exp (−βEj ) exp (βf Xj ) (5.24)
j
X
S = −kB pj ln pj (5.25)
j

which we will use to derive a thermodynamic connection. Using the Gibbs entropy formula and
the expression for the probability of a microstate, we can write:

X
S = −kB pj ln pj (5.26)
j
h i h i
E fX

X exp − kBjT exp kB Tj
= −kB pj ln   (5.27)
Φ
X  Ej f Xj

= −kB pj − + − ln Φ (5.28)
kB T kB T
X  Ej  X  f Xj  X
= pj − pj + pj kB ln Φ (5.29)
T T
1X f X X
= pj Ej − pj Xj + kB ln Φ pj (5.30)
T T

5
University of Wisconsin-Madison Lecture 5
CBE 710, Fall 2019 - Prof. R. C. Van Lehn September 19, 2019

P P P
Here, we recognize that pj Ej = hEi, pj Xj = hXi, pj = 1 due to the normalization of
state probabilities, and ln Φ has no j dependence, so we can write:

hEi f hXi
S= − + kB ln Φ (5.31)
T T
T S = hEi − f hXi + kB T ln Φ (5.32)
∴ E − f X − T S = −kB T ln Φ (5.33)
h i h i
E fX
Thus,the generalized ensemble with partition function Φ = j exp − kBjT exp kB Tj is related
P

to thermodynamic variables via −kB T ln Φ = E − T S − f X. As a first consistency check, we


can see that if f = 0, the equation correctly reduces to −kB T ln Z = E − T S = F which is
the correct thermodynamic link between the canonical partition function and the Helmholtz free
energy (F = E − T S). We will use Σ to refer to this new “free energy” that we have defined:
Σ = E − T S − f X.
Let’s just check the self-consistency of this result by writing out thermodynamic relations. For
example, writing out the total derivative of Σ and substituting in the fundamental equation gives:

dΣ = dE − f dX − Xdf − T dS − SdT (5.34)


= (f dX − T dS − P dV ) − f dX − Xdf − T dS − SdT (5.35)
= −Xdf − SdT − P dV (5.36)
     
∂Σ ∂Σ ∂Σ
= dX + dT + dV (5.37)
∂f V,T ∂T X,V ∂V X,T
 
∂Σ
∴X=− (5.38)
∂f V,T

We can use this relationship to check that the thermodynamic connection between Φ and Σ is
accurate:

6
University of Wisconsin-Madison Lecture 5
CBE 710, Fall 2019 - Prof. R. C. Van Lehn September 19, 2019

 
∂Σ
X=− (5.39)
∂f V,T
 
∂ ln Φ
= kB T (5.40)
∂f V,T
 
kB T ∂Φ
= (5.41)
Φ ∂f V,T
  
   
kB T  ∂ X Ej f Xj 
= exp − exp (5.42)
Φ ∂f kB T kB T
j
V,T
   
kB T X Xj Ej f Xj
= exp − exp (5.43)
Φ kB T kB T kB T
j
h i h i
E fX

X exp − kBjT exp kB Tj
= Xj   (5.44)
Φ
j
X
= Xj pj (5.45)
j

= hXi (5.46)

Thus, this checks out - we correctly find that the ensemble average is equal to the thermodynamic
parameter via the relationship between Φ and Σ.

5.6 Recipe for the generalized ensemble


In the previous section, the thermodynamic potential that corresponds to the log of the generalized
enseble partion function is exactly that potential for which the thermodynamic variables conjugate
to E and X are held constant (i.e., the V T f ensemble in this generalized case). We have assumed
these variables as constant from the beginning of this derivation, but it is apparent that these are
the natural variables of the thermodynamic potential corresponding to E − T S − f X = Σ by
taking the derivative:

dΣ = dE − T dS − SdT − f dX − Xdf (5.47)


= T dS − P dV + f dX − T dS − SdT − f dX − Xdf (5.48)
= −P dV − SdT − Xdf (5.49)

Therefore, the thermodynamic potential Σ is at an extremum when V , T , and f are constant,


which defines them as the set of natural variables for this potential and this partition function. To
emphasize this point, we can also write the thermodynamic connection as:

−kB T ln Φ(V, T, f ) = Σ(V, T, f ) (5.50)


where Σ(V, T, f ) is the generalized thermodynamic potential that is a function of the natural
variables V T f .
This observation suggests a general recipe for deriving a generalized ensemble:

7
University of Wisconsin-Madison Lecture 5
CBE 710, Fall 2019 - Prof. R. C. Van Lehn September 19, 2019

• Determine the natural variables of the system (e.g., µ, V , T ) as the variables that are either
fixed due to the constraints of the system boundaries or are constant due to conditions of
equilibrium (i.e., intensive variables conjugate to extensive variables that can exchange with
the environment).

• Write a general partition function (Φ) of the form in Eq. 5.21, including all work terms that
correspond to extensive variables that can exchange with the environment.

• For each extensive variable that is able to exchange with the environment, substract the
product of the extensive variable and its conjugate variable from the internal energy E to
obtain a thermodynamic potential with the correct natural variables

• Equate −kB T ln Φ to the thermodynamic potential (Σ) that is a function of the same natural
variables.

• Derive other thermodynamic variables via appropriate derivatives of Σ.

The one caveat here is that for a system that can exchange energy with the environment, we
treat the extensive variable as the entropy, S, and substract T S from the internal energy, leading to
the canonical ensemble. This is due to the equivalence of the energy and entropy representations of
the fundamental equation. The other caveat, as noted above, is to ensure that you do not include
work terms in the expression for the energy of the system itself - that would be double counting
energies.

5.6.1 Example: the grand canonical ensemble


As a test of the generalized ensemble approach, we can derive the grand canonical ensemble, in
which the energy and number of particles of a system are allowed to vary while the volume and
temperature are held constant. Since N (conjugate to µ) and E (conjugate to 1/T ) can exchange
with the environment and V is fixed due to the constraints of the system boundaries, the natural
variables at equilibrium are µ, V and T . Here, µdN is the work term that corresponds to f dX in
the generalized ensemble, so we have that f = µ and X = N .
The partition function (using the symbol Ξ per convention for this ensemble) then has the form:

X
Ξ= exp [−βEj ] exp [βµNj ] (5.51)
j

The corresponding thermodynamic potential (using the symbol ΣG , with the subscript indicat-
ing the grand canonical ensmeble)is:

ΣG = E − T S − µN (5.52)
dΣG = −P dV − SdT − N dµ (5.53)

This potential, ΣG , is also sometimes called the grand potential. The total derivative emphasizes
that it has the correct natural variables (µ, V and T ). We can then equate this potential to the
partition function as:

ΣG = −kB T ln Ξ (5.54)

8
University of Wisconsin-Madison Lecture 5
CBE 710, Fall 2019 - Prof. R. C. Van Lehn September 19, 2019

which we can use to derive various relations. For example, the ensemble-average number of particles
in the system would be:

 
∂ΣG
hN i = (5.55)
∂µ V,T
 
∂ ln Ξ
= −kB T (5.56)
∂µ V,T

With explicit relations for Ej and Ni we could then derive the number of particles.

5.6.2 Example: the isobaric-isothermal ensemble


As another example, we can derive the isobaric-isothermal ensemble, in which the energy and
volume of a system are allowed to vary while the number of particles is held constant. In this case,
the natural variables at equilibrium are N , P and T and −P dV is the work term that corresponds
to f dX in the generalized ensemble.
The partition function (using the symbol ∆ per convention for this ensemble) then has the form:

X
∆= exp [−βEj ] exp [−βP Vj ] (5.57)
j

The corresponding thermodynamic potential is:

G = E − TS + PV (5.58)
dG = V dP − SdT + µdN (5.59)

This potential, G, is the Gibbs free energy, which is relevant at typical experimental conditions.
The total derivative emphasizes that it has the correct natural variables (N , P and T ). We can
then equate this potential to the partition function as:

G = −kB T ln ∆ (5.60)
which we can use to derive various relations. For example, the ensemble-average volume of the
system would be:

 
∂G
hV i = (5.61)
∂P T
 
∂ ln ∆
= −kB T (5.62)
∂P T

With explicit relations for Ej and Vi we could then derive the volume.
We now have discussed 4 explicit ensembles - microcanonical (N V E), canonical (N V T ), grand
canonical (µV T ), and isothermal-isobaric (N P T ), along with a generalized ensemble in which
additional work terms (e.g. corresponding to external electric/magnetic fields, for instance) can be
incorporated.

You might also like