You are on page 1of 143

MIDTERM EXAM

PHGN530 Statistical Mechanics


Note: You can collaborate with anyone including your classmates. In fact, you should
collaborate and try to understand the exam well. If you understand the homework and the
exam so far, you should be able to read and understand statistical mechanics easily.
Due: 10/04/2016
1. Counting the number of microstates (500 points total):
Consider 4 distinguishable harmonic oscillators in 1D with spring constant, k, and mass,
m. Calculate numbers using reasonable values of parameters.
Plot the following:
a) ( N ,V , E ) vs E . (100 points)
b)  ( N ,V , E )   ( N , V , E )
'
vs E . This is cumulative number of states. (100 points)
E'  E

 ( N ,V , E )
c) The density of states, ( E )  vs E . Remember that in an interval  the
E
number of states is given by ( N , V , E , )  ( E )  . (100 points)
d) What happens to the factors h3N and N ! that you keep on seeing? (100 points)
e) For a particular energy E , calculate the entropy using S  k ln ( N ,V , E ) and
S  k ln ( E ) . Are they equivalent? Remember that this expression connects statistical
mechanics to thermodynamics. (100 points)
2. Importance of large numbers (500 points total):
Consider 100 distinguishable harmonic oscillators in 1D with spring constant, k, and
mass, m. Repeat 1 a-e. What happens to the different ways of calculating number of
states?

3. Equivalence and non-equivalence of ensembles (600 points total):


Take the entropy that you calculated in 1 and 2, and calculate the energy, E and the
pressure P in
a) Microcanonical ensemble (200 points)
b) Canonical ensemble (200 points)
c) Grand canonical ensemble (200 points)

4. Fluctuations of thermodynamic quantities (600 points total):


Calculate the fluctuations of E and P in
a) Microcanonical ensemble (200 points)
b) Canonical ensemble (200 points)
c) Grand canonical ensemble (200 points)
PH530 Statistical Mechanics Take-Home Midterm

Alex Wilhelm
Department of Physics, Colorado School of Mines, 1500 Illinois St, Golden, CO 80401, USA
(Dated: October 7, 2016)
The statistical mechanics of systems of harmonic oscillators are explored. Systems of N = 4 and
N = 100 oscillators are used as examples of small scale and large scale systems. Relevant quantities
are calculated and plotted for each system. Important solutions are boxed (except for equation (44)
which cannot be boxed).

QUANTUM OSCILLATORS this assignment, k = h̄ = ω = 1 and the error is on the


order of machine precision.
PROBLEM #1

Part A

For a system of distinguishable quantum harmonic os-


cillators, the energy of each level is given by:

1
En = h̄ω(n + ) (1)
2
The total amount of energy for a system of this type
is given by:

 N
Etot = h̄ω Ntot + (2)
2
FIG. 1. Multiplicity for N = 4 as a function of total en-
Here, Ntot is the number of quanta that can be al- ergy.The blue line shows the general trend of the multiplicity.
located to N oscillators in the system. The number of
possible configurations as a function of N is shown in the
table below:
Part B
TABLE I.
Number of Oscillators (N) Multiplicity of States Ω
We now move on to calculate the cumulative number
of states. This is defined by:
1 1
2 10
X
3 20 φ(E, N, V ) = Ω(E 0 , N, V ) (5)
4 35 E 0 ≤E

Where E and E 0 refer to total energies. For the mul-


From this table, it can be seen that the multiplicity of tiplicity defined in Part A, this equation sums to:
states is given by:
(Ntot + N − 1)! √ −N
Ω(Ntot , N, V ) = (3) Γ(E + N2 + 1) π2
Ntot !(N − 1)! φ= + (6)
Γ(N + 1)Γ(E − 2 + 1) Γ(1 − 2 )Γ( N2+1 )
N N

Solving for Ntot in Equation (2) and substituting into


Equation (3) gives a new multiplicity: This equation is plotted as a function of E for N = 4
below in Figure 2.

( Eh̄ω
tot
+ N
2 − 1)!
Ω(Etot , N, V ) = (4) Part C
( Eh̄ω
tot
− N
2 )!(N − 1)!

This multiplicity is plotted below in Figure 1 for N = 4 I now move on to calculate the Density of States for
as a function of total energy. For all plots generated in the system of quantum harmonic oscillators. This can be
2

Part E

We have two methods for calculating an entropy at our


disposal. These two methods are below:

S = kln(Ω(N, V, E)) (8)

S = kln(Ω(E)) (9)

Here, the first is calculated using the multiplicity of


states and the second method is calculated using the
density of states. Rather than calculating the entropy
for particular energy values, I plotted the entropies as
FIG. 2. Cumulative number of states for N = 4. Here, the a function of energy in Figure 4 to better visualize the
red line is a step function because of a plotting artifact in difference between the two methods.
Mathematica. I was unable to remove said artifact so I joined
the points myself with a discrete function. This occurs in
every other plot of φ in this paper.

described as:
∂φ
Ω(E) = (7)
∂E

A plot of Ω(E) is shown below in Figure 3

FIG. 4. Entropy calculations for N = 4.

In Figure 4, it can be seen that for all energy ranges,


the entropies are essentially the same, with the difference
becoming smaller and smaller as the energy increases.
This makes sense as the the multiplicity and density of
states should approach each other as the energy gets
larger.
In Figure 5 we can see that the ways of counting states
are not all equivalent for low oscillator number. The
FIG. 3. Density of states for N = 4. We can see that the den-
sity of states increases as E increases which is to be expected.
cumulative number of states φ grows much faster than
the other two methods (who are essentially equivalent).

PROBLEM #2
Part D
Part A
3N
The factor of h comes from the uncertainty between
position and momentum coordinates. That factor nor- For this part of the midterm, and all of the following
malizes the calculation of the density of states to cor- parts in Problem #2, the equations are all the same as in
rectly scale the volume of phase space that the density is Problem #1. The only difference is the value of N being
calculated in. The N ! term is only relevant for indistin- used to generate the plots.
guishable particles. It is a weighting factor that ensures As in the first problem, I plot the multiplicity of states
we do not over-count the number of states. as a function of energy in Figure 6.
3

FIG. 7. Cumulative number of states for N = 100. The


FIG. 5. State counting methods for N = 4. plotting artifact can again be seen. However, I did not join
the points this time.

Part C

In this section, I plot the density of states for the sys-


tem in Figure 8.

FIG. 6. Multiplicity of states for N = 100.

Here we can see that the multiplicity follows the same


general curve as when there were only 4 oscillators. How-
ever, it stays flatter for more values of E and starts at
a higher E. The higher starting value is due to the fact
FIG. 8. Density of states for N = 100.
that all plots are generated with the starting energy cor-
responding to the minimum energy of Emin = h̄ωN 2 . The
flatness of the curve is due to the fact that as N increases, We can see again that the density of states increases
the number of arrangements for the system at low energy with increasing energy and that for a larger number of
is relatively constrained while it becomes gradually less oscillator, the density of states is much larger.
constrained as E increases.
Part D

Part B
Refer to Problem #1 Part D for the answer to this
question as it is the same as Problem #1 Part D.
Like in Problem #1, I have made a plot of the cumu-
lative number of states φ(N, V, E) in Figure 7.
We can see that it is similar to the figure in Problem #1 Part E
Part B, where the discreteness of the cumulative number
of states is evident. Just like in Part A of this problem Just as in Problem #1, I compare the two different
though, the scale is totally different. This is because methods of calculating the entropy for a microscopic sys-
there are so many more states allowed at low energies for tem. A figure of these two methods for calculating en-
the N = 100 case than the N = 4 case. tropy is shown in Figure 9
4

PROBLEM #3

Part A - Microcanonical Ensemble

For every ensemble, the entropy is the same:


!
(Ntot + N − 1)!
S = kln (10)
Ntot !(N − 1)!

This is the entropy calculated from the multiplicity of


states. Taking Stirling’s approximation, we get:

S ≈ k(Ntot + N )ln(Ntot + N ) − Ntot ln(Ntot ) − N ln(N )


(11)
FIG. 9. Comparison of entropy calculations for N = 100. Taking the derivative at constant N gives the temper-
ature:

1 ∂S 1 ∂S
= = (12)
T ∂Etot N h̄ω ∂Ntot N

It is extremely evident from this plot that the two
methods of calculating entropy are essentially identical Carrying out this operation gives an equation for the
for all energy ranges. This means that the entropy is a temperature:
good way to connect the microscopic world to the macro-
scopic world as differences in the counting of states does
1 k  Ntot + N 
not effect the entropy of the system. = ln (13)
T h̄ω Ntot
Plugging in for Etot and exponentiating this gives a
value for the energy of the microcanonical ensemble:

N h̄ω eh̄ωβ + 1
E= (14)
2 eh̄ωβ − 1

The pressure for the microcanonical ensemble can be


calculated as:
∂S
P = =0 (15)
∂V
Because the entropy does not depend on volume, the
pressure is trivially 0 for the microcanonical ensemble.

FIG. 10. Methods of state counting for N = 100. Part B - Canonical Ensemble

The energy must be calculated slightly differently for


the canonical ensemble than it was for the microcanon-
In Figure 10 we can see that the different methods for ical ensemble. This is due to the fact that the system
counting states are all essentially equivalent for large N . is now allowed to exchange energy with its surrounds.
This is very different than the small N case in Figure 5. Therefore, the energy is not constant and we must in-
stead calculate an average energy for the system. I start
with the partition function for a single harmonic oscilla-
Overall, we see that as N gets larger, all the methods
tor which is derived in Pathria Pg. 67:
of counting states become more or less equivalent. This
is good as each method is easier in different situations
and their equivalence will allow us to calculate thermo- e−βh̄ω
Z1 = (16)
dynamic quantities with relative ease. (1 − e− βh̄ω)
5

1
Here, β = kT . For N -oscillators, this partition func-
tion becomes: ∞
X 1
rn = f or |r| < 1 (23)
n=0
1−r
!N
e−βh̄ω Knowing this, we can immediately read off the con-
ZN = (17)
(1 − e−βh̄ω ) vergence of the grand partition function. The term in
square brackets is r so we can write the grand partition
For the canonical ensemble, the average energy of the function as:
system can be calculated through:
1
ZGC =  βh̄ω (24)
∂ln(Z) −
e 2


E=− (18) 1− 1+eβh̄ω
∂β
The average energy can now be calculated just like in
Using simple calculus identities to simplify this expres-
Part B. (Pure computation steps are skipped as they are
sion and Mathematica to compute the simplified expres-
simple calculus and algebra).
sion, I arrive at an average energy for the canonical en-
semble of:
∂ln(ZGC ) 1 ∂ZGC
E GC = − =− (25)
∂β ZGC ∂β
N h̄ω (eh̄ωβ + 1)
E= (19)
2 (eh̄ωβ − 1) h̄ωeβh̄ω/2 (1 + eβh̄ω )
E GC = (26)
2(eβh̄ω−1 )(eβh̄ω+µ − eµ − eβh̄ω/2 )
It is remarkable that this average energy is the same
as the energy for the microcanonical ensemble. This looks complicated, but it can actually be reduced
Again, as the entropy and all other statistical and ther- even further if we think about what is really happening in
modynamic quantities in this system are independent of the system. The system is exchanging particles with its
volume, the pressure of this ensemble is trivially 0. This surroundings, therefore an average number of oscillators
is because all pressures require a change in volume and we be in the system at any point in time. This average
our ensemble does not live inside of a volume. Therefore number of oscillators can be calculated as:

∂ln(ZGC ) 1 ∂ZGC
P =0 (20) hN iGC = =− (27)
∂µ ZGC ∂µ

Part C - Grand Canonical Ensemble eβh̄ω/2


hN iGC = (28)
(eβh̄ω+µ − eµ − eβh̄ω/2 )
The grand canonical ensemble is the most complicated We can see that hN iGC can be easily substituted into
of the three ensembles and allows for the exchange of par- Equation (26) to arrive at the final answer for E.
ticles and energy with the surroundings. This means that
the average energy will be different from the other two
cases. I start with the partition function for the grand hN iGC h̄ω (eh̄ωβ + 1)
E GC = (29)
canonical ensemble which is the canonical one multiplied 2 (eh̄ωβ − 1)
by the µ exponent and then summed over N :
Again, it is remarkable that the average energy for
the grand canonical ensemble can be reduced to the

!
X e−βh̄ωN −µN same form as the other two ensembles when the average
ZGC = (21)
(1 − e−βh̄ωN ) number of oscillators is known.
N =0

This can be rewritten as a geometric series by pulling


out the common N .
P =0 (30)


" #N Just as in the other two ensembles, the pressure P
X e−βh̄ω−µ must be 0 as no thermodynamic or statistical quantities
ZGC = (22)
(1 − e−βh̄ω ) depend on the volume of the system and all methods of
N =0
calculating the pressure rely on derivatives with respect
A geometric series has the form of: to the volume.
6

PROBLEM #4 Part C - Grand Canonical Ensemble

Part A - Microcanonical Ensemble The energy fluctuations for the grand canonical ensem-
ble can be calculated in two different methods (the first
For the microcanonical ensemble, the answer for both being found on Pathria Pg 105):
the energy and pressure fluctuations is trivial. This sys-
tem is defined to be completely isolated from its sur- !2
∂E
roundings. Therefore there is no exchange of energy or (∆E)2 GC = (∆E)2 C + (∆N )2 (40)
∂hN i

particles with the surroundings. Because of this,the en- T,V
ergy is fixed, and there are no energy fluctuations:
∂E µ ∂E
(∆E)2 GC = − + (41)
∂β β ∂µ
(∆E)2 = 0 (31)
Given the fact that (∆E)2 C (the canonical energy fluc-
Additionally, because we have no pressure in the sys-
tuation) is already known from the previous section, I
tem, due to the lack of a defined volume, there are no
will proceed with that calculation rather than the alter-
pressure fluctuations:
native (which is explored in detail in the Mathematica
calculations I have provided).
(∆P )2 = 0 (32) The term in the parentheses is trivial as E is linear in
hN i (from previous problem).

Part B - Canonical Ensemble


!2 !2
∂E h̄ω (eh̄ωβ + 1)
= (42)
∂hN i 2 (eh̄ωβ − 1)

For the canonical ensemble we can calculate the aver- T,V
age energy fluctuations from the average energy of the The fluctuations in oscillator number can be deter-
system: mined from the average oscillator number hN i that was
determined in the previous problem.
∂E
(∆E)2 = − (33) !
∂β ∂N eβh̄ω/2 (eµ − eβh̄ω+µ )
(∆N )2 = kT =−

Using the average energy found in Problem #3 Part ∂µ

(eβh̄ω+µ − eµ − eβh̄ω/2 )2
T,V
B, we find that the average energy fluctuations are:
(43)
Combining these terms and adding it to the canonical
hN iω 2 h̄2 eβh̄ω hN iω 2 h̄2 eβh̄ω (1 + eβh̄ω ) energy fluctuation gives the final result for the energy
(∆E)2 = − +
2(eβh̄ω − 1) 2(eβh̄ω − 1)2 fluctuations for the grand canonical ensemble:
(34)
1  βh̄ω 
(∆E)2 GC = hN iω 2 h̄2 csch2 −
!
2 2 βh̄ω βh̄ω βh̄ω
hN iω h̄ e (e + 1) (e − 1) 4 2
(∆E)2 = −
2(eβh̄ω − 1) (eβh̄ω − 1) (eβh̄ω − 1) (h̄ω)2 eβh̄ω/2+µ (eh̄ωβ + 1)
(44)
(35) 4(e h̄ωβ − 1)(eβh̄ω+µ − eµ − eβh̄ω/2 )2
hN iω 2 h̄2 eβh̄ω In the canonical limit, we get the canonical energy fluc-
(∆E)2 = (36)
(eβh̄ω − 1)2 tuations (the first term) back because the oscillator num-
ber fluctuation (∆N )2 = 0 so the whole second term is
This can be simplified using the trigonometric identity
zero. Again, (∆P )2 = 0 from the lack of a defined volume
for csch(x):
for the problem.
2ex βh̄ω
csch(x) = with x = (37)
(e2x − 1) 2 CLASSICAL OSCILLATORS
Plugging this in gives:
PROBLEM #1

1  βh̄ω 
(∆E)2 = hN iω 2 h̄2 csch2 (38) Part A
4 2
I start again with a system of 1D N classical harmonic
(∆P )2 = 0 (39) oscillators. The Hamiltonian for this system can be de-
7

scribed by: the multiplicity of states found in Part A, I can easily


compute the series summation:
N
X p2i 1
Hclass = + mω 2 x2i (45) −N
i=0
2m 2 HE
φ(E) = (50)
N Γ(N )
Here, pi is the momentum of oscillator i, xi is the posi-
tion of oscillator i, m is the mass of each indistinguishable −N
oscillator and ω. The multiplicity of states for a system Here HE is the Nth harmonic number. A plot of this
can be calculated by: function is shown in Figure 12

Z Z
1 N
Ω(E, N, V ) = N d xi dN pi δ(E − H(q, p)) (46)
h
This can be rewritten as:

Z
1
Ω(E, N, V ) = dN xi dN pi (47)
hN H(qi ,pi )≤E

Z
1
Ω(E, N, V ) = dN xi dN pi (48)
mωhN PN 2 2
i=0 (pi +xi )≤2mE

This integral turns out to be a sphere of radius 2mE
so we can write the multiplicity of states as:
FIG. 12. Cumulative multiplicity of states for N = 4 classical
oscillators. We can see that this is directly comparable to
1  E N the quantum case in Figure 11. Just like in Figure 11, the
Ω(E, N, V ) = (49) step function is a strange artifact of the Mathematica plotting
N Γ(N ) h̄ω
scheme.
A plot of this multiplicity for N = 4 oscillators is shown
in Figure 11.
Part C

I again calculate the density of states as I did for the


quantum case. The formula was given in the quantum
section so I only give the final answer here:

1−N
ζ(1 − N ) − HE
Ω(E) = − (51)
Γ(N )

A plot of the density of states is shown if Figure 13.

Part D
FIG. 11. Multiplicity of states for N = 4 classical oscillators.
We can see that this is directly comparable to the quantum See Part D of the quantum systems.
case in Figure 1.

Part E

Part B The equation for entropy was given in the quantum


part of the exam so I do not reproduce it here. I only plot
I now move on to calculate the cumulative multiplic- the comparison of the different entropy calculations and
ity of states φ as I did for the quantum system. Using the different multiplicity/density of states calculations.
8

FIG. 13. Density of states for N = 4 classical oscillators. FIG. 15. Comparison of entropies for N = 4. We can see that
Again, the shape is the exact same as in Figure 2. the entropies agree well with each other as is to be expected.
The plot also agrees well with Figure 4.

FIG. 14. Comparison of state counting methods for N = 4.


We can see that just like the quantum case, the cumulative
multiplicity is far different from the other two methods. FIG. 16. The multiplicity for N = 100. We can see that it
has the same form as Figure 6. This means that the quantum
and classical systems could behave in similar ways.
So, we see that the classical system is much like the
quantum system for low numbers of oscillators. I now
move on to compare the two systems for large numbers
of oscillators.

PROBLEM #2

Part A

As the equations are all the same for Problem #2 as


they are for #1, I will only plot and discuss the results
with N = 100 oscillators as compared to N = 4 oscilla-
tors. A plot of the multiplicity is shown in Figure 16.

Part B FIG. 17. The cumulative multiplicity for N = 100. We can


see that it has the same form as Figure 7. This means that
A plot of the cumulative multiplicity of states is shown the quantum and classical systems could behave in similar
in Figure 17. ways.
9

Part C

A plot of the multiplicity of states is shown in Figure


18.

FIG. 20. Comparison of entropies for N = 100. We can


see that the entropies agree well with each other as is to be
expected. The plot also agrees well with Figure 9. The dip
below 0 on the left half means that there is a minimum energy
for this system at the x-intercept.
FIG. 18. The density of states for N = 100. We can see
that it has the same form as Figure 8. This means that the
quantum and classical systems could behave in similar ways. quantum systems are very similar and their entropies
only differ by a scaling factor.

Part D
PROBLEM #3
See Part D of the quantum systems.
Part A - Microcanonical Ensemble

Part E For the microcanonical ensemble, we have defined the


energy to be fixed. The entropy of the microcanonical
In this section, I show a plot of the comparison of the ensemble is:
two entropy calculations (just like in previous sections)
and a comparison of the different state counting methods. !
E
S(E) = kln(Ω(E, N, V )) = N k 1 + ln (52)
h̄ω

Here, Stirling’s approximation was used. Now, just as


in the quantum case, we can calculate the energy:

1 ∂S Nk
= = (53)
T ∂Etot N Etot

Etot = N kT (54)

This result makes sense as this is the typical total en-


FIG. 19. Comparison of state counting methods for N = 100. ergy for a 1D thermal system. Again, the pressure is 0
We can see that just like the quantum case all three methods because:
converge for large N .

From the many plots in Problem #1 and #2 of ∂S


P = =0 (55)
the classical section, we can see that the classical and ∂V
10

Part B - Canonical Ensemble Calculating the average number of particles gives:

For the canonical ensemble, I calculate the energy just 1 ∂ln(ZGC ) eβµ
as I did for the quantum case. First I must calculate the hN i = − = (65)
β ∂µ βh̄ω − eβµ
partition function for a single oscillator in a continuous
classical system: Now substituting hN i into E I arrive at the final aver-
ZZ age energy for the grand canonical ensemble.
1 0 0
Z1 = dx0 dp0 e−βH(q ,p ) (56)
h
hN i(1 − βµ)
E= (66)
ZZ β
1 0 0 −β( p
02
1 2 02
Z1 = dx dp e 2m + 2 mω x ) (57)
h Now, we can see that if µ → 0 (the canonical limit) and
substitute in for β, then we recover the average energy
for the canonical ensemble. Just like every other case,
1
Z1 = (58) the pressure for this system is 0 because of the lack of
h̄βω
volume dependence.
The partition function for N particles is then:
PROBLEM #4
 1 N
ZN = (59)
h̄βω Part A - Microcanonical Ensemble

The average energy can then be calculated like for the


quantum system: Just like in the quantum case:

(∆E)2 = 0 (67)
∂ln(Z)
E=− = N kT (60)
∂β
(∆P )2 = 0 (68)
Just like for every other part, the pressure is 0 because for the same reasons stated in that section.
we have no volume dependence.

Part B - Canonical Ensemble


Part C - Grand Canonical Ensemble
The energy fluctuation for the canonical ensemble is
Now, I will calculate the average energy for the grand given by:
canonical ensemble. This method is the same as used in
the quantum system. Now, the grand partition function
is: ∂E
(∆E)2 = − (69)
∂β
∞ ZZ
p02
Using the average energy calculate in Problem #3 I
1 2
x02 ) −βµN
X
ZGC = dx0 dp0 e−β( 2m + 2 mω e (61) arrive at the average energy fluctuation for the canonical
N =0 ensemble:

∞  ∞
X 1 N −βµN X 1 N
ZGC = e = xN = (62) (∆E)2 = (70)
h̄βω 1−x β2
N =0 N =0

Just like in the quantum system, the pressure fluctua-


1 tions are 0:
ZGC = eβµ
(63)
1− βh̄ω
∂P
Now, I calculate the average energy based on this: (∆P )2 = =0 (71)
∂β

∂ln(ZGC ) eβµ (βµ − 1) This is because P = 0 for the canonical ensemble.


E=− = (64)
∂β β(βh̄ω − eβµ )
11

Part C - Grand Canonical Ensemble Nam dui ligula, fringilla a, euismod sodales, sollici-
tudin vel, wisi. Morbi auctor lorem non justo. Nam la-
For the grand canonical ensemble, the energy fluctua- cus libero, pretium at, lobortis vitae, ultricies et, tellus.
tions can be calculated as: Donec aliquet, tortor sed accumsan bibendum, erat ligula
aliquet magna, vitae ornare odio metus a mi. Morbi ac
orci et nisl hendrerit mollis. Suspendisse ut massa. Cras
!2 nec ante. Pellentesque a nulla. Cum sociis natoque pe-
∂E
(∆E)2 GC = (∆E)2 C + (∆N )2 (72) natibus et magnis dis parturient montes, nascetur ridicu-
∂hN i

T,V lus mus. Aliquam tincidunt urna. Nulla ullamcorper
vestibulum turpis. Pellentesque cursus luctus mauris.
Calculating individual terms gives: Nulla malesuada porttitor diam. Donec felis erat,
congue non, volutpat at, tincidunt tristique, libero. Vi-
vamus viverra fermentum felis. Donec nonummy pellen-
!2
tesque ante. Phasellus adipiscing semper elit. Proin fer-

∂E (1 − βµ)2
= (73) mentum massa ac quam. Sed diam turpis, molestie vitae,
∂hN i β2

T,V placerat a, molestie nec, leo. Maecenas lacinia. Nam ip-
sum ligula, eleifend at, accumsan nec, suscipit a, ipsum.
Morbi blandit ligula feugiat magna. Nunc eleifend con-
sequat lorem. Sed lacinia nulla vitae enim. Pellentesque
!
∂N βh̄ωeβµ
(∆N )2 = kT =− (74)

tincidunt purus vel magna. Integer non enim. Praesent
∂µ (eβµ − βh̄ω)2


T,V euismod nunc eu purus. Donec bibendum quam in tel-
lus. Nullam cursus pulvinar lectus. Donec et mi. Nam
Combining these terms gives the final result for the vulputate metus eu enim. Vestibulum pellentesque felis
average energy fluctuations of the grand canonical en- eu massa.
semble: Quisque ullamcorper placerat ipsum. Cras nibh.
Morbi vel justo vitae lacus tincidunt ultrices. Lorem ip-
sum dolor sit amet, consectetuer adipiscing elit. In hac
N (1 − βµ)2 βh̄ωeβµ habitasse platea dictumst. Integer tempus convallis au-
(∆E)2 GC = − (75) gue. Etiam facilisis. Nunc elementum fermentum wisi.
β2 β2 (eβµ − βh̄ω)2
Aenean placerat. Ut imperdiet, enim sed gravida sollic-
itudin, felis odio placerat quam, ac pulvinar elit purus
Lastly, just like every other part of this assignment, the
eget enim. Nunc vitae tortor. Proin tempus nibh sit
average pressure fluctuations are 0 because of the lack of
amet nisl. Vivamus quis tortor vitae risus porta vehic-
a volume in the system.
ula.
Fusce mauris. Vestibulum luctus nibh at lectus. Sed
bibendum, nulla a faucibus semper, leo velit ultricies tel-
ACKNOWLEDGMENTS lus, ac venenatis arcu wisi vel nisl. Vestibulum diam. Ali-
quam pellentesque, augue quis sagittis posuere, turpis la-
I would like to acknowledge the rest of the class for cus congue quam, in hendrerit risus eros eget felis. Mae-
collaborating with me on this assignment. cenas eget erat in sapien mattis porttitor. Vestibulum
Lorem ipsum dolor sit amet, consectetuer adipiscing porttitor. Nulla facilisi. Sed a turpis eu lacus commodo
elit. Ut purus elit, vestibulum ut, placerat ac, adipisc- facilisis. Morbi fringilla, wisi in dignissim interdum, justo
ing vitae, felis. Curabitur dictum gravida mauris. Nam lectus sagittis dui, et vehicula libero dui cursus dui. Mau-
arcu libero, nonummy eget, consectetuer id, vulputate a, ris tempor ligula sed lacus. Duis cursus enim ut augue.
magna. Donec vehicula augue eu neque. Pellentesque Cras ac magna. Cras nulla. Nulla egestas. Curabitur a
habitant morbi tristique senectus et netus et malesuada leo. Quisque egestas wisi eget nunc. Nam feugiat lacus
fames ac turpis egestas. Mauris ut leo. Cras viverra me- vel est. Curabitur consectetuer.
tus rhoncus sem. Nulla et lectus vestibulum urna fringilla Suspendisse vel felis. Ut lorem lorem, interdum eu,
ultrices. Phasellus eu tellus sit amet tortor gravida plac- tincidunt sit amet, laoreet vitae, arcu. Aenean faucibus
erat. Integer sapien est, iaculis in, pretium quis, viverra pede eu ante. Praesent enim elit, rutrum at, molestie
ac, nunc. Praesent eget sem vel leo ultrices bibendum. non, nonummy vel, nisl. Ut lectus eros, malesuada sit
Aenean faucibus. Morbi dolor nulla, malesuada eu, pulv- amet, fermentum eu, sodales cursus, magna. Donec eu
inar at, mollis ac, nulla. Curabitur auctor semper nulla. purus. Quisque vehicula, urna sed ultricies auctor, pede
Donec varius orci eget risus. Duis nibh mi, congue eu, lorem egestas dui, et convallis elit erat sed nulla. Donec
accumsan eleifend, sagittis quis, diam. Duis eget orci sit luctus. Curabitur et nunc. Aliquam dolor odio, com-
amet orci dignissim rutrum. modo pretium, ultricies non, pharetra in, velit. Integer
arcu est, nonummy in, fermentum faucibus, egestas vel,
odio.
PH 530 - Statistical Mechanics
Take Home Midterm
Alex Wilhelm
10/3/2016
Clear["Global`*"]

Problem #1
a)

En = ℏωn + 1  for a 1D quantum harmonic oscilla-


2
tor
N
Etot = ℏωNtot +  Here N is the number of allowed states
2
for particles to occupy and Ntot is the number of particles
Ω(Etot,N,V) = (Ntot +N - 1) ! / (Ntot ! (N - 1) !)

Ntot + NN - 1 !
Ω1a[Ntot_, NN_] := ;
Ntot ! NN - 1 !
Etot NN
Ω1aa[Etot_, NN_] = Ω1a[Ntot, NN] /. Ntot → - 
ℏω 2
NN Etot
- 1 + 2
+ ωℏ
!
(- 1 + NN) ! - NN
2
+ Etot
ωℏ
!

So:
Etot N
 ℏω + 2 -1!
Ω(Etot, N, V) =
 Eℏω
tot
- N2 ! (N-1)!
2 AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb

Assume N = 4,ℏω = 1
NNN1
Emin1 = ;
2
NNN1 = 4;
Emax = 20;
data1a = Table[Ω1aa[i, 4] /. {ℏ → 1, ω → 1}, {i, Emin1, Emax}];
Elst = Table[i, {i, Emin1, Emax}];
plot1a = Show[{Plot[Ω1aa[Etot, 4] /. {ℏ → 1, ω → 1},
{Etot, Emin1, Emax}, PlotRange → {{Emin1, Emax}, All}, PlotStyle → Blue],
ListPlot[Transpose[{Elst, data1a}], PlotMarkers → {Black, 10},
PlotStyle → Blue, PlotRange → {{Emin1, Emax}, All}]},
PlotLabel → "Ω(Etot ,N,V)", Frame → True, FrameLabel → {"E", ""}, ImageSize → Large]

Ω(Etot ,N,V)
1400

1200

1000

800

600

400

200

5 10 15 20
E
AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb 3

b)
ϕ[Ep_, NN_] := Sum[Ω1aa[Etot, NN] /. {ℏ → 1, ω → 1}, {Etot, 1, Ep}];
ϕ[Et, NNNN] // FullSimplify // TraditionalForm
datab = Table[ϕ[Ep, 4], {Ep, Emin1, Emax}];
plot1b = Show[{Plot[ϕ[Ep, NNN1], {Ep, Emin1, Emax}, PlotStyle → Red,
PlotRange → {{Emin1, Emax}, All}], ListLinePlot[Thread[{Elst, datab}],
PlotMarkers → {Black, 10}, PlotRange → {{Emin1, Emax}, All}]},
PlotLabel → "ϕ(Etot ,N)", Frame → True, FrameLabel → {"E", ""}, ImageSize → Large]

(*ListLinePlot[datab,PlotMarkers→ {Black,10},PlotStyle→ Red]*)


NNNN
ΓEt + 2
+ 1 π 2-NNNN
-
NNNN NNNN NNNN+1
Γ(NNNN + 1) ΓEt - 2
+ 1 Γ1 - 2
 Γ 2 

ϕ(Etot ,N)

6000

4000

2000

5 10 15 20
E
4 AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb

c)
Ω1c[EE_] = D[ϕ[EE, 4], EE];
D[ϕ[EE, NNNN], EE] // FullSimplify
data1c = Ω1c[Elst];
NNNN NNNN
Gamma1 + EE +  2 + (- 2 - 2 EE + NNNN) HarmonicNumber1 + EE - +
2 2
NNNN
(2 + 2 EE - NNNN) HarmonicNumberEE +  
2
NNNN
2 Gamma2 + EE -  Gamma[1 + NNNN]
2

plot1c = Show[{ListPlot[Thread[{Elst, data1c}],


PlotMarkers → {Black, 5}, PlotRange → {{Emin1, Emax}, All}],
Plot[Ω1c[EE], {EE, 1, Emax}, PlotRange → {{Emin1, Emax}, All}, PlotStyle → Blue]},
PlotLabel → "Ω(E)", Frame → True, FrameLabel → {"E", ""}, ImageSize → Large]

Ω(E)

1400

1200

1000

800

600

400

200

0
5 10 15 20
E

d)
The h3 N terms come from normalizing the momentum space
box that the harmonic oscillators live in. We have defined no
such box which is why we don’t have any. The N! comes
AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb 5

from resolving Gibb’s paradox. It accounts for the indistin-


guishableness of the particles.
e)
S[EE_] = k Log[Ω1aa[EE, NNN1]] /. {k → 1, ℏ → 1, ω → 1};
(*Should be in terms of multiplicity instead of density of states*)

data1e = S[Elst];
plot1e = Show[
{Plot[S[EE], {EE, Emin1, Emax}, PlotRange → {{Emin1, Emax}, All}, PlotStyle → Blue],
ListPlot[Thread[{Elst, data1e}],
PlotMarkers → {Black, 5}, PlotRange → {{Emin1, Emax}, All}]},
Frame → True, FrameLabel → {"E", "S", "S(E)"}, ImageSize → Large]

S(E)

4
S

5 10 15 20
E
6 AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb

plot1O = ListLinePlot[
{Thread[{Elst, data1a}], Thread[{Elst, datab}], Thread[{Elst, data1c}]},
PlotRange → {{Emin1, Emax}, All}, PlotStyle → {Blue, Red, Green},
PlotLegends → Placed[{"Ω(Etot ,N,V)", "ϕ(E,N)", "Ω(E)"}, {.15, .85}], Frame → True,
FrameLabel → {"E", "", "Comparison of Multiplicy and Density of States"},
ImageSize → Large, PlotMarkers → {Black, 5}]

plot1s = ListLinePlot[{Thread[{Elst, Log[data1a]}], Thread[{Elst, Log[data1c]}]},


PlotRange → {{Emin1, Emax}, All}, PlotStyle → {Blue, Red},
PlotLegends → Placed[{"ln(Ω(Etot ,N,V))", "ln(Ω(E))"}, {.15, .85}],
Frame → True, FrameLabel → {"E", "S", "Comparison of Entropies"},
ImageSize → Large, PlotMarkers → {Black, 5}]

Comparison of Multiplicy and Density of States

7000 Ω(Etot ,N,V)


ϕ(E,N)
Ω(E)
6000

5000

4000

3000

2000

1000

0
5 10 15 20
E
AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb 7

Comparison of Entropies

7
ln(Ω(Etot ,N,V))
ln(Ω(E))
6

4
S

0
5 10 15 20
E

Problem #2
a)

En = ℏωn + 1 
2
N
Etot = ℏωNtot +  Here N is the number of allowed states
2
for particles to occupy and Ntot is the number of particles
Ω(Etot,N,V) = (Ntot +N - 1) ! / (Ntot ! (N - 1) !)

Ntot + NN - 1 !
Ω2a[Ntot_, NN_] := ;
Ntot ! NN - 1 !
Etot NN
Ω2aa[Etot_, NN_] = Ω2a[Ntot, NN] /. Ntot → - 
ℏω 2
NN Etot
- 1 + 2
+ ωℏ
!
(- 1 + NN) ! - NN
2
+ Etot
ωℏ
!

So:
8 AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb

Etot N
 ℏω + 2 -1!
Ω(Etot, N, V) =
 Eℏω
tot
- N2 ! (N-1)!
Assume N = 4,ℏω = 1
NNN = 100;
NNN
Emin = ;
2
data2a = Table[Ω2aa[i, NNN] /. {ℏ → 1, ω → 1}, {i, Emin, NNN}];
Elst2 = Table[i, {i, Emin, 100}];
plot2a = Show[{Plot[Ω2aa[Etot, NNN] /. {ℏ → 1, ω → 1},
{Etot, Emin, NNN}, PlotRange → {{Emin, NNN + 1}, All}, PlotStyle → Blue],
ListPlot[Transpose[{Elst2, data2a}], PlotMarkers → {Black, 10}, PlotStyle → Blue,
PlotRange → {{Emin, NNN + 1}, All}]}(*,PlotLabel→ "Ω(Etot ,N,V)"*),
Frame → True, FrameLabel → {"E", "", "Ω(Etot ,N,V)"}, ImageSize → Large]

Ω(Etot ,N,V)
1.4 × 1040

1.2 × 1040

1.0 × 1040

8.0 × 1039

6.0 × 1039

4.0 × 1039

2.0 × 1039

50 60 70 80 90 100
E
AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb 9

b)
ϕ[Ep_, NN_] := Sum[Ω2aa[Etot, NN] /. {ℏ → 1, ω → 1}, {Etot, 0, Ep}];
data2b = Table[ϕ[Ep, NNN], {Ep, Emin, NNN}];
plot2b = Show[
{Plot[ϕ[Ep, NNN], {Ep, Emin, NNN}, PlotStyle → Red, PlotRange → {{Emin, NNN}, All}],
ListPlot[Thread[{Elst2, data2b}], PlotMarkers → {Black, 10},
PlotRange → {{Emin, NNN}, All}]},
FrameLabel → {"E", "", "ϕ(Etot ,N)"}, Frame → True, ImageSize → Large,
PlotLegends → Placed[{"Analytic Derivative", "Value of Derivative"}, {.15, .85}]]

ϕ(Etot ,N)

2.0 × 1040

1.5 × 1040

1.0 × 1040

5.0 × 1039

50 60 70 80 90 100
E

c)
Ω2c[EE_] = D[ϕ[EE, NNN], EE];

data2c = Ω2c[Elst2];
10 AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb

plot2c = Show[{ListPlot[Thread[{Elst2, data2c}],


PlotMarkers → {Black, 5}, PlotRange → {{Emin, NNN}, All}],
Plot[Ω2c[EE], {EE, Emin, NNN}, PlotRange → {{Emin, NNN}, All}, PlotStyle → Blue]},
Frame → True, FrameLabel → {"E", "", "Ω(E)"}, ImageSize → Large]

Ω(E)

2.0 × 1040

1.5 × 1040

1.0 × 1040

5.0 × 1039

0
50 60 70 80 90 100
E

d)
The h3 N terms come from normalizing the momentum space
box that the harmonic oscillators live in. We have defined no
such box which is why we don’t have any. The N! comes
from resolving Gibb’s paradox. It accounts for the indistin-
guishableness of the particles.
AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb 11

e)
S[EE_] = k Log[Ω2aa[EE, NNN]] /. {k → 1, ℏ → 1, ω → 1};
data2e = S[Elst2];
plot2e = Show[
{Plot[S[EE], {EE, Emin, NNN}, PlotRange → {{Emin, NNN + 1}, All}, PlotStyle → Blue],
ListPlot[Thread[{Elst2, data2e}], PlotMarkers → {Black, 5},
PlotRange → {{Emin, NNN + 1}, All}]}, Frame → True,
PlotLabel → "S(E)", FrameLabel → {"E", "S"}, ImageSize → Large]

S(E)

80

60
S

40

20

50 60 70 80 90 100
E
12 AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb

plot2O = ListLinePlot[
{Thread[{Elst2, data2a}], Thread[{Elst2, data2b}], Thread[{Elst2, data2c}]},
PlotRange → {{Emin, NNN}, All}, PlotStyle → {Blue, Red, Green},
PlotLegends → Placed[{"Ω(Etot ,N,V)", "ϕ(E,N)", "Ω(E)"}, {.15, .85}], Frame → True,
FrameLabel → {"E", "", "Comparison of Multiplicy and Density of States"},
ImageSize → Large, PlotMarkers → {Black, 5}]

plot2s = ListLinePlot[{Thread[{Elst2, Log[data2a]}], Thread[{Elst2, Log[data2c]}]},


PlotRange → {{Emin, NNN}, All}, PlotStyle → {Blue, Red},
PlotLegends → Placed[{"ln(Ω(Etot ,N,V))", "ln(Ω(E))"}, {.15, .85}],
Frame → True, FrameLabel → {"E", "S", "Comparison of Entropies"},
ImageSize → Large, PlotMarkers → {Black, 5}]

Comparison of Multiplicy and Density of States

Ω(Etot ,N,V)
2.0 × 1040 ϕ(E,N)
Ω(E)

1.5 × 1040

1.0 × 1040

5.0 × 1039

0
50 60 70 80 90 100
E
AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb 13

Comparison of Entropies

ln(Ω(Etot ,N,V))
80 ln(Ω(E))

60
S

40

20

0
50 60 70 80 90 100
E

Problem #3

a)
S = k (ln((Ntot+N)!)-ln(Ntot!)-ln(N!)) → Does not depend on V
so ∂S = 0 so P=0.
∂v

Using Stirling’s approximation:


S ≃ k((Ntot + N)ln(Ntot+N) -Ntotln(Ntot) - Nln(N))

k Ntot +N
Now, 1 / T = ∂S / ∂E N = ∂S / ∂Ntot N (1/ℏω) = ln 
ℏω Ntot

1  ℏω 
k E+ Nℏω N e kT +1
= 2
1
→ Exponentiate → E = ℏω
ℏω E- Nℏω 2 e
 ℏω 
kT -1
2
14 AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb

Above in red is the energy for the canonical ensemble.


(*This should be for the microcanonical. Use the partition
function to calculate average energy. Do the same for the *)

b)
NN
-β ℏ ω
ⅇ 2
Z[β_ ] = ;
1 - ⅇ-β ℏ ω NN
Eavg = - D[Z[β], β] / Z[β] // Simplify
1 + ⅇβ ω ℏ  NN ω ℏ
2 - 1 + ⅇβ ω ℏ 

(*Z was found in Pathria page 67*)


AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb 15

c)
1
ZGC[β_, μ_] = ω
;
-β ℏ +μ

1-
2

(1-ⅇ-β ℏ ω )

EavgGC = - D[ZGC[β, μ], β]


EavgGC = - D[ZGC[β, μ], β] / ZGC[β, μ]
EavgGC = - D[ZGC[β, μ], β] / ZGC[β, μ] // FullSimplify

"Average Energy: " <> ToString[EavgGC // TraditionalForm]

AvgN = D[ZGC[β, μ], μ]


AvgN = - D[ZGC[β, μ], μ] / ZGC[β, μ] // Simplify
AvgN = AvgN
"Average Number: " <> ToString[AvgN // TraditionalForm]
3βωℏ βωℏ
-μ- -μ-
ⅇ 2 ωℏ ⅇ 2 ωℏ
+
(1-ⅇ-β ω ℏ )2 2 (1-ⅇ-β ω ℏ )

-μ-
βωℏ 2

1-
2

1-ⅇ-β ω ℏ

3βωℏ βωℏ
-μ- -μ-
ⅇ 2 ωℏ ⅇ 2 ωℏ
+
(1-ⅇ-β ω ℏ )2 2 (1-ⅇ-β ω ℏ )
βωℏ
-μ-

1-
2

1-ⅇ-β ω ℏ
βωℏ
ⅇ 2 1 + ⅇβ ω ℏ  ω ℏ
βωℏ
2 - 1 + ⅇβ ω ℏ  - ⅇμ - ⅇ 2 + ⅇμ+β ω ℏ 
βωℏ
ωℏⅇ 2 ⅇβ ω ℏ + 1
Average Energy: βωℏ
2 ⅇβ ω ℏ - 1 ⅇβ ω ℏ+μ - ⅇ 2 - ⅇμ 
βωℏ
ⅇ-μ- 2
-
-μ-
βωℏ 2

1 - ⅇ-β ω ℏ  1 -
2

1-ⅇ-β ω ℏ

βωℏ
ⅇ 2
- βωℏ
ⅇμ + ⅇ 2 - ⅇμ+β ω ℏ
βωℏ
ⅇ 2
- βωℏ
ⅇμ + ⅇ 2 - ⅇμ+β ω ℏ
βωℏ
ⅇ 2
Average Number: - βωℏ
- ⅇβ ω ℏ+μ + ⅇ 2 + ⅇμ
16 AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb

S = k (ln((Ntot+N)!)-ln(Ntot!)-ln(N!)) → Does not depend on V


so ∂S = 0 so P=0.
∂v

Problem #4
a)
For the microcanonical ensemble, Z = Ω(E)

2
(ΔE)2 = E 2 - E = - ∂E 
∂β

We have defined the energy as fixed for the microcanonical


ensemble so (ΔE)2 = 0.
Because the pressure is 0 in this system, there can be no
pressure fluctuations. Therefore (ΔP)2 = 0.

b)

For the canonical ensemble, Z = ∫ dEΩ(E) e-βE → use a sum-
0
mation over discrete En

2
(ΔE)2 = E 2 - E = - ∂E 
∂β
AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb 17

Eavg
- D[Eavg, β](*//FullSimplify*)
- D[Eavg, β] // FullSimplify
1 + ⅇβ ω ℏ  NN ω ℏ
2 - 1 + ⅇβ ω ℏ 

ⅇβ ω ℏ NN ω2 ℏ2 ⅇβ ω ℏ 1 + ⅇβ ω ℏ  NN ω2 ℏ2
- +
2 - 1 + ⅇβ ω ℏ  2 - 1 + ⅇβ ω ℏ 2
1 βωℏ 2
NN ω2 ℏ2 Csch 
4 2

c)
For the grand canonical ensemble Z =
∞ ∞
Σ ∫ dEΩ(E) e-(βE-βμN)
N=0
0
(ΔE) = kT2 ∂E 
2
z,V = - ∂E 
∂T ∂β
18 AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb

1 1
k T2 DEavgGC /. β →  , T + k T μ DEavgGC /. β →  , μ
kT kT
μ
D[EavgGC /. {μ → 0}, β] + D[EavgGC, μ]
β

- Na ω2 ℏ2 
2
βωℏ

ⅇβ ω ℏ 1 + ⅇβ ω ℏ  1 + ⅇβ ω ℏ  1 + ⅇβ ω ℏ  - 1 ⅇ 2 + ⅇμ+β ω ℏ 
ⅇβ ω ℏ 2
- + - +
- 1 + ⅇβ ω ℏ 2
βωℏ
- 1 + ⅇβ ω ℏ  2 - 1 + ⅇβ ω ℏ  - 1 + ⅇβ ω ℏ  - ⅇμ - ⅇ 2 + ⅇμ+β ω ℏ 

- Na ω2 ℏ2  ⅇβ ω ℏ ⅇβ ω ℏ 1 + ⅇβ ω ℏ 
- + -
2 - 1 + ⅇβ ω ℏ  - 1 + ⅇβ ω ℏ 2


- Na 1 + ⅇβ ω ℏ  - 1 + ⅇ
μ+β ω
1 + ⅇβ ω ℏ 
2 
2
+
2 - 1 + ⅇβ ω ℏ  - 1 + ⅇβ ω ℏ 

βωℏ
ⅇ 2 1 + ⅇβ ω ℏ 2 ⅇμ - ⅇμ+β ω ℏ  ω2 ℏ2
βωℏ 2
4 - 1 + ⅇβ ω ℏ 2 ⅇμ + ⅇ 2 - ⅇμ+β ω ℏ  β

ωℏ ωℏ ωℏ
ⅇ 2 k T 1 + ⅇ k T  - ⅇμ + ⅇμ+ k T  k T μ ω ℏ
- +
ωℏ ωℏ ωℏ 2
2 - 1 + ⅇ k T  - ⅇμ - ⅇ 2 k T + ⅇμ+ k T 

3ωℏ ωℏ
3ωℏ
ⅇ 2 k T ω2 ℏ2 ⅇ 2 k T 1 + ⅇ k T  ω2 ℏ2
k T2 - + -
ωℏ ωℏ ωℏ ωℏ 2 ωℏ ωℏ
2 - 1 + ⅇ k T  - ⅇμ - ⅇ 2 k T + ⅇμ+ k T  k T2 2 - 1 + ⅇ k T  - ⅇμ - ⅇ 2 k T + ⅇμ+ k T  k T2

ωℏ ωℏ
ωℏ ωℏ μ+
ⅇ2kT ω ℏ ⅇ kT ω ℏ
ωℏ ωℏ
ⅇ 2 k T 1 + ⅇ k T  ω ℏ -
ⅇ 2kT 1 + ⅇ kT  ω 2 ℏ2 2 k T2 k T2
-
ωℏ ωℏ ωℏ ωℏ ωℏ ωℏ 2
4 - 1 + ⅇ k T  - ⅇμ - ⅇ 2 k T + ⅇμ+ k T  k T2 2 - 1 + ⅇ k T  - ⅇμ - ⅇ 2 k T + ⅇμ+ k T 
AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb 19

βωℏ
ⅇ 2 1 + ⅇβ ω ℏ  - ⅇμ + ⅇμ+β ω ℏ  μ ω ℏ
- +
βωℏ 2
2 - 1 + ⅇβ ω ℏ  - ⅇμ - ⅇ 2 + ⅇμ+β ω ℏ  β
3βωℏ 3βωℏ
ⅇ 2 ω2 ℏ2 ⅇ 2 1 + ⅇβ ω ℏ  ω2 ℏ2
βωℏ
- βωℏ
+
2 - 1 + ⅇβ ω ℏ  - 1 - ⅇ 2 + ⅇβ ω ℏ  2 - 1 + ⅇβ ω ℏ 2 - 1 - ⅇ 2 + ⅇβ ω ℏ 
βωℏ βωℏ
1 + ⅇβ ω ℏ  ω ℏ - 12 ⅇ
βωℏ
ⅇ 2 1 + ⅇβ ω ℏ  ω2 ℏ2 ⅇ 2 2 ω ℏ + ⅇβ ω ℏ ω ℏ
-
βωℏ βωℏ 2
4 - 1 + ⅇβ ω ℏ  - 1 - ⅇ 2 + ⅇβ ω ℏ  2 - 1 + ⅇβ ω ℏ  - 1 - ⅇ 2 + ⅇβ ω ℏ 
βωℏ

1 ⅇβ ω ℏ ⅇβ ω ℏ 1 + ⅇβ ω ℏ  1 + ⅇβ ω ℏ 1 + ⅇβ ω ℏ  - 12 ⅇ 2 + ⅇμ+β ω ℏ 
- - + - + Na ω2 ℏ2
2 - 1 + ⅇβ ω ℏ - 1 + ⅇβ ω ℏ 2
βωℏ
2 - 1 + ⅇβ ω ℏ  - 1 + ⅇβ ω ℏ  - ⅇμ -ⅇ 2 + ⅇμ+β ω ℏ 
βωℏ

1 ⅇβ ω ℏ ⅇβ ω ℏ 1 + ⅇβ ω ℏ  1 + ⅇβ ω ℏ 1 + ⅇβ ω ℏ  - 12 + ⅇμ+ 2  Na
- Na - + - - ω2 ℏ2
2 - 1 + ⅇβ ω ℏ - 1 + ⅇβ ω ℏ 2 2 - 1 + ⅇβ ω ℏ  - 1 + ⅇβ ω ℏ

βωℏ
ⅇ 2 1 + ⅇβ ω ℏ 2 ⅇμ - ⅇμ+β ω ℏ  ω2 ℏ2
βωℏ 2
4 - 1 + ⅇβ ω ℏ 2 ⅇμ + ⅇ 2 - ⅇμ+β ω ℏ  β

βωℏ
μ+
ⅇ 2 1 + ⅇω ℏ β  μ ω ℏ
-
ωℏβ 2
2 β ⅇμ + ⅇ 2 - ⅇμ+ω ℏ β 
βωℏ
ⅇμ+ 2 1 + ⅇβ ω ℏ  μ ω ℏ
-
βωℏ 2
2 ⅇμ + ⅇ 2 - ⅇμ+β ω ℏ  β

1
Na2 ⅇβωℏ ω ℏ
- 1 + ⅇβ ω ℏ 2 β
βωℏ
- β ω ℏ + ⅇμ Sinh
 β ω ℏ 3 + Cosh[β ω ℏ] - 2 μ Sinh[β ω ℏ] // FullSimplify
2
"Energy Fluctuation: " <> ToString
1 1 βωℏ βωℏ
Na2 Csch2   ω ℏ - β ω ℏ + ⅇμ Sinh  β ω ℏ 3 + Cosh[β ω ℏ] - 2 μ Sinh[β ω ℏ]
β 4 2 2
(*/.{μ→ 0}*) // FullSimplify // TraditionalForm
1 βωℏ
ⅇβ ω ℏ Na2 ω ℏ - β ω ℏ + ⅇμ Sinh  (β ω ℏ (3 + Cosh[β ω ℏ]) - 2 μ Sinh[β ω ℏ])
- 1 + ⅇ β ω ℏ 2 β 2

Energy Fluctuation:
1 βωℏ βωℏ
Na2 ω ℏ Csch2 ⅇμ sinh (β ω ℏ (cosh(β ω ℏ) + 3) - 2 μ sinh(β ω ℏ)) - β ω ℏ
4β 2 2

The line just above this is the alternate solution that I men-
tion in the report. It took more time but seemed less correct
so I abandoned it. The canonical energy fluctuation can be
20 AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb

seen in the solution but it is coupled to many terms that do


not disappear in any way even as μ → 0.
Export[NotebookDirectory[] <> "plot1a.png", plot1a]
Export[NotebookDirectory[] <> "plot1b.png", plot1b]
Export[NotebookDirectory[] <> "plot1c.png", plot1c]
Export[NotebookDirectory[] <> "plot1e.png", plot1e]
Export[NotebookDirectory[] <> "plot1O.png", plot1O]
Export[NotebookDirectory[] <> "plot1s.png", plot1s]

Export[NotebookDirectory[] <> "plot2a.png", plot2a]


Export[NotebookDirectory[] <> "plot2b.png", plot2b]
Export[NotebookDirectory[] <> "plot2c.png", plot2c]
Export[NotebookDirectory[] <> "plot2e.png", plot2e]
Export[NotebookDirectory[] <> "plot2O.png", plot2O]
Export[NotebookDirectory[] <> "plot2s.png", plot2s]
C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\plot1a.png

C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\plot1b.png

C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\plot1c.png

C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\plot1e.png

C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\plot1O.png

C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\plot1s.png

C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\plot2a.png

C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\plot2b.png

C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\plot2c.png

C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\plot2e.png
AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb 21

C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\plot2O.png

C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\plot2s.png

ωℏβ 3βωℏ
ⅇ 2 1 + ⅇω ℏ β  - ⅇμ + ⅇμ+ω ℏ β  μ ω ℏ ⅇ 2 ω2 ℏ2
- + - +
ωℏβ 2 ωℏβ

2 β - 1 + ⅇω ℏ β  - ⅇμ -ⅇ 2 + ⅇμ+ω ℏ β  2 - 1 + ⅇω ℏ β  - ⅇμ - ⅇ 2 + ⅇμ+ω ℏ β 

3ωℏβ ωℏβ
ⅇ 2 1 + ⅇω ℏ β  ω2 ℏ2 ⅇ 2 1 + ⅇω ℏ β  ω2 ℏ2
ωℏβ
- ωℏβ
-
2 - 1 + ⅇω ℏ β 2 - ⅇμ - ⅇ 2 + ⅇμ+ω ℏ β  4 - 1 + ⅇω ℏ β  - ⅇμ - ⅇ 2 + ⅇμ+ω ℏ β 

ωℏβ
ωℏβ
ⅇ 2 ωℏ
ⅇ 2 1 + ⅇω ℏ β  ω ℏ - ⅇμ+ω ℏ β ω ℏ
2
// ExpToTrig // FullSimplify
ωℏβ 2
2 - 1 + ⅇω ℏ β  - ⅇμ - ⅇ 2 + ⅇμ+ω ℏ β 

βωℏ 3 βωℏ
ω ℏ Csch  - β ω ℏ Csch  + ⅇμ (β ω ℏ (3 + Cosh[β ω ℏ]) - 2 μ Sinh[β ω ℏ]) 
2 2
βωℏ 2
4 β - 2 ⅇμ + Csch 
2

Na
EavgGC2 = ℏ ω
2
Na ω ℏ
2

Below is the point where I calculate the extra term for the
grand canonical ensemble energy fluctuations
ℏ ω ⅇℏ ω β + 1
dUdNav = ;
2 ⅇℏ ω β - 1
dUdNav2
1 + ⅇβ ω ℏ 2 ω2 ℏ2
4 - 1 + ⅇβ ω ℏ 2
22 AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb

1
Nfluc = D[AvgN, μ]
β
GCterm = Nfluc * dUdNav2 // FullSimplify(*page 105*)
βωℏ
ⅇ 2 ⅇμ - ⅇμ+β ω ℏ 
βωℏ 2
ⅇμ + ⅇ 2 - ⅇμ+β ω ℏ  β
βωℏ
ⅇμ+ 2 1 + ⅇβ ω ℏ 2 ω2 ℏ2
-
βωℏ 2
4 - 1 + ⅇβ ω ℏ  ⅇμ + ⅇ 2 - ⅇμ+β ω ℏ  β
AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb 23

Problem #1 Classical Case


1 En n
Ω1aaclass[En_, n_] = /. {ℏ → 1, ω → 1};
n Gamma[n] ℏω
Emin1 = 0;
NNN1 = 4;
Emax = 20;
data1a = Table[Ω1aaclass[i, 4] /. {ℏ → 1, ω → 1}, {i, Emin1, Emax}];
Elst = Table[i, {i, Emin1, Emax}];
cplot1a = Show[{Plot[Ω1aaclass[Etot, 4] /. {ℏ → 1, ω → 1},
{Etot, Emin1, Emax}, PlotRange → {{Emin1, Emax}, All}, PlotStyle → Blue],
ListPlot[Transpose[{Elst, data1a}], PlotMarkers → {Black, 10},
PlotStyle → Blue, PlotRange → {{Emin1, Emax}, All}]},
PlotLabel → "Ω(Etot ,N,V)", Frame → True, FrameLabel → {"E", ""}, ImageSize → Large]
Ω(Etot ,N,V)
7000

6000

5000

4000

3000

2000

1000

0 5 10 15 20
E
24 AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb

Part B
ϕclass[Ep_, NN_] := Sum[Ω1aaclass[Etot, NN] /. {ℏ → 1, ω → 1}, {Etot, 0, Ep}];
ϕclass[Et, NNNN] // FullSimplify // TraditionalForm
ϕclass[Et, NNNN]
datab = Table[ϕclass[Ep, 4], {Ep, Emin1, Emax}];
cplot1b = Show[{Plot[ϕclass[Ep, NNN1], {Ep, Emin1, Emax}, PlotStyle → Red,
PlotRange → {{Emin1, Emax}, All}], ListLinePlot[Thread[{Elst, datab}],
PlotMarkers → {Black, 10}, PlotRange → {{Emin1, Emax}, All}]},
PlotLabel → "ϕ(Etot ,N)", Frame → True, FrameLabel → {"E", ""}, ImageSize → Large]
(-NNNN)
HEt + 0NNNN
Γ(NNNN + 1)
0NNNN + HarmonicNumber[Et, - NNNN]
NNNN Gamma[NNNN]
ϕ(Etot ,N)

30 000

25 000

20 000

15 000

10 000

5000

0 5 10 15 20
E

Part C
Ω1cclass[EE_] = D[ϕclass[EE, 4], EE];
D[ϕclass[EE, NNNN], EE](*//FullSimplify*) // TraditionalForm
data1c = Ω1cclass[Elst];
(1-NNNN)
ζ(1 - NNNN) - HEE
-
Γ(NNNN)
AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb 25

cplot1c = Show[{ListPlot[Thread[{Elst, data1c}], PlotMarkers → {Black, 7},


PlotRange → {{Emin1, Emax}, All}], Plot[Ω1cclass[EE],
{EE, 1, Emax}, PlotRange → {{Emin1, Emax}, All}, PlotStyle → Blue]},
PlotLabel → "Ω(E)", Frame → True, FrameLabel → {"E", ""}, ImageSize → Large]
Ω(E)

6000

4000

2000

0 5 10 15 20
E
26 AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb

Part E
S[EE_] = k Log[Ω1aaclass[EE, NNN1]] /. {k → 1, ℏ → 1, ω → 1};
(*Should be in terms of multiplicity instead of density of states*)
S[EE]
data1e = S[Elst];
cplot1e =
Show[{Plot[S[EE], {EE, Emin1, Emax}, PlotRange → {{Emin1, Emax}, {- 10, 10}},
PlotStyle → Blue], ListPlot[Thread[{Elst, data1e}],
PlotMarkers → {Black, 5}, PlotRange → {{Emin1, Emax}, {- 10, 10}}]},
Frame → True, FrameLabel → {"E", "S", "S(E)"}, ImageSize → Large]
EE4
Log 
24
S(E)
10

0
S

-5

-10
0 5 10 15 20
E
AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb 27

cplot1O = ListLinePlot[
{Thread[{Elst, data1a}], Thread[{Elst, datab}], Thread[{Elst, data1c}]},
PlotRange → {{Emin1, Emax}, All}, PlotStyle → {Blue, Red, Green},
PlotLegends → Placed[{"Ω(Etot ,N,V)", "ϕ(E,N)", "Ω(E)"}, {.15, .85}], Frame → True,
FrameLabel → {"E", "", "Comparison of Multiplicy and Density of States"},
ImageSize → Large, PlotMarkers → {Black, 5}]

cplot1s = ListLinePlot[{Thread[{Elst, Log[data1a]}], Thread[{Elst, Log[data1c]}]},


PlotRange → {{Emin1, Emax}, All}, PlotStyle → {Blue, Red},
PlotLegends → Placed[{"ln(Ω(Etot ,N,V))", "ln(Ω(E))"}, {.15, .85}],
Frame → True, FrameLabel → {"E", "S", "Comparison of Entropies"},
ImageSize → Large, PlotMarkers → {Black, 5}]

Comparison of Multiplicy and Density of States

30 000
Ω(Etot ,N,V)
ϕ(E,N)
25 000 Ω(E)

20 000

15 000

10 000

5000

0 5 10 15 20
E
28 AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb

Comparison of Entropies

8 ln(Ω(Etot ,N,V))
ln(Ω(E))

4
S

-2

0 5 10 15 20
E

Problem #2
(*Clear["Global`*"]*)
AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb 29

1 En n
Ω1aaclass[En_, n_] = /. {ℏ → 1, ω → 1};
n Gamma[n] ℏω
Emin1 = 0;
NNN1 = 100;
Emax = 100;
data1a = Table[Ω1aaclass[i, NNN1] /. {ℏ → 1, ω → 1}, {i, Emin1, Emax}];
Elst = Table[i, {i, Emin1, Emax}];
Elst2 = Table[i, {i, Emin1, Emax}];
cplot2a = Show[{Plot[Ω1aaclass[Etot, NNN1] /. {ℏ → 1, ω → 1},
{Etot, Emin1, Emax}, PlotRange → {{Emin1, Emax}, All}, PlotStyle → Blue],
ListPlot[Transpose[{Elst, data1a}], PlotMarkers → {Black, 5},
PlotStyle → Blue, PlotRange → {{Emin1, Emax}, All}]},
PlotLabel → "Ω(Etot ,N,V)", Frame → True, FrameLabel → {"E", ""}, ImageSize → Large]
Ω(Etot ,N,V)

1 × 1042

8 × 1041

6 × 1041

4 × 1041

2 × 1041

0 20 40 60 80 100
E
30 AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb

Part B
ϕclass[Ep_, NN_] := Sum[Ω1aaclass[Etot, NN] /. {ℏ → 1, ω → 1}, {Etot, 0, Ep}];
ϕclass[Et, NNNN] // FullSimplify // TraditionalForm
ϕclass[Et, NNNN]
datab = Table[ϕclass[Ep, NNN1], {Ep, Emin1, Emax}];
cplot2b = Show[{Plot[ϕclass[Ep, NNN1], {Ep, Emin1, Emax}, PlotStyle → Red,
PlotRange → {{Emin1, Emax}, All}], ListLinePlot[Thread[{Elst, datab}],
PlotMarkers → {Black, 5}, PlotRange → {{Emin1, Emax}, All}]},
PlotLabel → "ϕ(Etot ,N)", Frame → True, FrameLabel → {"E", ""}, ImageSize → Large]
(-NNNN)
HEt + 0NNNN
Γ(NNNN + 1)
0NNNN + HarmonicNumber[Et, - NNNN]
NNNN Gamma[NNNN]
ϕ(Etot ,N)

1.5 × 1042

1.0 × 1042

5.0 × 1041

0 20 40 60 80 100
E

Part C
Ω1cclass[EE_] = D[ϕclass[EE, NNN1], EE];
D[ϕclass[EE, NNNN], EE](*//FullSimplify*)
data1c = Ω1cclass[Elst];
- HarmonicNumber[EE, 1 - NNNN] + Zeta[1 - NNNN]
-
Gamma[NNNN]
AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb 31

cplot2c = Show[{ListPlot[Thread[{Elst, data1c}], PlotMarkers → {Black, 5},


PlotRange → {{Emin1, Emax}, All}], Plot[Ω1cclass[EE],
{EE, 1, Emax}, PlotRange → {{Emin1, Emax}, All}, PlotStyle → Blue]},
PlotLabel → "Ω(E)", Frame → True, FrameLabel → {"E", ""}, ImageSize → Large]
Ω(E)

1.5 × 1042

1.0 × 1042

5.0 × 1041

0 20 40 60 80 100
E
32 AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb

Part E
S[EE_] = k Log[Ω1aaclass[EE, NNN1]] /. {k → 1, ℏ → 1, ω → 1};
(*Should be in terms of multiplicity instead of density of states*)
S[EE];
data1e = S[Elst];
cplot2e =
Show[{Plot[S[EE], {EE, Emin1, Emax}, PlotRange → {{Emin1, Emax}, {- 300, 100}},
PlotStyle → Blue], ListPlot[Thread[{Elst, data1e}],
PlotMarkers → {Black, 5}, PlotRange → {{Emin1, Emax}, {- 300, 100}}]},
Frame → True, FrameLabel → {"E", "S", "S(E)"}, ImageSize → Large]
S(E)
100

-100
S

-200

-300
0 20 40 60 80 100
E
AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb 33

cplot2O = ListLinePlot[
{Thread[{Elst2, data1a}], Thread[{Elst2, datab}], Thread[{Elst2, data1c}]},
PlotRange → {{Emin1, NNN1}, All}, PlotStyle → {Blue, Red, Green},
PlotLegends → Placed[{"Ω(Etot ,N,V)", "ϕ(E,N)", "Ω(E)"}, {.15, .85}], Frame → True,
FrameLabel → {"E", "", "Comparison of Multiplicy and Density of States"},
ImageSize → Large, PlotMarkers → {Black, 5}]

cplot2s =
ListLinePlot[{Thread[{Elst2, Log[data1a]}], Thread[{Elst2, Log[data1c]}]},
PlotRange → {{Emin1, NNN1}, All}, PlotStyle → {Blue, Red},
PlotLegends → Placed[{"ln(Ω(Etot ,N,V))", "ln(Ω(E))"}, {.15, .85}],
Frame → True, FrameLabel → {"E", "S", "Comparison of Entropies"},
ImageSize → Large, PlotMarkers → {Black, 5}]
Comparison of Multiplicy and Density of States

Ω(Etot ,N,V)
1.5 × 1042 ϕ(E,N)
Ω(E)

1.0 × 1042

5.0 × 1041

0 20 40 60 80 100
E
34 AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb

Comparison of Entropies

100

ln(Ω(Etot ,N,V))
ln(Ω(E))

-100
S

-200

-300

0 20 40 60 80 100
E
AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb 35

Export[NotebookDirectory[] <> "cplot1a.png", cplot1a]


Export[NotebookDirectory[] <> "cplot1b.png", cplot1b]
Export[NotebookDirectory[] <> "cplot1c.png", cplot1c]
Export[NotebookDirectory[] <> "cplot1e.png", cplot1e]
Export[NotebookDirectory[] <> "cplot1O.png", cplot1O]
Export[NotebookDirectory[] <> "cplot1s.png", cplot1s]

Export[NotebookDirectory[] <> "cplot2a.png", cplot2a]


Export[NotebookDirectory[] <> "cplot2b.png", cplot2b]
Export[NotebookDirectory[] <> "cplot2c.png", cplot2c]
Export[NotebookDirectory[] <> "cplot2e.png", cplot2e]
Export[NotebookDirectory[] <> "cplot2O.png", cplot2O]
Export[NotebookDirectory[] <> "cplot2s.png", cplot2s]
C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\cplot1a.png

C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\cplot1b.png

C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\cplot1c.png

C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\cplot1e.png

C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\cplot1O.png

C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\cplot1s.png

C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\cplot2a.png

C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\cplot2b.png

C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\cplot2c.png

C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\cplot2e.png

C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\cplot2O.png

C:\Users\amwil_000\Google Drive\Graduate
Classes\Fall 2016\Stat Mech\Midterm\cplot2s.png
36 AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb

Problem #3
Part A
EE
SS[EE_] = n * k 1 + Log 
ℏω
D[SS[EE], EE]
EE
k n 1 + Log 
ωℏ
kn
EE

Part B
Zb = Integrate
p2 1
IntegrateExp- β + m ω2 x2 , {x, - ∞, ∞}, GenerateConditions → False,
2m 2
{p, - ∞, ∞}, GenerateConditions → False // FullSimplify

β
m
m β ω2

Part C
1 NN
Zc = Sum ⅇβ μ NN , {NN, 0, ∞} // FullSimplify
ℏβω
βωℏ
- ⅇβ μ + β ω ℏ

avgE = D[Zc, β] / Zc // FullSimplify


ⅇβ μ (- 1 + β μ)
β - ⅇβ μ + β ω ℏ

-1
avgN = D[Zc, μ] / Zc
β
ⅇβ μ
-
- ⅇβ μ + β ω ℏ

avgE / avgN
-1 + β μ
-
β
AlexWilhelmTakeHomeMidterm2016Oct06-Calculations.nb 37

Problem #4
Mostly done in my head

Part C
D[avgN, μ] // FullSimplify
ⅇβ μ β2 ω ℏ
-
ⅇβ μ - β ω ℏ2
�����������������������������
David Hensle (in conjunction with the class)
06/10/16

����������

���������������������������������������������������������������������������������
�����������������������������������������������������������������������������
��������������������������������������������������������������������������������
������������������������������������������������������������������������������������

����������������������������������������������
2 ��� SM_midterm.nb

������������������

���������������
Ω[Ε_� ���_] �= (Ε / (ℏ * ω) + ��� / � + �) ! / ((Ε / (ℏ * ω) - ��� / �) ! * (��� - �) !)
����[��������[
��������� @ {�����[Ε� {Ε� �� ��}]� �����[Ω[Ε� �] /� {ℏ → �� ω → �}� {Ε� �� ��}]}�
��������� → ������������� �� ������ ��� � = ���
��������� → {�Ε�� �Ω(Ε��)�}� ����������� → {���}]�
����[Ω[Ε� �] /� {ℏ → �� ω → �}� {Ε� �� ��}]]
Multiplicity of states for N = 4
Ω(Ε,N)

25 000

20 000

15 000

10 000

5000

Ε
2 4 6 8 10

���������������
����[��_] = ���[Ω[��� �]� {��� �� ��}]�
����[��������[
��������� @ {�����[Ε� {Ε� �� ��}]� �����[����[Ε] /� {ℏ → �� ω → �}� {Ε� �� ��}]}�
��������� → ���� �� ������������ �� ������ ��� � = ���
��������� → {�Ε�� �Φ(Ε��)�}� ����������� → {���}]�
����[����[��] /� {ℏ → �� ω → �}� {��� �� ��}]]
Sum of Multiplicity of states for N = 4
Φ(Ε,N)

60 000

50 000

40 000

30 000

20 000

10 000

Ε
2 4 6 8 10

����������������������������������������������
SM_midterm.nb ��� 3

��Ω�������∂EΦ������������
�����[��_] = �[����[��]� ��]�
����[��������[
��������� @ {�����[Ε� {Ε� �� ��}]� �����[�����[Ε] /� {ℏ → �� ω → �}� {Ε� �� ��}]}�
��������� → �������� �� ������ ��� � = ���
��������� → {�Ε�� �Ω(Ε)�}� ����������� → {���}]�
����[�����[��] /� {ℏ → �� ω → �}� {��� �� ��}]]
Density of states for N = 4
Ω(Ε)

30 000

25 000

20 000

15 000

10 000

5000

Ε
2 4 6 8 10

����������������������������������������������
4 ��� SM_midterm.nb

�������ℏ����������������������������������������������������������������������������
��������������������������������������������������������������������������������
����������
����������������������������������
����[��������[
��������� @ {�����[Ε� {Ε� �� ��}]� �����[���[�����[Ε] /� {ℏ → �� ω → �}]� {Ε� �� ��}]}�
��������� → ���� �� ������� ��� ������������ �� ������ ��� � = ���
��������� → {�Ε�� �Ω(Ε��)�}� ����������� → {���}� ����������� → {���(Ω(�����))�}]�
����[���[�����[��] /� {ℏ → �� ω → �}]� {��� �� ��}]�
��������[
��������� @ {�����[Ε� {Ε� �� ��}]� �����[���[Ω[Ε� �] /� {ℏ → �� ω → �}]� {Ε� �� ��}]}�
��������� → {�Ε�� �Ω(Ε��)�}� ����������� → {�����}� ����������� → {���(Ω(�))�}]�
����[���[Ω[Ε� �] /� {ℏ → �� ω → �}]� {Ε� �� ��}]]
log of Density and Multiplicity of states for N = 4
Ω(Ε,N)
14

12

10

ln(Ω(N,V,E))
8

ln(Ω(E))
6

Ε
5 10 15 20

Notice that they are not the same for all values of E, but they become very close for large E.

����������������������������������������������
SM_midterm.nb ��� 5

�����������������������������������������������������
������������
���������������
����[��������[
��������� @ {�����[Ε� {Ε� ��� ��}]� �����[Ω[Ε� ���] /� {ℏ → �� ω → �}� {Ε� ��� ��}]}�
��������� → ������������� �� ������ ��� � = �����
��������� → {�Ε�� �Ω(Ε��)�}� ����������� → {���}]�
����[Ω[Ε� ���] /� {ℏ → �� ω → �}� {Ε� ��� ��}� ��������� → ���]]
Multiplicity of states for N = 100
Ω(Ε,N)
1.2 × 1017

1.0 × 1017

8.0 × 1016

6.0 × 1016

4.0 × 1016

2.0 × 1016

Ε
52 54 56 58 60

���������������
������[��_] = ���[Ω[��� ���]� {��� ��� ��}]�
����[��������[
��������� @ {�����[Ε� {Ε� ��� ��}]� �����[������[Ε] /� {ℏ → �� ω → �}� {Ε� ��� ��}]}�
��������� → ���� �� ������������ �� ������ ��� � = �����
��������� → {�Ε�� �Φ(Ε��)�}� ����������� → {���}]�
����[������[��] /� {ℏ → �� ω → �}� {��� ��� ��}� ��������� → ���]]
Sum of Multiplicity of states for N = 100
Φ(Ε,N)

1.2 × 1017

1.0 × 1017

8.0 × 1016

6.0 × 1016

4.0 × 1016

2.0 × 1016

Ε
52 54 56 58 60

����������������������������������������������
6 ��� SM_midterm.nb

��Ω�������∂EΦ������������
�������[��_] = �[������[��]� ��]�
����[��������[
��������� @ {�����[Ε� {Ε� ��� ��}]� �����[�������[Ε] /� {ℏ → �� ω → �}� {Ε� ��� ��}]}�
��������� → �������� �� ������ ��� � = �����
��������� → {�Ε�� �Ω(Ε)�}� ����������� → {���}]�
����[�������[��] /� {ℏ → �� ω → �}� {��� ��� ��}� ��������� → ���]]
Ω(Ε) Density of states for N = 100

3.0 × 1017

2.5 × 1017

2.0 × 1017

1.5 × 1017

1.0 × 1017

5.0 × 1016

Ε
52 54 56 58 60

����������������������������������������������
SM_midterm.nb ��� 7

�������ℏ����������������������������������������������������������������������������
��������������������������������������������������������������������������������
����������
����������������������������������
����[��������[��������� @
{�����[Ε� {Ε� ��� ��}]� �����[���[�������[Ε] /� {ℏ → �� ω → �}]� {Ε� ��� ��}]}�
��������� → ���� �� ������� ��� ������������ �� ������ ��� � = �����
��������� → {�Ε�� �Ω(Ε��)�}� ����������� → {���}� ����������� → {���(Ω(�����))�}]�
����[���[�������[��] /� {ℏ → �� ω → �}]� {��� ��� ��}]�
��������[��������� @
{�����[Ε� {Ε� ��� ��}]� �����[���[Ω[Ε� ���] /� {ℏ → �� ω → �}]� {Ε� ��� ��}]}�
��������� → {�Ε�� �Ω(Ε��)�}� ����������� → {�����}� ����������� → {���(Ω(�))�}]�
����[���[Ω[Ε� ���] /� {ℏ → �� ω → �}]� {Ε� ��� ��}]]
log of Density and Multiplicity of states for N = 100
Ω(Ε,N)

60

50

40 ln(Ω(N,V,E))

30 ln(Ω(E))

20

10

Ε
55 60 65 70

Notice that they are roughly the same, especially for larger E.

�������������������������������
���������������������������

����������������������������������������������
8 ��� SM_midterm.nb

���������������������

����������������������������������������������
SM_midterm.nb ��� 9

����������������������������

����������������������������������������������
10 ��� SM_midterm.nb

����������������������������������������������
SM_midterm.nb ��� 11

Parition function for quantum oscillators in grand canonical ensemble

���� = �  � - � ���[- β * μ] * ����[ℏ * � * β / �]-� 




�- �
ⅇβ μ ���� � �β ℏ 

���� = - � / β * ∂μ ���[����] // ������������



� - � ⅇ-β μ ���� � �β ℏ 

���� = (- ∂β ���[����] + μ * ����) // ������������

ⅇβ μ � μ - � ℏ ���� � �β ℏ  ���� � �β ℏ 

- � + � ⅇβ μ ���� � �β ℏ 

���������������������������������
���������������������������
Since the microcanonical ensemble has a constant energy, the average energy is just the sum of all of
the oscillators in the system: Etot = N*E where E is the energy of a single oscillator and is equal to the
hamiltonian H = p2 (2 m) + mw2 q2 2

���������������������

����������������������������������������������
12 ��� SM_midterm.nb

����������������������������

����������������������������������������������
SM_midterm.nb ��� 13

Parition function for classical oscillators in grand canonical ensemble


���� = � / (� - ���[β * μ] / (β * ℏ * �))

ⅇβ μ
�- �βℏ

���� = - � / β * ∂μ ���[����] // ������������



� - ⅇ-β μ �βℏ

����������������������������������������������
14 ��� SM_midterm.nb

���� = (- ∂β ���[����] + μ * ����) // ������������


ⅇβ μ (- � + � β μ)
β ⅇβ μ - � β ℏ

�������������������������������
���������������������������
Energy fluctuations are 0 since in a microcanonical ensemble, the energy is defined to be constant.
Since the oscillators are still localized, the pressure is still a non-fluctuating 0. (The same argument for
pressure fluctuations applies to parts b and c as well.)

���������������������
Energy fluctuations are given by the second derivative of the log of the partition function with respect to
β. Thus, we can just take the partition function calculated from part 3 and let mathematica take the
derivatives for us:
��� = � * ����[β * ℏ * � / �]-�
�βℏ -�
�-� ���� 

Δ����������������� = ∂β (∂β ���[���]) // ������������


� �βℏ �
� �� ℏ� ���� 
� �

����������������������������
Again, using the parition function from part 3:

������� ���� = �  � - � ���[- β * μ] * ����[ℏ * � * β / �]-� 



�������

�- �
ⅇβ μ ���� � �β ℏ 

������� Δ���������������������� = ∂β (∂β ���[����]) + μ * ∂μ (∂β ���[����]) // ������������


�βℏ
������� ⅇβ μ ���� 

�βℏ �βℏ � �βℏ
� μ (� + μ + β μ) + ����  - ⅇβ μ � μ + �� ℏ� ����  + � ℏ ���� 
� � �
�βℏ �
� ℏ (� + ����[� β ℏ]) - � (� + β) μ ����[� β ℏ]  � - � + ⅇβ μ ���� 

����������������������������������������������
SM_midterm.nb ��� 15

���������������������������������
���������������������������
Energy fluctuations are 0 since in a microcanonical ensemble, the energy is defined to be constant.
Since the oscillators are still localized, the pressure is still a non-fluctuating 0. (The same argument for
pressure fluctuations applies to parts b and c as well.)

���������������������
Energy fluctuations are given by the second derivative of the log of the partition function with respect to
β. Thus, we can just take the partition function calculated from part 3 and let mathematica take the
derivatives for us:
��� = (β * ℏ * �)-�
(� β ℏ)-�

Δ����������������� = ∂β (∂β ���[���]) // ������������



β�

����������������������������
Again, using the parition function from part 3:
������� ���� = � / (� - ���[β * μ] / (β * ℏ * �))

�������
ⅇβ μ
�- �βℏ

������� Δ���������������������� = ∂β (∂β ���[����]) + μ * ∂μ (∂β ���[����]) // ������������


- ⅇ� β μ � + β� μ + ⅇβ μ � β (� + β μ (- � + β (� + β) μ)) ℏ
�������
β� ⅇβ μ - � β ℏ�

����������������������������������������������
Stat Mech Midterm
Kirsten Blagg
10/04/16

1) Consider 4 distinguishable harmonic oscillators in 1D with spring constant k,


and mass m.
Quantum System
Setting up parameters
We will just use natural units and set everything to 1 for simplicity

In[68]:= Ñ = 1; H*eVK*L
m = 1; H*kg*L
k = 1; H*Spring constant*L
Ω = Sqrt@m  kD; H*1s*L
H*We are assuming an Einstien solid so all of the frequencies are the same *L
kb = 1; H*Boltmans constant*L

Energy of a 1D Harmonic Oscillator


The energy of a simple harmonic oscillator is given by
1
En = ÑΩIn + M
2
So then the total energy is given by
N
Etotal = ÑΩINtot + M
2
Where Ntot is the number of units we have to distribute among N ocsillators

a) Plot W(N,V,E) vs. E


In order to find the multiplicity we can think of the system as taking Ntot and dividing it among N slots Hn1 , n2 , n3 , n4 L

We can explore this by starting with Ntot = 0 and working our way up to find a pattern:
For Ntot = 0:
0000 has 1 combination
Thus the multiplicity is 1
For Ntot = 1:
1000 has 4 combinations
Thus the multiplicity is 4
For Ntot = 2:
1100 has 6 combinations
2000 has 4 combinations
Thus the multiplicity is 4+6 = 10
For Ntot = 3:
3000 has 4 combinations
2100 has 12 combinations
1110 has 4 combinations
Thus the multiplicity is 4+12+4 = 20
For Ntot = 4:
4000 has 4 combinations
1300 has 12 combinations
1120 has 12 combinations
2200 has 6 combinations
1111 has 1 combination
Thus the multiplicity is 4+12+12+6+1 = 35
This pattern gives us that the multiplicity is given by
HNtot +N-1L!
WHN, Ntot , VL =
Ntot ! HN-1L!
Using our energy equation to solve for Ntot in terms of energy
E-N2*ÑΩ
Ntot =
ÑΩ Printed by Wolfram Mathematica Student Edition
And substituting into the multiplicity gives
2 StatMech_Midterm_3.nb
This pattern gives us that the multiplicity is given by
HNtot +N-1L!
WHN, Ntot , VL =
Ntot ! HN-1L!
Using our energy equation to solve for Ntot in terms of energy
E-N2*ÑΩ
Ntot =
ÑΩ
And substituting into the multiplicity gives

In[71]:= W@Num_, EE_D = Factorial@HEE - Num  2 * Ñ * ΩL  HÑ * ΩL + Num - 1D 


HFactorial@HEE - Num  2 * Ñ * ΩL  HÑ * ΩLD * Factorial@Num - 1DL;
H*general function for the multiplicity of the function*L
It is important to note that the minmum energy is N/2*ÑΩ not zero. So for 4 oscilators Emin=2ÑΩ

In[72]:= Emin = 4  2 * Ñ * Ω;H*This will provide the lower bound for each of our
plots*L
If we look at the discrete case where our energy can only be interger values

Show@ListPlot@8Transpose ž 8Table@j, 8j, Emin, 10<D, Table@W@4, iD, 8i, Emin, 10<D<<,
AxesLabel ® 8"Energy", "Multiplicity"<, PlotStyle ® PointSize@MediumD,
PlotLabel ® "WHN,EL vs E"DH*Plot of the discrete points*L,
Plot@W@4, xD, 8x, Emin, 10<, AxesLabel ® 8"Energy", "Multiplicity"<,
PlotStyle ® PointSize@MediumD, PlotLabel ® "WHN,EL vs E for N = 4 HQuantumL"D
H*Plot of the continuous function*LD
WHN,EL vs E
Multiplicity

150

100
Out[73]=

50

Energy
4 6 8 10

The points each represent the multiplicity at each discrete allowed energy value. We can see that the multiplicity starts at zero for zero energy
and increases exponentially.

b) Plot F(N,V,E) = SW(N,V,E) vs E


First we can write a function for F(N,V,E)

In[74]:= F@Num_, EE_D = Sum@W@Num, xD, 8x, Emin, EE<D;


H*Here we sum the multiplicity calculated previously over all values of
E*L

Printed by Wolfram Mathematica Student Edition


StatMech_Midterm_3.nb 3

Show@ListPlot@8Transpose ž 8Table@j, 8j, Emin, 10<D, Table@F@4, iD, 8i, Emin, 10<D<<,
AxesLabel ® 8"Energy", "F"<, PlotStyle ® PointSize@MediumD,
PlotLabel ® "FHN,EL vs E for N = 4"D,
Plot@F@4, yD, 8y, Emin, 10<, AxesLabel ® 8"Energy", "F"<, PlotStyle ® PointSize@MediumD,
PlotLabel ® "FHN,EL vs E for N = 4 HQuantumL"DD
FHN,EL vs E for N = 4
F
500

400

300
Out[75]=

200

100

Energy
4 6 8 10

If we think of the multiplicity as the number of allowed states at a given energy (as the outer most shell of a sphere) then F is given by the
number of states at a given energy level plus the number of states due to all of the previous energy levels. In terms of our sphere image we are
not just looking at the states on the shell, but every state on and inside of the shell.

c) Plot the density of states


We can now calculate the density of states by taking the derivative

In[76]:= WE@Num_, EE_D = D@F@Num, EED, EED; H*function for the density of states*L

Show@ListPlot@8Transpose ž 8Table@j, 8j, Emin, 10<D, Table@WE@4, iD, 8i, Emin, 10<D<<,
AxesLabel ® 8"E", "Density of States"<, PlotStyle ® PointSize@MediumD,
PlotLabel ® "Density of States vs E for N = 4"D,
Plot@WE@4, yD, 8y, Emin, 10<, AxesLabel ® 8"E", "Density of States"<,
PlotStyle ® PointSize@MediumD,
PlotLabel ® "Density of States vs E for N = 4 HQuantumL"DD
Density of States vs E for N = 4
Density of States

150

Out[77]=
100

50

E
4 6 8 10

The above plot gives the density of states at a given energy level E with the points representing the allowed energy states.

Comparison of different ways of calcualting the states:


In order to better understand the differences in each of these state calculations we plot all of the functions for a given energy scale

Printed by Wolfram Mathematica Student Edition


4 StatMech_Midterm_3.nb

Plot@8W@4, xD, F@4, xD, WE@4, xD<, 8x, Emin, 10<, AxesLabel ® 8"Energy", "State"<,
PlotLegends ® 8"Multipicity", "F", "Density of State"<,
PlotLabel ® 8"Comparison of State calculations for N = 4 HQuantumL"<D

8Comparison of State calculations for N = 4<


State

300

250
Multipicity
200
Out[78]= F
150 Density of State

100

50

Energy
4 6 8 10

We clearly see that the different claculations each lead to different values for small N (in this case N = 4) each of these values differ and these
differences increase as energy increases.

Note: I have only plotted the continuous vaules so that we can more clearly see the divergence. This is still only true for discrete energy vaules
of the quantum harmonic oscillator.

d) What happens to the factors of h3 N and N! that you keep seeing?


The factors of h3 N do not appear in the quantum case because our system is aleady discritized via the allowed energy states so we do not take
an intergral. Our problem is just a counting problem.

N! is not in our calculations because we have distinguishable particles. The N! is only used in systems with indistinguishable particles in order
to resolve Gibbs paradox (Pathria 5.5)

e) For a particular energy E, calculate the entropy using S = kln(W(N,V,E)) and S=kln(W(E)).
Are they equivalent?
We can compare the calculation of entropy using the multiplicity and the density of states
Where
S = kB ln(W)

Printed by Wolfram Mathematica Student Edition


StatMech_Midterm_3.nb 5

Show@
ListPlot@8Transpose ž 8Table@j, 8j, Emin, 10<D, Table@kb * Log@W@4, iDD, 8i, Emin, 10<D<<,
AxesLabel ® 8"E", "Entropy"<, PlotStyle ® Blue, PlotStyle ® PointSize@MediumD,
PlotLabel ® "Comparison of Entropy", PlotLegends ® 8"WHN,E,VL"<D,
ListPlot@
8Transpose ž 8Table@j, 8j, Emin, 10<D, Table@kb * Log@WE@4, iDD, 8i, Emin, 10<D<<,
AxesLabel ® 8"E", "Entropy"<, PlotStyle ® Magenta, PlotStyle ® PointSize@MediumD,
PlotLabel ® "Comparison of Entropy", PlotLegends ® 8"WHEL"<D,
Plot@8kb * Log@W@4, xDD, kb * Log@WE@4, xDD<, 8x, Emin, 20<, AxesLabel ® 8"E", "Entropy"<,
PlotStyle ® PointSize@MediumD,
PlotLabel ® "Comparison of Entropy for N = 4 HQuantumL"DD

Comparison of Entropy
Entropy

WHEL
3
Out[79]=
WHN,E,VL
2

E
4 6 8 10

We see that the entropy calculated using the density of states is higher than the entropy calculated by the multiplicity. However, the two values
converge as E increases.

Classical System
Now we can do this again for the case of the classical system where the energy is no longer limited to discrete values.

a) Plot W(N,V,E) vs. E


The Hamiltionian for a system of N 1D classical harmonic oscillators is given by
N pi 2 1
H= S + mΩ2 qi 2
i=1 2 m 2
We can find the normalized phase space volume in order to find the multiplicity of the system
1
Wclass HE, V, NL = Ù d N qdN p
hN
HHqi ,pi L
1
= ÙN d N qdN p
hN S Ipi 2 +qi 2 M£2 mE
i=1

1 1 N
= I M ÙN d N xdN p
hN mΩ S Ipi 2 +xi 2 M£2 mE
i=1

1 1 N ΠN
= I M H2 mELN
h3 mΩ NGHNL
Thus our multiplicity for the classical system is given by
1 E N
Wclass HE, V, NL = I M
NGHNL ÑΩ

We can write this as a function and plot it with respect to energy

Printed by Wolfram Mathematica Student Edition


6 StatMech_Midterm_3.nb

In[84]:= Wclass@Num_, EE_D = 1  HNum * Gamma@NumDL * HEE  HÑ * ΩLL ^ Num;


Plot@Wclass@4, EED, 8EE, 0, 10<, AxesLabel ® 8"Energy", "WHN,V,EL"<,
PlotLabel ® "Multiplicity vs. Energy for N = 4 HClassicalL"D
Multiplicity vs. Energy for N = 4 HClassicalL
WHN,V,EL

400

300

Out[85]=
200

100

Energy
2 4 6 8 10

For the classical case we again see an exponential increase of avalible states as the energy increases

b) Plot F(N,V,E) = SW(N,V,E) vs E


Here we find F by summing the previous value over all energy values and plot it with respect to energy.

In[86]:= Fclass@Num_, EE_D = Sum@Wclass@Num, xD, 8x, 0, EE<D;


Plot@Fclass@4, EED, 8EE, 0, 10<, AxesLabel ® 8"Energy", "FHN,V,EL"<,
PlotLabel ® "F vs E N=4 HClassicalL"D
F vs E N=4 HClassicalL
FHN,V,EL

1000

800

Out[87]= 600

400

200

Energy
2 4 6 8 10

The shape is the same as the multiplicity, but the scale of the avalible states is signifigantly higher.

Printed by Wolfram Mathematica Student Edition


StatMech_Midterm_3.nb 7

c) Plot the density of states


In[88]:= WEclass@Num_, EE_D = D@Fclass@Num, EED, EED;
Plot@WEclass@4, EED, 8EE, 0, 10<, AxesLabel ® 8"Energy", "WHEL"<,
PlotLabel ® "Density of States N=4 HClassicalL"D
Density of States N=4 HClassicalL
WHEL
500

400

300
Out[89]=

200

100

Energy
2 4 6 8 10

This shows the same general trend as the other states though the scale differs.

Comparison of different ways of calcualting the states:

In[90]:= Plot@8Wclass@4, xD, Fclass@4, xD, WEclass@4, xD<, 8x, 0, 10<,


AxesLabel ® 8"Energy", "State"<,
PlotLegends ® 8"Multipicity", "F", "Density of State"<,
PlotLabel ® "Comparison of state values for N=4 HClassicalL"D

Comparison of state values for N=4 HClassicalL


State

600

500

400
Multipicity
Out[90]= F
300
Density of State
200

100

Energy
2 4 6 8 10

Again we see that all the states have the same general shape. However they differ as they did in the quantum case. F has the largest value then
the Density of states then the mulitplicity with the lowest value. These differences increase as energy increases.

d) What happens to the factors of h3 N and N! that you keep seeing?


The factors of h3 N becomes just hN because we are only in one dimension. This effectivly discritizes phase space so that we can count the
number of states through integration.

N! is not in our calculations because we have distinguishable particles (Same argument as above) (Pathria 5.5)

Printed by Wolfram Mathematica Student Edition


8 StatMech_Midterm_3.nb

e) For a particular energy E, calculate the entropy using S = kln(W(N,V,E)) and S=kln(W(E)).
Are they equivalent?
In[93]:= Plot@8k * Log@Wclass@4, EEDD, k * Log@WEclass@4, EEDD<, 8EE, 2, 15<,
AxesLabel ® 8"Energy", "Entropy"<,
PlotLabel ® "Comparison of Entropy N=4 HClassicalL",
PlotLegends ® 8"Mutilipicty", "Density of States"<D

Comparison of Entropy N=4 HClassicalL


Entropy

Mutilipicty
Out[93]=
4 Density of States

Energy
4 6 8 10 12 14

We see that the entropy calculated using the density of states if greater than that calculated using the multiplicity. Again the two values
converge as energy increase

Comparison between Harmonic and Classical case


Here we compare each of the state calculations in the quantum and the classical case. In each case the values calculated using for the quantum
mechanical system.

In[96]:= GraphicsRow@
8Plot@8W@4, xD, Wclass@4, xD<, 8x, 0, 10<, AxesLabel ® 8"Energy", "Multiplicity"<D,
Plot@8F@4, xD, Fclass@4, xD<, 8x, 0, 10<, AxesLabel ® 8"Energy", "F"<D,
Plot@8WE@4, xD, WEclass@4, xD<, 8x, 0, 10<,
AxesLabel ® 8"Energy", "Density of States"<,
PlotLegends ® 8"Quantum", "Classical"<D<D

Multiplicity F
700
400
600

300 500

400
Out[96]=
200
300

200
100
100

Energy Energy
2 4 6 8 10 2 4 6 8 10

Printed by Wolfram Mathematica Student Edition


StatMech_Midterm_3.nb 9

2) Now considering a system of 100 harmonic oscillators we can calculate the


same quantities
Quantum System
Now we will look at the quantum system for 100 harmonic oscillators

a) Multiplicity vs. E
We use the same functions as for the N=4 case

It is important to note that the minmum energy is N/2*ÑΩ. So for this part Emin=2ÑΩ

In[98]:= Emin = 100  2 * Ñ * Ω;

If we look at the discrete case where our energy can only be interger values. These are again given by the points on each graph

In[101]:= Show@ListPlot@8Transpose ž 8Table@j, 8j, Emin, 100<D, Table@W@100, iD, 8i, Emin, 100<D<<,
AxesLabel ® 8"Energy", "Multiplicity"<, PlotStyle ® PointSize@MediumD,
PlotLabel ® "WHN,EL vs E for N = 100 HQuantumL"D,
Plot@W@100, xD, 8x, Emin, 100<, AxesLabel ® 8"Energy", "Multiplicity"<,
PlotStyle ® PointSize@MediumD, PlotLabel ® "WHN,EL vs E for N = 100 HQuantumL"DD
Multiplicity WHN,EL vs E for N = 100 HQuantumL
36
3.5 ´ 10

3.0 ´ 1036

2.5 ´ 1036

36
Out[101]= 2.0 ´ 10

1.5 ´ 1036

1.0 ´ 1036

5.0 ´ 1035

Energy
60 70 80 90 100

Plotting the mulitplicity for a quantum system with 100 oscillators we see that the multiplicity is essentially zero until in increases to a high
value. This is a drastically different plot than for small N.

b) F(N,V,E) = SW(N,V,E) vs E
First we can write a function for F(N,V,E) by summing over all of the energy values and plot the function with respect to energy

In[103]:= F@Num_, EE_D = Sum@W@Num, xD, 8x, Emin, EE<D;

Printed by Wolfram Mathematica Student Edition


10 StatMech_Midterm_3.nb

In[104]:= Show@ListPlot@8Transpose ž 8Table@j, 8j, Emin, 100<D, Table@F@100, iD, 8i, Emin, 100<D<<,
AxesLabel ® 8"Energy", "F"<, PlotStyle ® PointSize@MediumD,
PlotLabel ® "FHN,EL vs E for N = 100 HQuantumL"D,
Plot@F@100, yD, 8y, Emin, 100<, AxesLabel ® 8"Energy", "F"<,
PlotStyle ® PointSize@MediumD, PlotLabel ® "FHN,EL vs E for N = 100 HQuantumL"DD
F FHN,EL vs E for N = 100 HQuantumL
5 ´ 1036

4 ´ 1036

3 ´ 1036
Out[104]=

2 ´ 1036

1 ´ 1036

Energy
60 70 80 90 100

This give the same shape as the multiplicity.

c) Density of states
Here we calculate and plot the density of states by taking the derivative of the previous value with respect to energy.

In[106]:= WE@Num_, EE_D = D@F@Num, EED, EED;

In[107]:= Show@ListPlot@8Transpose ž 8Table@j, 8j, Emin, 100<D, Table@WE@100, iD, 8i, Emin, 100<D<<,
AxesLabel ® 8"E", "Density of States"<, PlotStyle ® PointSize@MediumD,
PlotLabel ® "Density of States vs E for N = 100 HQuantumL"D,
Plot@WE@100, yD, 8y, Emin, 100<, AxesLabel ® 8"E", "Density of States"<,
PlotStyle ® PointSize@MediumD,
PlotLabel ® "Density of States vs E for N = 100 HQuantumL"DD
Density of States Density of States vs E for N = 100 HQuantumL
6 ´ 1036

5 ´ 1036

4 ´ 1036

Out[107]=
3 ´ 1036

2 ´ 1036

1 ´ 1036

E
60 70 80 90 100

Again we see the same trend.

Comparison of different ways of calcualting the states:


Just as in the

Printed by Wolfram Mathematica Student Edition


StatMech_Midterm_3.nb 11

In[108]:= Plot@8W@100, xD, F@100, xD, WE@100, xD<, 8x, 88, 100<,
PlotLegends ® 8"Multipicity", "F", "Density of State"<,
AxesLabel ® 8"Energy", "State"<,
PlotLabel ® "Comparison of states for N = 100 HQuantumL"D

State Comparison of states for N = 100 HQuantumL

4 ´ 1039

3 ´ 1039 Multipicity
Out[108]= F
2 ´ 1039
Density of State

1 ´ 1039

Energy
90 92 94 96 98 100

While these values still are not exactly the same, they are signifigantly closer than in the case of 4 oscillators. We can imply that the values
would get closer as the number of oscillators increased. It is interesting that F and the density of states are much closer in value for a given
energy than the multiplicity which is lower that either value.

d) What happens to the factors of h3 N and N! that you keep seeing?


The explination is the same as for the 4 quantum oscillator system.

Printed by Wolfram Mathematica Student Edition


12 StatMech_Midterm_3.nb

e) For a particular energy E, calculate the entropy using S = kln(W(N,V,E)) and S=kln(W(E)).
Are they equivalent?
In[109]:= Show@
ListPlot@
8Transpose ž 8Table@j, 8j, Emin, 60<D, Table@kb * Log@W@100, iDD, 8i, Emin, 60<D<<,
AxesLabel ® 8"E", "Entropy"<, PlotStyle ® Blue, PlotStyle ® PointSize@MediumD,
PlotLabel ® "Comparison of Entropy for N = 100 HQuantumL",
PlotLegends ® 8"WHN,E,VL"<D,
ListPlot@
8Transpose ž 8Table@j, 8j, Emin, 60<D, Table@kb * Log@WE@100, iDD, 8i, Emin, 60<D<<,
AxesLabel ® 8"E", "Entropy"<, PlotStyle ® Magenta, PlotStyle ® PointSize@MediumD,
PlotLabel ® "Comparison of Entropy", PlotLegends ® 8"WHEL"<D,
Plot@8kb * Log@W@100, xDD, kb * Log@WE@100, xDD<, 8x, Emin, 60<,
AxesLabel ® 8"E", "Entropy"<, PlotStyle ® PointSize@MediumD,
PlotLabel ® "Comparison of Entropy for N = 100 HQuantumL"DD

Comparison of Entropy for N = 100 HQuantumL


Entropy

30

25

20 WHEL
Out[109]=

15 WHN,E,VL

10

E
52 54 56 58 60

Again we are able to compare the entropy values. Even through the states were much closer to the same value than in the case of 4 oscillators,
the entropy calculated using the multiplicty is lower than the calculation done using the density of states.

Classical System
Now we can do this again for the case of the classical system with 100 harmonic oscillators.

a) Plot W(N,V,E) vs. E


We first plot the multipilicity in the case of 100 harmonic oscillators. The function is the same as was calculated in the case of 4 classical
oscillators. The plot has the same trend as the case for the quantum harmonic oscillators and the multiplicity drastically increases to a maximum
at a given energy value.

Printed by Wolfram Mathematica Student Edition


StatMech_Midterm_3.nb 13

In[110]:= Wclass@Num_, EE_D = 1  HNum * Gamma@NumDL * HEE  HÑ * ΩLL ^ Num;


Plot@Wclass@100, EED, 8EE, 0, 100<, AxesLabel ® 8"Energy", "WHN,V,EL"<,
PlotLabel ® "Multiplicity vs Energy for N=100 HClassicalL"D
WHN,V,EL Multiplicity vs Energy for N=100 HClassicalL
1.2 ´ 1034

1.0 ´ 1034

8.0 ´ 1033

Out[111]=
6.0 ´ 1033

4.0 ´ 1033

2.0 ´ 1033

Energy
20 40 60 80 100

b) Plot F(N,V,E) = SW(N,V,E) vs E


Again using the same functions we are able to plot Φ and see that the trend as energy increases is the same as in the case of 100 quantum
oscillators.

In[112]:= Fclass@Num_, EE_D = Sum@Wclass@Num, xD, 8x, 0, EE<D;


Plot@Fclass@100, EED, 8EE, 0, 100<, AxesLabel ® 8"Energy", "FHN,V,EL"<,
PlotLabel ® "FHN,V,EL vs Energy for 100 oscillators HClassicalL"D
FHN,V,EL FHN,V,EL vs Energy for 100 oscillators HClassicalL

1.5 ´ 1034

1.0 ´ 1034
Out[113]=

5.0 ´ 1033

Energy
20 40 60 80 100

c) Plot the density of states


The density of states versus energy for the case of 100 classical oscillators is given below. Note that the trends are the same as in the quantum
case and as in the other state calculations for 100 classical oscillators.

Printed by Wolfram Mathematica Student Edition


14 StatMech_Midterm_3.nb

In[114]:= WEclass@Num_, EE_D = D@Fclass@Num, EED, EED;


Plot@WEclass@100, EED, 8EE, 0, 100<, AxesLabel ® 8"Energy", "WHEL"<,
PlotLabel ® "Density of States vs Energy for N = 100 HClassicalL"D
WHEL Density of States vs Energy for N = 100 HClassicalL
34
2.0 ´ 10

1.5 ´ 1034

Out[115]=
1.0 ´ 1034

5.0 ´ 1033

Energy
20 40 60 80 100

Comparison of different ways of calcualting the states:


In[116]:= Plot@8Wclass@100, xD, Fclass@100, xD, WEclass@100, xD<, 8x, 0, 100<,
AxesLabel ® 8"Energy", "State"<,
PlotLegends ® 8"Multipicity", "F", "Density of State"<,
PlotLabel ® "Comparison of States for N = 100 HClassicalL"D

State Comparison of States for N = 100 HClassicalL


34
1.5 ´ 10

1.0 ´ 1034 Multipicity


Out[116]= F
Density of State
5.0 ´ 1033

Energy
20 40 60 80 100

Comparing the states for each of the cases in the system of 100 classical oscillators we see that the values are almost exactly the same. This is
expected in the classical case because in calculating the multiplicity we accounted for the avalible states in phase space. This means that we did
not have the same discrepencies as in the quantum case when we were explicitly counting. This is why in systems of large N and continuous
energy we always choose to simply calculate the density of states.

d) What happens to the factors of h3 N and N! that you keep seeing?


The factors of h3 N becomes just hN because we are only in one dimension

N! is not in our calculations because we have distinguishable particles (same as for 4 classical oscillators). (Pathria 5.5)

Printed by Wolfram Mathematica Student Edition


StatMech_Midterm_3.nb 15

e) For a particular energy E, calculate the entropy using S = kln(W(N,V,E)) and S=kln(W(E)).
Are they equivalent?
In[119]:= Plot@8k * Log@Wclass@100, EEDD, k * Log@WEclass@100, EEDD<, 8EE, 40, 100<,
AxesLabel ® 8"Energy", "Entropy"<,
PlotLabel ® "Comparison of Entropy for N=100 HClassical",
PlotLegends ® 8"Multiplicity", "Density of States"<D

Comparison of Entropy for N=100 HClassical


Entropy

80

60 Multiplicity
Out[119]=
Density of States
40

20

Energy
50 60 70 80 90 100

In plotting the entropy for the system of 100 classical harmonic oscillators, we see that there is almost no difference between the calculation
using the multiplicity and the calculation using the density of states. This is expected given the difference in the states discussed above.

Comparison between Harmonic and Classical case


In[50]:= GraphicsRow@
8Plot@8W@100, xD, Wclass@100, xD<, 8x, 50, 100<, AxesLabel ® 8"Energy", "WHN,V,EL"<D,
Plot@8F@100, xD, Fclass@100, xD<, 8x, 50, 100<, AxesLabel ® 8"Energy", "F"<D,
Plot@8WE@100, xD, WEclass@100, xD<, 8x, 50, 100<,
AxesLabel ® 8"Energy", "Density of State"<D<D

WHN,V,EL F

2.0 ´ 1037 3.0 ´ 1037

2.5 ´ 1037
1.5 ´ 1037
2.0 ´ 1037
Out[50]=
1.0 ´ 1037 1.5 ´ 1037

1.0 ´ 1037
5.0 ´ 1036
5.0 ´ 1036

Energy Energy
60 70 80 90 100 60 70 80 90 100

In comparing each of the states between the classical case in pink and the quantum case in blue we see that the shapes are exactly the same. The
plots for the classical case are just shifted. This explained by the difference in zero point energy between the two systems which was discussed
previously.

Printed by Wolfram Mathematica Student Edition


16 StatMech_Midterm_3.nb

3)Take the entropy that you calculated in 1 and 2, and calculate the energy E
and the pressure P in:
Quantum System
a) Microcanonical ensemble
Energy
The energy of microconical ensemble can be calculated using
1 ¶S
=J N
T ¶E V,N
The entropy as calculated above is given by
S = kln(W(N,V,E))
HN+Ntot -1L!
= klnJ N
Ntot ! HN-1L!
= klnHNtot + N - 1L ! - klnHNtot !L - klnHN - 1L !
If we assume that we have a large number of particles we are able to use Sterlings approximation which states
ln(n!) > nln(n)-n
Then we get
S = kHNtot + N - 1L lnHNtot + N - 1L - Ntot - N + 1 - kNtot lnHNtot L + Ntot - kHN - 1L lnHN - 1L + N - 1
=kHNtot + N - 1L lnHNtot + N - 1L - kNtot lnHNtot L - kHN - 1L lnHN - 1L
=kHNtot + NL lnHNtot + NL - kNtot lnHNtot L - kHNL lnHNL

Finally,
1 ¶S
=
T ¶E
1 ¶S
=
ÑΩ ¶Ntot
k
= 8lnHN + Ntot L - lnHNtot L}
ÑΩ

And as derived above


E-N2*ÑΩ
Ntot =
ÑΩ
Then
1 k E-N2*ÑΩ E-N2*ÑΩ
= :lnJN + N - lnJ N>
T ÑΩ ÑΩ ÑΩ
Thus we can solve for E and get
1 1
E = NÑΩB + F
2 expHÑِkTL-1

Pressure
P ¶S
We know that = with constant energy and number of particles. The oscillators are localized so they cannot exert any pressure on any
T ¶V
walls of the system
¶S
Since =0
¶V
P=0

b) Canonical ensemble
Energy
For a canonical ensemble we can calculate the energy directly from the partition function rather than from the entropy
We have the partition function for a single quantum oscillator given by
¥
Z1 HΒL = Ù dEWHEL e- ΒHE-ΜNL (Pathria 3.8)
0
¥
= S WHN, V, EL e- ΒHn+12L ÑΩ
n=0
-1
expJ ΒÑΩN
2
=
1-expH- ΒÑΩL
We can then find the partician function for N-oscillators
ZN HΒL = Z1 HΒL N
-N
= e-HN2L ΒÑΩ I1 - e- ΒÑΩ M
Using the partitian function we are able to solve for the energy
¶HlnHZLL
E = -B F Printed by Wolfram Mathematica Student Edition
¶Β Er
¶ -N
= -B I ΒÑΩ - NlnI1 - e- ΒÑΩ MMF
¶Β 2
N NÑΩ
= ÑΩ +
0
¥
= S WHN, V, EL e- ΒHn+12L ÑΩ
n=0
-1
expJ
2
ΒÑΩN StatMech_Midterm_3.nb 17
=
1-expH- ΒÑΩL
We can then find the partician function for N-oscillators
ZN HΒL = Z1 HΒL N
-N
= e-HN2L ΒÑΩ I1 - e- ΒÑΩ M
Using the partitian function we are able to solve for the energy
¶HlnHZLL
E = -B F
¶Β Er
¶ -N
= -B I ΒÑΩ - NlnI1 - e- ΒÑΩ MMF
¶Β 2
N NÑΩ
= ÑΩ +
2 e ΒÑΩ -1
N NÑΩ
= ÑΩ + expHÑِkTL-1
2
1 1
E = NÑΩB + F
2 expHÑِkTL-1

Pressure
We can use Helmholtz free energy (A) since the system has a constant number of particles
A = -kTln HZN HΒLL
-N
= -kTln(e-HN2L ΒÑΩ I1 - e- ΒÑΩ M )
-HN2L ΒÑΩ - ΒÑΩ -N
= -kTln(e M + lnI1 - e M
-N
= -kTA ΒÑΩ - NlnI1 - e- ΒÑΩ ME
2
1
Where Β = in equillibrium
kT
-ÑΩ
N
A= ÑΩ + NkTlnK1 - e kT O
2
Now we can easily solve for the pressure
¶A
P = -J N
¶V N.T
P=0

c) Grand canonical ensemble


Energy
Again instead of finding the energy by using the entropy we can use the partition function

For a grand canonical ensemble the partition function is given by


¥ ¥
Z = S Ù dEWHEL e- ΒHE-ΜNL
N=0
0
¥ ¥
= S Ù dEWHEL e- Β@Hn+12L ÑΩ-ΜND
N=0
0
-N
¥ expJ ΒÑΩ-ΜNN
2
=S N
N=0 H1-expH- ΒÑΩLL
-1 N
¥ expJ ΒÑΩ-ΜN
2
=S
N=0 H1-expH- ΒÑΩLL
Now in order to find the series solution we will look at

¥ 1
S xN =
N=0 1-x
Given x<1
Then
1
Z= -1
exp ΒÑΩ-Μ
2
1-
H1-expH-ΒÑΩLL
1
Z= 1
1- e-Μ CschH ΒΩÑL
2

And using the same method as before we can calculate the energy
¶HlnHZLL
E = -B F
¶Β Er

In[41]:= Engce = - D@Log@1  H1 - Exp@- 1  2 * Β * Ñ * Ω - ΜD  H1 - Exp@- Β * Ñ * ΩDLLD, ΒD

Then we get
ÑΩe ΒΩѐ2 I1+e ΒΩÑ M
E= ΒÑΩ
2 Ie -1M Ie Μ+ΒΩÑ -e ΒΩѐ2 -e Μ M

Printed by Wolfram Mathematica Student Edition


18 StatMech_Midterm_3.nb

Then we get
ÑΩe ΒΩѐ2 I1+e ΒΩÑ M
E=
2 Ie ΒÑΩ -1M Ie Μ+ΒΩÑ -e ΒΩѐ2 -e Μ M

We can also calculate N from the partitian fuction


-1 ¶lnHZL
N= J N
Β ¶Μ

In[42]:= Ngce = - D@Log@1  H1 - Exp@- 1  2 * Β * Ñ * Ω - ΜD  H1 - Exp@- Β * Ñ * ΩDLLD, ΜD

e-Μ-ΒΩѐ2
N= e-Μ- ΒΩÑ
-ΒΩÑ
ΒI1-e M 1-
1-e- ΒΩÑ

Then
e-Μ-ΒΩѐ2 e-Μ-ΒΩѐ2
1- =
1-e-ΒΩÑ N ΒI1-e-ΒΩÑ M
And we can subsitute that into E in order to write E as a function of N
ã-Β Ω Ñ Ω Ñ
+Ω ѐ2
J1-ã-Β Ω Ñ N
E=
1N
e-ΒΩÑ 1
E = N ÑΩJ + N
1-e-ΒΩÑ 2

Pressure
For the grand canonical ensemble we have that
kT
P HZ, V, TL = lnHZL
V
P=0

Classical System
a) Microcanonical ensemble
Energy
The energy of microconical ensemble can be calculated using
1 ¶S
=J N
T ¶E V,N
Using Sterlings approximation to find the entropy of the system
1 E N
S(E,V,N) = kB lnJ NI M
NGHNL NÑΩ
E
S HE, V, NL = NkB A1 + lnI ME
NÑΩ
Then we can find the energy in the same manner as the previous section
1 ¶S
=J N
T ¶E V,N
Nkb
=
E
Now solving for E
E = Nkb T

Pressure
Again we assume that the oscillators are localized so
P=0

b) Canonical ensemble
Energy
For a canonical ensemble we can calculate the energy directly from the partition function rather than from the entropy
We have the partition function for a single quantum oscillator given by
1 - ΒH
Z1 HΒL = Ù Ù dqdpe
h
p2 1
1 -Β + mΩ2 q2
= à à dq dp e
2m 2
h
1 -mΩ2 q2 Β - Βp2 ‘H2 mL
= Ù dq e Ù dp e
h
1 2Π 12 2 Πm 12
= J N J N
h ΒmΩ Β
1
Z1 HΒL =
ÑΒΩ Printed by Wolfram Mathematica Student Edition
We can then find the partician function for N-oscillators
ZN HΒL = Z1 HΒL N
1 N
=J N
We have the partition function for a single quantum oscillator given by
1 - ΒH
Z1 HΒL = Ù Ù dqdpe
h

1 -Β
p2 1
+ mΩ2 q2 StatMech_Midterm_3.nb 19
= à à dq dp e
2m 2
h
1 -mΩ2 q2 Β - Βp2 ‘H2 mL
= Ù dq e Ù dp e
h
1 2Π 12 2 Πm 12
= J N J N
h ΒmΩ Β
1
Z1 HΒL =
ÑΒΩ
We can then find the partician function for N-oscillators
ZN HΒL = Z1 HΒL N
1 N
=J N
ÑΒΩ
Using the partitian function we are able to solve for the energy
¶HlnHZLL
E = -B F
¶Β Er
¶ 1 N
= -B JlnJJ N NNF
¶Β ÑΒΩ

=N HlnHÑΒΩLL
¶Β
=N/Β
E = NkB T
Pressure
Again localization means that
P=0

c) Grand canonical ensemble


Energy
Again instead of finding the energy by using the entropy we can use the partition function (same method as the quantum case)

For a grand canonical ensemble the partition function is given by


¥ 1 N N - ΒHHN -ΜNL
Z= S N ÙÙd qd pe
N=0 h
¥ e ΜΒN
N N - ΒH
= S N ÙÙd qd pe N
N=0 h
¥ 1 - ΒH N
= S eΜΒN A Ù Ù dq dp e E
N=0 h
We can recognize the integral done in part (b)
¥ N
= S AeΜΒ ‘ ΒÑΩE
N=0
Now in order to find the series solution we will look at

¥ 1
S xN =
N=0 1-x
Given x<1
Then
1
Z= e ΜΒ
1-
ÑΒΩ

Using the same method as before we can calculate the energy


¶HlnHZLL
E = -B F
¶Β Er

In[59]:= Engce = - D@Log@1  H1 - Exp@Μ * ΒD  Hhb * Β * wLLD, ΒD  FullSimplify

Then we get
e ΒΜ H ΒΜ-1L
E=
ΒIe ΒΜ -ÑΩΒM

We can also calculate N from the partitian fuction


-1 ¶lnHZL
N= J N
Β ¶Μ

In[64]:= Ngceclass = - 1  Β * D@Log@1  H1 - Exp@Μ * ΒD  Hhb * Β * wLLD, ΜD  FullSimplify


1
N=
I1-ÑΩΒe-ΒΜ M

And we can subsitute that into E in order to write E as a function of N


ΒΜ-1
E=-
ΒI1-ÑΩΒe-ΒΜ M
Printed by Wolfram Mathematica Student Edition
NH1- ΒΜL
E =
Β
20 StatMech_Midterm_3.nb
1
N=
I1-ÑΩΒe-ΒΜ M

And we can subsitute that into E in order to write E as a function of N


ΒΜ-1
E=-
ΒI1-ÑΩΒe-ΒΜ M
NH1- ΒΜL
E =
Β

Pressure
For the grand canonical ensemble we have that
kT
P HZ, V, TL = lnHZL
V
P=0

4)Calculate the fluctuations of E and P in:


Quantum System
a) Microcanonical ensemble
The energy fluctuations are zero for a microcanonical ensemble by definition
Similarily the pressure fluctuations are zero since the volume, energy, and number of particles remains constant.

b) Canonical ensemble
For a canonical ensemble we note that
HDEL2 = < E2 > - < E >2
-
¶E
=-
¶Β
N,V
-¶ 1 1
= @NÑΩB + F]
¶Β 2 expHÑΩΒL-1
2 2 ΒÑΩ
Ñ Ω e
HDEL2 = 2
Ie ΒΩÑ -1M
The fluctation in pressure is 0 since as stated perviously there is not pressure in our system

c) Grand canonical ensemble


We can write the fluctuations in the energy
HDEL2 = < E2 > - < E >2
-
¶E
=-
¶Β
¶E ¶E ¶N
= -BJ N +J N J N F
¶ Β N,V ¶N T,V ¶ Β z,V
¶E 2
= < HDEL2 >Canonical +:J N > HDNL2
¶N T,V
Ñ2 Ω2 e ΒÑΩ e-ΒΩÑ 1 2
= + BÑΩJ + NF HDNL2
Ie ΒΩÑ -1M
2
1-e-ΒΩÑ 2

We can caclulate HDNL ^ 2


- ΒΩÑ -1M
e Μ e ΒΩѐ2 Ie
HDNL2 = Μ ΒÑِ2 2
Ie +e -e Μ+ΒΩÑ M

And we can substitute that into HDEL2


2 - ΒΩÑ -1M
Ñ2 Ω2 e ΒÑΩ e-ΒΩÑ 1 e Μ e ΒΩѐ2 Ie
HDEL2 = - BÑΩJ + NF
Ie ΒΩÑ
-1M
2
1-e-ΒΩÑ 2 Μ
Ie +e ΒÑِ2
-e Μ+ΒΩÑ M
2

Ñ Ω e2 2 ΒÑΩ
e-ΒΩÑ
1 2 ÑΩΒ2 e ΒΜ
= - Ñ2 Ω2 J + N
Ie ΒΩÑ -1M
2
1-e-ΒΩÑ 2 Ie ΒΜ -ÑΩΒM
2

e ΒÑΩ I4 e-32 ΒΩÑ +1+e ΒΩѐ2 Ie-ΒΩÑ -1MM


HDEL2 = ÑΩB 2
- 2
F
Ie ΒΩÑ -1M e Μ I1+e ΒÑِ2 -e Μ+ΒΩÑ M

Classical System
a) Microcanonical ensemble
The energy fluctuations are zero for a microcanonical ensemble by definition
Similarily the pressure fluctuations are zero since the volume, energy, and number of particles remains constant (Same argument as for the
quantum system)
Printed by Wolfram Mathematica Student Edition
StatMech_Midterm_3.nb 21

The energy fluctuations are zero for a microcanonical ensemble by definition


Similarily the pressure fluctuations are zero since the volume, energy, and number of particles remains constant (Same argument as for the
quantum system)

b) Canonical ensemble
For a canonical ensemble we note that
HDEL2 = < E2 > - < E >2
-
¶E
=-
¶Β
N,V
¶ N
= -J N
¶ Β Β N,V
-N
HDEL2 =
Β2
The fluctation in pressure is 0 since as stated perviously there is not pressure in our system

c) Grand canonical ensemble


We can write the fluctuations in the energy
HDEL2 = < E2 > - < E >2
-
¶E
=-
¶Β
¶E ¶E ¶N
= -BJ N +J N J N F
¶ Β N,V ¶N T,V ¶ Β z,V
¶E 2
= < HDEL2 >Canonical +:J N > HDNL2
¶N T,V
-N 1 2
= + B F HDNL2
Β2 Β

We can caclulate HDNL ^ 2

In[65]:= D@Ngceclass, ΜD  FullSimplify

We can substitute that into the energy fluctuation


-N 1 2 ÑΩΒ2
HDEL2 = - B F e ΒΜ
Β2 Β Ie ΒΜ -ÑΩΒM
2

-N ÑΩ
HDEL2 = -
Β2 I1-ÑΩΒe-ΒΜ M
2

Printed by Wolfram Mathematica Student Edition


Midterm - Statistical Mechanics
PHGN530
4 October 2016
Marie McLain
Collaborators: Kirsten Blagg, David Hensle, Eric Jones, Alex Wilhelm, Shou Liu

1.) Counting the number of microstates: 4 distinguishable harmonic oscillators


in 1D with spring constant k, mass m
In[203]:= Clear"Global`*"

k
The Hamiltonian of a SHO in 1D, with ω = , is
m

p2 m
H[p_, q_] := + 1 / 2 m ω2 q2
2
With energy:
1
En = ℏωn + 2 
For many SHOs, we write the energy as
N
Etotal = ℏωNtot + 2 

Defining the constants to simplify the calculations (recognizing that these are not experimental values!):
In[204]:= ω = 1; m = 1; kb = 1; ℏ = 1(*6.582*10-16 *)(*eVs*);

a.) Plot Ω(N,V,E) vs E


Here, we are looking for the number of microstates as a function of energy E. To determine the multiplic-
ity we can add up the combinations for each of the four harmonic oscillators. In order to discern the
pattern, we look at increasing the total number of oscillators from 0 to 4 and consider a “basis” with four
sites: (n1 n2 n3 n4 ) where Ntot = n1 + n2 + n3 + n4

Ntot = 0
(0000)
There is one combination for Ntot = 0, i.e. Ω = 1.
Ntot = 1
Since ni are distinguishable, we have separate states
(0001)
(0010)
(0100)

Printed by Wolfram Mathematica Student Edition


2 MarieMcLain2016October6.nb

(1000) 4 combinations for Ntot = 1, i.e. Ω = 4.


Ntot = 2
(0002)
(0020)
(0200)
(2000) 4 distinguishable combinations, and now we start to see a pattern
(0011)
(0101)
(0110)
(1001)
(1010)
(1100) 6 distinguishable combinations, and now I will omit listing all the possible combinations individu-
ally
There are 4+6 combinations for Ntot = 2, i.e. Ω = 10.
Ntot = 3
(0003) - 4
(0012) - 12
(0111) - 4
There are 4+12+4 combinations for Ntot = 3, i.e. Ω = 20.
Ntot = 4
(0004) - 4
(0013) - 12
(0022) - 6
(0112) - 12
(1111) - 1
There are 4+12+6+12+1 combinations for Ntot = 4, i.e. Ω = 35.
We find from the pattern that the number of microstates follows a binomial expansion, as Ω is given by
(Ntot +N-1)!
Ω(N, Ntot , V ) = Ntot ! (N-1)!
Plug in the energy of the SHO from above to find Ntot
E-N/2*ℏω
Ntot = ℏω
Then substitute into Ω

 Engy - Num
+ Num - 1!
ℏω 2
In[205]:= Ω[Num_, Engy_] = ;
 Engy - Num
! (Num - 1)!
ℏω 2

Due to the uncertainty principle, we have minimum allowed energy Emin = (1/2) N ℏω
4ℏω
In[206]:= Emin = ;
2
For the classical case, we have continuous-allowed energy states. I have plotted both the classical and
the quantum case below. The quantum case is shown in smiley faces on the same plot to demonstrate
the agreement. The y-axis is located in a weird place, at E=5 for some reason, so it appears as if the
energy values are negative, but don’t worry, they are not!

Printed by Wolfram Mathematica Student Edition


MarieMcLain2016October6.nb 3

In[207]:= ShowPlotΩ[4, x], x, Emin, 20,


PlotLabel → "Ω(N,V,E) vs E", AxesLabel → {"E", "Ω(N,V,E)"},
ImageSize → Large, PlotStyle → RGBColor[0.25, 0, 0.75], Thick,
ListPlotTranspose @Tablen1, n1, Emin, 20, TableΩ[4, n2], n2, Emin, 20,
ImageSize → Large, PlotMarkers → "☺", PlotStyle → RGBColor[1, 0, 1]
Ω(N,V,E) vs E
Ω(N,V,E)
1400


1200

1000

800 ☺
Out[207]=


600


400


200 ☺

☺ ☺ ☺
☺ ☺ ☺ ☺ ☺ E
10 15 20

For the quantum case, we have discrete-allowed energy values, shown on its own below.

Printed by Wolfram Mathematica Student Edition


4 MarieMcLain2016October6.nb

In[208]:= ListPlotTranspose @Tablen1, n1, Emin, 20, TableΩ[4, n2], n2, Emin, 20,
PlotLabel → "Ω(N,V,E) vs E", AxesLabel → {"E", "Ω(N,V,E)"},
ImageSize → Large, PlotMarkers → "☺", PlotStyle → RGBColor[1, 0, 1]
Ω(N,V,E) vs E
Ω(N,V,E)
1400


1200

1000

800 ☺
Out[208]=


600


400


200 ☺

☺ ☺ ☺
☺ ☺ ☺ ☺ ☺ E
5 10 15 20

b.) Plot Φ(N, V, E) = ∑E'≤E Ω(N,V,E’) vs E. Cumulative number of states


The difference here is that we are summing over the energy of all of the states.
Engy
In[209]:= Φ[Num_, Engy_] =  Ω[Num, x];
x=Emin

Printed by Wolfram Mathematica Student Edition


MarieMcLain2016October6.nb 5

In[210]:= ShowPlotΦ[4, x], x, Emin, 20,


PlotLabel → "Φ(N,V,E) vs E", AxesLabel → {"E", "Φ(N,V,E)"},
ImageSize → Large, PlotStyle → RGBColor[0.25, 0, 0.75], Thick,
ListPlotTranspose @Tablen1, n1, Emin, 20, TableΦ[4, n2], n2, Emin, 20,
PlotMarkers → "☺", ImageSize → Large, PlotStyle → RGBColor[1, 0, 1]
Φ(N,V,E) vs E
Φ(N,V,E)

6000 ☺


Out[210]= 4000



2000




☺ ☺ ☺ ☺
☺ ☺ ☺ ☺ ☺ 10 15 20
E

Printed by Wolfram Mathematica Student Edition


6 MarieMcLain2016October6.nb

In[211]:= ListPlotTranspose @Tablen1, n1, Emin, 20, TableΦ[4, n2], n2, Emin, 20,
PlotLabel → "Φ(N,V,E) vs E", AxesLabel → {"E", "Φ(N,V,E)"},
PlotMarkers → "☺", ImageSize → Large, PlotStyle → RGBColor[1, 0, 1]
Φ(N,V,E) vs E
Φ(N,V,E)


7000

6000 ☺

5000

Out[211]=
4000

3000 ☺

2000


1000 ☺


☺ ☺ ☺ ☺ ☺ ☺ ☺ ☺ E
5 10 15 20

c.) Plot the density of states Ω(E)= ∂Φ(N,V,E)/∂E vs . Remember that in an


interval Δ the number of states is given by Γ(N,V,E,Δ)=Ω(E)Δ.
In[212]:= ΩE[Num_, Engy_] = ∂Engy Φ[Num, Engy];

Printed by Wolfram Mathematica Student Edition


MarieMcLain2016October6.nb 7

In[213]:= ShowPlotΩE[4, x], x, Emin, 20, PlotLabel → "Ω(E) vs E", AxesLabel → {"E", "Ω(E)"},
ImageSize → Large, PlotStyle → RGBColor[0.25, 0, 0.75], Thick,
ListPlotTranspose @Tablen1, n1, Emin, 20, TableΩE[4, n2], n2, Emin, 20,
PlotMarkers → "☺", ImageSize → Large, PlotStyle → RGBColor[1, 0, 1]
Ω(E) vs E
Ω(E)

1400 ☺

1200 ☺

1000


Out[213]= 800

600 ☺

400 ☺


200

☺ ☺ ☺

☺ ☺ ☺ ☺ 10 15 20
E

Printed by Wolfram Mathematica Student Edition


8 MarieMcLain2016October6.nb

In[214]:= ListPlotTranspose @Tablen1, n1, Emin, 20, TableΩE[4, n2], n2, Emin, 20,
PlotLabel → "Ω(E) vs E", AxesLabel → {"E", "Ω(E)"},
PlotMarkers → "☺", PlotStyle → RGBColor[1, 0, 1], ImageSize → Large
Ω(E) vs E
Ω(E)

1400 ☺

1200 ☺

1000


Out[214]= 800

600 ☺

400 ☺


200

☺ ☺ ☺

☺ ☺ ☺ ☺
5 10 15 20
E

d.) What happens to the factors h3 N and N! that you keep on seeing?
The factor h3 N arises from inherent uncertainties due to the measurement of q and p; it also helps to
resolve the dimensionality problem of the partition function. However, in our case, we are not measuring
q and p, we are counting states; thus we do not see this factor.
The factor N! is for cases when the microstates are indistinguishable, and here we have distinguishable
particles so we do not take it into account. (reference: Susanta’s notes)

e.) For a particlular energy E, calculate the entropy using S = k lnΩ(N,V,E)


and S = k lnΩ(E). Are they equivalent? Remember that this expression
connects statistical mechanics to thermodynamics.
The y-axis again looks deceiving due to its placement, but it is not at E=0, so don’t worry, we don’t have
negative energy! The first plot shows the continuous/classical entropies with the discrete/quantum
overlay. The second plot shows solely the quantum entropies with discrete-allowed energies.

Printed by Wolfram Mathematica Student Edition


MarieMcLain2016October6.nb 9

In[215]:= ShowPlotkb Log[Ω[4, x]], kb Log[ΩE[4, x]],


x, Emin, 20, PlotLabel → "Entropies from different Ω",
AxesLabel → {"Energy (E)", "Entropy (S)"},
PlotLegends → {"Ω(E,N,V)", "Ω(E)"}, ImageSize → Large,
PlotStyle → RGBColor[0.25, 0, 0.75], Thick, RGBColor[1, 0, 1], Thick,
PlotRange → All, ListPlot
Transpose @Tablen1, n1, Emin, 20, Tablekb Log[Ω[4, n2]], n2, Emin, 20,
PlotMarkers → "☺", PlotStyle → RGBColor[0.25, 0, 0.75],
ImageSize → Large, ListPlot
Transpose @Tablen1, n1, Emin, 20, Tablekb Log[ΩE[4, n2]], n2, Emin, 20,
PlotMarkers → "☺", PlotStyle → RGBColor[1, 0, 1], ImageSize → Large
Entropies from different Ω
Entropy (S)


☺ ☺ ☺


☺ ☺ ☺

6 ☺










☺ Ω(E,N
Out[215]= 4


☺ Ω(E)





2



☺ 10 15 20
Energy (E)

Printed by Wolfram Mathematica Student Edition


10 MarieMcLain2016October6.nb

In[216]:= ShowListPlot
Transpose @Tablen1, n1, Emin, 20, Tablekb Log[Ω[4, n2]], n2, Emin, 20,
PlotLabel → "Quantum entropies from different Ω",
AxesLabel → {"Energy (E)", "Entropy (S)"},
PlotMarkers → "☺", PlotStyle → RGBColor[0.25, 0, 0.75],
ImageSize → Large, PlotLegends → {"Ω(E,N,V)"}, ListPlot
Transpose @Tablen1, n1, Emin, 20, Tablekb Log[ΩE[4, n2]], n2, Emin, 20,
PlotMarkers → "☺", PlotStyle → RGBColor[1, 0, 1],
ImageSize → Large, PlotLegends → {"Ω(E)"}
Quantum entropies from different Ω
Entropy (S)


7
☺ ☺
☺ ☺

☺ ☺
6 ☺ ☺

☺ ☺
☺ ☺
☺ ☺
5
☺ ☺
☺ ☺
☺ ☺ ☺ Ω(E,N
Out[216]= 4 ☺
☺ ☺
☺ Ω(E)

3 ☺


2


1

☺ 5 10 15 20
Energy (E)

For a particular energy E = 20, for instance:


S(Ω(N,V,E=20)):
In[241]:= kb * Log[Ω[4, 20.]]
Out[241]= 7.19293

S(Ω(E=20)):
In[242]:= kb Log[ΩE[4, 20.]]
Out[242]= 7.26654

In[240]:= kb Log[ΩE[4, 20.]] - kb * Log[Ω[4, 20.]]  kb Log[ΩE[4, 20.]] 100
Out[240]= 1.01289

The entropies are very close but they are not the same. They are approximately 1% different at this
value of E. However, the plot demonstrates that they converge at higher values of E.

2.) Importance of large numbers: 100 distiguishable harmoic oscillators in 1D

Printed by Wolfram Mathematica Student Edition


MarieMcLain2016October6.nb 11

with spring constant k and mass m. What happens to the different ways of
calculating number of states?
The

a.) Plot Ω(N,V,E) vs E


We remember the uncertainty principle and rewrite our minimum allowed energy of the system:
100 ℏ ω
In[220]:= Emin = ;
2
In[221]:= ShowPlotΩ[100, x], x, Emin, 100, PlotLabel → "Ω(N,V,E) vs E",
AxesLabel → {"E", "Ω(N,V,E)"}, ImageSize → Large,
PlotStyle → RGBColor[0.25, 0, 0.75], Thick, ListPlot
Transpose @Tablen1, n1, Emin, 100, TableΩ[100, n2], n2, Emin, 100,
PlotMarkers -> "☺", PlotStyle → RGBColor[1, 0, 1]
Ω(N,V,E) Ω(N,V,E) vs E

1.4 × 1036

1.2 × 1036

1.0 × 1036

8.0 × 1035
Out[221]=

6.0 × 1035

4.0 × 1035 ☺

2.0 × 1035


☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺
60 70 80
☺☺90 100
E

Printed by Wolfram Mathematica Student Edition


12 MarieMcLain2016October6.nb

In[222]:= ListPlotTranspose @Tablen1, n1, Emin, 100, TableΩ[100, n2], n2, Emin, 100,
PlotLabel → "Ω(N,V,E) vs E", AxesLabel → {"E", "Ω(N,V,E)"},
PlotMarkers -> "☺", PlotStyle → RGBColor[1, 0, 1]
Ω(N,V,E) Ω(N,V,E) vs E

3.5 × 1036

3.0 × 1036

2.5 × 1036

Out[222]= 2.0 × 1036

1.5 × 1036

1.0 × 1036

5.0 × 1035

☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺ ☺☺
☺☺
☺☺☺☺☺☺ 90 E
60 70 80 100

b.) Plot Φ (N, V, E) = ∑E'≤E Ω(N,V,E’) vs E. Cumulative number of states


Engy
In[223]:= Φ[Num_, Engy_] =  Ω[Num, x];
x=Emin
ShowPlotΦ[100, x], x, Emin, 100, PlotLabel → "Φ(N,V,E) vs E",
AxesLabel → {"E", "Φ(N,V,E)"}, ImageSize → Large, ListPlot
Transpose @Tablen1, n1, Emin, 100, TableΦ[100, n2], n2, Emin, 100,
PlotLabel → "Φ(N,V,E) vs E", AxesLabel → {"E", "Φ(N,V,E)"},
PlotMarkers → "☺", ImageSize → Large, PlotStyle → RGBColor[1, 0, 1]

Φ(N,V,E) Φ(N,V,E) vs E
2.0 × 1036

1.5 × 1036

Out[224]=
1.0 × 1036


5.0 × 1035


☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺
60 70 80
☺☺90 100
E

Printed by Wolfram Mathematica Student Edition


MarieMcLain2016October6.nb 13

In[225]:= ListPlotTranspose @Tablen1, n1, Emin, 100, TableΦ[100, n2], n2, Emin, 100,
PlotLabel → "Φ(N,V,E) vs E", AxesLabel → {"E", "Φ(N,V,E)"},
PlotMarkers → "☺", ImageSize → Large, PlotStyle → RGBColor[1, 0, 1]
Φ(N,V,E) Φ(N,V,E) vs E

5 × 1036

4 × 1036

3 × 1036
Out[225]=

2 × 1036 ☺

1 × 1036



☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺
50 60 70 80
☺☺90 100
E

c.) Plot the density of states Ω(E)= ∂Φ(N,V,E)/∂E vs . Remember that in an


interval Δ the number of states is given by Γ(N,V,E,Δ)=Ω(E)Δ.
In[226]:= ΩE[Num_, Engy_] = ∂Engy Φ[Num, Engy];

Printed by Wolfram Mathematica Student Edition


14 MarieMcLain2016October6.nb

In[227]:= ShowPlotΩE[100, x], x, Emin, 100, PlotLabel → "Ω(E) vs E",


AxesLabel → {"E", "Ω(E)"}, ImageSize → Large, ListPlot
Transpose @Tablen1, n1, Emin, 100, TableΩE[100, n2], n2, Emin, 100,
PlotLabel → "Ω(E) vs E", AxesLabel → {"E", "Ω(E)"},
PlotMarkers → "☺", PlotStyle → RGBColor[1, 0, 1], ImageSize → Large
Ω(E) Ω(E) vs E
2.5 × 1036

2.0 × 1036

1.5 × 1036

Out[227]=

1.0 × 1036


5.0 × 1035


☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺
60 70 80
☺☺90 100
E

Printed by Wolfram Mathematica Student Edition


MarieMcLain2016October6.nb 15

In[228]:= ListPlot
Transpose @Tablen1, n1, Emin, 100, TableΩE[100, n2], n2, Emin, 100,
PlotLabel → "Ω(E) vs E", AxesLabel → {"E", "Ω(E)"},
PlotMarkers → "☺", PlotStyle → RGBColor[1, 0, 1], ImageSize → Large
Ω(E) Ω(E) vs E

6 × 1036

5 × 1036

4 × 1036

Out[228]=

3 × 1036


2 × 1036

1 × 1036


☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺
60 70 80
☺☺90 100
E

d.) What happens to the factors h3 N and N! that you keep on seeing?
The factor h3 N arises from inherent uncertainties due to the measurement of q and p; it also helps to
resolve the dimensionality problem of the partition function. However, in our case, we are not measuring
q and p, we are counting states; thus we do not see this factor.
The factor N! is for cases when the microstates are indistinguishable, and here we have distinguishable
particles so we do not take it into account. (reference: Susanta’s notes)

Printed by Wolfram Mathematica Student Edition


16 MarieMcLain2016October6.nb

e.) For a particlular energy E, calculate the entropy using S = k lnΩ(N,V,E)


and S = k lnΩ(E). Are they equivalent? Remember that this experession
connects statistical mechanics to thermodynamics.
In[229]:= Plotkb Log[Ω[100, x]], kb Log[ΩE[100, x]], x, Emin, 100,
PlotLabel → "Entropies from different Ω", AxesLabel → {"Energy (E)", "Entropy (S)"},
PlotLegends → {"Ω(E,N,V)", "Ω(E)"}, ImageSize → Large,
PlotStyle → RGBColor[0.25, 0, 0.75], Thick, RGBColor[1, 0, 1], Thick
Entropies from different Ω
Entropy (S)

80

60
Ω(E,N
Out[229]=
Ω(E)
40

20

Energy (E)
60 70 80 90 100

Printed by Wolfram Mathematica Student Edition


MarieMcLain2016October6.nb 17

In[230]:= ShowListPlotTranspose @
Tablen1, n1, Emin, 100, Tablekb Log[Ω[100, n2]], n2, Emin, 100,
PlotLabel → "Quantum entropies from different Ω",
AxesLabel → {"Energy (E)", "Entropy (S)"}, PlotMarkers → "☺",
PlotStyle → RGBColor[0.25, 0, 0.75], ImageSize → Large, PlotLegends → {"Ω(E,N,V)"},
ListPlotTranspose @Tablen1, n1, Emin, 100,
Tablekb Log[ΩE[100, n2]], n2, Emin, 100, PlotMarkers → "☺",
PlotStyle → RGBColor[1, 0, 1], ImageSize → Large, PlotLegends → {"Ω(E)"}
Quantum entropies from different Ω
Entropy (S)

☺☺☺☺☺

☺☺☺☺☺
80 ☺
☺☺☺☺☺

☺☺☺☺

60 ☺☺☺
☺☺ ☺ Ω(E,N
Out[230]= ☺☺☺
☺☺☺ ☺ Ω(E)

40
☺☺☺
☺☺☺
☺☺☺
20
☺☺









☺ Energy (E)
60 70 80 90 100

For a particular energy E = 100, for instance:


S(Ω(N,V,E=100)):
In[238]:= kb Log[Ω[100, 100.]]
Out[238]= 92.3975

S(Ω(E=100)):
In[239]:= kb Log[ΩE[100, 100.]]
Out[239]= 92.891

In[237]:= kb Log[ΩE[100, 100.]] - kb * Log[Ω[100, 100.]]  kb Log[ΩE[100, 100.]] 100
Out[237]= 0.531218

The entropies are very close but they are not the same. They are approximately 0.5% different at this
value of E. However, the plot demonstrates that they converge at higher values of E.
We see that the different ways of calculating the number of states start to look more similar to one
another as we increase the number of oscillators. In the large N limit, we should see no measurable
difference between the different ways of measuring the number of states, both in the quantum case and

Printed by Wolfram Mathematica Student Edition


18 MarieMcLain2016October6.nb

in the classical case.

3.) Equivalence and non-equivalence of ensembles: Take the entropy


calculated in 1) and 2) and calculate the energy E and the pressure P in

a.) Microcanonical ensemble: classical

Printed by Wolfram Mathematica Student Edition


MarieMcLain2016October6.nb 19

In[247]:= Import"/home/marie/Documents/statMech/prob3_1.jpg"

Out[247]=

Printed by Wolfram Mathematica Student Edition


20 MarieMcLain2016October6.nb

b.) Canonical ensemble: classical


In[248]:= Import"/home/marie/Documents/statMech/prob3_2.jpg"

Out[248]=

(reference: pg 65-73 of Pathria)

Printed by Wolfram Mathematica Student Edition


MarieMcLain2016October6.nb 21

c.) Grand canonical ensemble: classical


In[249]:= Import"/home/marie/Documents/statMech/prob3_3.jpg"

Out[249]=

Printed by Wolfram Mathematica Student Edition


22 MarieMcLain2016October6.nb

a.) Microcanonical ensemble: quantum


In[250]:= Import"/home/marie/Documents/statMech/prob3_4.jpg"

Out[250]=

Printed by Wolfram Mathematica Student Edition


MarieMcLain2016October6.nb 23

b.) Canonical ensemble: quantum


In[251]:= Import"/home/marie/Documents/statMech/prob3_5.jpg"

Out[251]=

Printed by Wolfram Mathematica Student Edition


24 MarieMcLain2016October6.nb

c.) Grand canonical ensemble: quantum


In[252]:= Import"/home/marie/Documents/statMech/prob3_6.jpg"

Out[252]=

4.) Fluctuations of thermodynamic quantities: Calculate the fluctuations of E

Printed by Wolfram Mathematica Student Edition


MarieMcLain2016October6.nb 25

and P in

a.) Microcanonical ensemble


b.) Canonical ensemble
c.) Grand canonical ensemble
In[253]:= Import"/home/marie/Documents/statMech/prob4_1.jpg"

Printed by Wolfram Mathematica Student Edition


26 MarieMcLain2016October6.nb

Out[253]=

Printed by Wolfram Mathematica Student Edition


MarieMcLain2016October6.nb 27

In[254]:= Import"/home/marie/Documents/statMech/prob4_2.jpg"

Out[254]=

Printed by Wolfram Mathematica Student Edition


PHGN 530 S TATISTICAL M ECHANICS

Midterm Exam

Eric Jones
October 02, 2016

1 C OUNTING THE NUMBER OF MICROSTATES (500 PTS )


1.1 PART A
In order to enumerate the multiplicity of states Ω(N ,V, E ) at constant V and N = 4 as a func-
tion of E , we follow the approach taken in Callen [1]. The energy levels of a single 1 dimen-
sional quantum harmonic oscillator are:

1
E (n) = ~ω(n + ),
2
q
k
where ω = m .
For four, uncoupled 1D simple harmonic oscillators, the expression for the energy be-
comes:

4
E (n 1 , n 2 , n 3 , n 4 ) = ~ω(n 1 + n 2 + n 3 + n 4 + )
2
= ~ω(n + 2),

with n = n 1 + n 2 + n 3 + n 4 . Each integer n i runs from 0 to ∞, as does the integer n. As such,


each energy is determined by a value of n, and the multiplicity of states at that energy is
determined by the number of ways that the n quanta can be distributed between the four
oscillators, or equivalently, the number of ways n 1 + n 2 + n 3 + n 4 = n for fixed n. We proceed
to derive this for the general case of n quanta and N oscillators so that it can be applied to
both N = 4 and N = 100.

1
Suppose we have n indistinguishable balls lying in a line. These represent our n quanta of
energy. Given N oscillators we can fully distribute the n quanta by placing N − 1 partitions
at various positions between the n balls so that, for example, the number of balls to the left
of the left-most partition is the number of quanta contained in the first oscillator, and so on
and so forth. The basic combinatorial problem we want to solve then is: how many ways
can we place these partitions? This can be viewed as the following equivalent problem. Line
(n + N − 1) (= the number of balls + the number of partitions) undetermined symbols up in
a row. N − 1 of these must be partitions and n must be balls. How many ways can we choose
N − 1 of the undetermined symbols to be partitions (or n to be balls)? The answer is given by
the binomial coefficient:

à ! à !
n +N −1 n +N −1
Ω(N ,V, E (n)) = =
N −1 n
(n + N − 1)!
=
n!(N − 1)!
(E /~ω + N − 1)!
= ,
(E /~ω)!(N − 1)!

once we have scaled the zero-point energy from 2~ω to 0 since it has no bearing on the mul-
tiplicity of states. In order to check this formula for N = 4, we consider a few test cases.

For n = 0 there is only one energy state and the only possibility for partition is (n 1 , n 2 , n 3 , n 4 ) =
(0, 0, 0, 0). This corroborates the formula above.

For n = 1, the possible partitions are (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), and (0, 0, 0, 1). The bino-
mial formula also gives 4 states.

For n = 2, the possible partitions are (2, 0, 0, 0), (0, 2, 0, 0), (0, 0, 2, 0), (0, 0, 0, 2), (1, 1, 0, 0), (1, 0, 1, 0),
(1, 0, 0, 1), (0, 1, 0, 1), (0, 1, 1, 0), and (0, 0, 1, 1). This gives 10 states. The binomial coefficient also
gives 10.

It should be noted that we are treating the harmonic oscillators here as distinguishable, and
so our expression for the multiplicity of states should be correct. The multiplicity of states
is plotted below where it is understood that each dot is the left corner of a flat step, which
persists until the next integer n value is encountered (long story short, I couldn’t figure how
to get python to do histograms).

2
20000

15000
Ω(N =4,V,n)

10000

5000

0
0 10 20 30 40 50
E =n
ω

Figure 1.1: Quantum Multiplicity of States

In order to get some idea of what the classical analogue of this plot might be, we can let n
become continuous. Then our factorials become gamma functions, n! → Γ(n + 1), such that
the multiplicity of states becomes:

Γ(n + N )
Ω(N ,V, E (n)) =
Γ(n + 1)Γ(N )
Γ(E /~ω + N )
= .
Γ(E /~ω + 1)Γ(N )

Both the discrete and continuous multiplicity of states are now plotted below. It is noteworthy
that the continuum limit slightly over-counts, since it is non-stationary in regions where the
discrete multiplicity is flat.

3
Quantum
20000 Classical

15000
Ω(N =4,V,n)

10000

5000

0
0 10 20 30 40 50
E =n
ω

Figure 1.2: Quantum and Continuum Multiplicity of States

1.2 PART B
Having obtained explicit expressions for Ω(N ,V, E ) in both the discrete and continuum case,
we now consider the cumulative number of states as a function of energy:

Φ(N ,V, E ) = Ω(N ,V, E 0 )


X
E 0 ≤E
à !
Xn n0 + N − 1
=
n 0 =0 n0
à !
n+N (n + N )!
= = ,
n n! N !

where the last line follows according to both Wolfram Alpha and Wikipedia (I didn’t have time
to prove it). This is plotted below along with the continuous, gamma function version, and
the two plots above.

4
Quantum Multiplicity
20000 Classical Multiplicity
Cumulative Quantum Multiplicity
Cumulative Classical Multiplicity
Ω(N =4,V,n) & Φ(N =4,V,n)

15000

10000

5000

0
0 10 20 30 40 50
E =n
ω

Figure 1.3: Quantum and Continuum Multiplicity of States and Cumulative Multiplicity of
States

1.3 PART C
In order to calculate the density of states,

∂Φ(N ,V, E )
Ω(E ) =
,
∂E
we turn the above expression into a finite difference equation:

Φ(N ,V, E (n)) − Φ(N ,V, E (n − 1))


Ω− (E (n)) =
E (n) − E (n − 1)
1 h (n + N )! (n + N − 1)! i
= −
~ω n! N ! (n − 1)! N !
1 (n + N − 1)! h (n + N ) i
= −1
~ω (n − 1)! N ! n
1 (n + N − 1)!
= .
~ω n! (N − 1)!

5
Note that we have just shown that: ~ω Ω− (E (n)) = Ω(N ,V, E (n)), but that if we had used a
forward (or central) difference for the derivative, the expressions would be slightly off. For
example, for the forward difference, the expression would be:

1 (n + N )!
Ω+ (E (n)) = .
~ω (n + 1)! (N − 1)!
If we now consider some energy interval ∆ in which we measure our multiplicities, then we
can plot Ω(N ,V, E (n)), ∆Ω+ (E (n)), and ∆Ω− (E (n)) below for ∆=
˜ ~ω.

Ω(N =4,V,E) =∆Ω− (E)


20000 ∆Ω + (E)
Classical
Classical
15000
Ω & ∆Ω ±

10000

5000

0
0 10 20 30 40 50
E =n
ω

Figure 1.4: Density of States and Multiplicity of States (N = 4)

1.4 PART D
The typical factor of N ! does not enter into this analysis, since dividing multiplicities by N !
is a feature introduced to correct for over-counting indistinguishable particles. Our particles,
on the other hand are distinguishable. Moreover, the presence of h 3N is usually introduced
as a “fundamental phase space volume element” associated with fundamental measurement
uncertianty. However, we have been dealing almost entirely with combinatorially counted

6
numbers and as such, have not needed to introduce 1/h 3N as a way to discretize a continuum
phase space (since quantum mechanics already does this as we can see in the expression for
the Ω± ).

1.5 PART E
Calculating the entropy first with our multiplicity of states we get:

h (n + N − 1)! i
S[Ω(N ,V, E )] = k ln .
n! (N − 1)!

If, on the other hand, we calculate using the density of states multiplied over some energy
interval ∆:

h (n + N − 1)! i h ∆ i
S[∆Ω− (E )] = k ln + k ln
n! (N − 1)! ~ω
h (n + N )! i h ∆ i
S[∆Ω+ (E )] = k ln + k ln
(n + 1)! (N − 1)! ~ω
,

We see that at worst the discrepancy in entropy is given by:

h (n + N ) i h ∆ i
∆S + = k ln + k ln ,
(n + 1) ~ω
and at best:

h ∆ i
∆S − = k ln ,

which vanishes if we choose ∆ = ~ω. These results are plotted below for ∆ = 1.5~ω.

7
10

6
S
k

4 S[Ω + (E)]
S[Ω− (E)]
S[Ω(N =4,V,E)]
2 S + Classical
S− Classical
S Classical
0
0 10 20 30 40 50
E =n
ω

Figure 1.5: Entropies (N = 4)

2 I MPORTANCE OF LARGE NUMBERS (500 PTS )


We now repeat all of the plots above for the case in which N = 100. This shows that, although
the analytic formulae are the same, the various results appear to converge to one another as
far as counting states and entropy computations are concerned.

8
2.1 PART A

1e39

3
Ω(N =100,V,n)

0
0 10 20 30 40 50
E =n
ω

Figure 2.1: Quantum Multiplicity of States

9
1e39
Quantum
4 Classical

3
Ω(N =100,V,n)

0
0 10 20 30 40 50
E =n
ω

Figure 2.2: Quantum and Continuum Multiplicity of States

10
2.2 PART B

1e39
Quantum Multiplicity
4 Classical Multiplicity
Cumulative Quantum Multiplicity
Cumulative Classical Multiplicity
Ω(N =100,V,n) & Φ(N =100,V,n)

0
0 10 20 30 40 50
E =n
ω

Figure 2.3: Quantum and Continuum Multiplicity of States and Cumulative Multiplicity of
States

11
2.3 PART C

1e39
Ω(N =100,V,E) =∆Ω− (E)
4 ∆Ω + (E)
Classical
Classical
3
Ω & ∆Ω ±

0
0 10 20 30 40 50
E =n
ω

Figure 2.4: Density of States and Multiplicity of States (N = 100)

2.4 PART D
There was no plot for this subsection.

12
2.5 PART E

80

60
S
k

40
S[Ω + (E)]
S[Ω− (E)]
20 S[Ω(N =100,V,E)]
S + Classical
S− Classical
S Classical
0
0 10 20 30 40 50
E =n
ω

Figure 2.5: Entropies (N = 100)

3 E QUIVALENCE AND NON - EQUIVALENCE OF ENSEMBLES (600 PTS )


An important set of facts in the following analysis is that for the microcanonical ensemble,
energy E , particle number N , and volume V are kept fixed; for the canonical ensemble, tem-
perature T , particle number N , and volume V are kept fixed; and for the grand canonical
ensemble, only T and V are kept fixed while N and E are allowed to vary.

3.1 PART A
In order to calculate the energy and pressure with the microcanonical ensemble, we recall
our expression for entropy derived earlier:

h (n + N − 1)! i
S[Ω(N ,V, E )] = k ln
n! (N − 1)!
= k ln(n + N − 1)! − k ln n! − k ln(N − 1)! .

13
Using Stirling’s approximation, we write this as:

S[Ω(N ,V, E )]=k(n


˜ + N − 1) ln(n + N − 1) − k(n + N − 1) − kn ln n + kn − k(N − 1) ln(N − 1) + k(N − 1)
= k(n + N − 1) ln(n + N − 1) − kn ln n − k(N − 1) ln(N − 1).

While the total energy of this system is fixed, we could assess how entropy scales with the
total energy at which we fix the system. Then, we can use the thermodynamic identity:

∂S
µ ¶
1
=
T ∂E V,N

to calculate (assuming a continuous n or performing a finite difference for the derivative):

∂S
µ ¶
1
=
T ∂E V,N
∂S ∂n
µ ¶
=
∂n ∂E V,N
k h (n + N − 1) i
= ln
~ω n
h (n + N − 1) i ³ ~ω ´
=⇒ = exp
n kT
h ³ ~ω ´ i
=⇒ n exp − 1 = N − 1.
kT
Now if we had not scaled back our zero point energy, we would have had:

E N
n= − ,
~ω 2
such that:

N
½µ ¾ ¶
1
E (N , T ) = ~ω(N − 1) ³ ´ + ,
~ω 2
exp kT −1

which in the thermodynamic limit (large N, i.e. N >> 1) becomes:

½µ ¶ ¾
1 1
E (N , T ) = ~ωN ³ ´ + .
~ω 2
exp kT −1

As for the computation of pressure, we cite the thermodynamic identity:

14
P ∂S
µ ¶
= =0
T ∂V E ,N

since the entropy does not depend on volume. This can be seen as a statement that the os-
cillators are localized and thus do not have the translational degrees of freedom in order to
apply force to an external containment vessel.

3.2 PART B
In order to calculate the energy and pressure in this section, we need to first write down our
partition function for the system:

∞ n ³ N´ o
Ω(N ,V, E (n)) exp − β~ω n +
X
Z= ,
n=0 2

which is the Laplace Transform of our multiplicity of states.

∞ n ³ N ´o
Ω(N ,V, E (n)) exp − β~ω n +
X
Z= ,
n=0 2
n NoX ∞ n o
= exp − β~ω Ω(N ,V, E (n)) exp − β~ωn
2 n=0
à !
n NoX ∞ n +N −1
= exp − β~ω xn ,
2 n=0 n
n o
where x := exp −β~ω < 1. The summation in the equation above can be evaluated explicitly
as:

à !
∞ n +N −1 1
xn =
X
.
n=0 n (1 − x)N

Then, our partition function becomes:

15
n o
exp − β~ω N2
Z=µ
n o¶N
1 − exp − β~ω
n o
exp − β~ω N2

n o¶N
1 − exp − β~ω

µ exp − β~ω
n o
¶N
2
= µ n o¶
1 − exp − β~ω
µ ¶N
1
= ¡ β~ω ¢
2 sinh 2

From this, we can calculate the ensemble average of the energy via:

∂ ln Z
〈E 〉 = −
∂β
∂ h ¡ ¡ β~ω ¢¢i
= − N ln 1 − ln 2 − ln sinh
∂β 2
¡ β ~ω ¢
~ω cosh 2
=N
2 sinh β~ω
¡ ¢
2
~ω exp β~ω + 1
¡ ¢
=N
2 exp β~ω − 1
¡ ¢

2 + exp β~ω − 1
¡ ¢
= N ~ω ¡
2 exp β~ω − 1
¡ ¢ ¢
µ ¶
1 1
= N ~ω + ,
exp β~ω − 1 2
¡ ¢

which corroborates exactly the energy we found in part 3.)a.) since β = 1/kT . As for the
pressure, we know that in terms of the partition function, the average ensemble pressure can
be calculated:

1 ∂ ln Z
µ ¶
〈P 〉 = = 0.
β ∂V N ,β

This vanishes as well, because the partition function is independent of volume. This corre-
sponds to our result in part 3.)a.) since no physics has changed here- the oscillators are still
localized.

16
3.3 PART C
We again need to calculate the partition function, but this time allowing particle number to
vary as well.

∞ X

Ω(N ,V, E (n)) exp − βE (n) − βµN
X ¡ ¢
Z=
N =0 n=0
à !
∞ ∞ n +N −1
exp − βµN exp − βE (n)
X ¡ ¢X ¡ ¢
=
N =0 n=0 n
∞ µ ¶N
1
exp − βµN
X ¡ ¢
= ¡ β~ω ¢ ,
N =0 2 sinh 2

where the last line follows from our result for the partition function in part 3.)b.). We can
manipulate this further as:

exp − βµ N
¡ ¢¶

X
µ
Z= ¡ β~ω ¢ ,
N =0 2 sinh
¡ 2 ¢ ¶¸−1
exp − βµ
· µ
= 1− ¡ β ~ω ¢ .
2 sinh 2

We have performed the above sum above as a geometric series under the assumption that the
summand is convergent. We now calculate the energy expectation value.

∂ ln Z
〈E 〉 = −
∂β
¡ β ~ω ¢ ¡ β ~ω ¢
exp(−βµ) 2 sinh 2 µ + ~ω cosh 2
=− ¡ β ~ω ¢ ¡ β ~ω ¢ .
2 sinh 2 − exp(−βµ) 2 sinh 2

We can calculate 〈N 〉 and use it to replace the first fractional factor the above expression:

∂ ln Z
〈N 〉 = −kT
∂µ
exp(−βµ)
=− ¡ β ~ω ¢ .
2 sinh 2 − exp(−βµ)

At which our energy becomes:

µ½ ¶ ¾
1 1
〈E 〉 = 〈N 〉 ~ω + +µ ,
exp β~ω − 1 2
¡ ¢

where now we have acquired an additional term signifying the dependence of the average
energy on the energy required to move an average of 〈N 〉 particles into the system.

17
4 F LUCTUATIONS OF THERMODYNAMIC QUANTITIES (600 PTS )
4.1 PART A
By assumption, E and N are set at fixed values in the microcanonical ensemble. Moreover,
since there are no dependencies of any thermodynamic quantities on volume, pressure is
also fixed at zero. As such, all fluctuations are null.

¡ ¢2
〈 E − 〈E 〉 〉 = 0
¡ ¢2
〈 N − 〈N 〉 〉 = 0
¡ ¢2
〈 P − 〈P 〉 〉 = 0.

4.2 PART B
By the same arguments above, number and pressure fluctuations will be zero for the canoni-
cal ensemble:

¡ ¢2
〈 N − 〈N 〉 〉 = 0
¡ ¢2
〈 P − 〈P 〉 〉 = 0.

However, energy is now unfixed.

¢2 ∂〈E 〉
〈 E − 〈E 〉 〉 = kT 2
¡
∂T
exp β~ω
¡ ¢
¡ ¢2
= N ~ω ³ ´2 .
exp β~ω − 1
¡ ¢

Note that for extremely small temperatures, fluctuations in energy decay exponentially to
zero while for extremely large temperature, fluctuations become violently large, which is in-
tuitively correct.

4.3 PART C

¢2 ∂〈E 〉 ∂〈E 〉
〈 E − 〈E 〉 〉 = kT 2 + kT µ
¡
∂T ∂µ
∂〈E 〉 ∂〈E 〉
µ ¶
1
= −β +µ .
β ∂β ∂µ
After about three pages of mathematics, one finds:

¡ β~ω ¢ µ ¡ β~ω ¢
〈N 〉~ω cosh 2 ~ω cosh 2 〈N 〉(~ω)2

¢2
¡ β ~ω ¢ + µ + £
¡
〈 E − 〈E 〉 〉 = ¡ β ~ω ¢ ¡ β~ω ¢¤2 + 〈N 〉µ
2 sinh 2 − exp(−βµ) 2 sinh 2 2 sinh 2

18
In order to check if this expression is correct, we take the limit µ → 0 while at the same time
enforcing that ∂µ 〈N 〉 = ∂β 〈N 〉 = 0. This allows us to compare the result to that of the canonical
ensemble energy fluctuations, which we find to be identical:

¡ ¢2 ¯¯ 〈N 〉(~ω)2
lim 〈 E − 〈E 〉 〉¯ =£ ¡ β~ω ¢¤2
µ→0 ∂µ 〈N 〉=∂β 〈N 〉=0
2 sinh 2
exp β~ω
¡ ¢
¢2
= N ~ω ³
¡
´2 .
exp β~ω − 1
¡ ¢

The fluctuation in pressure will again be zero by the same localization arguments as before:

¡ ¢2
〈 P − 〈P 〉 〉 = 0.

5 C LASSICAL C OMPUTATION OF R ELEVANT QUANTITIES


The classical Hamiltonian for a system of N distinguishable harmonic oscillators is:

N p i2
½ ¾
1
+ mω2 q i2 .
X
H ({q i , p i }) =
i =1 2m 2
With this we can calculate the cumulative multiplicity of states using the normalized phase
space volume. Note that this normalization of the phase space volume reintroduces Planck’s
constant- a normalization required by the fundamental limit on the resolution of what a “vol-
ume” can mean in phase space:

1
Z
Φ(N ,V, E ) = d N qd N p.
hN H ({q i ,p i })≤E

In order to perform this integration, make the change of variables x i := mωq i such that the
Hamiltonian becomes:

1 X N ½ ¾
2 2
H ({x i , p i }) = p + xi ,
2m i =1 i
which for fixed energy H ({x i , p i }) =
pE is the equation for the boundary of a 2N dimensional
sphere in phase space with radius 2mE . The phase space volume integral is then:

µ ¶N Z
1 1
Φ(N ,V, E ) = d N xd N p
hN mω H ({x i ,p i })≤E
¶N
πN
µ
1 1
= (2mE )N
hN mω Γ(N + 1)
¶N
πN
µ
1 1
= (2mE )N .
hN mω N!

19
We then calculate the entropy as:

S = k ln Φ(N ,V, E )
E
½ µ ¶ ¾
= kN ln − ln N + 1

E
½ µ ¶ ¾
= kN ln +1 ,
N ~ω

where we have used Stirling’s approximation on ln(N !). Note again that we have not divided
by an overall factor of N ! because our particles are again distinguishable. In what follows, the
use of classical particles does not effect the basic assumptions regarding the three ensembles.
That is, the microcanonical ensemble has energy, volume and number fixed, the canonical
ensemble has only variable energy, but fixed temperature, while the grand canonical ensem-
ble allows both energy and particle number to fluctuate.
One expression for the total energy of the system can be gotten as:

∂S
µ ¶
1
=
T ∂E V,N
Nk
=
E
=⇒ E = N kT.

Note that we can expand the energy we found earlier for the quantum case for large temper-
atures, which gives the classical expression plus the quantum zero-point energy.

N ~ω
EQuant um =
˜ + N kT
2
Pressure is again zero, since the entropy is independent of volume.
The canonical partition function for this system is:

1
Z
Z= d N qd N pe −βH ,
hN
where the Hamiltonian is given by the first equation in this section. The exponential can be
factorized in each coordinate and momenta and thus the integrals separable. Since each of
the N Gaussian integrals over the momenta and N Gaussian integrals over the coordinates
give the same result, we can re-write and solve the above as:

20
µ 2 ¶¾¶N
p
µ ½
1 1
Z
2 2
Z= d qd p exp − β + mω q
h 2m 2
µ s s
2mπ N

1 2π
=
h βmω2 β
¶N
kT
µ
= .

In the above, we have used for the evaluation of Gaussian integrals:

π
Z r
−αx 2
d xe = .
α

We can now easily calculate the average energy for the canonical ensemble, which unsurpris-
ingly is:

∂ ln Z
〈E 〉 = −
∂β
= N kT.

Energy fluctuations are:

¢2 ∂〈E 〉
〈 E − 〈E 〉 〉 = kT 2
¡
∂T
= N (kT )2 .

Again, pressure and its fluctuations are zero.


For the grand canonical ensemble, the partition function can be written in terms of the
single particle canonical partition function as:

∞ µ ¶N
Z1C e −βµ
X
ZGC = .
N =0

This is our old friend the geometric series.

1
ZGC = .
1 − Z1C e −βµ

With average number calculated as:

21
∂ ln Z
〈N 〉 = −kT
∂µ
Z1C
= ,
e βµ − Z1C

the average energy takes the form:

∂ ln Z
〈E 〉 = −
∂β
= 〈N 〉(kT + µ),

as would be expected. The fluctuations for the grand canonical ensemble are then (after
another few pages of math):

¢2 ∂〈E 〉 ∂〈E 〉
〈 E − 〈E 〉 〉 = kT 2 + kT µ
¡
∂T ∂µ
∂〈E 〉 ∂〈E 〉
µ ¶
1
= −β +µ
β ∂β ∂µ
βµ
e
µ ¶µ ¶
〈N 〉 1
= +1 +µ .
β e βµ − Z1C β

Again, if we take the limit µ → 0 and suppress the first term in the expression above (which
arises from the fluctuations in 〈N 〉), then we recover the expression for the fluctuations in the
canonical ensemble. Pressure and its fluctuation are zero here as well.

R EFERENCES
[1] Herbert B. Callen. Thermodynamics. John Wiley & Sons, Inc., New York, N.Y., 1960.

22
Question 1&2
For the 1-D harmonic oscillator, the energy is
1
=E hw( N + R ) (1)
2
1
=
R ( E − Nhw) / hw (2)
2
Where R=0,1,2...for the quantum system
For N DISTINGUISHABLE oscillator, the number of microstates,

( R + N − 1)!
Ω ( N ,V , E ) = (3)
R !( N − 1)!
Combine equation (2) and (3), we have
1
[( E − Nhw) / hw + N − 1)]!
Ω ( N ,V , E ) = 2 (4)
1
( E − Nhw)!( N − 1)!
2
For the cumulative number of microstates, we have
φ ( N ,V , E=) ∑ Ω( N ,V , E ')
E≤E '
(5)

For the density of the microstates, we have


∂φ ( N ,V , E )
Ω( E ) = (6)
∂E
Here, we set hw=0.5, N=4 for the first part and N=100 for the second part. The graph of the

number of microstates Ω( N ,V , E ) , the cumulative number of microstates φ ( N ,V , E )

and the density of the microstates Ω( E ) VS E can be plotted by MATLAB.

Figure 1, The number of microstates(red) the cumulative number of microstates (blue) the
density of the microstates (green) VS E when N=4
Figure 2, The number of microstates(red) the cumulative number of microstates (blue) the
density of the microstates (green) VS E when N=100

The entropy can be calculated by both using the number of microstates or the density of the
microstates

Figure 3, The entropy using the number of microstates(red) and using the density of the
microstates (blue) VS E when N=4
Figure 4, The entropy using the number of microstates (red) and using the density of the
microstates (blue) VS E when N=100

From figure 3 and figure 4, we can see that they are not equivalent since the number of
microstates and the density of the microstates should be two different concepts.

Since all those harmonic oscillators are distinguishable, so there is no N! term. The N! term will
appear on the denominator when the oscillators are indistinguishable.

You might also like