free energy and phase equilibria - acmm · free energy and phase equilibria thermodynamic...

35
Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4 Application: Phase diagram of Carbon

Upload: lekhanh

Post on 26-Aug-2018

246 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Free Energy and Phase equilibria Thermodynamic integration 7.1

Chemical potentials 7.2 Overlapping distributions 7.2

Umbrella sampling 7.4 Application: Phase diagram of Carbon

Page 2: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Why free energies? •  Reaction equilibrium constants

•  Examples: –  Chemical reactions, catalysis, etc.... –  Protein folding, binding: free energy gives binding constants

•  Phase diagrams –  Prediction of thermodynamic stability of phases, –  Coexistence lines –  Critical points –  Triple points –  First order/second order phase transitions

K =[B][A]

=pBpA

= exp −β(GB −GA )[ ]

A↔ B

Page 3: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Critical point: no difference between liquid and vapor Triple point: liquid, vapor and solid in equilibrium. How do we compute these lines?

Along the liquid gas coexistence line increasing the pressure and temperature at constant volume the liquid density becomes lower and the vapor density higher.

Phase diagrams

Page 4: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Phase equilibrium

TI = TII PI = PII µI = µII

If µI > µII : transport of particles from phase I to phase II.

Stable phase:

Lowest chemical potential (for single phase: lowest Gibbs free energy)

Criteria for equilibrium (for single component) Chemical potential

µ =∂F∂N#

$ %

&

' ( V ,T

=∂G∂N#

$ %

&

' ( P ,T

=Gm

Page 5: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Relation thermodynamic potentials

Helmholtz free energy: F = U - TS

Gibbs free energy: G = F + PV

Suppose we have F(n,V,T)

Then we can find G from F from:

All thermodynamic quantities can be derived from F and its derivatives

TnVFVFG

,⎟⎠

⎞⎜⎝

⎛∂

∂−=

P = −∂F∂V$

% &

'

( ) n,T

Page 6: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Phase equilibria from F(V,T) Common tangent construction

V

F

P = −∂F∂V$

% &

'

( ) n,T

Equal tangents liquid

gas Connecting line: equal G

Page 7: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Common tangent construction

V

F TnVFVFG

,⎟⎠

⎞⎜⎝

⎛∂

∂−=liquid

gas

Helmholtz Free Energy Perspective

Page 8: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Common tangent construction

V

G

G = F −V ∂F∂V$

% &

'

( ) n,T

liquid

gas

Only equilibrium when P,T is on coexistence line.

Both liquid and vapor G equal and minimal

Gibbs Free Energy Perspective

Page 9: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

We need F or µ •  So equilibrium from F(V) alone or from P and µ

•  So in fact for only 1 point of the equation of state the F is needed

•  For liquid e.o.s even from ideal gas

F(V ) = F(V0) +∂F∂V#

$ %

&

' ( N,T

dVV0

V∫ = F(V0) − PdV∫

F(ρ) = F(ρ0) + N P( # ρ )ρ2

d # ρ ρ0

ρ

βF(ρ) /N = βF id (ρ) /N +βP( $ ρ ) - $ ρ

ρ2d $ ρ

0

ρ

Page 10: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Equation of state

P = P ρ,T( )

∂F∂V#

$ %

&

' ( N ,T

= −P

F(ρ) = F(ρ0) + N P( # ρ )ρ2

d # ρ ρ0

ρ

βF(ρ) /N = βF id (ρ) /N +βP( $ ρ ) - $ ρ

ρ2d $ ρ

0

ρ

Page 11: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Free Energies and Phase Equilibria

•  Determine free energy of both phases relative to a reference state Free energy difference calculation General applicable: Gas, Liquid, Solid, Inhomogeneous systems, …

•  Determine free energy difference between two phases Gibbs Ensemble Specific applicable: Gas, Liquid

General Strategies

Page 12: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Statistical Thermodynamics

( )NVTQF ln−=β

A NVT =1

QNVT

1Λ3NN!

drN∫ A rN( )exp −βU rN( )[ ]

QNVT =1

Λ3NN!drN∫ exp −βU rN( )[ ]

Partition function

Ensemble average

Free energy

P rN( ) =1

QNVT

1Λ3NN!

dr'N∫ δ r'N −rN( )exp −βU r'N( )[ ]∝exp −βU rN( )[ ]Probability to find a particular configuration

Page 13: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Ensemble average versus free energy

≈drN A rN( )∫ exp −βU rN( )[ ]drN exp −βU rN( )[ ]∫

= A NVT

Generate configuration using MC:

r1N ,r2

N ,r3N ,r4

N!,rMN{ }

A = 1M

Ai=1

M

∑ riN( )

βF = −lnQNVT = −ln 1Λ3NN!

drN∫ exp −βU rN( )[ ]

F is difficult, because requires accounting of phase space volume

Generate configuration using MD:

r1N ,r2

N ,r3N ,r4

N!,rMN{ }

A = 1M

Ai=1

M

∑ riN( ) ≈ 1T dtA(t)

0

T

∫ ≈ A∫ NVTergodicity

Page 14: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

I - Thermodynamic integration •  Known reference state λ=0 •  unkown target state λ=1

F(λ =1)−F(λ = 0) = dλ∂F λ( )∂λ

#

$%

&

'(N ,V ,Tλ=0

λ=1

U λ( ) = 1− λ( )UI + λUII

Coupling parameter

QNVT λ( ) =1

Λ3NN!drN∫ exp −βU λ( )[ ]

Page 15: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Thermodynamic integration

∂F λ( )∂λ

$

% &

'

( ) N ,T

= −1β∂∂λln Q( )

= −1β1Q∂Q∂λ

=drN ∂U λ( ) ∂λ( )∫ exp −βU λ( )[ ]

drN∫ exp −βU λ( )[ ]

( )λλ

λ∂

∂=

U

F λ =1( ) − F λ = 0( ) = d∫ λ∂U λ( )∂λ

λ

Free energy as ensemble average!

Page 16: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Example •  In general

•  Specific example

∂U λ( )∂λ

λ

= UII −UI λ

U 0( ) =ULJ

U 1( ) =UStockm Stockmayer

Lennard-Jones

U λ( ) =ULJ + λU dipole-dipole

U λ( ) = (1− λ)UI + λUII

∂U λ( )∂λ

λ

= Udip−dipλ

Page 17: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Free energy of solid More difficult. What is reference? Not the ideal gas. Instead it is the Einstein crystal: harmonic oscillators around r0

F = Fein + dλ∂U λ( )∂λλ= 0

λ=1

∫λ

U λ;rN( ) = (1−λ)U rN( )+λU r0N( )+λ α(ri − ri )

2

i=1

N

F = Fein + dλλ= 0

λ=1

∫ −U rN( ) +U r0N( ) + α(ri − ri)

2

i=1

N

∑λ

Page 18: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Hard sphere freezing

P

ρ

Solid free energy from Einstein crystal liquid free

energy from Ideal gas

Equal µ/P (and T)

Page 19: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

II - Thermodynamic perturbation Two systems:

System 1: N, V, T, U1 System 0: N, V, T, U0

ΔβF = βF1 −βF0 = −ln Q1 Q0( )

= −lndsN∫ exp −βU1$% &'dsN∫ exp −βU0( )

= −lndsN∫ exp −β U1 −U0( )$

%&'exp −βU0

$% &'

dsN∫ exp −βU0( )

Q0 =V N

Λ3NN!dsN∫ exp −βU0( )

Q1 =V N

Λ3NN!dsN∫ exp −βU1( )

( )1 0 0ln expF U Uβ βΔ = − − −$ %& '

Page 20: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

= −N ln 1Λ3ρ

%

& '

(

) * + N − ln dsN∫ exp −βU sN ;L( )[ ]( )

= −ln V N

Λ3NN!$

% &

'

( ) − ln dsN∫ exp −βU sN ;L( )[ ]( )

Chemical potential

µ ≡∂F∂N$

% &

'

( ) V ,T

QNVT =V N

Λ3NN!dsN∫ exp −βU sN ;L( )[ ]

βF = −ln QNVT( )

βF = βF IG + βF ex

} €

βµ = βµIG + βµex

TV

exex

NF

,!!"

#$$%

&

∂≡

ββµ

TV

IGIG

NF

,!!"

#$$%

&

∂≡

ββµ

Page 21: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Widom test particle insertion

TVNF

,!"

#$%

&∂

∂≡

ββµ

βµ =βF N +1)( ) −βF N)( )

N +1− N

= −lnQ N +1( )Q N( )

= −ln

V N +1

Λ3N +3 N +1( )!V N

Λ3NN!

$

%

& & & &

'

(

) ) ) )

− lndsN +1∫ exp −βU sN +1;L( )[ ]dsN∫ exp −βU sN ;L( )[ ]

$

%

& &

'

(

) )

= −ln VΛ3 N +1( )

$

% &

'

( ) − ln

dsN +1∫ exp −βU sN +1;L( )[ ]dsN∫ exp −βU sN ;L( )[ ]

$

%

& &

'

(

) )

βµ = βµIG + βµex

βµex = −lndsN +1∫ exp −βU sN +1;L( )[ ]dsN∫ exp −βU sN ;L( )[ ]

%

&

' '

(

)

* *

Page 22: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Widom test particle insertion

βµex = −lndsN +1∫ exp −βU sN +1;L( )[ ]dsN∫ exp −βU sN ;L( )[ ]

%

&

' '

(

)

* *

βµex = −lndsN∫ ds N+1∫ exp −β ΔU + +U sN ;L( )( )[ ]

dsN∫ exp −βU sN ;L( )[ ]

&

'

( (

)

*

+ +

U sN +1;L( ) = ΔU + +U sN ;L( )

= −lnds N+1∫ dsN∫ exp −βΔU +[ ]{ }exp −βU sN ;L( )[ ]

dsN exp −βU sN ;L( )[ ]∫

&

'

( (

)

*

+ +

= −ln ds N+1∫ exp −βΔU +[ ]NVT( ) Ghost particle!

Page 23: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Hard spheres

βµex = −ln ds N+1∫ exp −βΔU +[ ]NVT( )

U r( ) =∞ r ≤σ0 r >σ

% & '

exp −βΔU +[ ] =0 if overlap1 no overlap% & '

probability to insert a test particle!

exp −βΔU +[ ]But, … may fail at high density

Page 24: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

III - Overlapping Distribution Method Two systems:

System 1: N, V,T, U1 System 0: N, V,T, U0

ΔβF = βF1 −βF0 = −ln Q1 Q0( ) = − lndsN∫ exp −βU1( )dsN∫ exp −βU0( )

#

$%%

&

'((= − ln

Q1Q0

#

$%

&

'(

Q0 =V N

Λ3NN!dsN∫ exp −βU0( )

Q1 =V N

Λ3NN!dsN∫ exp −βU1( )

p0 ΔU( ) =dsN∫ exp −βU0( )δ U1 −U0 −ΔU( )

dsN∫ exp −βU0( )

p1 ΔU( ) =dsN∫ exp −β U1 −U0( )[ ]exp −βU0[ ]δ U1 −U0 −ΔU( )

dsN∫ exp −βU1( )

p1 ΔU( ) = Q0

Q1exp −βΔU( ) p0 ΔU( )

=ΔU (δ function)

=1Q1

=Q0

Q11Q0

Q0

Q1= exp βΔF( )

p1 ΔU( ) =dsN∫ exp −βU1( )δ U1 −U0 −ΔU( )

dsN∫ exp −βU1( )

=Q0

Q1exp −βΔU( )

dsN∫ exp −βU0[ ]δ U1 −U0 −ΔU( )Q0

ln p1 ΔU( ) = β ΔF −ΔU( ) + ln p0 ΔU( )

Page 25: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

ln p1 ΔU( ) = β ΔF −ΔU( ) + ln p0 ΔU( )

βΔF = f1 ΔU( ) − f0 ΔU( )

Simulate system 0: compute f0 Simulate system 1: compute f1

f0 ΔU( ) ≡ ln p0 ΔU( ) − 0.5βΔU

f1 ΔU( ) ≡ ln p1 ΔU( ) + 0.5βΔU

Overlapping Distribution Method

Page 26: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Chemical potential

System 1: N, V, T, U System 0: N-1, V, T, U + 1 ideal gas exFFF βµβββ ≡−=Δ 01

( ) ( )UfUfex Δ−Δ= 01βµ

System 0: test particle energy System 1: real particle energy 01 UUU −=Δ

Moderate density Hight density

Page 27: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Umbrella sampling •  Start with thermodynamic perturbation

ΔβF = −ln Q1 Q0( )

= −lndsN∫ exp −βU1( )dsN∫ exp −βU0( )

%

& ' '

(

) * *

exp −βΔF( ) =dsN∫ exp −βU0( )exp(−βΔU)

dsN∫ exp −βU0( )

&

' ( (

)

* + +

exp −βΔF( ) = exp −βΔU( ) 0

Can we use this for free energy difference between arbitrary systems?

Page 28: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

T1

T2

T5

T3

T4

E

P(E)

Overlap becomes very small

T0

Page 29: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

E

P(Δ

U)

Overlap becomes very small

System 1

System 0

ΔU

Page 30: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Bridging function •  Introduce function π(sN) altering distribution.

•  This approach is called umbrella sampling

exp −βΔF( ) =dsN∫ π (sN )exp −βU1( ) /π (sN )dsN∫ π (sN )exp −βU0( ) /π (sN )

'

( ) )

*

+ , ,

exp −βΔF( ) =exp −βU1( ) /π

π

exp −βU0( ) /ππ

Page 31: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

E

P(Δ

U)

System 1

System 0

ΔU

umbrella

Page 32: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4
Page 33: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Tracing coexistence curves •  If we have a coexistence point on the phase diagram we can

integrate allong the line while maintaining coexistence.

dµα = dµβ

P

T

α phase

β phase dP

dT

P en T are equal along coexistence line

Page 34: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Tracing coexistence curves

dµ = dG = - SdT + VdP

- SαdT + VαdP = - SβdT + VβdP

dPdT

=Sβ − SαVβ −Vα

dPdT

=ΔSΔV

=ΔHTΔV

Clapyeron equation

dPdT

=Δ(U +PV )TΔV dP = Δ(U +PV )

TΔVdT

Page 35: Free Energy and Phase equilibria - ACMM · Free Energy and Phase equilibria Thermodynamic integration 7.1 Chemical potentials 7.2 Overlapping distributions 7.2 Umbrella sampling 7.4

Example: Carbon Phase Diagram