{VERSION 4 0 "IBM INTEL NT" "4.0" }
{USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 
1 0 0 0 0 1 }{CSTYLE "" -1 256 "" 1 16 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }
{CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 
258 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 259 "" 0 1 0 0 
0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 1 0 0 0 0 0 
0 0 0 1 }{CSTYLE "" -1 261 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }
{CSTYLE "" -1 262 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 
263 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 264 "" 0 1 0 0 
0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 1 0 0 0 0 0 
0 0 0 1 }{CSTYLE "" -1 266 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }
{CSTYLE "" -1 267 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 
268 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 269 "" 0 1 0 0 
0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 270 "" 0 1 0 0 0 0 1 0 0 0 0 0 
0 0 0 1 }{CSTYLE "" -1 271 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 }
{CSTYLE "" -1 272 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 
273 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 }{CSTYLE "" -1 274 "" 0 1 0 0 
0 0 0 0 1 0 0 0 0 0 0 1 }{CSTYLE "" -1 275 "" 0 1 0 0 0 0 1 0 0 0 0 0 
0 0 0 1 }{CSTYLE "" -1 276 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }
{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 
0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }}
{SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT 256 23 "Entropy and Temperature" 
}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 227 "This w
orksheet contains calculations that illustrate the statistical mechani
cs definition of entropy. Two coupled Einstein solids are considered f
ollowing the explanations by Thomas A Moore and Daniel V Schroeder (Am
. J. Phys. " }{TEXT 257 2 "65" }{TEXT -1 13 ", 26 (1997))." }}{PARA 0 
"" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 741 "In macroscopic t
hermodynamics entropy is defined as the quantity that increases by Q/T
 when a thermodynamic system receives the energy amount Q by heating w
hile at temperature T. This is not intuitive, and the additional expla
nations about entropy measuring order in the system are also ad-hoc. T
his definition of entropy is referred to as the Clausius definition. B
oltzmann is the originator of the statistical mechanics definition. In
 the Einstein solid the thermodynamic system is simplified by consider
ing a given number of oscillators at fixed locations. Each atom has th
ree degrees of freedom, and the oscillators can take up energy in quan
tized units. The quantum zero-point energy of the oscillators is irrel
evant for the discussion." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "
" 0 "" {TEXT -1 520 "The connection between the macroscopic and micros
copic descriptions is as follows. Macroscopically the system is descri
bed by a a few variables (For a tank of an atomic gas: Number of atoms
, Volume of the gas, and total internal energy U; other variables such
 as pressure and temperature follow from the ideal gas law). Microscop
ically there can be many states that are consistent with this macrosta
te. The number of consistent microstates is called the multiplicity. D
ifferent macrostates have different multiplicities." }}{PARA 0 "" 0 "
" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 435 "If a system is isolate
d in a given macrostate it is equally likely to be in any of the consi
stent microstates - they have all equal probability [fundamental assum
ption of stat mech]. The probability equals the inverse multiplicity f
or that macrostate. This assumption leads to the second law of thermod
ynamics, namely that macroscopic objects exhibit irreversible behaviou
r. To prove this point we consider two coupled Einstein solids." }}
{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 93 "First we \+
calculate the multiplicity for an Einstein solid (for a derivation see
: H B Callen, " }{TEXT 258 54 "Thermodynamics and an Introduction to T
hermostatistics" }{TEXT -1 10 ", p. 334)." }}{PARA 0 "" 0 "" {TEXT -1 
0 "" }}{PARA 0 "" 0 "" {TEXT -1 20 "We have a system of " }{TEXT 262 
1 "N" }{TEXT -1 53 " one-dimensional oscillators (the number of atoms \+
is " }{TEXT 263 1 "N" }{TEXT -1 45 "/3), each oscillator can be in a s
tate where " }{TEXT 264 1 "n" }{TEXT -1 29 " units of energy are store
d, " }{TEXT 259 1 "n" }{TEXT -1 50 "=0,1,2,...; the total energy of th
e system equals " }{TEXT 265 1 "q" }{TEXT -1 18 " units of energy (" }
{TEXT 266 1 "q" }{TEXT -1 53 " is also a non-negative integer). The un
it of energy " }{TEXT 260 1 "E" }{TEXT -1 4 " = h" }{TEXT 261 2 " f" }
{TEXT -1 116 " , where f is he natural frequency of the oscillator and
 h is Planck's constant. The multiplicity for a system with " }{TEXT 
268 1 "N" }{TEXT -1 42 " degrees of freedom and a total number of " }
{TEXT 267 1 "q" }{TEXT -1 85 " units of energy can be shown to be (at \+
least try to verify this by counting for low " }{TEXT 270 1 "N" }
{TEXT -1 2 ", " }{TEXT 269 1 "q" }{TEXT -1 2 "):" }}}{EXCHG {PARA 0 ">
 " 0 "" {MPLTEXT 1 0 21 "restart; with(plots):" }}}{EXCHG {PARA 0 "> \+
" 0 "" {MPLTEXT 1 0 32 "Omega:=(N,q)->binomial(q+N-1,q);" }}}{EXCHG 
{PARA 0 "" 0 "" {TEXT -1 140 "A system of 3 oscillators with 3 units o
f energy shared can be in a state (300), (210), (111), (012), (030), .
.. a total of 10 combinations." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 
1 0 11 "Omega(3,3);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 830 "The two c
oupled Einstein solids represent an interacting system; we label the t
wo by A and B. We can consider a macrostate where the total energy U i
s split between A and B as U = U_A + U_B. The reason for being able to
 specify U_A and U_B lies in the fact that the coupling between the tw
o solids is weak: while within the solids the systems are fluctuating \+
between the microstates consistent with the macrostates (e.g., U_A, N_
A), the transfer of energy between A and B happens on a longer timesca
le and it is possible to know U_A and U_B. One calculates the multipli
cities for A and B, and takes the product of these to find the multipl
icity for the coupled system. This is true since the two solids are in
dependent of each other, and any microstate in A can combine with any \+
microstate in B (for given macrostates in A and B)." }}{PARA 0 "" 0 "
" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 257 "What we need now is a \+
counting scheme: for given N_A, N_B and total number of excitation qua
nta q_t, we wish to find out how many microstates there are for a give
n combination where q_A, and q_B units of energy stored in A, B respec
tively (q_A + q_B = q_t)." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 
19 "N_A:=300; N_B:=200;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "q
_t:=20;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 114 "We work with lists in
 Maple (lists are ordered sets), and define ourselves a function to ad
d an element to a list:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "
ladd:=(L,e)->[op(L),e];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "
ladd([1,2,3],4);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "O_A:=[]
: O_B:=[]: O_t:=[]: " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "for q_A fro
m 0 to q_t do:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "q_B:=q_t-q_A;" }}
{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "o_A:=Omega(N_A,q_A);" }}{PARA 0 "> \+
" 0 "" {MPLTEXT 1 0 20 "o_B:=Omega(N_B,q_B);" }}{PARA 0 "> " 0 "" 
{MPLTEXT 1 0 13 "o_t:=o_A*o_B;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 "O
_A:=ladd(O_A,o_A); O_B:=ladd(O_B,o_B); O_t:=ladd(O_t,o_t);" }}{PARA 0 
"> " 0 "" {MPLTEXT 1 0 3 "od:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 115 
"The lists can be printed. If q is large, however, the lists are very \+
long, and we have commented out the statement." }}}{EXCHG {PARA 0 "> \+
" 0 "" {MPLTEXT 1 0 5 "#O_A;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 
0 5 "#O_B;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "#O_t;" }}}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "listplot(O_t);" }}}{EXCHG 
{PARA 0 "" 0 "" {TEXT -1 141 "We want to look at the width of the dist
ribution. We can write a procedure to generate the mean, and the devia
tion of the data from the mean." }}{PARA 0 "" 0 "" {TEXT -1 108 "In th
e calculation of the average we subtract by one since the first value \+
of the list corresponds to q_A=0." }}}{EXCHG {PARA 0 "> " 0 "" 
{MPLTEXT 1 0 33 "MSD:=proc(L) local n,i,av,dev,wt;" }}{PARA 0 "> " 0 "
" {MPLTEXT 1 0 33 "n:=nops(L); wt:=add(L[i],i=1..n):" }}{PARA 0 "> " 
0 "" {MPLTEXT 1 0 28 "av:=add((i)*L[i],i=1..n)/wt:" }}{PARA 0 "> " 0 "
" {MPLTEXT 1 0 47 "dev:=evalf(sqrt(add((i-av)^2*L[i],i=1..n)/wt));" }}
{PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "print(`average: `,av-1,` deviation:
 `,dev);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 
"> " 0 "" {MPLTEXT 1 0 9 "MSD(O_t);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 
-1 237 "We calculated the expectation value of the distance squared fr
om the average value and took the square root to obtain a distance. Th
e expectation values for the average are normalized by dividing the su
ms by the sum over all data points." }}{PARA 0 "" 0 "" {TEXT -1 17 "N_
A=300, N_B=200:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" 
{TEXT -1 52 "We see from repeated calculations with increased q: " }}
{PARA 0 "" 0 "" {TEXT -1 18 "q=100: 60, dev 5.4" }}{PARA 0 "" 0 "" 
{TEXT -1 19 "q=200: 120, dev 8.2" }}{PARA 0 "" 0 "" {TEXT -1 20 "q=300
: 180, dev 10.7" }}{PARA 0 "" 0 "" {TEXT -1 20 "q=400: 240, dev 13.1" 
}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 20 "q=800: \+
480, dev 22.3" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" 
{TEXT -1 294 "For fixed number of degrees of freedom we have increased
 the amount of energy deposited. The combination of energy quanta dist
ributed between A and B follows some order: q_A = 6/10 * q_t is the lo
cation with the largest multiplicity for the choice of N_A vs N_B. How
 does the width grow with q?" }}{PARA 0 "" 0 "" {TEXT -1 74 "This has \+
to be considered carefully. The number of states increases like q" }}
{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 18 " For 20/3
0 we get " }}{PARA 0 "" 0 "" {TEXT -1 20 "q=800: 480. dev 56.6" }}
{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 
0 13 "v1:=56.6/480;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "v2:=
111.5/960;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "v2/v1;" }}}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "evalf(1/sqrt(2));" }}}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "v3:=166.3/1440;" }}}{EXCHG 
{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "v3/v1;" }}}{EXCHG {PARA 0 "> " 0 "" 
{MPLTEXT 1 0 17 "evalf(1/sqrt(3));" }}}{EXCHG {PARA 0 "> " 0 "" 
{MPLTEXT 1 0 13 "v4:=13.1/240;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 
1 0 6 "v4/v1;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "evalf(1/sq
rt(4));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "v8:=22.3/480;" }
}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "v8/v1;" }}}{EXCHG {PARA 0 "
> " 0 "" {MPLTEXT 1 0 17 "evalf(1/sqrt(8));" }}}{EXCHG {PARA 0 "" 0 "
" {TEXT -1 162 "The relative width is not decreasing as 1/sqrt(q), but
 we are also not in the limit of large q, yet. If N was larger than q,
 the rel. width would go as 1/sqrt(N)." }}{PARA 0 "" 0 "" {TEXT -1 0 "
" }}{PARA 0 "" 0 "" {TEXT -1 694 "For many degrees of freedom (N appro
aching 10^24, and implying also a large number of energy units deposit
ed) the distribution becomes very narrowly peaked. Thus, there is an a
lmost uniquely defined macrostate with a very high multiplicity compar
ed to the others. The second law of thermodynamics (that states that e
ntropy increases) can be cast into the form that the system evolves al
ways towards the macrostate with the largest multiplicity. It happens \+
since in the course of fluctuations the system is bound to evolve into
 the state with the largest probability. Given that all microstates ar
e assumed to be equally probable, it must evolve towards the macrostat
e with largest multiplicity." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}
{EXCHG {PARA 0 "" 0 "" {TEXT -1 305 "Entropy is defined now as the log
arithm of the multiplicity. This ensures the additivity of entropies i
n weakly coupled systems (since their combined multiplicity was given \+
as a product of the individual ones). In addition, the entropy definit
ion contains Boltzmann's constant as a proportionality factor." }}
{PARA 0 "" 0 "" {TEXT -1 15 "S = k ln(Omega)" }}{PARA 0 "" 0 "" {TEXT 
-1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 116 "For plotting purposes we chose
 k=1 (a unit system). We can calculate the entropies for the subsystem
s and the total." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "P1:=lis
tplot(map(log,O_A),color=red):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 
1 0 38 "P2:=listplot(map(log,O_B),color=blue):" }}}{EXCHG {PARA 0 "> \+
" 0 "" {MPLTEXT 1 0 39 "P3:=listplot(map(log,O_t),color=green):" }}}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "display(P1,P2,P3);" }}}
{EXCHG {PARA 0 "" 0 "" {TEXT -1 112 "The graph shows that at equilibri
um (which happens at q_A=60) the total entropy is stationary and has a
 maximum." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 
208 "We understand now that the evolution of the macrosystem can be de
scribed as consistent with the 2nd law of thermodynamics in the form t
hat the isolated system evolves towards a state with the largest entro
py." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 99 "No
te that the total entropy S_t is fairly flat in the vicinity of the ma
ximum as a function of q_A." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}
{EXCHG {PARA 0 "" 0 "" {TEXT 271 30 "How can we define temperature?" }
}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 206 "One can
 adopt a definition based on energy flow and thermal equilibrium: two \+
objects in thermal contact are at the same temperature if they are in \+
thermal equilibrium, in which case there is no spontaneous " }{TEXT 
272 3 "net" }{TEXT -1 532 " flow between them. If there is a spontaneo
us net flow from A to B, then A loses energy and is at a higher temper
ature, and B gains energy and is at a lower temperature. Now to relate
 temperature to entropy we have to find in the above figure at the equ
ilibrium point two quantitites that become equal. These are the slopes
 of the curves for S_A(q_A) and S_B(q_A), which are equal in magnitude
 and opposite in sign. S_B(q_B) has the same slope as S_A(q_A), i.e., \+
the sign is also equal. Thus, temperature has to be related to dS/dq.
" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 163 "On d
imensional grounds (given the choice of constant k in the definition o
f S) it is the inverse temperature that equals the rate of change of e
ntropy with energy." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "
" {TEXT -1 824 "The above figure is used by Moore and Schroeder to jus
tify this. Assume that you are on the right of the equilibrium point q
_A=60 units, i.e., solid A has more energy than what it would have at \+
equilibrium. In this region the curve for S_A (red) has a positive slo
pe that is levelling off. The (blue) curve has a negative slope that i
s increasing in magnitude. What does this mean? If a small amount of e
nergy (e.g. one unit dq=1) were to pass from A to B in this region (a \+
movement to the left in the graph, or a move towards equilibrium), the
 increase in S_B would be bigger than the decrease in S_A. The total e
ntropy would increase (green curve). The second law of TD tells us tha
t this process will happen spontaneously (there are many more microsta
tes in this region, i.e., a fluctuation will find this regime easily).
" }}{PARA 0 "" 0 "" {TEXT -1 253 "The steeper the slope in the entropy
 versus energy curve the more the system wants to obey the second law \+
and increase its energy (B), while the a shallower entropy-energy curv
e for the other system (A) means that it doesn't mind to give up some \+
energy." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 
374 "To summarize: to the right of the equilibrium point A has more en
ergy than at equilibrium and energy flows from A to B to reach equilib
rium. A thus has a higher temperature than B there. Its entropy-energy
 curve has a smaller slope, while the slope for |S_B(q_A)|  is larger.
 Thus, the inverse of the temperature is proportional to the rate of c
hange of entropy with energy:" }}{PARA 0 "" 0 "" {TEXT -1 11 "1/T = dS
/dU" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 171 "W
hen the volume of the system is allowed to change (as is true for gase
s) one has to take partial derivatives, and one cannot simply rearrang
e the above eq. into dS=dU/T !" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}
{PARA 0 "" 0 "" {TEXT -1 256 "For the Einstein solid we can use the ab
ove equation to calculate the temperature as T = dU/dS by using neighb
ouring values in the entropy as the energy is changed by one unit up a
nd down. A central difference formula is used, the spacing in U equals
 dq=2." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 81 
"We take a single solid with 50 degrees of freedom and vary q between \+
zero and 100" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "N:=50;" }}}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "
" {MPLTEXT 1 0 7 "O1:=[]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 
23 "for q from 0 to 100 do:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "o1:=
Omega(N,q);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "O1:=ladd(O1,o1);" }}
{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "od:" }}}{EXCHG {PARA 0 "> " 0 "" 
{MPLTEXT 1 0 27 "S1:=map(evalf,map(log,O1)):" }}}{EXCHG {PARA 0 "> " 
0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 37 "Now we c
an calculate the temperature:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 
0 7 "T1:=[]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "for q from \+
2 to 99 do:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "t1:=2/(S1[q+1]-S1[q-
1]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "T1:=ladd(T1,t1); od:" }}}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "listplot(T1);" }}}{EXCHG 
{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "S1[13];" }}}{EXCHG {PARA 0 "> " 0 "
" {MPLTEXT 1 0 7 "T1[13];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 90 "We a
re out by one step when comparing the entropy and temperature lists! (
cf fig. 5 in MS)" }}{PARA 0 "" 0 "" {TEXT -1 164 "The graph shows how \+
the temperature increases with the energy amount stored in the solid. \+
Traditionally one measures the heat capacity as a function of temperat
ure." }}{PARA 0 "" 0 "" {TEXT -1 216 "The heat capacity is the rate of
 change of the amount of energy with temperature. We can calculate it \+
also by differencing. One normalizes it usually by the number of oscil
lators (to take out the size of the system)." }}}{EXCHG {PARA 0 "> " 
0 "" {MPLTEXT 1 0 7 "C1:=[]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 
0 22 "for q from 2 to 97 do:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "c1:
=2/(T1[q+1]-T1[q-1])/N;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "C1:=ladd
(C1,c1); od:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 100 "The simple listp
lot graphs the specific heat capacity (at fixed volume) as a function \+
of energy (q)." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "listplot(
C1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 19 "To plot C(T) we do:" }}}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 "plot([[T1[j],C1[j+1]] $j=1..
95],view=[0..3,0..1]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 260 "Note t
hat dimensionful constants such as k, and the energy quantum E have be
en set to unity. The temperature unit is actually E/k. The heat capaci
ty is constant above E/k=1, and drops to zero below. At high temperatu
res the specific heat capacity approaches k." }}{PARA 0 "" 0 "" {TEXT 
-1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 75 "Can we investigate the low-temp
erature behaviour? We need many oscillators." }}}{EXCHG {PARA 0 "> " 
0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "N:
=1000000; q_m:=200;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "O1:=[
]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "for q from 0 to q_m d
o:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "o1:=Omega(N,q);" }}{PARA 0 ">
 " 0 "" {MPLTEXT 1 0 16 "O1:=ladd(O1,o1);" }}{PARA 0 "> " 0 "" 
{MPLTEXT 1 0 3 "od:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "S1:=
map(evalf,map(log,O1)):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 37 "Now we
 can calculate the temperature:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 
1 0 7 "T1:=[]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "for q fro
m 2 to q_m-1 do:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "t1:=2/(S1[q+1]-
S1[q-1]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "T1:=ladd(T1,t1); od:" 
}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "listplot(T1);" }}}{EXCHG 
{PARA 0 "" 0 "" {TEXT -1 41 "We have clearly reached low temperatures.
" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "C1:=[]:" }}}{EXCHG 
{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "for q from 2 to q_m-3 do:" }}{PARA 
0 "> " 0 "" {MPLTEXT 1 0 26 "c1:=2/(T1[q+1]-T1[q-1])/N;" }}{PARA 0 "> \+
" 0 "" {MPLTEXT 1 0 20 "C1:=ladd(C1,c1); od:" }}}{EXCHG {PARA 0 "" 0 "
" {TEXT -1 100 "The simple listplot graphs the specific heat capacity \+
(at fixed volume) as a function of energy (q)." }}}{EXCHG {PARA 0 "> \+
" 0 "" {MPLTEXT 1 0 13 "listplot(C1);" }}}{EXCHG {PARA 0 "" 0 "" 
{TEXT -1 19 "To plot C(T) we do:" }}}{EXCHG {PARA 0 "> " 0 "" 
{MPLTEXT 1 0 58 "plot([[T1[j],C1[j+1]] $j=1..q_m-5],view=[0..0.2,0..0.
02]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 95 "The curve for the specif
ic heat C(T) turns around at low T to appraoch zero with a small slope
!" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 
274 26 "The Boltzmann distribution" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}
{PARA 0 "" 0 "" {TEXT -1 374 "An important quantity in statistical mec
hanics is the Boltzmann factor: for a system at a given temperature it
 provides the probability to find the system in a microstate of energy
 E. The system is at temperature T while in thermal contact with a hea
t bath (a large system). This relative probability is given by exp(-E/
kT), and is derived in texts on statistical mechanics." }}{PARA 0 "" 
0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 302 "The results from th
e previous section can be used to demonstrate this behaviour. We can c
onsider a coupled system of a N=1000 oscillator Einstein solid coupled
 to a single oscillator. We vary the temperature by changing the amoun
t of energy units shared between the single oscillator and the heat ba
th." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "restart; with(plots)
:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "Omega:=(N,q)->binomial(q+N-1,q
); ladd:=(L,e)->[op(L),e];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 73 "The
 'solid' A is the single oscillator, while B represents the heat bath.
" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "N_A:=1; N_B:=1000;" }}}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "q_t:=100;" }}}{EXCHG {PARA 0 
"> " 0 "" {MPLTEXT 1 0 26 "O_A:=[]: O_B:=[]: O_t:=[]:" }}}{EXCHG 
{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "for q_A from 0 to q_t do:" }}{PARA 
0 "> " 0 "" {MPLTEXT 1 0 13 "q_B:=q_t-q_A;" }}{PARA 0 "> " 0 "" 
{MPLTEXT 1 0 20 "o_A:=Omega(N_A,q_A);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 
0 20 "o_B:=Omega(N_B,q_B);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "o_t:=
o_A*o_B;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 "O_A:=ladd(O_A,o_A); O_B
:=ladd(O_B,o_B); O_t:=ladd(O_t,o_t);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 
0 3 "od:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "O_t:=map(evalf@
log,O_t):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 64 "P1:=listplot(O
_t,view=[0..30,250..340],color=blue): display(P1);" }}}{EXCHG {PARA 0 
"" 0 "" {TEXT -1 491 "The plot is shifted by one unit on the horizonta
l axis, i.e., the point at (1,335) corresponds to q_A=0. The graph sho
ws the logarithm of the probability for the microstate (its multiplici
ty) as a function of the number of units of energy. The function falls
 off exponentially which implies a linear fall-off of the logarithm. T
hus, we have demonstrated the Boltzmann factor variation with E. [At t
he high end of the curve near q_A=q_t one can see a deviation due to t
he finite number q_t]. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 
0 "" {TEXT -1 307 "Next we observe the change with temperature. We est
imate the temparature of the heat bath at the centre of the graph show
n above (it varies a little due to the finiteness of the calculation, \+
i.e., the removal of 1-30 units of energy out of a bath of 1000 oscill
ators that share 100 units is not negligible)." }}}{EXCHG {PARA 0 "> \+
" 0 "" {MPLTEXT 1 0 27 "Temp1:=1/(O_t[14]-O_t[15]);" }}}{EXCHG {PARA 
0 "" 0 "" {TEXT -1 44 "Now we quadruple the number of energy units:" }
}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "q_t:=400;" }}}{EXCHG {PARA 
0 "> " 0 "" {MPLTEXT 1 0 26 "O_A:=[]: O_B:=[]: O_t:=[]:" }}}{EXCHG 
{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "for q_A from 0 to q_t do:" }}{PARA 
0 "> " 0 "" {MPLTEXT 1 0 13 "q_B:=q_t-q_A;" }}{PARA 0 "> " 0 "" 
{MPLTEXT 1 0 20 "o_A:=Omega(N_A,q_A);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 
0 20 "o_B:=Omega(N_B,q_B);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "o_t:=
o_A*o_B;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 "O_A:=ladd(O_A,o_A); O_B
:=ladd(O_B,o_B); O_t:=ladd(O_t,o_t);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 
0 3 "od:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "O_t:=map(evalf@
log,O_t):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "P2:=listplot(O
_t,view=[0..30,790..840],color=green): display(P2);" }}}{EXCHG {PARA 
0 "" 0 "" {TEXT -1 31 "Let us compare the two slopes: " }}{PARA 0 "" 
0 "" {TEXT -1 57 "In case 1 (q_t=100) :  70 units vertical vs 30 horiz
ontal" }}{PARA 0 "" 0 "" {TEXT -1 57 "In case 2 (q_t=400) :  35 units \+
vertical vs 30 horizontal" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "
" 0 "" {TEXT -1 279 "We quadrupled the number of energy units in the h
eat bath made up of 1000 oscillators and the slope in the log(Omega) p
lot halved. If Omega is proportional to exp(-E/kT) as claimed we need \+
to show that the temperature increases like the square root of the num
ber of energy units." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 
0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 
0 27 "Temp2:=1/(O_t[14]-O_t[15]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 
275 "The temperature of the heat bath is approximately twice of what i
t was in the first case. Thus, we have demonstrated that the probabili
ty distribution as calculated from the multiplicity associated with th
e heat bath follows the dependence given by the Boltzmann factor exp(-
" }{TEXT 275 1 "E" }{TEXT -1 2 "/k" }{TEXT 276 1 "T" }{TEXT -1 2 ")." 
}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 273 
43 "Thermal behaviour of a two-state paramagnet" }}{PARA 0 "" 0 "" 
{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 539 "Moore and Schroeder disc
uss this problem as a an example that leads to further implications of
 the theoretical definition of temperature given above. In conventiona
l thermodynamics temperature is the measure of the amount of kinetic m
otion (linear motion of atoms in a gas, vibrational motion of diatomic
 or other molecules, vibrations of stationary atoms in the Einstein so
lid, etc.). In the case of a magnet the degrees of freedom are contain
ed in the spin orientation of individual atoms with respect to an exte
rnally defined direction." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "
" 0 "" {TEXT -1 484 "The energy of an atom with an outer electron with
 unpaired spin in an outer magnetic field depends on the orientation o
f the electron spin, which gives rise to a magnetic moment (if the ele
ctron is in an s state,or in a state with zero magnetic quantum number
 there is no contribution from orbital angular momentum to the magneti
c moment). The magnetic moment vector is opposite to the spin vector d
ue to the negative charge of the electron (see e.g., Wolfson and Pasac
hoff, p. 1098)." }}{PARA 0 "" 0 "" {TEXT -1 962 "The energy of a magne
tic dipole in an external field is given as U = - mu . B , and therefo
re the state with a magnetic dipole oriented in the same direction as \+
the external field has a lower energy than the state that has a counte
raligned magnetic dipole moment. The magnetic dipole moment is defined
 such that the torque produced by the magnetic field on it acts to ali
gn the dipole with the magnetic field vector. (The evidence for this i
s obtained from tracing the magnetic field of a big solenoid or bar ma
gnet by placing a compass at various locations: near the North and Sou
th poles it is evident how the compass needle (its dipole) aligns with
 the field; at the sides of the 'big' magnet it apparently counteralig
ns: this is a result of the inhomogeneity of the field: the field line
s outside the bar magnet run in the opposite direction to form closed \+
loops - this causes two permanent magnets side-by-side to snap togethe
r in a counteraligned fashion)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}
{PARA 0 "" 0 "" {TEXT -1 309 "For our problem this complication does n
ot exist. The external field is homogeneous. The total potential energ
y of a system of N dipoles depends on how many are aligned (pointing u
p) N_u and how many are counteraligned (pointing down) N_d, with N_u +
 N_d = N . If we chose units such that mu=1 and B=1 we have" }}{PARA 
0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 66 "The energies of
 the individual up and down states for the dipoles:" }}{PARA 0 "" 0 "
" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 24 "E_u = -mu B, E_d = mu B
." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 59 "U = \+
N_u E_u + N_d E_d = mu B (N_d - N_u) = mu B (N - 2 N_u)" }}{PARA 0 "" 
0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 45 "The magnetization of
 the ensemble is given as" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "
" 0 "" {TEXT -1 30 "M = mu (N_u - N_d) = - U / B ." }}{PARA 0 "" 0 "" 
{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 147 "These relations imply th
at the macrostate is specified by the total number N, the total energy
 U, or equivalently by specifying N and N_u (or N_d)." }}{PARA 0 "" 0 
"" {TEXT -1 107 "The multiplicity of such a macrostate is given by the
 number of possibilities to chose N_u out of N states." }}{PARA 0 "" 
0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "
> " 0 "" {MPLTEXT 1 0 45 "restart; with(plots): ladd:=(L,e)->[op(L),e]
;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "Omega:=(N,N_u)->binomial(N,N_u
);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 19 "The number of spins" }}}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "N:=100;" }}}{EXCHG {PARA 0 "
" 0 "" {TEXT -1 264 "The energy range is from -100 to 100 (or -N to N)
 given that the spins can all be aligned up to counteraligned. First w
e calculate the energies, multiplicities and entropy: given that a sin
gle spin can only be aligne or counteraligned the loop runs over the s
pins:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "U1:=-[]: O1:=[]: S
1:=[]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "for N_u from N to
 0 by -1 do:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "u1:=(N-2*N_u);" }}
{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "o1:=Omega(N,N_u);" }}{PARA 0 "> " 
0 "" {MPLTEXT 1 0 12 "s1:=log(o1);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 
50 "U1:=ladd(U1,u1); O1:=ladd(O1,o1); S1:=ladd(S1,s1);" }}{PARA 0 "> \+
" 0 "" {MPLTEXT 1 0 3 "od:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 
3 "U1;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "plot([[U1[j],S1[j
]] $j=1..N+1]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 211 "The magnetiza
tion is trivial: it is simply related to the energy, but we are intere
sted in the temperature and the specific heat capacity. The temperatur
e is given as the inverse of the slope of the above graph." }}}{EXCHG 
{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "S1[3];" }}}{EXCHG {PARA 0 "> " 0 "" 
{MPLTEXT 1 0 7 "T1:=[]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "
for q from 2 to N do: dif:=(S1[q+1]-S1[q-1]);" }}{PARA 0 "> " 0 "" 
{MPLTEXT 1 0 51 "if dif<>0 then t1:=evalf((U1[q+1]-U1[q-1])/dif) fi;" 
}}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "T1:=ladd(T1,t1): od:" }}}{EXCHG 
{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "#listplot(T1);" }}}{EXCHG {PARA 0 "
> " 0 "" {MPLTEXT 1 0 7 "T1[10];" }}}{EXCHG {PARA 0 "> " 0 "" 
{MPLTEXT 1 0 112 "j:='j': plot([[T1[j],-U1[j]/N] $j=1..N-2],style=poin
t,view=[-10..10,-1..1],title=`Magnetization per site M(T)`);" }}}
{EXCHG {PARA 0 "" 0 "" {TEXT -1 124 "When all spins are aligned the te
mperature T is at its lowest. At high temperatures the average magneti
zation drops to zero." }}{PARA 0 "" 0 "" {TEXT -1 131 "The definition \+
of temperature allows for two signs, depending on the sign of the chan
ge of rate of the energy U with the entropy S." }}{PARA 0 "" 0 "" 
{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 26 "What is the heat capacity
?" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> \+
" 0 "" {MPLTEXT 1 0 7 "C1:=[]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 
1 0 23 "for q from 2 to N-2 do:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "
c1:=(U1[q+1]-U1[q-1])/(T1[q+1]-T1[q-1])/N;" }}{PARA 0 "> " 0 "" 
{MPLTEXT 1 0 20 "C1:=ladd(C1,c1); od:" }}}{EXCHG {PARA 0 "> " 0 "" 
{MPLTEXT 1 0 110 "j:='j': plot([[T1[j+1],C1[j]] $j=1..N-3],style=point
,view=[0..10,0..0.5],title=`Heat Capacity per site C(T)`);" }}}{EXCHG 
{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "C1[1];" }}}{EXCHG {PARA 0 "> " 0 "" 
{MPLTEXT 1 0 6 "T1[1];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 209 "The di
satvantage of using lists instead of tables: indexing is out of step i
f finite differencing is used (loop starts at two instead of one; thus
 T[2] corresponds to S[1], U[1], C[1] corresponds to T[2], etc." }}
{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 377 "
NOTE: WE HAVE SIMPLY MADE THE QUANTITIES DIMENSIONLESS FOR PLOTTING PU
RPOSES by setting k=1, e=1 (energy quantum), mu=1. To check the dimens
ions one should put the right units back in. Where entropy is shown, i
t is really S/k; where the heat capacity is shown, it is C/k, where th
e temperature is shown, it is kT/e for the Einstein solid, and kT/(mu \+
B) for the paramagnet, etc." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 
0 "" }}}}{MARK "23 0 0" 6 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }
{PAGENUMBERS 0 1 2 33 1 1 }