Introduction To (Statistical) Thermodynamics
Introduction To (Statistical) Thermodynamics
Introduction To (Statistical) Thermodynamics
Thermodynamics
Molecular Simulations
MD
Molecular dynamics: solve
equations of motion
r1
r2
rn
MC
Monte Carlo: importance
sampling r1
r2
rn 2
3
4
Questions
What is the desired distribution?
5
Summary
Thermodynamics
– First law: conservation of energy
– Second law: in a closed system entropy increase
and takes its maximum value at equilibrium
System at constant temperature and volume
– Helmholtz free energy decrease and takes its
minimum value at equilibrium
Equilibrium:
– Equal temperature, pressure, and chemical
potential
6
Entropy
Closed system:
E,V •1st law: total energy remains constant
•2nd law: entropy increases
E = E (S,V ,N i)
M
dE = TdS-pdV + ∑μidN i
i=1
dS ≥0
⎛ ∂E ⎞ 1 ⎛ ∂S ⎞
Temperature T =⎜ ⎟ or =⎜ ⎟
⎝ ∂S ⎠V ,N i T ⎝ ∂E ⎠V ,N i
7
Helmholtz free energy
n
F ≡ E −TS dE = TdS-pdV + ∑μidN i
n i=1
⎛ ∂F ⎞
Pressure: p=- ⎜ ⎟
⎝ ∂V ⎠T ,N i
⎛∂F T ⎞
Energy: E =⎜
⎝ ∂1 T ⎟
⎠ V ,N i
⎛ ∂F ⎞
Chemical potential: μi = ⎜
⎝ ∂N i ⎟
⎠T ,V , N j 8
Statistical Thermodynamics
System of N molecules: r1 K rN , v 1 K v N
9
Outline (2)
Statistical Thermodynamics
– Basic Assumption
• micro-canonical ensemble
• relation to thermodynamics
– Canonical ensemble
• free energy
• thermodynamic properties
– Other ensembles
• constant pressure
• grand-canonical ensemble
10
Statistical Thermodynamics:
the basics
• Nature is quantum-mechanical
• Consequence:
– Systems have discrete quantum states.
– For finite “closed” systems, the number of states is
finite (but usually very large)
• Hypothesis: In a closed system, every state
is equally likely to be observed.
• Consequence: ALL of equilibrium
Statistical Mechanics and
Thermodynamics
11
…, but there are not
Each individual many microstates that
microstate is Basic assumption
give these extreme
equally probable results
If the number of
particles is large (>10)
these functions are
sharply peaked12
Does the basis assumption lead to
something that is consistent with classical
thermodynamics?
E1 E2 = E −E1
Systems 1 and 2 are weakly coupled
such that they can exchange energy.
Ω (E1 , E − E1 )= Ω1 (E1 )× Ω 2 (E − E1 )
15
We have to live with the past, therefore
S = k B ln Ω (E )
With kB= 1.380662 10-23 J/K
In thermodynamics, the absolute (Kelvin)
temperature scale was defined such that
n
⎛ ∂S ⎞ 1 dE = TdS-pdV + ∑μidN i
⎜ ⎟ =
⎝ ∂E ⎠N ,V T i=1
But we found (defined):
⎛ ∂ ln Ω (E )⎞
β ≡⎜ ⎟
⎝ ∂E ⎠N ,V
16
And this gives the “statistical” definition of temperature:
1 ⎛ ∂ ln Ω (E )⎞
≡ kB ⎜ ⎟
T ⎝ ∂E ⎠N ,V
In short:
Entropy and temperature are both related to
the fact that we can COUNT states.
Basic assumption:
1. leads to an equilibrium condition: equal temperatures
2. leads to a maximum of entropy
3. leads to the third law of thermodynamics
17
Number of configurations
How large is ?
•For macroscopic systems, super-astronomically large.
•For instance, for a glass of water at room temperature:
25
2×10
Ω ≈10
•Macroscopic deviations from the second law of
thermodynamics are not forbidden, but they are
extremely unlikely.
18
Canonical ensemble 1/kBT
Consider a small system that can exchange heat with a big reservoir
∂ ln Ω
Ei E −Ei ln Ω (E − Ei )= ln Ω (E )− Ei + L
∂E
Ω (E − Ei ) Ei
ln =−
Ω (E ) k BT
P (Ei )∝ exp (− Ei k BT )
19
Boltzmann distribution
Thermodynamics
Thermo recall (2)
What is the average energy
First law of the system?
of thermodynamics
∑ dE = Tdi SE− pdV(− β Ei )
i exp
E ≡ ∑ E P (E )=
exp (
−β E )
i i
i
∑ energy:
Helmholtz Free j j
F ≡E −TS
∂ ln ∑ exp (−β E ) i
dF = −Sd=T−− pdV i
∂β
⎛∂ F T ⎞ 1 ∂F ∂F
⎜ ⎟ = F∂+ln QN ,V ,T= F −T
⎝ ∂1 T ⎠= − T ∂1 T ∂T
Compare: ∂β
= F + TS = E
⎛∂ F T ⎞ F
⎜ ⎟= E Hence: = −ln QN ,V ,T
⎝ ∂1 T ⎠ k BT
20
Remarks (1)
We have assume quantum mechanics (discrete states) but
we are interested in the classical limit
1 ⎧
⎪ ⎡ p 2
N ⎤⎪
⎫
∑ i exp (−β Ei )→ h3 N ! ∫∫ dp dr exp ⎨−β ⎢∑ i 2m + U (r )⎥⎬
N N i
⎪
⎩ ⎣ i ⎦⎪
⎭
1
3
→ Volume of phase space (particle in a box)
h
1
→ Particles are indistinguishable
N!
Integration over the momenta can be carried out for most systems:
3N 3
N
⎧
⎪ ⎡ p 2
⎤⎫
⎪ ⎡ ⎧ p 2
⎫⎤ ⎛ 2π m ⎞ 2
1 ⎡−β U (
Q (N , V , T )=
Λ3 N N ! ∫ dr N
exp ⎣ r N
)
⎤
⎦
22
Example: ideal gas
1
Q (N , V , T )Thermo
= 3N
Λ N! ∫ exp ⎡
dr (3)
recall
N
⎣− β U (
r )
⎤
⎦
N
Λ N! Λ N!
Free energy: Pressure
⎛ ⎛
∂F ⎞V N
⎞
β F = −ln⎜ ⎜ ⎟3 N = −P⎟
⎝ ∂⎝VΛ⎠T N ! ⎠
Energy: ⎛N ⎞
≈ N ln Λ + N ln ⎜ ⎟ = N ln Λ3 + N ln ρ
3
Pressure: ⎛∂ F T
⎝ V⎞ ⎠
⎞ ⎛ ∂β F
⎜ ⎟= ⎜ ⎟= E
⎝ ∂1 T ⎠ ⎝ Energy:
∂β ⎠
⎛ ∂F ⎞ N
P = −⎜ ⎟ = ⎛ ∂β F ⎞ 3N ∂Λ 3
⎝ ∂V ⎠T β V E =⎜ ⎟= = Nk BT
⎝ ∂β ⎠ Λ ∂β 2 23
Ideal gas (2)
⎛ ∂F ⎞
Chemical potential: μi = ⎜
⎝ ∂N i ⎟
⎠T ,V , N j
⎛N ⎞
β F = N lnΛ + N ln⎜ ⎟
3
⎝V ⎠
βμ = lnΛ3 + ln ρ +1
βμ IG = βμ 0 + ln ρ
24
Summary:
Canonical ensemble (N,V,T)
Partition function:
1
Q (N , V , T )= 3 N ∫ dr exp ⎣− β U (
⎡ N
r )
N
⎤
⎦
Λ N!
Probability to find a particular configuration
β F = −ln QN ,V ,T
25
Summary:
micro-canonical ensemble (N,V,E)
Partition function:
1
(( ) )
Q (N ,V , E )= 3 N ∫∫ dp N dr N δ H p N ,r N − E
h N!
P (Γ )∝ 1
Free energy
β S = ln QN ,V , E
26
Thermodynamic properties
P (Γ )∝ exp ⎡
⎣− β U (Γ )⎤⎦
Ensemble average:
1
A = ∫ d ΓA (Γ )exp ⎡⎣− β U (Γ )⎤⎦
Q
But for doing this wee need to know the Statistical Thermodynamics
of the various ensembles.
28
Example (1):
vapour-liquid equilibrium mixture
29
Example (2):
swelling of clays
Deep in the earth clay layers
can swell upon adsorption of
water:
– How to mimic this in the N,V,T
ensemble?
– What is a better ensemble to
use?
30
Ensembles
• Micro-canonical ensemble: E,V,N
• Canonical ensemble: T,V,N
• Constant pressure ensemble: T,P,N
• Grand-canonical ensemble: T,V,μ
31
Constant pressure simulations:
N,P,T ensemble
Vi , Ei E −Thermo
Ei , recall (4)
V −Vi
1/kBT p/kBT
First law ofConsider
thermodynamics
a small system that can exchange
dE = TdS volume andμenergy
− pdV +∑ i i
d N i
with a big reservoir
Hence ⎛ ∂ ln Ω ⎞ ⎛ ∂ ln Ω ⎞
ln Ω ( V − Vi , E − Ei )
1 ⎛ ∂S (
= ln Ω ⎞V , E )− ⎜ ⎟ Ei − ⎜ ⎟ Vi + L
=⎜ ⎟ ⎝ ∂E ⎠V ⎝ ∂V ⎠E
Ω (E − Ei , V − Vi )T ⎝ ∂E E ⎠V , N
i pVi
ln =− −
Ω (E , V )and k BT k B T
∂S ⎞ p
Hence, the probability⎛⎜to find⎟ =i i:
E ,V
⎝ ∂V ⎠T , N T exp ⎡⎣− β (Ei + pVi )⎤⎦
Ω (E − Ei , V − Vi )
P (Ei , Vi )= =
( ) (
∑ j ,k Ω E − E j ,V − Vk ∑ j ,k exp ⎡⎣−β E j + pVk ⎤⎦ )
∝ exp ⎡⎣−β (Ei + pVi )⎤⎦ 32
N,P,T ensemble (2)
In the classical limit, the partition function becomes
1
()
Q (N , P, T )= 3 N ∫ dV exp (−β PV )∫ dr N exp ⎡⎣− β U r N ⎤⎦
Λ N!
The probability to find a particular configuration: r N ,V
( ) ( ( ))
P r N , V ∝ exp ⎡−β PV + U r N ⎤
⎣ ⎦
33
Grand-canonical simulations:
μ,V,T ensemble
N i , Ei E −Thermo
Ei , recall (5)
N −N i
1/kBT -μ/kBT
First law ofConsider
thermodynamics
a small system that can exchange
dE = TdSparticles
− pdV +∑ andμenergy
i i
d N i
with a big reservoir
Hence ⎛ ∂ ln Ω ⎞ ⎛ ∂ ln Ω ⎞
ln Ω (N − N i , E − Ei )=1 ln⎛Ω∂S(⎞
N , E )− ⎜ ⎟ Ei − ⎜ ⎟ Ni + L
=⎜ ⎟ ⎝ ∂E ⎠N ⎝ ∂N ⎠E
Ω (E − Ei , N − N i )T ⎝ ∂E E ⎠V , N
i μ i Ni
ln =− +
Ω (E , N )and k BT k B T
⎛ ∂S ⎞ μi
Hence, the probability ⎜ to ⎟ =i − i:
find E ,N
∂N i ⎠T ,V T exp ⎡⎣−β (Ei − μ i N i )⎤⎦
Ω (E − Ei , N − N i )
⎝
P (Ei , N i )= =
( ) (
∑ j ,k Ω E − E j , N − N k ∑ j ,k exp ⎡⎣−β E j − μ k N k ⎤⎦ )
∝ exp ⎡⎣−β (Ei − μ i N i )⎤⎦ 34
μ,V,T ensemble (2)
In the classical limit, the partition function becomes
(
∞ exp βμ N
)
Q (μ , V , T )= ∑ 3N
Λ N! ∫ d r N
exp ⎡
⎣− β ()
U r N
⎤
⎦
N =1
( ) ()
P N , r N ∝ exp ⎡⎣βμ N − β U r N ⎤⎦
35