You are on page 1of 46

The Partition Function and how it

"functions"
Michelle M. Francl
Bryn Mawr College
101 N. Merion Ave
Bryn Mawr, PA 19010 USA

mfrancl@brynmawr.edu

© Copyright 2005 by the Division of Chemical Education, Inc., American Chemical Society. All rights
reserved. For classroom use by teachers, one copy per student in the class may be made free of charge. Write to
JCE Online, jceonline@chem.wisc.edu, for permission to place a document, free of charge, on a class Intranet.
The author appreciates suggestions for improvement.

This notebook provides an introduction to the partition function for beginning physical chemistry students. Exercises
include an optional short exploration of Stirling's approximation and an investigation into the shape of the rotational-vibra-
tional spectrum of HCl. The notebook introduces the concept of a partition function, what information it might provide
about energy distribution within a system and how to extract that information. The first exercises could be used to intro-
duce statistical mechanics to students. The HCl spectrum exercise can serve as a capstone for a section on statistical
mechanics. Three exercises to test students' mastery of the material are included.

Keywords: statistical mechanics, Stirling's approximation, partition function, spectroscopic line intensities, vibrational
spectroscopy, HCl-DCl

Michelle M. Francl
Created: April 2000 1
Modified: November 2004
Introduction

Background

Huxley's diaphanous spot


I freely admit that, as a student, thermodynamics was not my favorite part of physical chemistry. To paraphrase St.
Augustine, it seemed as if “[thermodynamicists] have made a covenant with the devil to darken the spirit and confine man
in the bonds of hell.”[1] When I discovered statistical mechanics, it felt like a guilty pleasure. No longer did I flounder in a
morass of specialized conditions (“adiabatic or isothermal, no….wait – it’s against constant pressure”) and Maxwellian
partial derivatives in constant peril of violating the second law or some basic mathematical principle. Given the partition
function, I could cleanly compute any thermodynamic values I desired. Accurate absolute entropies were mine for the
calculating.

What exactly is a partition function? How are partition functions constructed? What (besides calculating accurate abso-
lute entropies of small molecules) is a partition function good for?

The partition function plays much the same role in statistical mechanics (or statistical thermodynamics) as does the wave
function in quantum mechanics. It serves as a compact store of information about a physical system that can be extracted

tion by integrating Ÿ y* HxL x yHxL „ x, the entropy can be computed from the partition function q using
using various mathematical operations. Just as the wave function y can be use to compute the average value of the posi-

NkT2
ÅÅÅÅÅÅ I ÅÅÅÅ
S=- ÅÅÅÅÅÅÅÅ
q
∑q
ÅÅÅÅÅ M + Nklnq.
∑T V

Certainly computing accurate entropies for small molecules is attractive to a certain type of student (me, for example), but
the power of statistical mechanics goes far beyond that. Statistical mechanics has the ability to explore systems as complex
as proteins [2] or as experimentally inaccessible as the creation of the universe [3]. One of Aldous Huxley's[4] characters
might have been describing the partition function when he wrote:

"The whole story of the universe is implicit in any part of it. The meditative eye can look through any single object and
see, as through a window, the entire cosmos. Make the smell of roast duck in an old kitchen diaphanous and you will have
a glimpse of everything, from the spiral nebulae to Mozart’s music and the stigmata of St. Francis of Assisi. The artistic
problem is to produce diaphanousness in spots, selecting the spots so as to reveal only the most humanly significant of
distant vistas behind the near familiar object." [5]

If we can bring a "meditative eye" to the partition function, we can create a diaphanous spot in the universe and bring the
infinite down to a human scale. The challenge for us is to learn how to see through the partition function to be able to gain
some perspective on the chemical landscape we see. In this notebook, we will see how to construct a partition function,
then explore partition functions of very simple systems to see how changes in the system parameters change the partition
function and finally use molecular partition functions to understand the shape of the HCl rotational-vibrational spectrum.

Augustine
[1] The actual quote is “..sive mathematici, sive quilibet impie divinantium, maxime dicentes vera, cavendi sunt, ne consortio daemoniorum
irretiant.” and is most often translated as “…beware mathematicians and all those who make empty prophecies, the danger already exists that
the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of hell.” From De Genesi ad
litteram. One should note that in the cultural context in which Augustine is writing, the purview of mathematicians, soothsayers and astrologers
overlapped quite strongly. In other places, Augustine writes quite favorably concerning mathematical principles. See, for example, chapter 17 of
Book II of Replies of Questions on Januarius, where he waxes eloquent on the theological virtues of triangular numbers. My

Michelle M. Francl
Created: April 2000 2
Modified: November 2004
choice of quote is faintly ironic, J. Williard Gibbs, widely considered the father of modern thermodynamics was well known for his impenetrable
prose, and was the son of a professor of sacred literature at Yale.

proteins in stat mech


[2] See "Molecular Driving Forces", K.A. Dill and S. Bromberg for the application of statistical mechanics to biological systems. A readable
recent paper apply these concepts would be T. Wieprecht, O. Apostolov, M. Beyermann, J. Seelig, "Thermodynamics of the a-Helix-Coil
Transition of Amphipathic Proteins In a Membrane Environment: Implications for the Peptide-Membrane Binding Equilibrium", J.Mol.Bio. 1999,
294, 785-794.

cosmology in stat mech


[3] A. Dalgarno, K. Kirby, and P. C. Stancil, "The Radiative Association of Li+ and H, Li and H+, and Li and H,'' Astrophysical Journal 458, 397
(1996).

huxley bio
[4] Aldous Huxley (1894–1963), British novelist, author of "Brave New World"

huxley quote
[5] Aldous Huxley, in Chapter 19 of Point Counter Point (1939). Huxley is writing as "Philip Quarles", and the diary entries are thought to be a
self-portrait of Huxley.

Michelle M. Francl
Created: April 2000 3
Modified: November 2004
Getting Started

à Note to the student

Questions and exercises are highlighted in grey boxes, you will get more from the exercise if you tackle these questions
explicitly rather than treating them as rhetorical devices than if you just hit "enter" and look at the graphs. If the question
asks you to explain or describe something, and you are working in a group, discuss the question with your partners, then
each write in your notebook what you agree on. Can't agree? Write down the points you can't settle and go back to your
text or course notes to try to sort it out. I have also included questions which ask you to sketch a graph in your notes, and
you may wonder why I don't simply recommend that you print out the graph, or look at it on the screen, after all, Mathemat-
ica does such a nice job of plotting. As you probably know, there are many ways to learn. Some people are auditory
learners, others visual, and still others are kinetic learners. Most of us use several such approaches as we master new skills
and concepts. Discussing the answers to questions engages the auditory process, sketching the graphs involves both
visual and kinetic approaches. Some of my students print out the raw notebook and write their notes and answers on this,
others do so on separate sheets of paper. Your instructor may have a preference, but whatever you do - write, frequently
and by hand! You are more likely to master and retain the concepts presented here.

If you are a Mathematica novice, don't panic. Even after using it for almost 15 years, I still feel like I've hardly scratched
the surface of what is possible and I am always discovering new and useful tidbits. If you work in groups, switch off
frequently who controls the keyboard -- lest one of you become more expert than the other. Finally, if you are a novice,
remember that Mathematica (like all computer languages) is picky -- for example it thinks that A[t] means find the value of
the function A given the value t, if you type A(t) instead, it will not understand you. If you get the dreaded "beep", have a
friend check your input (it's hard to see your own errors). The Mathematica tidbits below introduce various commands
that I found useful to solve the problems set out in this notebook. My students report that having examples to study and
modify is the best way to learn more about Mathematica. In the notebook, I've linked material in the "Mathematica
Tidbits" section to where it used. If you want a refresher, just click on the link and it will take you back to the appropriate
section. Finally, the help menu can be of assistance - many examples are given that you can edit for your own use.

At the end of this notebook, I've included three problems you can use to test your mastery of the material and a section
called "Culture of Chemistry." There is more to physical chemistry and the people who do it than you can find in any
physical chemistry textbook. See if you can find the physical chemistry in CSI or ER, or read a novel or short story that
features physical chemistry! If you want to see more "Culture of Chemistry" vignettes or a list of possible suggested
physical chemistry readings, check out the Resources for Teaching and Learning Physical Chemistry.

à Warming-up: Reading, Concepts to Know, Using Mathematica

What you might want to read before you start

The specific text references given below will provide the appropriate physical chemistry background, but you can also read
the section on statistical mechanics in any junior level physical chemistry text.

McQuarrie and Simon (1997): Ch. 17 pp. 693-713 and Ch. 18 pp. 737-746.

Atkins and dePaula 7th edition, (2002): Ch. 19 pp. 628-639 and Ch. 20 pp. 658-665

Michelle M. Francl
Created: April 2000 4
Modified: November 2004
What you should refresh before you start

It would be useful to refresh the following concepts and material: summation notation; series and their convergence; use
of logarithms and exponentials; the difference between an energy level and energy state (A level is a single value of the
energy, which may comprise one or more states, while an energy state is described by a particular wavefunction. For
example, the 2 px wavefunction describes a state, there are 3 states at the 2p energy level.); degeneracy (In the example just
given, the 2p level is 3-fold degenerate.); ground state and excited states; harmonic oscillator; rigid rotor.

The material also refers to the following concepts, but you need not have mastered them to use the notebook: selection
rules for vibrational and rotational transitions; degeneracy of rotational states, rotational temperature (Qrot ).

Mathematica tidbits
Mathematica tidbits
Comments
Mathematica is a sophisticated system for symbolic mathematics. Some commands that could be useful in solving the
problems embedded in this exercise are given below. These tidbits may not represent the most elegant methodology, or
even the most direct, and are almost certainly not the only way to use Mathematica to solve the problem. Remember, too,
that your head contains an extraordinarily sophisticated computing resource, don't forget to engage it when the situation
warrants. Sometimes it is easier to solve a simple piece of algebra, than to ask Mathematica to do it for you!

Comments have been placed directly in the Mathematica code in places where I thought they might be helpful in figuring
out why I approached something in a particular way, they are formatted as

(* THIS IS A COMMENT *)
packages, Graphics, Legends
è Useful packages

The two packages invoked here allow you to add legends to plots and to make bar graphs. See the Mathematica help
browser for more information about options to use with these commands The key here is that you need to load the pack-
ages before you use any of the commands in them. If you try the command first, then load the package, Mathematica gets
somewhat confused. I've set these as initialization cells (under the Cell/Cell Properties menu) to guarantee this.

In[1]:= << Graphics`Legend`


<< Graphics`Graphics`

spelling errors
è Turning off spelling errors

Often I don't want to see this error, particularly when reminding me that when I say "sec" (and mean seconds) I really don't
mean "secant" or "Sec".... I have this error report to "off" by default. If you find it helpful you can turn it on using

In[3]:= Off@General::spell1D
Off@General::spellD

I have this error report to "off" by default.If you find it helpful you can turn it on using

In[3]:= On@General::spell1D
On@General::spellD

Variables, using
è Assigning values to variables

Michelle M. Francl
Created: April 2000 5
Modified: November 2004
Want R to always be 8.314? (The ; keeps Mathematica from echoing the value. You can take it out and it will do the same
thing.)

In[61]:= R = 8.314;

Need to check the value of variable, just type its name

In[62]:= R
Out[62]= 8.314

Change your mind? Clear the variable out and reset it.

Clear@RD
R = 8.314 ê 4.184
In[63]:=

Out[64]= 1.98709

Just need the value of A to be specified in this one place? use /.

In[65]:= A + 18 ê. A → 4
Out[65]= 22

You can even use the /.substitution syntax with Plot and other more complex commands

In[66]:= Plot@Cos@A xD ê. A → 4, 8x, −Pi, Pi<D


1

0.5

-3 -2 -1 1 2 3

-0.5

-1
Out[66]= Graphics

You can specify multiple variables using the substitution syntax.

In[67]:= A + B ê. 8A → 4, B → 3<
Out[67]= 7

Functions
è Defining and using functions

Note the := format and use of the underscore only on the left hand side.

Standard functions are capitalized (Sin, Cos, etc.)

Michelle M. Francl
Created: April 2000 6
Modified: November 2004
Log[x] is natural log

Log[10,x] is log base 10

In[68]:= B@t_D := Hk1 ê Hk2 − k1LL HExp@−k1 tD − Exp@−k2 tDL Ao

In[69]:= Psi@x_, n_D := H2 ê aL ^ 1 ê 2 Sin@Hn Pi xL ê aD

To evaluate a function at a particular value, type the value(s) in the brackets

In[70]:= Sin@PiD
Out[70]= 0

In[71]:= Exp@−InfinityD
Out[71]= 0

è!!!
In[72]:= Sqrt@2D
Out[72]= 2

In[73]:= Psi@a ê 2, 1D
1
Out[73]=
a

To see the definition of a function (either a Mathematica built-in or one you have defined)

In[74]:= ? Exp
Info3303633162-1589036
Exp@zD is the exponential function. More…

In[75]:= ? Psi
Info3303633162-8325660
Global`Psi

H L Sin@ n aπ x D
Info3303633162-8325660
1 2 1
Psi@x_, n_D := 2 a

è Labeling graphs: labeling the x, y axes and the overall plot


Physical chemistry instructors frequently have a bee in their bonnets about labeling graphs! Mathematica makes it easy to
do that, and it's good to get into the habit of doing so, even when you are making graphs purely for your own pleasure.
You can label both the abscissa and the ordinate.

Michelle M. Francl
Created: April 2000 7
Modified: November 2004
Plot@x2 , 8x, −4, 4<, AxesLabel → 8"x", "y"<D
Label, Axes
In[88]:=

15

12.5

10

7.5

2.5

x
-4 -2 2 4
Out[88]= Graphics

You can also label the overall plot

Plot@x2 , 8x, 0, 4<, AxesLabel → 8"x", "y"<, PlotLabel −> "y=\!\Hx\^2\L"D


Plot label
In[89]:=

y y=x2

15

12.5

10

7.5

2.5

x
1 2 3 4
Out[89]= Graphics

MultipleLineGraphs, color, dashed lines, legends


è Multiple graphs on the same plot: How to use color, dashed lines, and legends

Michelle M. Francl
Created: April 2000 8
Modified: November 2004
, x2 =, 8x, −4, 4<E
1
In[90]:= PlotA9x,
x

10

-4 -2 2 4

-5

-10

Out[90]= Graphics

Notice that it is hard to tell which curve is which? Use colors to distinguish the three. Hue[0] is red, Hue[.3] is green and
Hue[.6] is blue (think ROYGBIV as you vary the value input to Hue from 0 to 1).

, x2 =, 8x, −4, 4<, PlotStyle −> 88Hue@0D<, 8Hue@.3D<, 8Hue@.6D<<E


1
In[91]:= PlotA9x,
x

10

-4 -2 2 4

-5

-10

Out[91]= Graphics

Still confused? Add a legend.

Michelle M. Francl
Created: April 2000 9
Modified: November 2004
, x2 =, 8x, −4, 4<, PlotStyle −> 88Hue@0D<, 8Hue@.3D<, 8Hue@.6D<<,
1
In[92]:= PlotA9x,
x
PlotLegend → 9"x", " ", "x2 "=, LegendPosition → 81.1, −.4<E
1
x

10
x
5
1
x
-4 -2 2 4
-5 x2

-10

Out[92]= Graphics

Printer doesn't do color? You're color blind (both my sons are so I'm sensitive to this!)? Use dashes and solid lines.

, x2 =, 8x, −4, 4<,


1
In[93]:= PlotA9x,

PlotStyle → 8GrayLevel@0D, Dashing@8.03<D, Dashing@80.01<D<,


x

PlotLegend → 8"x", "\!\H1\êx\L", "\!\Hx\^2\L"<, LegendPosition → 81.1, −.4<E

10
x
5
1
x
-4 -2 2 4
-5 x2

-10

Out[93]= Graphics

To try: Plot Sin[x], x2 and x4 on the same graph from -p to p using dashed lines and then using colors ranging from
blue to violet. Be sure to label the axes and use a legend. Answer.

Tables
è Tables

Sometimes, rather than graphing a function, you want to see its value at a few points in tabular form. Mathematica uses
the Table command to do this

Make a table (or list) of the values of the function x2 for integers ranging from 1 to 10.

squares = Table@x2 , 8x, 1, 10<D


81, 4, 9, 16, 25, 36, 49, 64, 81, 100<
In[3]:=

Out[3]=

If you'd prefer the output in column format use TableForm

Michelle M. Francl
Created: April 2000 10
Modified: November 2004
Table formatting
In[4]:= TableForm@squaresD
Out[4]//TableForm=
1
4
9
16
25
36
49
64
81
100

You can make list of pair (or triples or...) as well

In[6]:= squares = Table@8x, x2 <, 8x, 1, 10<D


TableForm@squaresD
881, 1<, 82, 4<, 83, 9<, 84, 16<, 85, 25<,
86, 36<, 87, 49<, 88, 64<, 89, 81<, 810, 100<<
Out[6]=

Out[7]//TableForm=
1 1
2 4
3 9
4 16
5 25
6 36
7 49
8 64
9 81
10 100

You can even put headings on the columns

In[8]:= TableForm@squares, TableHeadings → 8None, 8"integer", "square"<<D


Out[8]//TableForm=
integer square
1 1
2 4
3 9
4 16
5 25
6 36
7 49
8 64
9 81
10 100

Michelle M. Francl
Created: April 2000 11
Modified: November 2004
To try: Make a table of the first 10 numbers in the series xn = xn+1 . Answer.

Summation
è Sums
Summing up multiple terms requires a syntax similar to the table syntax. To add the first 10 squares together use

In[34]:= Sum@x2 , 8x, 1, 10<D


Out[34]= 385

To try: St. Augustine notes that the sum of the first 17 numbers (which can be arrayed in a triangle) is 153. Is he
right? Answer.

BarGraphs
è Bar Graphs

When looking at a distribution of discrete data, a bar chart can be useful. To use this package, you must have loaded the
Graphics`Graphics` package (which is done automatically when this notebook is loaded).

Make a bar chart of the squares of the first ten integers

In[6]:= squares = Table@x2 , 8x, 1, 10<D;

In[9]:= BarChart@squares, AxesLabel −> 8"integer", "squares"<,


PlotLabel → "Squares of the integers 1−10"D

squares Squares of the integers 1−10


100

80

60

40

20

integer
1 2 3 4 5 6 7 8 9 10

Out[9]= Graphics

Suppose you had wanted different labels for each data set. Using the data given for physical chemistry students per year at
Bryn Mawr College, a bar chart can be made by

Michelle M. Francl
Created: April 2000 12
Modified: November 2004
PChemStudents =
8832, 1998<, 87, 1999<, 820, 2000<, 821, 2001<, 818, 2002<, 825, 2003<<;
In[14]:=

BarChart@PChemStudents, AxesLabel → 8"year", "#Students enrolled in p−chem"<D

#Students enrolled in p−chem


30
25
20
15
10
5
year
1998 1999 2000 2001 2002 2003

Out[15]= Graphics

Fancy Bar Graph


If we wanted to be really fancy, we could track the number of students in p-chem, biochem and inorganic chemistry each
year. Alas, putting a legend and year labels on this graph is a bit more difficult and I've punted on that score.

ChemStudents = 830, 7, 18, 21, 20, 25<;


Inorganic = 825, 10, 15, 17, 16, 20<;
In[10]:=

Biochem = 840, 12, 18, 16, 20, 12<;


BarChart@ChemStudents, Inorganic,
Biochem, AxesLabel → 8"year", "#Students enrolled"<D

#Students enrolled
40

30

20

10

year
1 2 3 4 5 6

Out[13]= Graphics

I didn't care for the colors, so changed them using the BarStyle command.

Michelle M. Francl
Created: April 2000 13
Modified: November 2004
ChemStudents = 830, 7, 18, 21, 20, 25<;
Inorganic = 825, 10, 15, 17, 16, 20<;
In[14]:=

Biochem = 840, 12, 18, 16, 20, 12<;


BarChart@ChemStudents, Inorganic,
Biochem, AxesLabel → 8"year", "#Students enrolled"<,
BarStyle → 8Hue@.15D, Hue@.1D, Hue@0D<D

#Students enrolled
40

30

20

10

year
1 2 3 4 5 6

Out[17]= Graphics

To try: The average temperature in degrees Fahrenheit in Bryn Mawr during the academic year (by month) is:
September 68.8 ; October 57.2; November 47.1; December 38.4; January 32.3; February 34.8; March 43.2; April 53.1;
May 63.5. Make a bar chart (labeled with the months on the abscissa) of the temperatures. Answer.

Warm up problems

The following problems give you a chance to ramp-up for the longer, more complex exercises that follow. Click on the
answer link to see the solution.

WU-1 A function has the form p(x)=HaLx xx+1ê2 ‰x . What would the function lnp(x) be? Answer.

WU-2 How many atoms (to an order of magnitude) are in a nanogram of C60 ? Answer.

i 1 moles y i 2 MolesAtoms y i 23 y
H10−9 gramsL j
j z
zjj10 z
zjj10 z
z êê N
atoms
k 10 grams { k {k MolesAtoms {
In[7]:=
1 moles
Out[7]= 1. × 1015 atoms

There are on the order of 1015 atoms in 1 nanogram of buckminsterfullerene.

WU-3 Graph ‰-1êT as a function of T from T=300 to T=1000. Sketch (by hand) what the graph of ln(‰-1êT ) versus T
would look like over the same range. Answer.

Michelle M. Francl
Created: April 2000 14
Modified: November 2004
In[5]:= Plot@ −1êT
, 8T, 300, 1000<, AxesLabel → 8"T", "qHtL"<D

qHtL
0.999

0.9985

0.998

0.9975

T
400 500 600 700 800 900 1000

Out[5]= Graphics

WU-4 Does the summation ⁄¶x=1 ‰


-x
converge? Compute the first 10 terms. Compute the summation truncating at 10
terms. How many terms must you consider before the value doesn't change by more than 0.01? Answer.

In[30]:= Table@ −x
, 8x, 1, 9<D

9 =
1 1 1 1 1 1 1 1 1
Out[30]= , 2
, 3
, 4
, 5
, 6
, 7
, 8
, 9

In[33]:= Sum@ −x
, 8x, 1, 90<D êê N
Out[33]= 0.581977

Goals

Goals

When you finish this exercise, you will be able to explain what significance the magnitude of the partition function has and
how the partition function can be used to describe the distribution of energy in a system. You will be able to compute the
partition function for a system given the energy levels and their degeneracies, either as a list or a formula. You will be able
to use the partition function to calculate the population distribution.

Objectives
Objectives

After completing this workbook you will be able to:

é compute the partition function using explicit summation given the energy levels and their degeneracies, either as a list or
a formula

Michelle M. Francl
Created: April 2000 15
Modified: November 2004
é make decisions about when to truncate an infinite summation when computing the partition function

é explain what the magnitude of the partition function means

é predict how the partition function will change with temperature

é predict how changing the temperature affects the population distribution computed from the partition function

é predict how the distribution of energy levels (their degeneracy and spacing) affects the partition function

é predict how the distribution of energy levels (their degeneracy and spacing) affects the population distribution computed
from the partition function

é compute the percentage of the population in a given energy level given the partition function and the energy and degener-
acy of the level

é explain the relationship between the population of an energy level and the intensity of the spectroscopic line arising
from transitions from that level

é write a Mathematica notebook to compute the partition function by explicit summation

Test yourself

When you have completed the exercise, you can test your mastery of the material by doing the two "test yourself" exercises
provided under "Reprise and Revise"

Going further

Interested in more information? Check out the additional reading under "Reprise and Revise"

Workbook

1. Stirling's approximation

Stirling's approximation is key to deriving a useful form for the partition function. Using it simplifies differentiating n!.
The usual form given in physical chemistry textbooks for Stirling's approximation is ln n! > n ln n - n for large n. A
footnote in Atkins and dePaula (7th edition, 2002) on page 631 comments that this form is a simplification of a more
complex expression for the approximation: n!>H2 pL1ê2 nn+1ê2 ‰-n . Compare the two approximations to see why the more
complex (and presumably more accurate) one is relegated to a footnote.

1. Both approximations are considered "good" for large n? So, how large is large? Compare the two approximations
for ln n! with the true value for n=10, 100, 1000, 10000. Do (by hand) the one step derivation to find an expression
for ln n! for the more complex version of Stirling's approximation. For each approximation, at what n is the value
within 0.01% of the true value? (I'm arbitrarily defining 0.01% as "good"!)

Michelle M. Francl
Created: April 2000 16
Modified: November 2004
2. Roughly, what is the order of magnitude of n (the number of particles) for most chemical applications? What is the
order of magnitude of the smallest value of n you might imagine using for a chemical application? For n on these
orders of magnitude, do you see any advantage in using one form of Stirling's approximation over another? Why do
you think ln n! > n ln n - n is the form most often used in the derivation of the most probable configuration?

In[169]:= stirSimple@n_D := n Log@nD − n


i 1 y
Log@2 πD + j
jn + z
z Log@nD − n
1
k 2 {
stirComplex@n_D :=
2

n = 100;
stirSimple@nD êê N
In[171]:=

stirComplex@nD êê N
n !;
Log@%D êê N
Print@"StirSimple is different by ",
100 H% − %%%%L ê %, "% Hrelative to true valueL"D
Print@"StirComplex is different by ",
100 H%% − %%%%L ê %%, "% Hrelative to true valueL"D
Clear@
nD
Out[172]= 360.517
Out[173]= 363.739
Out[175]= 363.739
StirSimple is different by 0.885897% Hrelative to true valueL
StirComplex is different by 0.000229101% Hrelative to true valueL

Michelle M. Francl
Created: April 2000 17
Modified: November 2004
2. The partition function: creating a diaphanous spot in the universe

GSzeroInQ, Partition function by explict summation


The partition function plays a central role in statistical mechanics, very similar to the role played by the wavefunction in
quantum mechanics. To use Huxley's analogy the partition function lets us push through an infinite amount of informa-
tion to create a finite, interpretable perspective - a diaphanous spot we can peer through to understand something about the
infinite universe. Less poetically, the partition function is a compact description of the way (on average) energy is distrib-
uted in a system. In order to compute a partition function, you need to know the energies of all the possible states of the
system. Energies of states can be measured experimentally, or calculated using quantum chemical techniques. We will
consider examples of both below. The general form of the partition function is q(T)=⁄i ‰-Ei êkT where the summation is
over all the possible states of the system and k is Boltzmann's constant. There may be an infinite number of states, which
though it may prove calculationally challenging, doesn't stop us from using the summation notation. The energies are all
taken to be relative to the ground state, which is generally defined to be zero.

Each state counts as a term, so if there are degenerate energy levels, there will be duplicate terms in the summation. The
general form of the partition function is sometimes written to include the degeneracy explicitly: q(T)=⁄i ‰-gi Ei êkT where
gi is the degeneracy of the ith energy level. Be careful when computing partition functions using the explicit summation
formulas to be sure that you are accounting for any energy degeneracies.

Chemists generally don't calculate the value of the partition function itself , but instead the function is usually used to
compute either the population distribution over various states or various thermodynamic properties. But to begin we will
focus on the value of the partition function and what that can tell us, as well as the population distributions computed from
the partition function. The probability of finding a system in a particular state is given by ‰-Ei êkT /q(T). Watch out! If one
wishes to know the probability of a system having a particular energy and there are degenerate states, the probabilities of
each degenerate state must be summed.

two level systems

à Two-level systems

Consider a system consisting of two energy states: 0 and E1 where E1>0.


Question 3

3. Let E1=200 k (where k is Boltzmann's constant) and T=298 K. Compute the value of the partition function and
find the probability of being in the ground state and in the excited state. Verify that the sum of the two probabilities is
1!

In[185]:=
0 êHk TL
+ −200 k êHk TL
ê. T → 298 êê N
Out[185]= 1.51113

0 êHk TL
ê. T → 298 êê N
0 êHk TL −200 k êHk TL
In[186]:=
+
Out[186]= 0.661759

Michelle M. Francl
Created: April 2000 18
Modified: November 2004
ê. T → 298 êê N
−200 kêHk TL

0 êHk TL −200 k êHk TL


In[199]:=
+
Out[199]= 0.49995

0 êHk TL
ê. T → 298 êê N
−200 kêHk TL

0 êHk TL −200 k êHk TL 0 êHk TL −200 k êHk TL


In[190]:= +
+ +
Out[190]= 1.

4. Using the same system as in Question 3 compute the probability of being in the ground state as a function of
temperature from T=0 K to T=1000 K. Make a rough sketch of the graph on a separate sheet of paper, sketch by hand
on that graph the probability of being in the excited state. What happens at high temperature? At low temperature?
Suggest an explanation of the behavior at the two extremes. What do you think the probability of being in the ground
state would be at infinite temperature?

0 êHk TL
, 8T, 0, 2000<,
0 êHk TL
+ −200 k êHk TL
In[194]:= PlotA

AxesLabel → 8"T in K", "prob in GS"<, PlotRange → 80, 1<E

prob in GS
1

0.8

0.6

0.4

0.2

T in K
500 1000 1500 2000

Out[194]= Graphics

5. Consider what happens when the two states are spaced very far apart, say 2000 k at 298 K. Without doing any
calculations using Mathematica estimate the value of the partition function in this case as well as the probability of
being in the ground state. Write a brief explanation of how you arrived at your estimate. Now use Mathematica to
confirm your estimate! In general, what do you think a partition function value of 1 means? Can the value of the
partition function ever be less than 1?

In[201]:=
0 êHk TL
+ −2000 k êHk TL
ê. T → 298 êê N
Out[201]= 1.00122

0 êHk TL
ê. T → 298 êê N
0 êHk TL −2000 k êHk TL
In[200]:=
+
Out[200]= 0.998785

Michelle M. Francl
Created: April 2000 19
Modified: November 2004
degeneracy
Degeneracy

5. How does degeneracy affect the partition function and the population distribution? Consider the case where the
ground state is 3-fold degenerate and the excited state is non-degenerate and has energy 2000 k. Without doing any
calculations using Mathematica estimate the value of the partition function in this case as well as the probability of
having the energy be 0. Write a brief explanation of how you arrived at your estimate. Now use Mathematica to
confirm your estimate!

In[202]:=
0 êHk TL
+ 0 êHk TL
+ 0 êHk TL
+ −2000 k êHk TL
ê. T → 298 êê N
Out[202]= 3.00122

0 êHk TL
ê. T → 298 êê N
3
0 êHk TL 0 êHk TL 0 êHk TL −2000 k êHk TL
In[203]:=
+ + +
Out[203]= 0.999595

6. What can you conclude about how to interpret the magnitude of the partition function?

7. Write a general expression using summation notation for the probability of being in a g-fold degenerate energy
level.

multi-level systems

à Multi-level systems

Many of the systems chemists encounter have an infinite number of energy levels (for example, the harmonic oscillator).

evenly spaced systems


Systems with even spacing of energies (& no degeneracy to complicate matters!) and an infinite
number of states

Consider a system with an infinite number of energy states, each e higher in energy that the previous state. (In the har-
monic oscillator system, e would be hn.) Do we need to explicitly consider all the terms? How does changing the tempera-
ture affect the population distribution? How does changing the spacing affect the partition function and the population
distribution?

8. At 298 K, taking the energy spacing between levels to be 100 k, compute the first 30 terms of the partition
function. What do you notice about each term? Will this always be true?

Table@ −100 k i êHk TL


, 8i, 0, 29<D ê. T → 298 êê N
81., 0.71493, 0.511125, 0.365419, 0.261249, 0.186775, 0.133531, 0.0954652,
In[210]:=

Out[210]=
0.068251, 0.0487947, 0.0348848, 0.0249402, 0.0178305, 0.0127476,
0.00911361, 0.00651559, 0.00465819, 0.00333028, 0.00238092, 0.00170219,
0.00121695, 0.000870033, 0.000622013, 0.000444695, 0.000317926,
0.000227295, 0.0001625, 0.000116176, 0.0000830579, 0.0000593806<

Michelle M. Francl
Created: April 2000 20
Modified: November 2004
Question9

9. At 298 K, taking the energy spacing between levels to be 100 k, compute the partition function, truncating the
summation at 30 terms. How many (or few) terms do you need to use if you want the value of the partition function
to be invariant to 3 decimal places? Will you need to consider more terms or fewer terms at higher temperatures?
Explain your answer.

TableA‚ −100 k i êHk TL


ê. T → 100 êê N, 8n, 5, 100, 5<E
n−1
In[37]:=

H∗I' m computing it in increments of 5 terms,


i=0

so the first is the sum of 5 terms,


second is truncated after 10 terms, etc. so there is less to print out∗L
Out[37]= 81.57132, 1.5819, 1.58198, 1.58198, 1.58198, 1.58198,
1.58198, 1.58198, 1.58198, 1.58198, 1.58198, 1.58198, 1.58198,
1.58198, 1.58198, 1.58198, 1.58198, 1.58198, 1.58198, 1.58198<

Question 10

10. What happens when the spacing between energy levels increases? Graph the partition function as a function of
temperature from 100K to 1000K for a spacing of 100k and a spacing of 1000k.

PlotA9‚ −100 k i êHk TL


,‚ −1000 k i êHk TL
=, 8T, 100, 1000<,
20 20
In[13]:=

AxesLabel → 8"T", "qHTL"<, PlotStyle → 8GrayLevel@0D, Dashing@80.02<D<,


i=0 i=0

PlotLegend → 8"ε=100k", "ε=1000k"<, LegendPosition → 81.1, −.4<E

qHTL

8
6
ε=100k
4
ε=1000k
2
T
200 400 600 800 1000
Out[13]= Graphics

Question 11

11. At 298 K, taking the same energy spacing to be 100k, compute the probability of being in the first 10 states. Use a
bar graph to display the results. Truncate the partition function after 40 terms (why do you think I choose that
value?).

Michelle M. Francl
Created: April 2000 21
Modified: November 2004
In[222]:= n = 10;
−100 k j êHk TL
, 8j, 0, n − 1<E ê. T → 298 êê N,
⁄i=0 −100 k i êHk TL
BarChartATableA
40

BarLabels → Table@i, 8i, 0, n − 1<DE


Clear@
nD

0.25

0.2

0.15

0.1

0.05

0 1 2 3 4 5 6 7 8 9

Out[223]= Graphics

12. What happens to the distribution among states as you change the temperature? Using the same spacing as in
question 9 compare the distributions at T=300K , 500, 700Kand 900K. Use a bar graph to display the results. (The
courageous wishing to do this on one graph might look here for some hints). Qualitatively sketch the graph. Should
you truncate the partition function in a different place at different temperatures (see question 9 )? On the same graph,
sketch by hand what you think the distribution in these states should be at 2000K.

Michelle M. Francl
Created: April 2000 22
Modified: November 2004
In[273]:=
−100 k j êHk TL
, 8j, 0, n − 1<E ê. T → 300 êê N,
⁄40
n = 10; BarChartATableA
−100 k i êHk TL
i=0
−100 k j êHk TL
, 8j, 0, n − 1<E ê. T → 400 êê N,
⁄i=0 −100 k i êHk TL
TableA
40

−100 k j êHk TL
, 8j, 0, n − 1<E ê. T → 500 êê N
⁄i=0 −100 k i êHk TL
TableA
50

H∗COMMENT: needed additional terms here ∗L,


−100 k j êHk TL
, 8j, 0, n − 1<E ê. T → 600 êê N,
⁄i=0 −100 k i êHk TL
TableA
100

−100 k j êHk TL
, 8j, 0, n − 1<E ê. T → 700 êê N,
⁄i=0 −100 k i êHk TL
TableA
100

BarStyle → 8Hue@.5D, Hue@.3D, Hue@.15D, Hue@.1D, Hue@0D<H∗COMMENT:


color choices are such that blue is cooler and red warmer temps∗L,
BarLabels → Table@i, 8i, 0, n − 1<DE
Clear@
nD

0.25

0.2

0.15

0.1

0.05

0 1 2 3 4 5 6 7 8 9

Out[273]= Graphics

Michelle M. Francl
Created: April 2000 23
Modified: November 2004
In[264]:= n = 10;
−100 k j êHk TL
, 8j, 0, n − 1<E ê. T → 2000 êê N,
⁄i=0 −100 k i êHk TL
BarChartATableA
175

BarLabels → Table@i, 8i, 0, n − 1<DE


Clear@
nD

0.04

0.03

0.02

0.01

0 1 2 3 4 5 6 7 8 9

Out[265]= Graphics

13. What happens to the distribution among states as you change the spacing? Consider the population in the first ten
states when the spacing is very close (say 10 k) and when it is significantly larger (perhaps 1000 k) than our "standard"
spacing of 100 k. Use a temperature of 298 K and pay attention to truncation of the summation. Use a bar graph or
table to display the results. Whichever you choose, sketch the bar graph by hand and indicate which bars correspond
to which spacing. How does changing the spacing affect where you have to truncate the summation?

Michelle M. Francl
Created: April 2000 24
Modified: November 2004
In[286]:=
−10 k j êHk TL
, 8j, 0, n − 1<E ê. T → 298 êê N,
⁄400
n = 10; BarChartATableA
−10 k i êHk TL
i=0
−100 k j êHk TL
, 8j, 0, n − 1<E ê. T → 298 êê N,
⁄i=0 −100 k i êHk TL
TableA
400

−1000 k j êHk TL
, 8j, 0, n − 1<E ê. T → 298 êê N,
⁄i=0 −1000 k i êHk TL
TableA
40

BarLabels → Table@i, 8i, 0, n − 1<DE


Clear@nD

0.8

0.6

0.4

0.2

0 1 2 3 4 5 6 7 8 9
Out[286]= Graphics

degneracy
What happens when states are degenerate?

Consider a system where the energy levels are degenerate, and where the degeneracy increases with increasing energy. (An
example of such a system is the rigid rotor.)

14. Consider a system where the spacing is constant, e, and the degeneracy of the jth level is j+2. Sketch by hand an
energy level diagram of the first 4 levels. Take the spacing between levels to be 100 k and compute the populations in
the first 10 energy levels (not states) and the temperature to be 298 K. Be sure to pay attention to truncation of the
summation. Make a bar chart of your results. Compare this to the distribution you obtained in question 11. What do
you notice? Can you explain why the two distributions differ? Does increasing or decreasing the temperature change
the shape? Sketch the distribution at high temperature.

Michelle M. Francl
Created: April 2000 25
Modified: November 2004
In[24]:= n = 10;
Hj + 2L −100 k j êHk TL
, 8j, 0, n − 1<E ê. T → 20000 êê N,
⁄i=0 Hi + 2L −100 k i êHk TL
BarChartATableA
100

BarLabels → Table@i, 8i, 0, n − 1<DE


Clear@
nD

0.0025

0.002

0.0015

0.001

0.0005

0 1 2 3 4 5 6 7 8 9

Out[25]= Graphics

What happens when the spacing between levels is not constant?

Consider a system where the spacing increases as the energy increases (for example, the particle in a one dimensional box).

15. Consider a system where the energy of the nth state is given by , n2 e where n = 0, 1, 2....Sketch by hand an energy
level diagram of the first 4 levels. Take e to be 100 k and compute the populations in the first 10 states at a
temperature of 298 K. As always, be sure to pay attention to truncation of the summation. Make a bar chart of your
results. Compare this to the distribution you obtained in question 10. What do you notice? Can you explain why the
two distributions differ? Does increasing or decreasing the temperature change the shape? Sketch the distribution at
high temperature.

In[30]:= energy@n_D := n ^ 2 ε

Table@ −100 k i^2 êHk TL


, 8i, 0, 10<D
81,
In[32]:=

<
−100êT −400êT −900êT −1600êT
Out[32]= , , , ,
−2500êT −3600êT −4900êT −6400êT −8100êT −10000êT
, , , , ,

Table@energy@jD, 8j, 0, 10<D ê. ε → 100 k


80, 100 k, 400 k, 900 k, 1600 k, 2500 k, 3600 k, 4900 k, 6400 k, 8100 k, 10000 k<
In[31]:=

Out[31]=

Michelle M. Francl
Created: April 2000 26
Modified: November 2004
In[33]:= n = 10; ε = 100 k;
−100 k j^2 êHk TL
, 8j, 0, n − 1<E ê. T → 298 êê N,
⁄i=0 −100 k i^2 êHk TL
BarChartATableA
100

BarLabels → Table@i, 8i, 0, n − 1<DE


Clear@
nD
0.5

0.4

0.3

0.2

0.1

0 1 2 3 4 5 6 7 8 9
Out[34]= Graphics

e
16. Consider a system where the energy of the nth state is given by , - ÅÅÅÅ
n2
ÅÅ where n = 1,2,3.... (think the one electron
atom problem!) Sketch by hand an energy level diagram of the first 4 levels. Take e to be 100 k and compute the
populations in the first 10 states at a temperature of 298 K. (I know you know, but...., be sure to pay attention to
truncation of the summation.) Remember that the partition function is defined such that the lowest energy state is zero.
Since the definition I gave for the energy has a non-zero ground state, you will have to subtract the energy of the
ground state from each energy when you compute the wavefunction or probabilities.

Make a bar chart of your results. Compare this to the distribution you obtained in question 11 and the question above.
What do you notice? Does increasing or decreasing the spacing change the shape? Describe the changes.

Table@−100 k ê i ^ 2 + 100 k, 8i, 1, 10<D êê N


80., 75. k, 88.8889 k, 93.75 k, 96. k,
In[78]:=

Out[78]=
97.2222 k, 97.9592 k, 98.4375 k, 98.7654 k, 99. k<

Michelle M. Francl
Created: April 2000 27
Modified: November 2004
In[91]:= n = 10; ε = 500 k;
−H−εê j^2+εL êHk TL
, 8j, 1, n<E ê. T → 298 êê N,
⁄i=1
BarChartATableA
100 −H−εê i^2 +εLêHk TL

BarLabels → Table@i, 8i, 0, n − 1<DE


Clear@
nD

0.05

0.04

0.03

0.02

0.01

0 1 2 3 4 5 6 7 8 9

Out[92]= Graphics

3. Using the partition function to estimate spectroscopic line intensities


for simple diatomics

à Harmonic oscillator model for vibration


harmonic oscillator partition function
Assuming that the vibration of a diatomic molecule can be adequately described by a harmonic oscillator model, the
vibrational energy levels are evenly spaced with spacing hn. In part two we used explicit summation to compute the

the infinite summation. The harmonic oscillator vibrational partition function for a diatomic is given by qvib HTL = ÅÅÅÅÅÅÅÅ
partition function for an infinite set of evenly spaced energy levels, but in fact, we can find an analytical, closed form for
1
ÅÅÅÅÅÅÅÅ
1-‰-hnêkT
ÅÅÅÅÅ .
Here we explore the distribution of vibrational energy in a series of diatomic molecules.

Michelle M. Francl
Created: April 2000 28
Modified: November 2004
TableSpecData, data for diatomics
Vibrational and rotational spectroscopic constants for some diatomic molecules

constants, useful formulae


Constants
c = 2.998 × 1010 cm ê sec

h = 6.626 × 10-34 J - sec

k = 1.381 × 10-23 J ê K

Useful formulae

DE=hn

n= ÅÅÅÅlc

17. Does the vibrational partition function for HCl ever get to be much larger than 1? If so, under what conditions?
Are these conditions likely to be encountered in the physical chemistry teaching laboratory? Plot qvib as a function of
temperature, and sketch it in your notebook. What is the high temperature limit? What is the meaning of this limit?

In[162]:= h = 6.626 10 ^ −34;


k = 1.381 10 ^ −23;
c = 2.998 10 ^ 10;

In[165]:= h
Out[165]= 6.626 × 10−34

1
In[134]:= qvib@T_D :=
1− −Hh nuVibLêHk TL

Be sure to use correct units, in this case, nuVib must be in Hz; data taken from table above

Michelle M. Francl
Created: April 2000 29
Modified: November 2004
In[181]:= Plot[qvib[T]/.nuVib→8.97 10^13,{T,298,5000},AxesLabel->{"T","partition
function"}]

partition function

1.7
1.6
1.5
1.4
1.3
1.2
1.1
T
1000 2000 3000 4000 5000

Out[181]= Graphics

18. For which of the molecules in the table above would you expect the partition function to be largest at 500 K?
Which should be about the same as HCl? Don't do any calculations with Mathematica! Will this be true at all
temperatures? Draw on your experience with Question 10 above. If you like, plot the partition functions as a function
of temperature all on the same graph.

qvib@500D ê. nuVib → 8.97 10 ^ 13 H∗HCl∗L


qvib@500D ê. nuVib → 1.68 10 ^ 13 H∗Cl2∗L
In[210]:=

qvib@500D ê. nuVib → 9.36 10 ^ 13 H∗H2∗L


qvib@500D ê. nuVib → 1.32 10 ^ 14 H∗D2∗L
Out[210]= 1.00018
Out[211]= 1.24916
Out[212]= 1.00013
Out[213]= 1.

Michelle M. Francl
Created: April 2000 30
Modified: November 2004
In[193]:= Plot[{qvib[T]/.nuVib->8.97 10^13,qvib[T]/.nuVib→1.68 10^13,qvib[T]/.nuVib→
9.36 10^13,qvib[T]/.nuVib→1.32
10^14},{T,298,5000},PlotStyle->{Hue[0],Hue[.2],Hue[.4],Hue[.6]},AxesLabel->{
"T","partition
function"},PlotLegend->{"HCl","Cl2","H2","D2"},LegendPosition->{.5,.15}]

HCl

Cl2
partition function
H2
2.2
2 D2
1.8
1.6
1.4
1.2
T
1000 2000 3000 4000 5000

Out[193]= Graphics

19. Compute the percentages of the populations in the first 10 vibrational states of HCl at 300K.
Do you think you need to worry about "hot bands" (excitations from excited states)?
How hot does it have to get before one needs to consider the excited states if a 1% population is ‘significant’?
Are any excited states beyond the first one ever significantly populated at room temperature?
At a given temperature, would hot bands be more likely to occur for HCl or Cl2 ? Without doing any
Mathematica calculations make a prediction and explain it. Compute the percentages in the first excited state at 300K
for all four of the diatomics in the table above to verify your prediction.

−Hi h nuVibLêHk TL
In[214]:= PercentInIthState@i_, T_D :=
qvib@TD

Michelle M. Francl
Created: April 2000 31
Modified: November 2004
Table@8i, 100 PercentInIthState@i, 1000D ê. nuVib −> 8.97 10 ^ 13<, 8i, 0, 9<D;
TableForm@%, TableHeadings → 8None, 8"state", "% of pop"<<D
In[229]:=

Out[230]//TableForm=
state % of pop
0 98.6483
1 1.33346
2 0.0180249
3 0.000243649
4 3.29348 × 10−6
5 4.45192 × 10−8
6 6.01781 × 10−10
7 8.13449 × 10−12
8 1.09957 × 10−13
9 1.48632 × 10−15

Table@8i, 100 PercentInIthState@i, 300D ê. nuVib −> 8.97 10 ^ 13,


100 PercentInIthState@i, 300D ê. nuVib → 1.68 10 ^ 13,
In[233]:=

100 PercentInIthState@i, 300D ê. nuVib → 1.32 10 ^ 14,


100 PercentInIthState@i, 300D ê. nuVib → 9.36 10 ^ 13<, 8i, 0, 9<D;
TableForm@%, TableHeadings → 8None,
8"state", "% HCl", "% Cl2", "% H2", "% D2"<<D
Out[234]//TableForm=
state % HCl % Cl2 % H2 % D2
0 99.9999 93.1906 100. 100.
1 0.0000588353 6.34573 6.78539 × 10−8 0.0000315321
−11 −17
2 3.4616 × 10 0.432107 4.60415 × 10 9.94274 × 10−12
3 2.03664 × 10−17 0.0294239 3.1241 × 10−26 3.13516 × 10−18
4 1.19827 × 10−23 0.0020036 2.11982 × 10−35 9.88581 × 10−25
5 7.05004 × 10−30 0.000136433 1.43838 × 10−44 3.11721 × 10−31
−36 −6 −54
6 4.14792 × 10 9.29029 × 10 9.75999 × 10 9.82921 × 10−38
7 2.44044 × 10−42 6.32614 × 10−7 6.62254 × 10−63 3.09936 × 10−44
8 1.43584 × 10−48 4.30773 × 10−8 4.49365 × 10−72 9.77293 × 10−51
9 8.44783 × 10−55 2.93331 × 10−9 3.04912 × 10−81 3.08161 × 10−57

Michelle M. Francl
Created: April 2000 32
Modified: November 2004
rotation and vibration

à Rotation and vibration

The key to figuring out why the HCl high resolution vibrational spectrum has the shape it does is to recognize two things:
first, that the intensity of the spectral lines is directly proportional to the population of the initial energy state in the
transition; second, that the extra little lines on the spectrum are the result of transitions between rotational states (coupled
to a vibrational transition). Using the partition function to compute the relative populations of the different states, we
should thus be able to predict the relative peak heights.

Recall the energies of a linear rotor are given by E=hBJ(J+1). The rotational constant, B, for HCl is 10.593 cm-1 . Note
that the rotational energy levels are degenerate (where the degeneracy of the J th level is 2J+1). The rotational partition
function can be computed by direct summation (there are closed forms available, but they are approximate, unlike the

summation. The form of the partition function is thus qrot = ⁄¶ J =0 H2 J + 1L ‰


closed form for the vibrational partition function, which is exact) so we will need to be careful about the truncation of the
-hBJ HJ +1LêkT
.

20. Sketch an energy level diagram for the harmonic oscillator, indicating on it the rotational levels associated with the
ground state and first excited state vibrational levels. Indicate the transitions expected from the first four rotational
states associated with the ground excited vibrational state. (Remember the selection rules for vibrational and rotational
transitions!)

Michelle M. Francl
Created: April 2000 33
Modified: November 2004
21. Do you expect the population in the ground rotational state to be higher or lower than that in the first excited
rotational state? Make a bar graph of the percentage populations in each of the first 10 states at 300 K to verify your
prediction. What happens when you vary the temperature?

qRot@T_D := ‚ H2 j + 1L −Hh nuRot j Hj+1LLêHk TL


100
In[236]:=
j=0

H2 j + 1L −Hh nuRot j Hj+1LLêHk TL


In[254]:= PercentInJthState@j_, T_D :=
qRot@TD

TableForm@Table@8j, 100 PercentInJthState@j, 300D ê. nuRot → 3.18 10 ^ 11<,


8j, 0, 9<D, TableHeadings → 8None, 8"state", "% in state"<<D
In[251]:=

Out[251]//TableForm=
state % in state
0 5.00021
1 13.5499
2 18.4261
3 19.0123
4 16.2734
5 11.9606
6 7.6781
7 4.34686
8 2.1834
9 0.976924

BarChart@Table@8100 PercentInJthState@j, 300D ê. nuRot → 3.18 10 ^ 11, j<,


8j, 0, 9<D, AxesLabel → 8"J HstateL", "%"<D
In[247]:=

17.5
15
12.5
10
7.5
5

J HstateL
2.5

0 1 2 3 4 5 6 7 8 9

Out[247]= Graphics

22. Find the ratio of the population in the ground rotational state (J=0) to the first excited rotational state (J=1) using
your calculated values. On your HCl spectrum [if you don't have one of your own from lab or your instructor, one is
available here] measure the peaks corresponding to a transition from the ground rotational state and those

Michelle M. Francl
Created: April 2000 34
Modified: November 2004
corresponding to a transition from the first excited state. Take the ratio. How does your measured ratio compare to the
one you calculated? Can you vary the temperature to get the ratios to match better? What temperature does your
spectrum seem to match? Does this make sense? Try this with another pair of lines and see if you get the same
prediction for the temperature.

H2 i + 1L −Hh nuRot i Hi+1LLêHk TL

H2 j + 1L −Hh nuRot j Hj+1LLêHk TL


In[248]:= RatioStateItoStateJ@i_, j_, T_D :=

In[250]:= RatioStateItoStateJ@0, 1, 300D ê. nuRot → 3.18 10 ^ 11


Out[250]= 0.369023

23. Would the ratio be different for DCl?

Michelle M. Francl
Created: April 2000 35
Modified: November 2004
Reprise and Revise

Reprise and Revise


Additional Reading

à References and Further Reading

Physical Chemistry Background:

Peter Atkins and Julio de Paula, Physical Chemistry, 7th Edition, Oxford University Press, 2002.

Donald A. McQuarrie and John D. Simon, Physical Chemistry: A Molecular Approach, University Science Books,
1997.

Mathematics/Mathematica :

Michelle M. Francl, Survival Guide for Physical Chemistry, Physics Curriculum and Instruction: Lakeville, MN,
2001. The section on "Guerilla Math" has a review of summation notation and the properties of logarithms and
exponentials. There is also a short introduction to Mathematica.

Eric W. Weisstein, "Stirling's approximation." From MathWorld -- A Wolfram Web Resource.


http://mathworld.wolfram.com/StirlingsApproximation.html

MathBasics.nb, an introduction to Mathematica written for my physical chemistry course. Available at


www.brynmawr.edu/Acads/Chem/mfrancl/PChemResources/

Statistical Mechanics

T. Wieprecht, O. Apostolov, M. Beyermann, J. Seelig, "Thermodynamics of the a-Helix-Coil Transition of Amphip-


athic Proteins In a Membrane Environment: Implications for the Peptide-Membrane Binding Equilibrium",
J.Mol.Bio. 1999, 294, 785-794. A statistical mechanical approach to the thermodynamics of the helix-coil transi-
tion in a antibiotic protein found in frogs.

Ken A. Dill and Sarina Bromberg, Molecular Driving Forces: Statistical Thermodynamics in Chemistry and Biology,
Garland Science, 2003. Chapter 26, on cooperativity, has some readable applications of statistical mechanics,
including partition functions for helix-coil transitions.

Michelle M. Francl, "Frog Antibiotics: Statistical Mechanics of Helix-Coil Transitions" from Cultural of Chemistry
materials. Background material, questions and problems leading to a critical reading of a paper on the statistical
mechanics of helix-coil transitions. This and other units available from the author at her website.

MasteryQuestions

à Test Yourself for Mastery

TY-1 Do you think Mathematica computes n! directly for large numbers (that is by multiplying 1x2x3x4...) or do you
think it uses an approximation too? How could you test this?

TY-2 The energies and degeneracies of the ground state and the first excited electronic states of atomic iodine and
bromine are given below. At what temperature are 1% of the iodine atoms in the excited state? Without doing any
calculations, would the percentage of bromine atoms in the first excited state be higher or lower than the percentage of
excited iodine atoms at room temperature?

Michelle M. Francl
Created: April 2000 36
Modified: November 2004
Data for atomic iodine:
Out[27]//TableForm=
energy in cm−1 degeneracy
0 4
7603.15 2

Data for atomic bromine: (from NIST)


Out[26]//TableForm=
energy in cm−1 degeneracy
0 4
3685.24 2

only the first 4 terms of the direction summation qrot HTL = ⁄¶ J =0 H2 J + 1L ‰


TY-3 (a) On page 744 of "Physical Chemistry: A Molecular Approach", McQuarrie and Simon state that you need
-Qrot J HJ +1LêT to calculate the value of

qrot HTLto within 0.01% of the value of the full summation when T < 3Qrot . Verify their claim by computing qrot HTL
using the 4-terms in the explicit summation and many terms from appropriate temperatures for HCl (Qrot = 15.02 K)
and Cl2 (Qrot =0.351 K). Choose T for each case such that T < 3Qrot is satisfied. Qrot is the "rotational temperature", a
constant for each molecule. Qrot depends on the moment of inertia for a molecule. Using Qrot in calculations
simplifies the manipulation of units!
(b)Because the spacing between rotational levels is very small, the summation is sometimes replaced with an integral
which allows a closed form to be derived for the rotational partition function. For a heteronuclear diatomic molecule
T
the rotational partition function derived this way is ÅÅÅÅ
ÅÅÅÅÅ where Qrot depends on the moment of inertia. Compare the
Qrot
approximate function with the explicit summation at 298 K and 2000 K for HCl (Qrot = 15.02 K) and Cl2 (Qrot =0.351
K). Is there any advantage to using the explicit form at these temperatures, or is the approximation adequate?

Michelle M. Francl
Created: April 2000 37
Modified: November 2004
Culture of Chemistry

Culture of Chemistry

à Ludwig Boltzmann: Father of statistical mechanics

A sketch of Prof. Boltzmann done by a spectator at one of his lectures. Source unknown, from Andreas Glatz, Universität zu Köln.

The famous Boltzmann equation, S=k ln , is inscribed on Boltzmann’s tombstone in Vienna, Austria. Boltzmann did not
write it in this form, however, Max Planck did. Boltzmann also has two other equations named for him, the first is a
diffusion equation used in neutron transport theory and the second describes particles in a gravitational field. In 1904,
Boltzmann gave a series of general lectures on mathematics at the World’s Fair in St. Louis. He was also a popular
lecturer in philosophy at the University of Vienna. Boltzmann is considered the founder of statistical mechanics, and a
strong proponent of the “atomistic” view that understanding the behavior of atoms and molecules is critical to understand
the bulk.

Michelle M. Francl
Created: April 2000 38
Modified: November 2004
Notes to the instructor

instructor's notes

Using these materials

The notebook as it appears here is what I would use with my students as an in-class exercise, in lieu of lecture. Most of the
Mathematica commands are not included (to reduce the opportunity for inducing the "hit enter" trance). I expect and
encourage students to use the cut, paste and edit technique to complete the notebook. I generally follow up by posting a
completed notebook for them to review. I either produce a set of notes entitled "important things to know from..." or spend
10 minutes in lecture getting them to give me the highlights of what they've done (easy in the classroom I teach in where I
can pull up any screen on the main projector) to help them return to the forest from the trees. You might want to include
more of the skeleton for them to use as the skill level of your class indicates.

I always have students hand write the answers to the questions in their class notebooks, and sketch the graphs they get.
Engaging their kinetic sense by sketching the graphs seems particularly helpful, and students who do this rather than just
look at the graphs on the screen appear to have better retention of the information. To help overcome the resistance of the
"I don't have graph paper" or "I'm not a very good artist", I provide a PDF of graph paper on the course web site (see
Mathematics Help Central for a nice assortment that students can print themselves) and point out that while art is not my
forte either, I do draw things on the board and they do understand what I'm saying, the point being to learn to communi-
cate effectively in this way!

All three sections of this exercise are independent of one another. Stirling's approximation can be easily skipped; particu-
larly if you aren't emphasizing the derivation of the most probable configuration. I have used section 2 ("The Partition
Function: creating a diaphanous spot in the universe") variously: in place of the lecture to introduce the partition function,
as a self-study for students after lecture and as an in-class review at the end of statistical mechanics. The section on the
spectroscopic lines can be done with spectroscopy in lecture, with the classic HCl/DCl lab or as a capstone exercise for
statistical mechanics. If students have actual spectra, have them bring to class. If not, an image of a raw spectrum is
attached to this notebook; students should bring rulers to class, my students never do, I link to a set of disposable rulers.

I emphasized a numerical approach and direct summation in the section rather than using closed forms for summation
where these existed. My objective was to get students to develop a sense for the partition function and population distribu-
tions and did not want to distract them with the math associated with deriving the closed forms; you obviously could
certainly bring these in. This approach also emphasizes that with current computational resource you may not to find a
closed form.

I have solutions for the "mastery exercises" if you want them! Just send me an e-mail.

I am currently working on an NSF funded project to develop context-rich auxiliary materials for physical chemistry and to
assess their impact on student interest and performance. There is some evidence to show that context-rich curricula, which
embed new material in a wide context and/or which provide students multiple entry points into a subject, result in
increased student interest as well as improved performance. In this vein, I have included some references to the primary
literature for interested students to pursue and provided a "culture of chemistry" section on Ludwig Boltzmann. I have
been surveying my students in the past few years about these strategies. Students report that they enjoy the "Culture of
Chemistry" pieces, and say that reading them often gets them more interested, not only in the general subject area, but in
solving the problems! Students also note that the engagement with the primary literature is a motivating factor, to see that

Michelle M. Francl
Created: April 2000 39
Modified: November 2004
physical chemistry is not just something to be survived, but is part of a broader scaffold that impinges on many areas of
chemistry and science. More information on this project can be found at the project website. A description of a literature
exercise which connects to this Mathematica workbook can be found there. The exercise itself (on the entropy of helix-
coil transitions in an antibiotic peptide) can be downloaded at http://www.brynmawr.edu/Acads/Chem/NSFpchem/Draft-
Modules.html.

As always, I would appreciate comments, corrections, clarifications, which can be sent to mfrancl@brynmawr.edu.

Software information

This notebook was created using Mathematica v. 5.0.0.0 on a Macintosh running Mac OS 10.3.

Michelle M. Francl
Created: April 2000 40
Modified: November 2004
Appendix
HCl spectrum, i:1
Experimental HCl
spectrum

Michelle M. Francl
Created: April 2000 41
Modified: November 2004
Answers to Try It and Warm-up Exercises

Michelle M. Francl
Created: April 2000 42
Modified: November 2004
AnswerPlotSin
Plotting Sin[x]

To try: Plot Sin[x], x2 and x4 on the same graph from -p to p using dashed lines and then using colors ranging from
blue to violet. Be sure to label the axes and use a legend.

Plot@8Sin@xD, x2 , x4 <, 8x, −Pi, Pi<,


PlotStyle −> 88Hue@.6D<, 8Hue@.75D<, 8Hue@.9D<<,
In[119]:=

PlotLegend → 8"Sin@xD", "x2 ", "x4 "<, LegendPosition → 81.1, −.4<D

2
Sin@xD

1 x2

x4
-3 -2 -1 1 2 3

-1

Out[119]= Graphics

Plot@8Sin@xD, x2 , x4 <, 8x, −Pi, Pi<,


PlotStyle → 8GrayLevel@0D, Dashing@8.03<D, Dashing@80.01<D<,
In[120]:=

PlotLegend → 8"Sin@xD", "x2 ", "x4 "<, LegendPosition → 81.1, −.4<D

2
Sin@xD

1 x2

x4
-3 -2 -1 1 2 3

-1

Out[120]= Graphics

AnswerTable
Making a Table

To try: Make a table of the first 10 terms in the series xn = xn+1 .

Michelle M. Francl
Created: April 2000 43
Modified: November 2004
In[123]:= TableForm@Table@xn+1 , 8n, 1, 10<DD
Out[123]//TableForm=
x2
x3
x4
x5
x6
x7
x8
x9
x10
x11

AnswerSum
Sum of Numbers

To try: St. Augustine notes that the sum of the first 17 numbers (which can be arrayed in a triangle) is 153. Is he
right?

In[115]:= Sum@x, 8x, 1, 17<D


Out[115]= 153

AnswerBarChart
Bar Chart

To try: The average temperature in degrees Fahrenheit in Bryn Mawr during the academic year (by month) is:
September 68.8 ; October 57.2; November 47.1; December 38.4; January 32.3; February 34.8; March 43.2; April 53.1;
May 63.5. Make a bar chart (labeled with the months on the abscissa) of the temperatures.

Michelle M. Francl
Created: April 2000 44
Modified: November 2004
TempData = 8868.8, Sept<, 857.2, Oct<, 847.1, Nov<, 838.4, Dec<,
832.3, Jan<, 834.8, Feb<, 843.3, Mar<, 853.1, Apr<, 863.5, May<<;
In[126]:=

BarChart@TempData, AxesLabel → 8"Month", "T in F"<D

T in F
70
60
50
40
30
20
10
Month
Sept Oct Nov Dec Jan Feb Mar Apr May

Out[127]= Graphics

AnswerWU1
WU-1

WU-1 A function has the form p(x)=HaLx xx+1ê2 ‰x . What would the function lnp(x) be? Answer.

è!!!
ln ax + lnxx+1ê2 + ln‰x =
x ln a + Hx + ÅÅÅÅ12 L ln x + ln ‰x = xH1 + ln aL + Hx + ÅÅÅÅ12 L ln x + x = x H1 + ln a + ln xL + ÅÅÅÅ12 ln x = xH1 + ln axL + ln x

Stop anywhere you want.

AnswerWU2
WU-2

WU-2 How many atoms (to an order of magnitude) are in a nanogram of C60 ? Answer.

i 1 moles y i 2 MolesAtoms y i1023 y


H10−9 gramsL j
j z
zjj10 z
zjj z
z êê N
atoms
k 10 grams { k {k MolesAtoms {
In[7]:=
1 moles
There are on the order of 1015 atoms in 1 nanogram of buckminsterfullerene.

AnswerWU3
WU-3

WU-3 Graph ‰-1êT as a function of T from T=300 to T=1000. Sketch (by hand) what the graph of ln(‰-1êT ) versus T
would look like over the same range. Answer.

Michelle M. Francl
Created: April 2000 45
Modified: November 2004
In[5]:= Plot@ −1êT
, 8T, 300, 1000<, AxesLabel → 8"T", "qHtL"<D

qHtL
0.999

0.9985

0.998

0.9975

T
400 500 600 700 800 900 1000

Out[5]= Graphics

AnswerWU4
WU-4

WU-4 Does the summation ⁄¶x=1 ‰


-x converge? Compute the first 10 terms. Compute the summation truncating at 10

terms. How many terms must you consider before the value doesn't change by more than 0.01?

In[30]:= Table@ −x
, 8x, 1, 9<D

9 =
1 1 1 1 1 1 1 1 1
Out[30]= , 2
, 3
, 4
, 5
, 6
, 7
, 8
, 9

In[33]:= Sum@ −x
, 8x, 1, 90<D êê N
Out[33]= 0.581977

Michelle M. Francl
Created: April 2000 46
Modified: November 2004

You might also like