Heat Capacity and Energy Fluctuations Running an MD Simulation Equilibration Phase Before data-collection and results can be analyzed the system must be prepared via equilibration Minimize energy Velocity/Pressure scaling (move T/P to desired value) Heat cycles Tempering of potential parameters During equilibration monitor thermodynamic properties and structure After achieving stability, perform “production” run Equilibration of the 2D argon system 0.5 1 1.5 2 2.5 3 3.5 4 Time (ps) -320 -340 -360 -380 -400 -420 -440 -460 90 Temperature (K) 200 100 0 -100 -200 -300 -400 -500 -600 -700 Temperature Total Energy Energy (kJ/mol) Energy (kJ/mol) Potential and Kinetic Energy 0.5 1 1.5 2 2.5 3 3.5 4 Time (ps) 85 80 75 70 65 60 0.5 1 1.5 2 2.5 3 3.5 4 Time (ps) The properties (such as time averages) should not depend on the initial conditions ! Compute averages from several simulations : Initial condition time 1 2 3 Equilibration Production Compute block-averages : time Equilibration #1 #2 #3 Production #4 #5 #6 #7 Difficulty: Block-averages might be the same, because the “equilibration” is very slow Sometimes several simulations are performed with di erent system sizes to check equilibration Evolution of the radial distribution function of the 2D argon system 0-1 ps 1-2 ps 16 14 2-3 ps 6 6 5 5 4 4 g(r) g(r) 10 8 6 g(r) 12 3 3 2 2 1 1 4 2 0 0 1 2 3 4 5 6 7 8 9 10 Distance (Ang) 0 0 1 2 3 4 5 6 7 8 Distance (Ang) 9 10 0 0 1 2 3 4 5 6 7 8 Distance (Ang) Production phase It is important to continue to check the properties monitored during the equilibration phase during the production phase. They may still not be stable, in which case the beginning or the whole of the simulation might have to be discarded. 9 10 Properties from MD Simulations Time averages Thermodynamic properties (energies, pressure . . . ) Structural properties ... Dynamic quantities Time correlation functions (and their FT’s, related to spectroscopic properties.) Transport properties (di usion . . . ) Analyzing Simulation Results Directly visualize the results using molecular graphics. The results can (of course) be analyzed by inspection, although this is not as trivial as it may sound ! Snapshot from a simulation containing 512 water molecules and one Na + ion Local environment of Na+ (aq) Structural Properties The radial distribution function gives a measure of the local structure. It corresponds to the local concentration of particles in a (thin) spherical shell at the distance r around a central particle, relative to a uniform distribution of particles. r Examples Liquid Argon NaCl Melt 2 4.5 1.8 4 1.6 3.5 1.4 3 g(r) g(r) 1.2 1 0.8 2.5 2 1.5 0.6 0.4 1 0.2 0.5 0 Na+ - Na+ Cl- - ClNa+ - Cl- 0 1 2 3 4 5 6 Distance (Angstrom) 7 8 9 10 0 0 1 2 3 4 5 6 Distance (Angstrom) 7 8 9 10 Radial Distribution Functions Useful for molecular liquids. Site-site radial distribution functions for water : Hydrogen-Hydrogen Oxygen-Hydrogen 3.5 1.4 1.6 3 1.2 1.4 2.5 1 2 0.8 1.5 0.4 0.5 0.2 0 1 2 3 4 5 6 Distance (Ang) 7 8 9 10 1 0.6 1 0 1.2 g(r) g(r) g(r) Oxygen-Oxygen 0 0.8 0.6 0.4 0.2 0 1 2 3 4 5 6 Distance (Ang) 7 8 9 10 0 0 1 2 3 4 5 6 Distance (Ang) For large molecules the number of site-site distribution functions obviously becomes very large and only a subset is usually computed For molecules it is also possible to compute various angular dependent functions, and/or compute so-called spatial distribution functions 7 8 9 10 Integrating the radial distribution function gives the number of particles surrounding the central particle 30 25 g(r) n(r) g(r), n(r) 20 15 10 5 0 0 1 2 3 4 5 6 7 8 9 10 Distance (Ang) Structure of water around an Al 3+ ion: g Al − O ( r ) and n Al − O (r) Dynamical Properties Time Correlation Functions Correlations between two di erent quantities A and B are measured using a time correlation function : C AB ( t) = < A( t) · B ( 0) > Such time correlation functions are interesting since : They give a picture of the dynamics in the system Their time integrals are often related to various transport properties Their Fourier transforms are often related to experimental spectra If A and B are di erent properties, C is called a cross correlation function If A and B are the same property, C is called an auto correlation function . The auto correlation function is a measure of the “memory” of the system for some property Dynamical Properties: Time Correlation Functions (cont) If A( t) is a property of many particles the correlation function is collective If A( t) is a property of a single particle the function is a single particle correlation function The single particle velocity auto-correlation (VAC) function : C vv ( t) = < v ( t) · v ( 0) > Example : Hydrogen in liquid water 1 0.8 0.6 Cvv(t) 0.4 0.2 0 -0.2 -0.4 -0.6 0 0.1 0.2 0.3 Time (ps) 0.4 0.5 Dynamical Properties: Time Correlation Functions (cont) The average in the velocity auto-correlation function is typically taken over all particles in the system and for a number of di erent time origins < v ( t) · v ( 0) > = < v i ( t) · v i ( 0) > t=0 j=2 t=0 j=1 t=0 j=0 0 N 1 N Σ i 1 M = < v i ( t) · v i ( 0) > M Σ v (t + t) · v (t ) j i t=1 j=2 vi(2+t). vi(2) t=1 j=1 vi(1+t). vi(1) vi(0+t). vi(0) 2 j j t=1 j=0 1 i 3 4 5 6 7 8 9 time Dynamical Properties: Time Correlation Functions (cont) The normalized time correlation function is < A( t) · B ( 0) > < A( 0) · B ( 0) > C AB ( t) = Fourier transforming the correlation function Ĉ AB ( ω) = ! ∞ −∞ C AB ( t) e −i2πωt dt Fourier transform of the hydrogen in liquid water VAC 3 2.5 2 DOS 1.5 water intramolecular bend 1 water intramolecular stretch 0.5 0 -0.5 0 500 1000 1500 2000 2500 3000 Wavenumber (cm -1) 3500 4000 Transport Properties Integrating the velocity auto-correlation function gives the di sion coefficient 1 ∞ D = < v ( t) · v ( 0) > dt 3 0 This is an expression of the general type γ = ∞ 0 < Ȧ( t) · Ȧ( 0) > dt The corresponding “Einstein relation” is 2tγ = < ( A( t) − A( 0)) 2 > An alternate way to compute the di sion coefficient < |r ( t) − r ( 0) | 2 > 2tD = 3 The Einstein relation holds at long times ! 3 MSD (Angstrom^2) 2.5 MSD FIT 2 1.5 1 0.5 0 0 1 2 3 4 5 Time (ps) Examples of other dynamical properties that can be studied using time correlation functions and/or Einstein relations : Total dipole moment auto-correlation function : Related to (infrared) absorption spectrum Auto-correlation function of elements of the pressure tensor : Related to the viscosity Orientational correlation functions : Related to various spectroscopic techniques (NMR, IR, Raman . . . ) Handling Fast Vibrational Motion Energy Vibrational motion with high frequencies ( ω ≈ k BT ) are really quantized V(x)=kx 2/2 7 hω/2 5 hω/2 3 hω/2 hω/2 k B T/2? Displacement (x) Also, since the frequencies are very high, short timesteps are required Flow of energy might be slow, due to poor coupling between the degrees of freedom. This can lead to problems with equilibration. Treatment of Rigid Molecules One “solution” is to make molecules / bonds rigid ! Rigid molecules Separate motion into translation and rotation ; Separate equations of motion for the center of mass, and some representation of the rotation of the molecule (use Euler angles or quaternions) Rigid bonds Constraint dynamics (for ”holonomic constraints”) Appropriate for molecules that are partially flexible, such as a polymer Rigid small molecules can also be handled by introducing fixed “bonds”, three per atom (or, actually, 3N - 6 bonds per molecule) Constraint Dynamics Relatively simple algorithms exist : SHAKE and RATTLE SHAKE enforces the (for instance) distance between two atoms to be constant r rHH=1.63298 Å 1.0 = H O Å H= rO 1.0 Holonomic constraints : f ( q1 , q2 , . . . , t) = 0 rij2 − dij2 = 0 The SHAKE method is tightly connected to the integrator used, the variant for the velocity Verlet integrator is termed RATTLE The method introduces an extra force directed along the bond between two atoms at time zero (i.e. before the integration) First the integration step is completed as if there were no constraint force Then all constraint forces are solved for, one by one, iteratively Long Range Interactions A long range interaction decays no faster than r − d , where “d” is the dimensionality of the system The problem : The interaction decay is so slow that we cannot just truncate it at a reasonably short distance Even worse : Conditionally convergent ! Important members of this class : charge-charge (r − 1 ) charge-dipole (r − 2 ) dipole-dipole (r − 3 ) charge-quadrupole (r − 3 ) The Coulomb interaction : V = N 1 4 0 N i= 1 j= i+ 1 qi qj r ij Di erent methods to treat this kind of interaction have been devised (Ewald, reaction field, various multipole methods) Here only the ordinary Ewald method is (briefly) considered Sum over periodic images built up in spherical layers : εs The very large sphere is surrounded by a medium with relative permittivity s The potential energy can be written as : V = 1 4 0 1 2 n N N i j qi qj |r ij + n| where n = ( nx L, ny L, nz L) . nx , ny , nz are integers and L the size of the central image. The ’ in the sum : i = j for |n| = 0 The Ewald method : Add screening charge distribution with 3 − 3/ 2 − α 2 r 2 ) e opposite charge and equal magnitude ( α π + + - - The interaction between the charges is now short ranged : V real = erfc( x ) = 1 4 0 2π 1 2 n ∞ − 1/ 2 x N N i j e − t2 erfc ( α|r ij + n|) qi qj |r ij + n| dt For suitable values of the α parameter, |n| can be truncated to 0 The original potential is restored by adding a canceling charge distribution : The canceling distribution is summed in reciprocal (Fourier) space : 1 1 V reciprocal = 3 0L 2 k=0 1 − e 2 |k | |k|2 4α 2 N N qi qj cos ( r ij · k ) i j The sum goes over reciprocal vectors , k = 2πn/ L A correction term needs to be subtracted as the sum in reciprocal space includes the interaction of the canceling distribution at r i with itself : V self = − N α 4π 3/ 2 0 qi2 i The expression V = V real + V reciprocal + V self , corresponds to the potential energy for the large sphere surrounded by a medium with s = ∞