Professional Documents
Culture Documents
( 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?
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).
Part A
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
( 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
S = kln(Ω(E)) (9)
described as:
∂φ
Ω(E) = (7)
∂E
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
Part C
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
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
FIG. 10. Methods of state counting for N = 100. Part B - Canonical Ensemble
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 ∂µ
∞
" #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
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).
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
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
1−N
ζ(1 − N ) − HE
Ω(E) = − (51)
Γ(N )
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
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.
PROBLEM #2
Part A
Part C
Part D
PROBLEM #3
See Part D of the quantum systems.
Part A - Microcanonical Ensemble
1 ∂S Nk
= = (53)
T ∂Etot N Etot
Etot = N kT (54)
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
(∆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.
∞ ∞
X 1 N −βµN X 1 N
ZGC = e = xN = (62) (∆E)2 = (70)
h̄βω 1−x β2
N =0 N =0
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)
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]
ϕ(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
Gamma1 + EE + 2 + (- 2 - 2 EE + NNNN) HarmonicNumber1 + EE - +
2 2
NNNN
(2 + 2 EE - NNNN) HarmonicNumberEE +
2
NNNN
2 Gamma2 + EE - Gamma[1 + NNNN]
2
Ω(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
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}]
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
Ω(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}]
Ω(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
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
b)
NN
-β ℏ ω
ⅇ 2
Z[β_ ] = ;
1 - ⅇ-β ℏ ω NN
Eavg = - D[Z[β], β] / Z[β] // Simplify
1 + ⅇβ ω ℏ NN ω ℏ
2 - 1 + ⅇβ ω ℏ
c)
1
ZGC[β_, μ_] = ω
;
-β ℏ +μ
ⅇ
1-
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
Problem #4
a)
For the microcanonical ensemble, Z = Ω(E)
2
(ΔE)2 = E 2 - E = - ∂E
∂β
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 DEavgGC /. β → , T + k T μ DEavgGC /. β → , μ
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
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
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
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}]
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
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
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
IntegrateExp- β + m ω2 x2 , {x, - ∞, ∞}, GenerateConditions → False,
2m 2
{p, - ∞, ∞}, GenerateConditions → False // FullSimplify
2π
β
m
m β ω2
Part C
1 NN
Zc = Sum ⅇβ μ NN , {NN, 0, ∞} // FullSimplify
ℏβω
βωℏ
- ⅇβ μ + β ω ℏ
-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
ⅇβ μ � μ - � ℏ ���� � �β ℏ ���� � �β ℏ
- � + � ⅇβ μ ���� � �β ℏ
���������������������������������
���������������������������
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
����������������������������������������������
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
In[68]:= Ñ = 1; H*eVK*L
m = 1; H*kg*L
k = 1; H*Spring constant*L
Ω = Sqrt@m kD; H*1s*L
H*We are assuming an Einstien solid so all of the frequencies are the same *L
kb = 1; H*Boltmans constant*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-N2*ÑΩ
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-N2*ÑΩ
Ntot =
ÑΩ
And substituting into the multiplicity gives
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.
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.
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.
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
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.
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)
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.
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 ÑΩ
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
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.
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.
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.
N! is not in our calculations because we have distinguishable particles (Same argument as above) (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?
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
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
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
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ÑΩ
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[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
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[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
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
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.
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
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.
1.0 ´ 1034
8.0 ´ 1033
Out[111]=
6.0 ´ 1033
4.0 ´ 1033
2.0 ´ 1033
Energy
20 40 60 80 100
1.5 ´ 1034
1.0 ´ 1034
Out[113]=
5.0 ´ 1033
Energy
20 40 60 80 100
1.5 ´ 1034
Out[115]=
1.0 ´ 1034
5.0 ´ 1033
Energy
20 40 60 80 100
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.
N! is not in our calculations because we have distinguishable particles (same as for 4 classical oscillators). (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?
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
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.
WHN,V,EL F
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.
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}
ÑΩ
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+12L ÑΩ
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-HN2L ΒÑΩ 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+12L ÑΩ
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-HN2L ΒÑΩ 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-HN2L ΒÑΩ I1 - e- ΒÑΩ M )
-HN2L ΒÑΩ - ΒÑΩ -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
¥ 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
Then we get
ÑΩe ΒΩÑ2 I1+e ΒΩÑ M
E= ΒÑΩ
2 Ie -1M Ie Μ+ΒΩÑ -e ΒΩÑ2 -e Μ M
Then we get
ÑΩe ΒΩÑ2 I1+e ΒΩÑ M
E=
2 Ie ΒÑΩ -1M Ie Μ+ΒΩÑ -e ΒΩÑ2 -e Μ M
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=
1N
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Π 12 2 Πm 12
= 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Π 12 2 Πm 12
= 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
¥ 1
S xN =
N=0 1-x
Given x<1
Then
1
Z= e ΜΒ
1-
ÑΒΩ
Then we get
e ΒΜ H ΒΜ-1L
E=
ΒIe ΒΜ -ÑΩΒM
Pressure
For the grand canonical ensemble we have that
kT
P HZ, V, TL = lnHZL
V
P=0
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
Ñ Ω e2 2 ΒÑΩ
e-ΒΩÑ
1 2 ÑΩΒ2 e ΒΜ
= - Ñ2 Ω2 J + N
Ie ΒΩÑ -1M
2
1-e-ΒΩÑ 2 Ie ΒΜ -ÑΩΒM
2
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
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
-N ÑΩ
HDEL2 = -
Β2 I1-ÑΩΒe-ΒΜ M
2
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*);
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)
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!
☺
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.
In[208]:= ListPlotTranspose @Tablen1, 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
6000 ☺
☺
Out[210]= 4000
☺
☺
☺
2000
☺
☺
☺
☺
☺ ☺ ☺ ☺
☺ ☺ ☺ ☺ ☺ 10 15 20
E
In[211]:= ListPlotTranspose @Tablen1, 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
In[213]:= ShowPlotΩE[4, x], x, Emin, 20, PlotLabel → "Ω(E) vs E", AxesLabel → {"E", "Ω(E)"},
ImageSize → Large, PlotStyle → RGBColor[0.25, 0, 0.75], Thick,
ListPlotTranspose @Tablen1, 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
In[214]:= ListPlotTranspose @Tablen1, 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)
☺
☺ ☺ ☺
☺
☺
☺ ☺ ☺
☺
6 ☺
☺
☺
☺
☺
☺
☺
☺
☺
☺
☺
☺ Ω(E,N
Out[215]= 4
☺
☺
☺ Ω(E)
☺
☺
☺
☺
☺
2
☺
☺
☺
☺ 10 15 20
Energy (E)
In[216]:= ShowListPlot
Transpose @Tablen1, n1, Emin, 20, Tablekb 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 @Tablen1, n1, Emin, 20, Tablekb 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)
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.
with spring constant k and mass m. What happens to the different ways of
calculating number of states?
The
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
In[222]:= ListPlotTranspose @Tablen1, 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
1.5 × 1036
☺
1.0 × 1036
5.0 × 1035
☺
☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺ ☺☺
☺☺
☺☺☺☺☺☺ 90 E
60 70 80 100
Φ(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
In[225]:= ListPlotTranspose @Tablen1, 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
2.0 × 1036
1.5 × 1036
Out[227]=
1.0 × 1036
☺
5.0 × 1035
☺
☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺☺
60 70 80
☺☺90 100
E
In[228]:= ListPlot
Transpose @Tablen1, 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)
80
60
Ω(E,N
Out[229]=
Ω(E)
40
20
Energy (E)
60 70 80 90 100
In[230]:= ShowListPlotTranspose @
Tablen1, n1, Emin, 100, Tablekb 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)"},
ListPlotTranspose @Tablen1, n1, Emin, 100,
Tablekb 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
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
In[247]:= Import"/home/marie/Documents/statMech/prob3_1.jpg"
Out[247]=
Out[248]=
Out[249]=
Out[250]=
Out[251]=
Out[252]=
and P in
Out[253]=
In[254]:= Import"/home/marie/Documents/statMech/prob4_2.jpg"
Out[254]=
Midterm Exam
Eric Jones
October 02, 2016
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),
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
ω
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
ω
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:
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:
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 ∆=
˜ ~ω.
10000
5000
0
0 10 20 30 40 50
E =n
ω
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)! ~ω
,
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
ω
8
2.1 PART A
1e39
3
Ω(N =100,V,n)
0
0 10 20 30 40 50
E =n
ω
9
1e39
Quantum
4 Classical
3
Ω(N =100,V,n)
0
0 10 20 30 40 50
E =n
ω
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
ω
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
ω
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:
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
∂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
½µ ¶ ¾
1 1
E (N , T ) = ~ωN ³ ´ + .
~ω 2
exp kT −1
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
∞ 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
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(−βµ)
µ½ ¶ ¾
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.
¢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.
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.
¢2 ∂〈E 〉
〈 E − 〈E 〉 〉 = kT 2
¡
∂T
= N (kT )2 .
∞ µ ¶N
Z1C e −βµ
X
ZGC = .
N =0
1
ZGC = .
1 − Z1C e −βµ
21
∂ ln Z
〈N 〉 = −kT
∂µ
Z1C
= ,
e βµ − Z1C
∂ 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)
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.