1
CE 530 Molecular Simulation
Lecture 6
Statistical Mechanics
David A. Kofke
Department of Chemical Engineering
SUNY Buffalo
[email protected]
2
Statistical Mechanics
¡ Theoretical basis for derivation of macroscopic behaviors from
microscopic origins
¡ Two fundamental postulates of equilibrium statistical mechanics
• microstates of equal energy are equally likely
• time average is equivalent to ensemble average
¡ Formalism extends postulates to more useful situations
• thermal, mechanical, and/or chemical equilibrium with reservoirs
systems at constant T, P, and/or m
• yields new formulas for probabilities of microstates
derivation invokes thermodynamic limit of very large system
¡ Macroscopic observables given as a weighted sum over
microstates
• dynamic properties require additional formalism
3
Ensembles
¡ Definition of an ensemble
• Collection of microstates subject to at least one extensive constraint
“microstate” is specification of all atom positions and momenta
fixed total energy, total volume, and/or total number of molecules
unconstrained extensive quantities are represented by full range of possible values
• Probability distribution π describing the likelihood of observing each
state, or the weight that each state has in ensemble average
¡ Example: Some members of ensemble of fixed N
• isothermal-isobaric (TPN)
all energies and volumes represented
Low-probability state
4
Commonly Encountered Ensembles
Name All states of: Probability distribution Schematic
Microcanonical given EVN π i = Ω1
(EVN)
Canonical all energies π ( Ei ) = Q1 e − β Ei
(TVN)
Isothermal-isobaric all energies and π ( Ei ,Vi ) = Δ1 e − β ( Ei + PVi )
(TPN) volumes
Grand-canonical all energies and π ( Ei , Ni ) = Ξ1 e− β ( Ei + µ Ni )
(TVµ) molecule numbers
Note: β ≡ 1/ kT
5
Partition Functions
¡ The normalization constants of the probability distributions are
physically significant
• known as the partition function
• relates to a corresponding free energy, or thermodynamic potential,
via a bridge equation
Ensemble Thermodynamic Partition Function Bridge Equation
Potential
Microcanonical Entropy, S Ω = ∑1 S / k = ln Ω( E ,V , N )
Canonical Helmholtz, A Q = ∑ e− β Ei − β A = ln Q(T ,V , N )
Isothermal-isobaric Gibbs, G Δ = ∑ e− β ( Ei + PVi ) − β G = ln Δ(T , P, N )
Grand-canonical Hill, L = –PV Ξ = ∑e
− β ( Ei − µ N i ) β PV = ln Ξ(T ,V , µ )
6
Ensemble and Time Averaging
¡ Configuration given by all positions and momenta
• “phase space” (p N
,r N ) ∈Γ rN shorthand for “positions of all N atoms”
¡ Configuration variable A(rN,pN)
¡ Ensemble average
• Weighted sum over all members of ensemble
• In general A = ∑ Aiπ i
• For example, canonical ensemble, classical mechanics:
N
N N −β E( p ,r N )
∫ ∫
N N
A = Q1 1 dp dr A( p , r )e
h3 N N !
¡ Time average
• Sum over all states encountered in dynamical trajectory of system
Should average
t over initial
1
t →∞ t
N
(
A = lim ∫ A p (t ), r (t ); p (0), r (0) dt ′ conditions
N N N
)
0
Given by equations of motion
7
Ergodicity
¡ If a time average does not give complete representation of
full ensemble, system is non-ergodic
• Truly nonergodic: no way there from here
• Practically nonergodic: very hard to find route from here to there
Phase space
¡ Term applies to any algorithm that purports to generate a
representative set of configurations from the ensemble
¡ Click here for an applet describing ergodicity.
8
Separation of the Energy
¡ Total energy is sum of kinetic and potential parts
• E(pN,rN) = K(pN) + U(rN)
¡ Kinetic energy is quadratic in momenta
• K ( p N ) = ∑ i pi2 / 2mi
¡ Kinetic contribution can be treated analytically in partition
function Q = 1 dp N e− β ∑ pi2 / 2m dr N e− βU (r N )
h3 N N ! ∫ ∫
N − βU (r N ) thermal de Broglie wavelength
= 1
Λ3 N
1
N! ∫ dr e Λ= h
1 2π mkT
= ZN
Λ3 N configuration integral
¡ And it drops out of position averages
N
N − βU (r
∫
1 1 N )
A = ZN N !
dr A( r )e
9
Simple Averages 1. Energy
¡ Average energy
− β E ( p N ,r N )
∫ dp ∫ dr
1 1 N N N N
E = Q h N!
3 N
E ( p , r )e
¡ Note thermodynamic connection
∂ ln Q ∂ ( A / kT )
E =− = = Einternal
∂β ∂ (1/ kT )
definition of Q; calculus bridge equation Gibbs-Helmholtz equation
¡ Average kinetic energy
pi2 − β ∑ pi2 / 2 m
∫ dp ∑
1 N
K = 2m
e
h3 N
= 3 NkT Equipartition of energy: kT/2 for each degree of freedom
2
¡ Average potential energy
− βU (r N )
∫ dr
1 1 N N
U = ZN N !
U ( r )e
10
Simple Averages 2. Temperature
¡ Need to measure temperature in microcanonical ensemble
(NVE) simulations
¡ Define instantaneous kinetic temperature
1
T=
3Nk
∑ pi2 / m More generally, divide by number of molecular
degrees of freedom instead of 3N
¡ Thermodynamic temperature is then given as ensemble
average
T= T
¡ Relies on equipartition as developed in canonical ensemble
¡ A better formulation has been developed recently
11
Simple Averages 3a. Pressure
¡ From thermodynamics and bridge equation
⎛ ∂A ⎞ ∂ ⎡1 N − βU ( r N ) ⎤
P = −⎜ ⎟
⎝ ∂V ⎠T , N
= kT ln
∂V ⎣ ⎢ N ! ∫ dr e
⎥⎦
¡ Volume appears in limits of integration
• Scale coordinates to move volume dependence into the potential
r ∈(0, L)
sk ≡ rk / L U (r1x ,r1y ,…,rNz ) = U ( Ls1x , Ls1y ,…, LsNz ) = U ((Vs) N )
s ∈(0,1)
V = L3
∂ ⎡V N
ln N ! ∫ ds N e − βU ((Vs ) ) ⎤
N
P = kT L 1
∂V ⎢⎣ ⎥⎦
• L-derivative of U is related to force
∂
∂L
( ) ∂( s L) ∂U
U ( sL) N = ∑ k
∂L ∂( sk L)
1
= − ∑ rk f k
L
¡ Result
NkT 1 ! !
P=
V
+
3V
∑ rij ⋅ f ij
pairs i,j
12
Simple Averages 3b. Hard-Sphere Pressure
¡ Force is zero except at collision
¡ Time integration of virial over instant of collision is finite
• contribution over instant of collision
! ! ! !
r12 ⋅ f12 dt = r12 ⋅ Δp
2m1m2 ! !
= v ⋅r
m1 + m2 12 12
¡ Pressure is sum over collisions
NkT 1 1 ! !
P=
V
+ ∑ m v ⋅r
3V tsim collisions R 12 12
13
Simple Averages 4. Heat Capacity
¡ Example of a “2nd derivative” property
2 ⎛ ∂ ( β A) ⎞
2
⎛ ∂E ⎞
Cv = ⎜ ⎟ = −k β ⎜ 2 ⎟
⎝ ∂T ⎠V , N ⎝ ∂ β ⎠V , N
∂ 1 −β E
∂β Q( β ) ∫
= −k β 2 dr N
dp N
Ee
¡ Expressible in terms of fluctuations of the energy
2⎡ 2 2⎤ Note: difference between two O(N2)
Cv = k β E − E
⎣ ⎦ quantities to give a quantity of O(N)
¡ Other 2nd-derivative or “fluctuation” properties
• isothermal compressibility 1 ∂V
κ T = − ⎛⎜ ⎞⎟
V ⎝ ∂P ⎠T , N
14
(Not) Simple Averages 5. Free Energy
¡ Free energy given as partition-function integral
e− β A = Q
N N −β E
= 1
h3 N N ! ∫ dr e
dp
¡ Impossible to evaluate
• Even numerically!
• Click here for an applet demonstrating the difficulty
¡ Free energy involves properties of entire ensemble
• No value associated with a single member of ensemble
• For example, the size of (number of members in) the ensemble
¡ The trick is to settle for computing free-energy differences
¡ Return to this topic later in course
15
Fluctuations
¡ How complete is the mean as a statistic of ensemble behavior?
• Are there many members of the ensemble that have properties that
deviate substantially from the mean?
• Look at the standard deviation σ p(E)
2 1/ 2 1/ 2
σE = (E − E ) = ⎡ E2 − E ⎤
⎣
2
⎦
• This relates to the heat capacity
σ E = kT (CV / k )1/ 2 σE
• Relative to mean is the important measure E
σE
=
kT (CV / k ) 1/ 2
=
1/ 2
Ο( N )
= Ο( N −1/ 2 )
<E>
E E Ο( N )
¡ Fluctuations vanish in thermodynamic limit Nè∞
¡ Similar measures apply in other ensembles
• volume fluctuations in NPT; molecule-number fluctuations in µVT
¡ Click here for an applet illustrating fluctuations