An Introduction to Statistical Mechanics

Michelle M. Francl
Bryn Mawr College
101 N Merion Avenue
Bryn Mawr, PA 19010
mfrancl@brynmawr.edu

Copyright Michelle M. Francl, 2000.

Stirling's approximation

Comparing x ln x -x with ln(x!)  On page 667 in Atkins' "Physical Chemistry", the author notes that Stirling's approximation is actually given by what I call stir1 below.  We used another version in class, called stir2. Stirling's approximation comes in two flavors, one more complex than the other: the ‘real’ approximation:  ln x! ≈ ln(2π1/2 xx+0.5 e-x) and the form used more often in physical chemistry:  ln x! ≈ x ln x - x
Both approximations are considered good for ‘large’ x.  So how large  is large??  Using the commands that follow, answer these questions:
	✎✀At approximately what x  is the "real" Stirling’s approximation within .01% of the true value of 
ln x! ?
	✎✀At approximately what x  is the form we used in class  for Stirling’s approximation within .01% of the true value of ln x! ?________ 
 Note:  don’t calculate ln x! directly for x>1000 -- it may take an eon...be creative in answering the second question!
	✎✀For the applications we have in mind (x ≈ 10^14 or greater) do you see any advantage to using one or the other?  Why do think  the second version is typically used in the derivation of the most probable configuration?

stir1[x_]:= Log[(2 Pi)^0.5 x^(x+.5) Exp[-x]]
stir2[x_]:= x Log[x] - x

The //N gives you a value in scientific notation

Log[100!]//N

stir1[100]//N

stir2[100]//N

To help you decide which one is which, Hue[0]=red,[.3]=green,[.6]=blue,[.9]=purple

Plot[{Log[x!],stir1[x],stir2[x]},{x,1,2},
PlotStyle->{{Hue[0]},{Hue[.3]},{Hue[.6]}}]

The partition function

For the harmonic oscillator

How does the partition function for the harmonic oscillator (also called the vibrational partition function) for HCl vary with temperature?   
❑✀✀Try plotting qv versus T to find out.
 	✎✀✀Does it ever get to be much larger than 1? If so, under what conditions?
❑  On a single graph plot the percentages in each of the first three states as a function of temperature.
	✎✀✀What do you notice about each of the energy levels as T increases?
❑✀✀Try another way of evaluating fractional populations of states.  Make a table of the percentage populations in each of the first 10 states, then use this to make a bar graph.  Explore what happens when you vary the temperature.
 ✔  To make a table of the first ten states:  states=Table[{pofJ[i,5000],i},{i,0,9}];
 ✔  the ;  keeps the values from printing out
 ✔  To see the table in a useful format:  TableForm[states]
 ✔  To make a bar graph, first load the graphics stuff:  <<Graphics`Graphics`  NOTE:  You only need to load this once, then you can use BarChart all you want!  NOTE:  the ` is the back quote, not the regular quote, and is found on the same key as the ~
 then issue the command:  BarChart[states, PlotRange->{0,1}]
	✎✀✀How hot does it have to get before one needs to consider the excited states?  Most people would consider a fractional population of 1% as ‘significant’.
❑✀✀How does the vibrational partition function and the distribution of molecules among the different vibrational states change as the molecule changes.  Vibrational frequencies for a series of diatomic molecules are given on the attached sheet.  Use these to explore how increasing or decreasing the vibrational frequency changes the partition function. 
	✎✀✀Are ‘hot bands’ (excitations from excited vibrational states) more or less a worry for heavier molecules?
	✎✀✀  What general conclusions can you draw about the distribution of vibrational energy in diatomic molecules?

(Value for frequency is in hz and is HCl stretching frequency, 2990 cm-1.)

h=6.626 10^-34;
k=1.381 10^-23;
c=2.998 10^10;

wavenum=559.71;
nu=c wavenum

qHO[t_]:= 1/(1-Exp[-h nu / (k t)])
n[i_,t_]:=Exp[-i h nu / (k t)]
PinI[i_,t_]:=n[i,t]/qHO[t]

Plot[qHO[t],{t,298,5000}]

To plot the probability of being in the first three states (i=0,1,2) as a function
of temperature

Plot[{PinI[0,t],PinI[1,t],PinI[2,t]},{t,298,5000},
PlotStyle->{{Hue[0]},{Hue[.3]},{Hue[.6]}}]

To look at the relative populations of the first 10 states at a given  T:

<<Graphics`Graphics`

states=Table[PinI[i,298],{i,0,10}];
BarChart[states]

Now for the rotational states

The key to figuring out why the HCl-DCl spectrum has the shape it has is to realize two things, first that the intensity of the lines is directly proportional to the population of the initial (in this case the lowest) energy state in the transition and second, that the extra little lines on the spectrum are the result of transitions between rotational states (coupled to a vibrational transition).  So if we can do the same thing as we did for the harmonic oscillator above, we can find what the relative populations of the different rotational states are and therefore the relative intensities of your peaks!

Recall the energies of a linear rotor are given by E=hBJ(J+1).  B for HCl = 10.593 cm-1.  Note that there is now an "extra" term in the partition function: 2J+1.  This is the degeneracy of the states.  The equation for the partition function when some (or all) of the states are degenerate is qrot =Σ(wie-βϵi) where wi is the degeneracy of the ith state.

❑✀✀Make a bar graph (see the commands in Part II) of the percentage populations in each of the first 10 states. 
	✎✀What happens when you vary the temperature?
❑✀✀Find the ratio of the population in the first state (J=0) to the second state (J=1) using your calculated values.  
	✎✀ On your HCl spectrum measure the peaks corresponding to a transition from the first state and those corresponding to a transition from the second 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 measuring the same ratios on your DCl spectrum.  Are they the same as those from HCl?  Do you expect them to be?
❑✀✀How does the rotational partition function and the distribution of molecules among the different rotational states change as the molecule changes.  Rotational constants for a series of diatomic molecules are given in the table below.  Use these to explore how increasing or decreasing the vibrational frequency changes the partition function.  
A table of useful data:

Again, let's put together the equation for the partition function and the probability of finding the HCl molecule in rotational state i.

wavenum=.2441;
nu=c wavenum

qRot[t_]:= NSum[(2 j +1) Exp[-h nu j (j+1)/(k t)],{j,0,Infinity}]
n[i_,t_]:= (2 i +1) Exp[-i (i+1) h nu / (k t)]
PinI[i_,t_]:=n[i,t]/qRot[t]

Plot[qRot[t],{t,250,300}]

To look at the relative populations of the different states, let's plot

states=Table[PinI[i,298],{i,0,10}];
BarChart[states]