Professional Documents
Culture Documents
S. Kakorin
冉 冊
ln共n!兲 = n +
1
2
1
ln共n兲 − n + ln共2兲 +
2
1
−
1
12n 360n3
contain routines for the Lambert W-function and recent ar-
ticles discuss problems that can be solved analytically using
this function.6 The solution of the Boltzmann variational
+ ¯ 共Stirling series兲. 共2兲 problem using the exact function ln共n!兲 leads to a compli-
cated transcendental equation, which must be solved numeri-
The Stirling formula gives a much better approximation to cally. In any case, it is worthwhile to obtain a more exact and
ln共n!兲 because it includes all the leading terms in Eq. 共2兲:3 physically tractable solution of the Boltzmann variational
冉 冊
problem.
1
ln共n!兲 ⬇ n + ln共n兲 − n
2
1
+ ln共2兲 共Stirling formula兲. 共3兲
2 II. REVISED BOLTZMANN DISTRIBUTION
The reciprocal terms 1 / 共12n兲 − 1 / 共360n3兲 + ¯. in Eq. 共2兲 are A. Formulation of the variational problem
not essential if n ⬎ 2 共see Fig. 1兲. Generally, the occupation
number ni of the highest energy states i is very small if i We consider an isolated system of N indistinguishable
→ ⬁. However, the range of applicability of Eq. 共1兲 is limited non-interacting particles with total constant energy E.2 Each
to very large values of ni, where the condition ln共ni兲 / 2 particle may exist in any of the energy states 0 ⬍ 1 ⬍ ¯
Ⰶ ni ln共ni兲 − ni is satisfied. If ni is small, say ni = 1 or 2, Eq. ⬍ m, where m is the total number of states. The population
共1兲 yields negative values 共see Fig. 1兲. Therefore, the expo- is characterized by the set of numbers n0 , n1 , . . . , nm of the
nential Boltzmann distribution is limited strictly to ni Ⰷ 1 and particles in the energy states 0 , 1 , . . . , m, respectively. The
applies only for i not too large. However, the distribution is probability of finding ni distinguishable particles in each of
used in the literature even for i → ⬁ and ni → 0, where Eq. the m states is given by pni i, where pi is the probability of the
共1兲 does not apply. It is interesting that Stirling’s approxima- occupation of energy state i. The total probability of a con-
tion, Eq. 共1兲, fails and the more accurate Stirling formula, figuration 共n0 , 0兲 , 共n1 , 1兲 , . . . , 共nm , m兲 is given by the prod-
Eq. 共3兲, is required to derive the Gaussian distribution from nm
uct pn00 pn11 ¯ pm . For indistinguishable particles the statistical
the binomial distribution.5 weight of the same configuration is given by1
48 Am. J. Phys. 77 共1兲, January 2009 http://aapt.org/ajp © 2009 American Association of Physics Teachers 48
冉 冊 冉 冊
F
n0 n*
0
=
F
n1 n*
1
= ¯ 冉 冊
F
nm n*
m
= 0. 共10兲
冏 冏 冏 冏
F
ni n*
i
=
P
ni n*
i
− ␣ − i = 0 for i = 0,1, . . . ,m.
共11兲
The derivative P / ni in Eq. 共11兲 contains the derivative
d共1 / ni!兲 / dni. In this form, d共1 / ni!兲 / dni cannot be used to
Fig. 1. Comparison of Stirling’s approximation, Eq. 共1兲 共䊐兲, and the Stirling solve Eq. 共11兲 analytically. The usual approach is to replace
formula, Eq. 共3兲 共〫兲, with the exact function ln共n!兲 共⫻兲 up to n = 5. the function P in Eq. 共11兲 by ln共P兲. Because P ⬎ 0 and ln共P兲
is a monotonic function of P, both ln共P兲 and P have extre-
mum for the same ni*. Hence the function
w共n0,n1, . . . ,nm兲 =
N!
n0!n1! ¯ nm!
. 共4兲 ⌽共n0,n1, . . . ,nm兲 = ln共P共n0,n1, . . . ,nm兲兲 + ␣ N − 兺 ni 冉 m
i=0
冊
The total probability of the
共n0 , 0兲 , 共n1 , 1兲 , . . . , 共nm , m兲 takes the form
configuration
nm
冉 m
+  E − 兺 n i i
i=0
冊 共12兲
冉 冊
principle of equal a priori probabilities p0 = p1 = ¯ = pm = p, m
ln共P兲
in Eq. 共5兲 reduces to the ln共N!pN兲 − 兺 ln共n j!兲 = −
nm
so that the product pn00 pn11 ¯ pm = ln共ni!兲.
constant p n0+n1+¯+nm N
= p , where ni ni j=0 ni
m
共13兲
N = 兺 ni . 共6兲
i=0 We use Eq. 共13兲 and obtain the condition for an extremum of
⌽ in Eq. 共12兲 in the form
The most probable configuration, corresponding to the maxi-
mum of the probability in Eq. 共5兲, is calculated given the
− ln兩共ni!兲兩n* − ␣ − i = 0. 共14兲
constraint of the fixed total number of particles, Eq. 共6兲, and ni i
the total energy:
It remains to solve Eq. 共14兲.
m
E = 兺 n i i . 共7兲
i=0 III. APPLICATION OF STIRLING’S
Because of the two constraints, two of the m variables in APPROXIMATIONS
Eq. 共5兲 are dependent. One way to find the extremum is the A. Crude Stirling’s approximation
Lagrange method of undetermined multipliers using two
multipliers, ␣ and , in the form7 If we apply Stirling’s approximation, Eq. 共1兲, or the
冉 冊
m
Stirling formula, Eq. 共3兲, to Eq. 共14兲, we find
F共n0,n1, . . . ,nm兲 = P共n0,n1, . . . ,nm兲 + ␣ N − 兺 ni
− ln共ni*兲 − − ␣ − i = 0, 共15兲
i=0 2ni*
冉 m
+  E − 兺 n i i .
i=0
冊 共8兲 where = 0 or 1 represents the solution for Eq. 共1兲 or Eq. 共3兲,
respectively. If = 0, the solution of Eq. 共15兲 yields the ex-
ponential Boltzmann distribution:7
At this stage of the analysis all the ni are free variables, so
that N ⫽ 兺i=0
m
ni and E ⫽ 兺i=0
m
nii. The values ni* of an extre- ni* = exp共− ␣ − i兲, 共16兲
mum of F can be calculated from the equation where  = 1 / 共kT兲, k is Boltzmann’s constant, and T is the
dF = 冏 兺 冉 冊冏
m
i=0
F
ni n*
i
= 0, 共9兲
thermodynamic temperature. The ratio Pi = ni* / N is the usual
exponential Boltzmann probability. The partition function is
given by
i=m
where F / ni is the partial derivative of F with respect to ni
provided that all other variables n j with j ⫽ i are kept con- Z = 兺 exp共− i兲. 共17兲
i=0
stant. Because all F / ni ⱕ 0, the only way to satisfy Eq. 共9兲
is to require that The Lagrange multiplier ␣ can be written as
冉 冊
* =
ni,W , 共19兲 The exact derivative of ln共n!兲 is given by the Digamma-
1
2W − exp共␣W + i兲 function 0: d ln共n!兲 / dn = 0共n + 1兲, where the argument n in
2
0 can be any real number. Equation 共15兲 acquires the form
where the subscript W refers to the values calculated with the
− 0共ni* + 1兲 − ␣ − i = 0, 共28兲
function W共x兲. Because the second derivative of ⌽ is nega-
tive, where the subscript refers to the values calculated with the
冏 冏
⌽
2
n2i n*
1
=− * +
1
* 兲2 ⬍ 0,
ni,W 2共ni,W
共20兲
Digamma-function. The solution of Eq. 共28兲 is obtained in
terms of the inverse Digamma-function, −1 0 :
i,W ni,* = −1
0 共− ␣ − i兲 − 1. 共29兲
* is a maximum, and the ratio P = n* / N
the solution ni,W i,W i,W W
In contrast to W−0 , −1
0 is not included in the generally avail-
is the Lambert-Boltzmann probability, where N = 兺m n* . W i=0 i,W able software packages and must be calculated numerically.
In analogy to Eq. 共17兲 we calculate the Lambert W-partition The Digamma-partition function Z which is analogous to
function ZW in the form Eq. 共21兲 has the form
冉 冊
m * 共 兲
ni,W 1 N
ZW = 兺 *
i
= − 2NWW − exp共␣W兲 . 共21兲 Z = . 共30兲
i=0 ni=0,W共0 = 0兲 2 −1
0 共− ␣ 兲 − 1
The solution of Eq. 共21兲 for the Lagrange multiplier ␣W The correct range of the argument ␣ of −1 0 is found by
yields the form requiring that ni,* be non-negative. For ni,* ⱖ 0 Eq. 共28兲 sug-
␣W = − ln 冉 冊 NW
ZW
−
ZW
2NW
. 共22兲
gests that −␣ − i ⱖ 0共1兲 = −␥, where ␥ = 0.577. . . is the
Euler-Mascheroni constant. Because i ⱖ 0, we find that ␣
is related to the maximum value m by
In contrast to Eq. 共18兲 the value of ␣W is limited to a certain 0 ⱕ m = 共␥ − ␣兲/ . 共31兲
range as is discussed in Sec. III C.
The constraint in Eq. 共31兲 is similar to Eq. 共25兲 of the
Lambert-Boltzmann distribution, except for the constant ␥,
C. Range of ␣W which replaces ln共2 / e兲 ⬇ −0.307. The exact value of the
For the real and positive numbers ni,W * the range of the maximum energy m is larger by the quantity of 共␥
argument x = −exp共␣W + i兲 / 2 of W共x兲 in Eq. 共19兲 is limited − ln共2 / e兲兲 /  ⬇ 0.884kT than the approximate value Wm
to 0 ⱖ x ⱖ −1 / e. In the range 0 ⱖ x ⱖ −1 / e, W共x兲 is the given in Eq. 共25兲. For large energies, m , Wm Ⰷ kT, the dif-
W−0 -branch of the Lambert W-function, −1 ⱕ W−0 ⱕ 0.6 There- ference m − Wm is not important.
fore the function W in Eqs. 共19兲 and 共21兲 has to be replaced If we apply Eq. 共31兲 to Eq. 共30兲, we can express the exact
by W−0 . The range of validity of x imposes a constraint on the Digamma-partition function Z as
parameters ␣W and i: N
Z = . 共32兲
0 ⱕ exp共␣W + i兲 ⱕ 2/e. 共23兲 0 共  m −
−1
␥兲 − 1
Equation 共23兲 implies that ␣W is related to the value Wm of As in Eq. 共27兲 the exact partition function Z in Eq. 共32兲 can
the highest energy state by be expressed in closed form in terms of the N and m. Note
that the usual partition sum Z in Eq. 共17兲 is independent of N.
␣W = ln共2/e兲 − Wm . 共24兲
For a given ␣W Eq. 共23兲 requires that IV. RESULTS AND DISCUSSION
0 ⱕ 0 ⬍ ¯ ⬍ i ⬍ ¯ ⱕ Wm = 共ln共2/e兲 − ␣W兲/ . A. Exponential Boltzmann versus the Lambert-
共25兲 and the exact Boltzmann distribution
Equation 共25兲 suggests that the Lambert-Boltzmann distribu- As an example, we consider a system with n0* = 600 par-
tion, Eq. 共19兲, applies only up to the maximum energy Wm ticles in the ground state with 0 = 0. Equation 共15兲 with
共inclusive of the Wm-value兲. If we substitute Eq. 共22兲 into = 0 yields ␣ = −ln共n0*兲 = −6.397; Eq. 共15兲 with = 1 and the
Eq. 共25兲, we can calculate Wm explicitly, exact 0-Boltzmann equation, Eq. 共28兲, yield ␣W = −ln共n0*兲
Wm =
1

冋冉 冊 册
ln
2NW
eZW
+
ZW
2NW
, 共26兲
− 1 / 共2n0*兲 = ␣ = −0共n0* + 1兲 = −6.398. If we use Eqs. 共25兲 and
共31兲, we find Wm = ln共2 / e兲 − ␣W = 6.091 and m = ␥ − ␣
= 6.975, respectively. Within the range of applicability, the
or Lambert-Boltzmann distribution in Eq. 共19兲 and the exact
冊 冉
are for n*0 = n0,W 0, 0
T = 300 K. 共b兲 The same as in 共a兲 in the range 5 ⱕ  ⱕ 7, where the discrep- ⌬共m + 1/2兲
冉 冊
* * * *
ancies between n*, nW, and n are most pronounced; nW and n were calcu- i=m 1 − exp −
i kT
Z共m兲 = 兺
冉 冊 冉 冊
lated using Mathematica.
exp − = .
i=0 kT ⌬ ⌬
exp − exp −
2kT 2kT
Digamma-Boltzmann distribution in Eq. 共29兲 are close to the 共33兲
exponential Boltzmann distribution in Eq. 共16兲 关see Fig.
2共a兲兴. However, Eq. 共16兲 applies up to m → ⬁, whereas The maximum energy of the harmonic oscillator is not
Eqs. 共19兲 and 共29兲 apply up to Wm ⬇ 6 and m ⬇ 7, re- bounded from above and therefore the number of levels can
spectively 关see Fig. 2共b兲兴. For example, for a system of equi- be infinite, m → ⬁. However, for an isolated system of N
distant energy states, i = ⌬i, where i = 0 , 1 , . . . , m and ⌬ oscillators of total energy E there is a constraint on the en-
= kT, T = 300 K, the Lambert and the exact Digamma- ergies: 0 ⬍ 0 ⬍ ¯ ⬍ i ⬍ ¯ ⬍ m ⱕ E. In equilibrium and
Table I. Comparison of the key parameters of the three forms of the Boltzmann distribution for a system with
* = n* = 600 particles in the ground state with the zero energy = 0 and equidistant energy states:
n*0 = n0,W 0, 0 i
= ⌬i, where i = 0 , 1 , . . . , m and ⌬ = kT , T = 300 K; W−0 is the negative branch of the Lambert W-function, 0 is
the Digamma-function, ␥ ⬇ 0.577 is the Euler-Mascheroni constant, ln共2 / e兲 ⬇ −0.307,  = 1 / kT, k is the Boltz-
mann constant, and N is the total number of particles.
Z = N exp共␣兲 = 1.582
Eq. 共17兲
ZW = − 2NWW−0 −冉 冊 e ␣W
2
= 1.576 Z =
−1
0 共−
N
␣ 兲 − 1
= 1.576
Eq. 共21兲 Eq. 共30兲
CV = 3kNT2 冉 2 ln共Z共T兲兲
T2
冊 V,N
. 共34兲
冉
␣ = 0 N
exp共⌬/共2kT兲兲 − exp共− ⌬/共2kT兲兲
1 − exp共␣ − ␥兲
+ 1 . 共35兲 冊
Then we apply ␣共T兲 to Z in Eq. 共30兲 and calculate CV in
Eq. 共34兲 numerically. For silver the Einstein temperature is
E = 168 K, and hence ⌬ = Ek = 2.32⫻ 10−21 J. Calculations
with Eqs. 共31兲 and 共35兲 show that the maximum energy m
increases with increasing T and N 关see Figs. 3共c兲 and 3共d兲兴.
For example, at T = 293 K and N = 100, Eq. 共31兲 yields: m
= 4.7 kT 共0.19⫻ 10−19 J兲 and m = m / ⌬ − 1 / 2 = 8. For T
= 293 K and N = 6.022⫻ 1023 we obtain m = 55kT and m
= 95. Because of the constraints on m and m, CV / 共3Nk兲 is
Fig. 3. The partition function Z, the maximum energy ratio m / ⌬ of the
highest populated state 共here ⌬ = 2.3⫻ 10−21 J兲, and the reduced constant-
smaller than the Dulong-Petit limiting value CV / 共3Nk兲 = 1
volume heat capacity CV / 共3Nk兲, calculated with the exact Digamma- even if T Ⰷ E 关see Figs. 3共e兲 and 3共f兲兴. For example, for N
Boltzmann distribution for the Einstein Ag-solid as a function of the tem- = 50 and T = 293 K, Eq. 共34兲 yields CV / 共3Nk兲 = 0.937, which
perature T 共left column兲 and the total number of particles N 共right column兲. is smaller by 3.7% than the value CV / 共3Nk兲 = 0.973 of the
共a兲 The solid lines are the exact Digamma-partition function Z共m兲, Eq.
共32兲, of the oscillator with energy states i = ⌬共i + 1 / 2兲, where i
usual Einstein formula for m → ⬁:7
= 0 , 1 , . . . , m. The points represent the conventional partition sum, Z共m兲, 3N⌬2 exp共⌬/kT兲
truncated at m = m / ⌬ − 1 / 2, Eq. 共33兲, at N = 300 共1兲, N = 50 共2兲, and N CV共m → ⬁兲 = . 共36兲
= 5 共3兲. 共b兲 The solid line represents Z共m兲, Eq. 共32兲; the points refer to kT2共exp共⌬/kT兲 − 1兲2
Z共m兲, Eq. 共33兲, at T = 1200 K 共1兲, T = 300 K 共2兲, and T = 100 K 共3兲. 共c兲 The
solid line is the exact maximum energy ratio m / ⌬ of the oscillator, Eq. At very large values of N, say N = 6.022⫻ 1023, the exact
共31兲; the points represent the approximate values Wm / ⌬, Eq. 共37兲, cor- Digamma-Einstein heat capacity, Eq. 共34兲, approaches Eq.
rected by 共␥ − ln共2 / e兲兲kT at N = 300 共1兲, N = 50 共2兲, and N = 5 共3兲. 共d兲 The 共36兲, for example, at T = 293 K Eqs. 共34兲 and 共36兲 yield the
solid lines are the exact energy ratio m / ⌬, Eq. 共31兲, and the points are the same value CV / 共3Nk兲 = 0.973.
approximate values Wm / ⌬, Eq. 共37兲, corrected by 共␥ − ln共2 / e兲兲kT at T
= 1200 K 共1兲, T = 300 K 共2兲, and T = 100 K 共3兲. 共e兲 The points represent the
exact reduced heat capacity CV / 共3Nk兲 Eq. 共34兲, versus T for N = 300 共1兲,
N = 50 共2兲 共d兲, and N = 5 共3兲. The solid line corresponds to the usual Einstein D. Approximate value of the heat capacity
equation, Eq. 共36兲, for CV / 共3Nk兲 at m → ⬁. 共f兲 The points are the exact
values of CV / 共3Nk兲, Eq. 共34兲, for T = 1200 K 共1兲, T = 300 K 共2兲, and T If we substitute Eq. 共33兲 into Eq. 共26兲 and solve for Wm
= 100 K 共3兲. The lines 共---兲, 共¯兲, and 共—兲 represent the usual Einstein relative to Wm = ⌬共m + 1 / 2兲 for the case ZW / 共2NW兲
equation, Eq. 共36兲, at T = 50, 300, and 1200 K, respectively. Note that the
Einstein values CV / 共3Nk兲 are independent of N. The Dulong-Petit limiting Ⰶ ln共2NW / 共eZW兲兲, we obtain the Lambert W maximum en-
law predicts CV / 共3Nk兲 = 1. ergy Wm in the form
冉 冊
Stirling’s approximation,
Approximations Eq. 共1兲 1 1 Exact function
ln共n!兲 ⬇ n + ln共n兲 − n + ln共2兲
for ln共n!兲 ln共n!兲 ⬇ n ln共n兲 − n 2 2 ln共n!兲
冉 冊
* =
ni,W
population numbers Eq. 共16兲 1 =−1
0 共− ␣ −  i兲 − 1
2W−0 − exp共␣W + i兲 Eq. 共29兲
2
Eq. 共19兲
i→⬁ −i
The partition Z = 兺i=0 e ZW = −2NWW−0 共−exp共−Wm − 1兲兲 N
function Eq. 共17兲 Eq. 共27兲 Z =
−1
0 共  m − ␥ 兲 − 1
Eq. 共32兲