Molecular dynamics simulations

Similar documents
What is Classical Molecular Dynamics?

MD Thermodynamics. Lecture 12 3/26/18. Harvard SEAS AP 275 Atomistic Modeling of Materials Boris Kozinsky

Temperature and Pressure Controls

Massachusetts Institute of Technology Department of Physics. Final Examination December 17, 2004

Temperature and Pressure Controls

Javier Junquera. Statistical mechanics

G : Statistical Mechanics

7 To solve numerically the equation of motion, we use the velocity Verlet or leap frog algorithm. _ V i n = F i n m i (F.5) For time step, we approxim


Time-Dependent Statistical Mechanics 5. The classical atomic fluid, classical mechanics, and classical equilibrium statistical mechanics

CHAPTER V. Brownian motion. V.1 Langevin dynamics

Chapter 4 Molecular Dynamics and Other Dynamics

Gear methods I + 1/18

Understanding Molecular Simulation 2009 Monte Carlo and Molecular Dynamics in different ensembles. Srikanth Sastry

4. The Green Kubo Relations

Ab initio molecular dynamics. Simone Piccinin CNR-IOM DEMOCRITOS Trieste, Italy. Bangalore, 04 September 2014

Basics of Statistical Mechanics

Analysis of the simulation

CE 530 Molecular Simulation

Introduction to Simulation - Lectures 17, 18. Molecular Dynamics. Nicolas Hadjiconstantinou

Computer simulation methods (1) Dr. Vania Calandrini

Molecular Dynamics Simulations

The dynamics of small particles whose size is roughly 1 µmt or. smaller, in a fluid at room temperature, is extremely erratic, and is

Scientific Computing II

the EL equation for the x coordinate is easily seen to be (exercise)

1 Bulk Simulations in a HCP lattice

Modeling of Micro-Fluidics by a Dissipative Particle Dynamics Method. Justyna Czerwinska

Ab initio molecular dynamics and nuclear quantum effects

UNIVERSITY OF OSLO FACULTY OF MATHEMATICS AND NATURAL SCIENCES

PHYSICS 311: Classical Mechanics Final Exam Solution Key (2017)

Density Functional Theory. Martin Lüders Daresbury Laboratory

Use conserved quantities to reduce number of variables and the equation of motion (EOM)

AST1100 Lecture Notes

MatSci 331 Homework 4 Molecular Dynamics and Monte Carlo: Stress, heat capacity, quantum nuclear effects, and simulated annealing

Part 2: Molecular Dynamics. Literature History Practical Issues

Introduction to molecular dynamics

Physics 235 Chapter 7. Chapter 7 Hamilton's Principle - Lagrangian and Hamiltonian Dynamics

Lecture 41: Highlights

Brownian Motion and Langevin Equations

Potential/density pairs and Gauss s law

Brownian Motion: Fokker-Planck Equation

Energy and Forces in DFT

Molecular Dynamics Simulation of Argon

Ab Ini'o Molecular Dynamics (MD) Simula?ons

Basics of Statistical Mechanics

Advantages of a Finite Extensible Nonlinear Elastic Potential in Lattice Boltzmann Simulations

1. Electricity and Magnetism (Fall 1995, Part 1) A metal sphere has a radius R and a charge Q.

Introduction Statistical Thermodynamics. Monday, January 6, 14

(a) Write down the total Hamiltonian of this system, including the spin degree of freedom of the electron, but neglecting spin-orbit interactions.

Molecular Dynamics Simulation Study of Transport Properties of Diatomic Gases

Disordered Hyperuniformity: Liquid-like Behaviour in Structural Solids, A New Phase of Matter?

Dynamic force matching: Construction of dynamic coarse-grained models with realistic short time dynamics and accurate long time dynamics

AY202a Galaxies & Dynamics Lecture 7: Jeans Law, Virial Theorem Structure of E Galaxies

Physics 127a: Class Notes

κ = f (r 0 ) k µ µ k ν = κk ν (5)

The first order formalism and the transition to the

in order to insure that the Liouville equation for f(?; t) is still valid. These equations of motion will give rise to a distribution function f(?; t)

Langevin Methods. Burkhard Dünweg Max Planck Institute for Polymer Research Ackermannweg 10 D Mainz Germany

Fundamental Stellar Parameters. Radiative Transfer. Stellar Atmospheres

Handout 10. Applications to Solids

Physics 127c: Statistical Mechanics. Application of Path Integrals to Superfluidity in He 4

Classical Statistical Mechanics: Part 1

1. Introductory Examples

Ph1a: Solution to the Final Exam Alejandro Jenkins, Fall 2004

Ab initio molecular dynamics

8.333: Statistical Mechanics I Problem Set # 5 Due: 11/22/13 Interacting particles & Quantum ensembles

Physics 127b: Statistical Mechanics. Lecture 2: Dense Gas and the Liquid State. Mayer Cluster Expansion

Aim: Understand equilibrium of galaxies

BROWNIAN DYNAMICS SIMULATIONS WITH HYDRODYNAMICS. Abstract

1 Phase Spaces and the Liouville Equation

Experimental Soft Matter (M. Durand, G. Foffi)

This is a Gaussian probability centered around m = 0 (the most probable and mean position is the origin) and the mean square displacement m 2 = n,or

Thermodynamics of nuclei in thermal contact

MOLECULAR DYNAMICS SIMULATION OF HETEROGENEOUS NUCLEATION OF LIQUID DROPLET ON SOLID SURFACE

Central Forces. c 2007 Corinne Manogue. March 1999, last revised February 2009

A MOLECULAR DYNAMICS SIMULATION OF A BUBBLE NUCLEATION ON SOLID SURFACE

The Ideal Gas. One particle in a box:

Equations of linear stellar oscillations

Computational Physics. J. M. Thijssen

Lecture 4. Alexey Boyarsky. October 6, 2015

Heat Transport in Glass-Forming Liquids

Generalized Coordinates, Lagrangians

Classical Monte Carlo Simulations

ANALYTISK MEKANIK I HT 2016

Rotational Motion. Chapter 4. P. J. Grandinetti. Sep. 1, Chem P. J. Grandinetti (Chem. 4300) Rotational Motion Sep.

Physics 142 Energy in Mechanics Page 1. Energy in Mechanics

CHAPTER 8 CONSERVATION LAWS

4.1 Important Notes on Notation

424 Index. Eigenvalue in quantum mechanics, 174 eigenvector in quantum mechanics, 174 Einstein equation, 334, 342, 393

Simulations with MM Force Fields. Monte Carlo (MC) and Molecular Dynamics (MD) Video II.vi

ON THE INTEGRATION OF EQUATIONS OF MOTION: FEM AND MOLECULAR DYNAMICS PROBLEMS

Solution Set Two. 1 Problem #1: Projectile Motion Cartesian Coordinates Polar Coordinates... 3

Citation for published version (APA): Hess, B. (2002). Stochastic concepts in molecular simulation Groningen: s.n.

Equations of Stellar Structure

Collective Effects. Equilibrium and Nonequilibrium Physics

particle p = m v F ext = d P = M d v cm dt

Ideal Gas Behavior. NC State University

Atoms, electrons and Solids

Brownian motion and the Central Limit Theorem

Graduate Written Examination Spring 2014 Part I Thursday, January 16th, :00am to 1:00pm

Transcription:

Chapter 8 Molecular dynamics simulations Most physical systems are collections of interacting objects. For example, a drop of water contains more than 10 21 water molecules, and a galaxy is a collection of millions and millions of stars. In general, there is no analytical solution that can be found for an interacting system with more than two objects. We can solve the problem of a two-body system, such as the Earth Sun system, analytically, but not a three-body system, such as the Moon Earth Sun system. The situation is similar in quantum mechanics, in that one can obtain the energy levels of the hydrogen atom (one electron and one proton) analytically, but not those the helium atom (two electrons and a nucleus). Numerical techniques beyond those we have discussed so far are needed to study a system of a large number of interacting objects, or the so-called many-body system. Of course, there is a distinction between three-body systems such as the Moon Earth Sun system and a more complicated system, such as a drop of water. Statistical mechanics has to be applied to the latter. 8.1 General behavior of a classical system In this chapter, we introduce a class of simulation techniques called molecular dynamics, which solves the dynamics of a classical many-body system described by the Hamiltonian N p 2 N N i H = E K + E P = + V (r ij ) + U ext (r i ), (8.1) 2m i i> j=1 where E K and E P are the kinetic energy and potential energy of the system, respectively, m i, r i, and p i are the mass, position vector, and momentum of the ith particle, and V (r ij ) and U(r i ) are the corresponding interaction energy and external potential energy. From Hamilton s principle, the position vector and momentum satisfy ṙ i = H p i = p i m i, (8.2) ṗ i = H q i = f i, (8.3) 226

8.1 General behavior of a classical system 227 which are called Hamilton s equations and valid for any given H, including the case of a system that can exchange energy or heat with its environment. Here the force f i is given by f i = i U ext (r i ) j i i V (r ij ). (8.4) The methods for solving Newton s equation discussed in Chapter 1 and Chapter 4 can be used to solve the above equation set. However, those methods are not as practical as the ones about to be discussed, in terms of the speed and accuracy of the computation and given the statistical nature of large systems. In this chapter, we discuss several commonly used molecular dynamics simulation schemes and offer a few examples. Before we go into the numerical schemes and actual physical systems, we need to discuss several issues. There are several ways to simulate a many-body system. Most simulations are done either through a stochastic process, such as the Monte Carlo simulation, which will be discussed in Chapter 10, or through a deterministic process, such as a molecular dynamics simulation. Some numerical simulations are performed in a hybridized form of both, for example, Langevin dynamics, which is similar to molecular dynamics except for the presence of a random dissipative force, and Brownian dynamics, which is performed under the condition that the acceleration is balanced out by the drifting and random dissipative forces. We will not discuss Langevin or Brownian dynamics in this book, but interested readers can find detailed discussions in Heermann (1986) and Kadanoff (2000). Another issue is the distribution function of the system. In statistical mechanics, each special environment is dealt with by way of a special ensemble. For example, for an isolated system we use the microcanonical ensemble, which assumes a constant total energy, number of particles, and volume. A system in good contact with a thermal bath is dealt with using the canonical ensemble, which assumes a constant temperature, number of particles, and volume (or pressure). For any given ensemble, the system is described by a probability function W(R, P), which is in general a function of phase space, consisting of all coordinates and momenta of the particles R = (r 1, r 2,...,r N ) and P = (p 1, p 2,...,p N ), and other quantities, such as temperature, total particle number of the system, and so forth. For the canonical ensemble, we have W(R, P) = 1 N e H/k BT, (8.5) where T is the temperature of the system, k B is the Boltzmann constant, and N is a normalization constant. For an N-particle quasi-classical system, N = N!h 3N, where h is the Planck constant. Note that we can separate the position dependence and momentum dependence in W(R, P) if they are not coupled in H. Any average of the momentum-dependent quantity becomes quite simple because of the quadratic behavior of the momentum in H. So we concentrate

228 Molecular dynamics simulations on the position dependence here. The statistical average of a physical quantity A(R, P) is then given by A = 1 A(R, P)W(R, P) dr dp, (8.6) Z where Z is the partition function of the system from Z = W(R, P) dr dp. (8.7) The ensemble average given above is equivalent to the time average 1 A = lim τ τ τ 0 A(t) dt, (8.8) if the system is ergodic: that is, every possible state is accessed with an equal probability. Because molecular dynamics simulations are deterministic in nature, almost all physical quantities are obtained through time averages. Sometimes the average over all the particles is also needed to characterize the system. For example, the average kinetic energy of the system can be obtained from any ensemble average, and the result is given by the partition theorem N pi 2 E K = = G 2m i 2 k BT, (8.9) where G is the total number of degrees of freedom. For a very large system, G 3N, because each particle has three degrees of freedom. In molecular dynamics simulations, the average kinetic energy of the system can be obtained through E K = 1 M E K (t j ), (8.10) M where M is the total number of data points taken at different time steps and E K (t j ) is the kinetic energy of the system at time t j. If the system is ergodic, the time average is equivalent to the ensemble average. The temperature T of the simulated system is then given by the average kinetic energy with the application of the partition theorem, T = 2 E K /Gk B. j=1 8.2 Basic methods for many-body systems In general, we can define an n-body density function ρ n (r 1, r 2,...,r n ) = 1 N! W(R, P) dr n dp, (8.11) Z (N n)! where dr n = dr n+1 dr n+2 dr N. Note that the particle density ρ(r) = ρ 1 (r) is the special case of n = 1. The two-body density function is related to the pair-distribution function g(r, r ) through ρ 2 (r, r ) = ρ(r)g(r, r )ρ(r ), (8.12)

8.2 Basic methods for many-body systems 229 and one can easily show that ρ 2 (r, r ) = ˆρ(r)ˆρ(r ) δ(r r )ρ(r), (8.13) where the first term is the so-called density density correlation function. Here ˆρ(r) is the density operator, defined as ˆρ(r) = N δ(r r i ). (8.14) The density of the system is given by the average of the density operator, ρ(r) = ˆρ(r). (8.15) If the density of the system is nearly a constant, the expression for g(r, r ) can be reduced to a much simpler form g(r) = 1 N δ(r r ij ), (8.16) ρ N i j where ρ is the average density from the points r = 0 and r. If the angular distribution is not the information needed, we can take the angular average to obtain the radial distribution function g(r) = 1 g(r) sin θ dθ dφ, (8.17) 4π where θ and φ are the polar and azimuthal angles from the spherical coordinate system. The pair-distribution or radial distribution function is related to the static structure factor S(k) through the Fourier transform S(k) 1 = ρ [g(r) 1]e ik r dr (8.18) and its inverse g(r) 1 = 1 [S(k) 1]e ik r dk. (8.19) (2π) 3 ρ The angular average of S(k)isgivenby sin kr S(k) 1 = 4πρ [g(r) 1]r 2 dr. (8.20) 0 kr The structure factor of a system can be measured with the light- or neutronscattering experiment. The behavior of the pair-distribution function can provide a lot of information regarding the translational nature of the particles in the system. For example, a solid structure would have a pair-distribution function with sharp peaks at the distances of nearest neighbors, next nearest neighbors, and so forth. If the system is a liquid, the pair-distribution still has some broad peaks at the average distances of nearest neighbors, next nearest neighbors, and so forth, but the feature fades away after several peaks.

230 Molecular dynamics simulations If the bond orientational order is important, one can also define an orientational correlation function g n (r, r ) = q n (r)q n (r ), (8.21) where q n (r) is a quantity associated with the orientation of a specific bond. Detailed discussions on orientational order can be found in Strandburg (1992). Here we discuss how one can calculate ρ(r) and g(r) in a numerical simulation. The density at a specific point is given by ρ(r) N(r, r) (r, r), (8.22) where (r, r) is the volume of a sphere centered at r with a radius r and N(r, r) is the number of particles in the volume. Note that we may need to adjust the radius r to have a smooth and realistic density distribution ρ(r) for a specific system. The average is taken over the time steps. Similarly, we can obtain the radial distribution function numerically. We need to measure the radius r from the position of a specific particle r i, and then the radial distribution function g(r) is the probability of another particle s showing up at a distance r. Numerically, we have g(r) N(r, r) ρ (r, r), (8.23) where (r, r) 4πr 2 r is the volume element of a spherical shell with radius r and thickness r and N(r, r) is the number of particles in the shell with the ith particle at the center of the sphere. The average is taken over the time steps as well as over the particles, if necessary. The dynamics of the system can be measured from the displacement of the particles in the system. We can evaluate the time dependence of the mean-square displacement of all the particles, 2 (t) = 1 N [r i (t) r i (0)] 2, (8.24) N where r i (t) is the position vector of the ith particle at time t. For a solid system, 2 (t) is relatively small and does not grow with time, and the particles are in nondiffusive, or oscillatory, states. For a liquid system, 2 (t) grows linearly with time: 2 (t) = 6Dt + 2 (0), (8.25) where D is the self-diffusion coefficient (a measure of the motion of a particle in a medium of identical particles) and 2 (0) is a time-independent constant. The particles are then in diffusive, or propagating, states. The very first issue in numerical simulations for a bulk system is how to extend a finite simulation box to model the nearly infinite system. A common practice is to use a periodic boundary condition, that is, to approximate an infinite system by

8.2 Basic methods for many-body systems 231 piling up identical simulation boxes periodically. A periodic boundary condition removes the conservation of the angular momentum of the simulated system (particles in one simulation box), but still preserves the translational symmetry of the center of mass. So the temperature is related to the average kinetic energy by E K = 3 2 (N 1)k BT, (8.26) where the factor (N 1) is due to the removal of the rotation around the center of mass. The remaining issue, then, is how to include the interactions among the particles in different simulation boxes. If the interaction is a short-range interaction, one can truncate it at a cut-off length r c. The interaction V (r c ) has to be small enough that the truncation does not affect the simulation results significantly. A typical simulation box usually has much larger dimensions than r c. For a threedimensional cubic box with sides of length L, the total interaction potential can be evaluated with many fewer summations than N!/2, the number of possible pairs in the system. For example, if we have L/2 > r c, and if x ij, y ij, and z ij are all smaller than L/2, we can use V ij = V (r ij ); otherwise, we use the corresponding point in the neighboring box. For example, if x ij > L/2, we can replace x ij with x ij ± L in the interaction. We can deal with y and z coordinates similarly. In order to avoid a finite jump at the truncation, one can always shift the interaction to V (r) V (r c ) to make sure that it is zero at the truncation. The pressure of a bulk system can be evaluated from the pair-distribution function through P = ρk B T 2πρ2 3 0 V (r) g(r)r 3 dr, (8.27) r which is the result of the virial theorem that relates the average kinetic energy to the average potential energy of the system. The correction due to the truncation of the potential is then given by P = 2πρ2 3 r c V (r) g(r)r 3 dr, (8.28) r which is useful for estimating the influence on the pressure from the truncation in the interaction potential. Numerically, one can also evaluate the pressure from the time average w = 1 r ij f ij, (8.29) 3 i> j because g(r) can be interpreted as the probability of seeing another particle at a distance r. Then we have P = ρk B T + ρ w + P, (8.30) N

232 Molecular dynamics simulations which can be evaluated quite easily, because at every time step the force f ij = V (r ij ) is calculated for each particle pair. 8.3 The Verlet algorithm Hamilton s equations given in Eqs. (8.2) and (8.3) are equivalent to Newton s equation d 2 r i m i dt = f i, (8.31) 2 for the ith particle in the system. To simplify the notation, we will use R to represent all the coordinates (r 1, r 2,...,r N ) and G to represent all the accelerations (f 1 /m 1, f 2 /m 2,...,f N /m N ). Thus, we can rewrite Newton s equations for all the particles as d 2 R = G. (8.32) dt2 If we apply the three-point formula to the second-order derivative d 2 R/dt 2,we have d 2 R dt = 1 2 τ (R 2 k+1 2R k + R k 1 ) + O(τ 2 ), (8.33) with t = kτ. We can also apply the three-point formula to the velocity V = dr dt = 1 2τ (R k+1 R k 1 ) + O(τ 2 ). (8.34) After we put all the above together, we obtain the simplest algorithm, which is called the Verlet algorithm, for a classical many-body system, with R k+1 = 2R k R k 1 + τ 2 G k + O(τ 4 ), (8.35) V k = R k+1 R k 1 + O(τ 2 ). (8.36) 2τ The Verlet algorithm can be started if the first two positions R 0 and R 1 of the particles are given. However, in practice, only the initial position R 0 and initial velocity V 0 are given. Therefore, we need to figure out R 1 before we can start the recursion. A common practice is to treat the force during the first time interval [0,τ] as a constant, and then to apply the kinematic equation to obtain R 1 R 0 + τv 0 + τ 2 2 G 0, (8.37) where G 0 is the acceleration vector evaluated at the initial configuration R 0. Of course, the position R 1 can be improved by carrying out the Taylor expansion to higher-order terms if the accuracy in the first two points is critical. We can also replace G 0 in Eq. (8.37) with the average (G 0 + G 1 )/2, with G 1 evaluated at R 1, given from Eq. (8.37). This procedure can be iterated several

8.3 The Verlet algorithm 233 times before starting the algorithm for the velocity V 1 and the next position R 2. The Verlet algorithm has advantages and disadvantages. It preserves the time reversibility that is one of the important properties of Newton s equation. The rounding error may eventually destroy this time symmetry. The error in the velocity is two orders of magnitude higher than the error in the position. In many applications, we may only need information about the positions of the particles, and the Verlet algorithm yields very high accuracy for the position. If the velocity is not needed, we can totally ignore the evaluation of the velocity, since the evaluation of the position does not depend on the velocity at each time step. The biggest disadvantage of the Verlet algorithm is that the velocity is evaluated one time step behind the position. However, this lag can be removed if the velocity is evaluated directly from the force. A two-point formula would yield V k+1 = V k + τg k + O(τ 2 ). (8.38) We would get much better accuracy if we replaced G k with the average (G k + G k+1 )/2. The new position can be obtained by treating the motion within t [kτ,(k + 1)τ] as motion with a constant acceleration G k ; that is, R k+1 = R k + τv k + τ 2 2 G k. (8.39) Then a variation of the Verlet algorithm with the velocity calculated at the same time step of the position is R k+1 = R k + τv k + τ 2 2 G k + O(τ 4 ), (8.40) V k+1 = V k + τ 2 (G k+1 + G k ) + O(τ 2 ). (8.41) Note that the evaluation of the position still has the same accuracy because the velocity is now updated according to Eq. (8.41), which provides the cancelation of the third-order term in the new position. Here we demonstrate this velocity version of the Verlet algorithm with a very simple example, the motion of Halley s comet, which has a period of about 76 years. The potential between the comet and the Sun is given by V (r) = G Mm, (8.42) r where r is the distance between the comet and the Sun, M and m are the respective masses of the Sun and the comet, and G is the gravitational constant. If we use the center-of-mass coordinate system as described in Chapter 3 for the two-body collision, the dynamics of the comet is governed by µ d2 r dt 2 = f = GMm r r 3, (8.43)

234 Molecular dynamics simulations with the reduced mass µ = Mm m, (8.44) M + m for the case of Halley s comet. We can take the farthest point (aphelion) as the starting point, and then we can easily obtain the comet s whole orbit with one of the versions of the Verlet algorithm. Two quantities can be assumed as the known quantities, the total energy and the angular momentum, which are the constants of motion. We can describe the motion of the comet in the xy plane and choose x 0 = r max, v x0 = 0, y 0 = 0, and v y0 = v min. From well-known results we have that r max = 5.28 10 12 m and v min = 9.13 10 2 m/s. Let us apply the velocity version of the Verlet algorithm to this problem. Then we have x (k+1) = x (k) + τv (k) x + τ 2 x, (8.45) v (k+1) x = v (k) x + τ 2 [ g (k+1) x y (k+1) = y (k) + τv (k) y + τ 2 v (k+1) y = v (k) y + τ 2 [ g (k+1) y 2 g(k) + g (k) x 2 g(k) ], (8.46) y, (8.47) ], (8.48) + g (k) y where the time-step index is given in parentheses as superscripts in order to distinguish it from the x-component or y-component index. The acceleration components are given by g x = κ x r, (8.49) 3 g y = κ y r, (8.50) 3 with r = x 2 + y 2 and κ = GM. We can use more specific units in the numerical calculations, for example, 76 years as the time unit and the semimajor axis of the orbital a = 2.68 10 12 m as the length unit. Then we have r max = 1.97, v min = 0.816, and κ = 39.5. The following program is the implementation of the algorithm outlined above for Halley s comet. // An example to study the time-dependent position and // velocity of Halley's comet via the Verlet algorithm. import java.lang.*; public class Comet { static final int n = 20000, m = 200; public static void main(string argv[]) { double t[] = new double [n]; double x[] = new double [n]; double y[] = new double [n]; double r[] = new double [n]; double vx[] = new double [n]; double vy[] = new double [n]; double gx[] = new double [n]; double gy[] = new double [n]; double h = 2.0/(n-1), h2 = h*h/2, k = 39.478428;

8.3 The Verlet algorithm 235 r 2.0 1.5 1.0 0.5 Fig. 8.1 The distance between Halley s comet and the Sun calculated with the program given in the text. The period of the comet is used as the unit of time, and the semimajor axis of the orbit is used as the unit of distance. 0.0 0.0 0.5 1.0 1.5 2.0 t // Initialization of the problem t[0] = 0; x[0] = 1.966843; y[0] = 0; r[0] = x[0]; vx[0] = 0; vy[0] = 0.815795; gx[0] = -k/(r[0]*r[0]); gy[0] = 0; // Verlet algorithm for the position and velocity for (int i=0; i<n-1; ++i) { t[i+1] = h*(i+1); x[i+1] = x[i]+h*vx[i]+h2*gx[i]; y[i+1] = y[i]+h*vy[i]+h2*gy[i]; double r2 = x[i+1]*x[i+1]+y[i+1]*y[i+1]; r[i+1] = Math.sqrt(r2); double r3 = r2*r[i+1]; gx[i+1] = -k*x[i+1]/r3; gy[i+1] = -k*y[i+1]/r3; vx[i+1]= vx[i]+h*(gx[i+1]+gx[i])/2; vy[i+1]= vy[i]+h*(gy[i+1]+gy[i])/2; } for (int i=0; i<n-m; i+=m) { System.out.println(t[i]); System.out.println(r[i]); System.out.println(); } } } In Fig. 8.1, we show the result for the distance between Halley s comet and the Sun calculated using the above program.

236 Molecular dynamics simulations The accuracy of the velocity version of the Verlet algorithm is reasonable in practice; it is usually accurate enough because the corresponding physical quantities are rescaled according to, for example, the temperature of the system in most molecular dynamics simulations. The accumulated errors are thus removed when the rescaling is applied. More accurate algorithms, such as the Gear predictor corrector algorithm, will be discussed later in this chapter. 8.4 Structure of atomic clusters One of the simplest applications of the Verlet algorithm is in the study of an isolated collection of particles. For an isolated system, there is a significant difference between a small system and a large system. For a small system, the ergodic assumption of statistical mechanics fails and the system may never reach the so-called equilibrium state. However, some parallel conclusions can be drawn on the thermodynamics of small systems against infinite systems (Gross, 2001). For a very large system, standard statistical mechanics applies, even if it is isolated from the environment; the interactions among the particles cause the exchange of energies and drive the system to equilibrium. Very small clusters with just a few particles usually behave like molecules (Sugano and Koizumi, 1998). What is unclear is the behavior of a cluster of an intermediate size, say, about 100 atoms. In this section, we demonstrate the application of the velocity version of the Verlet algorithm in determining the structure and dynamics of clusters of an intermediate size. We will assume that the system consists of N atoms that interact with each other through the Lennard Jones potential [ ( σ ) 12 ( σ ) ] 6 V (r) = 4ε, (8.51) r r where r is the distance between the two particles, and ε and σ are the systemdependent parameters. The force exerted on the ith particle is therefore given by f i = 48ε σ 2 N j i ( ) [ ( ) σ 14 ri r j 1 ( ) ] σ 8. (8.52) r ij 2 r ij In order to simplify the notation, ε is usually used as the unit of energy, ε/k B as the unit of temperature, and σ as the unit of length. Then the unit of time is given by mσ 2 /48ε. Newton s equation for each particle then becomes dimensionless, d 2 r i dt 2 = g i = ( N (r i r j ) j i 1 1 rij 14 2rij 8 ). (8.53)

8.4 Structure of atomic clusters 237 After discretization with the Verlet algorithm, we have r (k+1) i v (k+1) i = r (k) i + τv (k) i + τ 2 2 g(k) i, [ ] (8.54) g (k+1) i + g (k) i. (8.55) = v (k) i + τ 2 The update of the velocity is usually done in two steps in practice. When g (k) i evaluated, the velocity is partially updated with v (k+1/2) i and then updated again when g (k+1) i updated, with v (k+1) i = v (k) i + τ 2 g(k) i (8.56) becomes available after the coordinate is = v (k+1/2) i + τ 2 g(k+1) i. (8.57) This is equivalent to the one-step update but more economical, because it does not require storage of the acceleration of the previous time step. We can then simulate the structure and dynamics of the cluster starting from a given initial position and velocity for each particle. However, several aspects still need special care. The initial positions of the particles are usually taken as the lattice points on a closely packed structure, for example, the face-centered cubic structure. What we want to avoid is the breaking up of the system in the first few time steps, which happens if some particles are too close to each other. Another way to set up a relatively stable initial cluster is to cut out a piece from a bulk simulation. The corresponding bulk simulation is achieved with the application of the periodic boundary condition. The initial velocities of the particles should also be assigned reasonably. A common practice is to assign velocities from the Maxwell distribution W(v x ) e mv2 x /2k BT, (8.58) which can be achieved numerically quite easily with the availability of Gaussian random numbers. The variance in the Maxwell distribution is k B T/m for each velocity component. For example, the following method returns the Maxwell distribution of the velocity for a given temperature. // Method to draw initial velocities from the Maxwell // distribution for a given mass m, temperature T, and // paritcle number N. public static double[] maxwell(doubule m, double T, int N) { int nv = 3*N; int ng = nv-6; double v[] = new double[nv]; double r[] = new double[2]; // Assign a Gaussian number to each velocity component for (int i=0; i<nv-1; i+=2){ r = rang(); is

238 Molecular dynamics simulations g[i] = r[0]; g[i+1] = r[1]; } // Scale the velocity to satisfy the partition theorem } double ek = 0; for (int i=0; i<nv; ++i) ek += v[i]*v[i]; double vs = Math.sqrt(m*ek*nv/(ng*T)); for (int i=0; i<nv; ++i) v[i] /= vs; return v; However, we always have difficulty in defining a temperature if the system is very small, that is, where the thermodynamic limit is not applicable. In practice, we can still call a quantity associated with the kinetic energy of the system the temperature, which is basically a measure of the kinetic energy at each time step, E K = G 2 k BT, (8.59) where G is the total number of independent degrees of freedom in the system. Note that now T is not necessarily a constant and that G is equal to 3N 6, with N being the number of particles in the system, because we have to remove the center-of-mass motion and rotation around the center of mass when we study the structure and dynamics of the isolated cluster. The total energy of the system is given by E = N m i v 2 i 2 N + V (r ij ), (8.60) i> j=1 where the kinetic energy E K is given by the first term on the right-hand side and the potential energy E P by the second. One remarkable effect observed in the simulations of finite clusters is that there is a temperature region where the system fluctuates from a liquid state to a solid state over time. A phase is identified as solid if the particles in the system vibrate only around their equilibrium positions; otherwise they are in a liquid phase. Simulations of clusters have revealed some very interesting phenomena that are unique to clusters of intermediate size (with N 100). We have discussed how to analyze the structural and dynamical information of a collection of particles in Sections 8.1 and 8.2. One can evaluate the mean square of the displacement of each particle. For the solid state, 2 (t) is relatively small and does not grow with time, and the particles are nondiffusive but oscillatory. For the liquid state, 2 (t) grows with time close to the linear relation 2 (t) = 6Dt + 2 (0), where D is the self-diffusion coefficient and 2 (0) is a constant. In a small system, this relation in time may not be exactly linear. One can also measure the specific structure of the cluster from the pair-distribution function g(r) and the orientational correlation function of the bonds. The temperature (or total kinetic energy) can be gradually changed to cool or heat the system.

8.5 The Gear predictor--corrector method 239 The results from simulations on clusters of about 100 particles show that the clusters can fluctuate from a group of solid states with lower energy levels to a group of liquid states that lie at higher energy levels in a specific temperature region, with k B T in the same order as the energy that separates the two groups. This is not expected because the higher-energy-level liquid states are not supposed to have an observable lifetime. However, the statistical mechanics may not be accurate here, because the number of particles is relatively small. More detailed simulations also reveal that the melting of the cluster usually starts from the surface. Interested readers can find more discussions of this topic in Matsuoka et al. (1992) and Kunz and Berry (1993; 1994). 8.5 The Gear predictor--corrector method We discussed multistep predictor corrector methods in Chapter 4 when solving initial-value problems. Another type of predictor corrector method uses the truncated Taylor expansion of the function and its derivatives as a prediction and then evaluates the function and its derivatives at the same time step with a correction given from the restriction of the differential equation. This multivalue predictor corrector scheme was developed by Nordsieck and Gear. Details of the derivations can be found in Gear (1971). We will take a first-order differential equation dr = f(r, t) (8.61) dt as an example and then generalize the method to other types of initial-value problems, such as Newton s equation. For simplicity, we will introduce the rescaled quantities r (l) = τ l d l r l! dt, (8.62) l with l = 0, 1, 2,... Note that r (0) = r. Now if we define a vector x = (r (0), r (1), r (2),...), (8.63) we can obtain the predicted value of x in the next time step x k+1, with t k+1 = (k + 1)τ, from that of the current time step x k, with t k = kτ, from the Taylor expansion for each component of x k+1 : that is, x k+1 = Bx k, (8.64) where B is the coefficient matrix from the Taylor expansion. One can easily show that B is an upper triangular matrix with unit diagonal and first row elements, with the other elements given by ( B ij = j 1 i ) = ( j 1)! i!(j i 1)!. (8.65)

240 Molecular dynamics simulations Note that the dimension of B is (n + 1) (n + 1), that is, x is a vector of dimension n + 1, if the Taylor expansion is carried out up to the term of d n r/dt n. The correction in the Gear method is performed with the application of the differential equation under study. The difference between the predicted value of the first-order derivative r (1) k+1 and the velocity field τf k+1 is δr (1) k+1 = τf k+1 r (1) k+1, (8.66) which would be zero if the exact solution were obtained with τ 0. Note that r (1) k+1 in the above equation is from the prediction of the Taylor expansion. So if we combine the prediction and the correction in one expression, we have x k+1 = Bx k + Cδx k+1, (8.67) where δx k+1 has only one nonzero component, δr (1) k+1, and C is the correction coefficient matrix, which is diagonal with zero off-diagonal elements and nonzero diagonal elements C ii = c i for i = 0, 1,...,n. Here c i are obtained by solving a matrix eigenvalue problem involving B and the gradient of δx k+1 with respect to x k+1. It is straightforward to solve for c i if the truncation in the Taylor expansion is not very high. Interested readers can find the derivation in Gear (1971), with a detailed table listing up to the fourth-order differential equations (Gear 1971, p. 154). The most commonly used Gear scheme for the first-order differential equation is the fifth-order Gear algorithm (with the Taylor expansion carried out up to n = 5), with c 0 = 95/288, c 1 = 1, c 2 = 25/24, c 3 = 35/72, c 4 = 5/48, and c 5 = 1/120. We should point out that the above procedure is not unique to first-order differential equations. The predictor part is identical for any higher-order differential equation. The only change one needs to make is the correction, which is the result of the difference between the prediction and the solution restricted by the equation. In molecular dynamics, we are interested in the solution of Newton s equation, which is a second-order differential equation with d 2 r f(r, t) = dt2 m, (8.68) where f is the force on a specific particle of mass m. We can still formally express the algorithm as where δx k+1 also has only one nonzero element x k+1 = Bx k + Cδx k+1, (8.69) δr (2) k+1 = τ 2 f k+1 /2m r (2) k+1, (8.70) which provides the corrections to all the components of x. Similarly, r (2) k+1 in the above equation is from the Taylor expansion. The corrector coefficient matrix is still diagonal with zero off-diagonal elements and nonzero diagonal elements C ii = c i for i = 0, 1,...,n. Here c i for the second-order differential equation

8.6 Constant pressure, temperature, and bond length 241 have also been worked out by Gear (1971, p. 154). The most commonly used Gear scheme for the second-order differential equation is still the fifth-order Gear algorithm (with the Taylor expansion carried out up to n = 5), with c 0 = 3/20, c 1 = 251/360, c 2 = 1, c 3 = 11/18, c 4 = 1/6, and c 5 = 1/60. The values of these coefficients are obtained with the assumption that the force in Eq. (8.68) does not have an explicit dependence on the velocity, that is, the first-order derivative of r. If it does, c 0 = 3/20 needs to be changed to c 0 = 3/16 (Allen and Tildesley, 1987, pp. 340 2). 8.6 Constant pressure, temperature, and bond length Several issues still need to be addressed when we want to compare the simulation results with the experimental measurements. For example, environmental parameters, such as temperature or pressure, are the result of thermal or mechanical contact of the system with the environment or the result of the equilibrium of the system. For a macroscopic system, we deal with average quantities by means of statistical mechanics, so it is highly desirable for the simulation environment to be as close as possible to a specific ensemble. The scheme adopted in Section 8.4 for atomic cluster systems is closely related to the microcanonical ensemble, which has the total energy of the system conserved. It is important that we also be able to find ways to deal with constant-temperature and/or constant-pressure conditions. We should emphasize that there have been many efforts to model realistic systems with simulation boxes by introducing some specific procedures. However, all these procedures do not introduce any new concepts in physics. They are merely numerical techniques to make the simulation boxes as close as possible to the physical systems under study. Constant pressure: the Andersen scheme The scheme for dealing with a constant-pressure environment was devised by Andersen (1980) with the introduction of an environmental variable, the instantaneous volume of the system, in the effective Lagrangian. When the Lagrange equation is applied to the Lagrangian, the equations of motion for the coordinates of the particles and the volume result. The constant pressure is then a result of the zero average of the second-order time derivative of the volume. The effective Lagrangian of Andersen (1980) is given by L = N m i 2 L2 ẋ 2 i V (Lx ij ) + M 2 2 P 0, (8.71) i> j where the last two terms are added to deal with the constant pressure from the environment. The parameter M can be viewed here as an effective inertia associated with the expansion and contraction of the volume, and P 0 is the external pressure, which introduces a potential energy P 0 to the system under the

242 Molecular dynamics simulations assumption that the system is in contact with the constant-pressure environment. The coordinate of each particle r i is rescaled with the dimension of the simulation box, L = 1/3, because the distance between any two particles changes with L and the coordinates independent of the volume are then given by x i = r i /L, (8.72) which are not directly related to the changing volume. Note that this effective Lagrangian is not the result of any new physical principles or concepts but is merely a method of modeling the effect of the environment in realistic systems. Now if we apply the Lagrange equation to the above Lagrangian, we obtain the equations of motion for the particles and the volume, ẍ i = g i L 2 3 ẋi, (8.73) = P P 0 M, (8.74) where g i = f i /m i and P is given by P = 1 3 ( N m i L 2 ẋ 2 i + r ij f ij ), (8.75) i which can be interpreted as the instantaneous pressure of the system and has a constant average P 0, because 0. After we have the effective equations of motion, the algorithm can be worked out quite easily. We will use i> j X = (x 1, x 2,, x N ), (8.76) G = (f 1 /m 1, f 2 /m 2,, f N /m N ), (8.77) to simplify the notation. If we apply the velocity version of the Verlet algorithm, the difference equations for the volume and the rescaled coordinates are given by k+1 = k + τ k + τ 2 (P k P 0 ), (8.78) 2M ( X k+1 = 1 τ ) 2 k X k + τẋ k + τ 2 G k, (8.79) 2 k 2L k k+1 = k+1/2 + τ(p k+1 P 0 ), (8.80) 2M ( Ẋ k+1 = 1 τ ) k+1 Ẋ k+1/2 + τg k+1, (8.81) 2 k+1 2L k+1 where the values with index k + 1/2 are intermediate values before the pressure and force are updated, with k+1/2 = k + τ(p k P 0 ), (8.82) Ẋ k+1/2 = ( 1 τ k 2 k 2M ) Ẋ k + τg k, (8.83) 2L k+1

8.6 Constant pressure, temperature, and bond length 243 which are usually evaluated immediately after the volume and the coordinates are updated. In practice, we first need to set up the initial positions and velocities of the particles and the initial volume and its time derivative. The initial volume is determined from the given particle number and density, and its initial time derivative is usually set to be zero. The initial coordinates of the particles are usually arranged on a densely packed lattice, for example, a face-centered cubic lattice, and the initial velocities are usually drawn from the Maxwell distribution. One should test the program with different Ms in order to find the value of M that minimizes the fluctuation. A generalization of the Andersen constant-pressure scheme was introduced by Parrinello and Rahman (1980; 1981) to allow the shape of the simulation box to change as well. This generalization is important in the study of the structural phase transition. With the shape of the simulation box allowed to vary, the particles can easily move to the lattice points of the structure with the lowest free energy. The idea of Parrinello and Rahman can be summarized in the Lagrangian L = 1 2 N N m i ẋ T i Bẋ i V (x ij ) + M 2 i> j 3 i, j=1 A 2 ij P 0, (8.84) where y i is the coordinate of the ith particle in the vector representation of the simulation box, = a (b c), with r i = x (1) i a + x (2) i b + x (3) i c. (8.85) Here A is the matrix representation of (a, b, c) in Cartesian coordinates and B = A T A. Instead of a single variable, there are nine variables A ij, with i, j = 1, 2, 3; this allows both the volume size and the shape of the simulation box to change. The equations of motion for x i and A ij can be derived by applying the Lagrange equation to the above Lagrangian. An external stress can also be included in such a procedure (Parrinello and Rahman, 1981). Constant temperature: the Nosé scheme The constant-pressure scheme discussed above is usually performed with an ad hoc constant-temperature constraint, which is done by rescaling the velocities during the simulation to ensure the relation between the total kinetic energy and the desired temperature in the canonical ensemble. This rescaling can be shown to be equivalent to a force constraint up to first order in the time step τ. The constraint method for the constant-temperature simulation is achieved by introducing an artificial force ηp i, which is similar to a frictional force if η is greater than zero or to a heating process if η is less

244 Molecular dynamics simulations than zero. The equations of motion are modified under this force to ṙ i = p i m i, (8.86) v i = f i m i ηv i, (8.87) where p i is the momentum of the ith particle and η is the constraint parameter, which can be obtained from the relevant Lagrange multiplier (Evans et al., 1983) in the Lagrange equations with η = 2 f i v i mi vi 2 = de P/dt Gk B T, (8.88) which can be evaluated at every time step. Here G is the total number of degrees of freedom of the system, and E P is the total potential energy. So one can simulate the canonical ensemble averages from the equations for r i and v i given in Eqs. (8.86) and (8.87). The most popular constant-temperature scheme is that of Nosé (1984a; 1984b), who introduced a fictitious dynamical variable to take the constant-temperature environment into account. The idea is very similar to that of Andersen for the constant-pressure case. In fact, one can put both fictitious variables together to have simulations for constant pressure and constant temperature together. Here we will briefly discuss the Nosé scheme. We can introduce a rescaled effective Lagrangian N m i L = 2 s2 ẋ 2 i V (x ij ) + m s 2 v2 s Gk BT ln s, (8.89) i> j where s and v s are the coordinate and velocity of an introduced fictitious variable that rescales the time and the kinetic energy in order to have the constraint of the canonical ensemble satisfied. The rescaling is achieved by replacing the time element dt with dt/s and holding the coordinates unchanged, that is, x i = r i. The velocity is rescaled with time: ṙ i = sẋ i. We can then obtain the equation of motion for the coordinate x i and the variable s by applying the Lagrange equation. Hoover (1985; 1999) showed that the Nosé Lagrangian leads to a set of equations very similar to the result of the constraint force scheme discussed at the beginning of this subsection. The Nosé equations of motion are given in the Hoover version by ṙ i = v i, (8.90) v i = f i ηv i, (8.91) m i where η is given in a differential form, η = 1 m s ( N p 2 i m i Gk B T and the original variable s, introduced by Nosé, is related to η by ), (8.92) s = s 0 e η(t t 0), (8.93)

8.6 Constant pressure, temperature, and bond length 245 with s 0 as the initial value of s at t = t 0. We can discretize the above equation set easily with either the Verlet algorithm or one of the Gear schemes. Note that the behavior of the parameter s is no longer directly related to the simulation; it is merely a parameter Nosé introduced to accomplish the microscopic processes happening in the constant-temperature environment. We can also combine the Andersen constant-pressure scheme with the Nosé constant-temperature scheme in a single effective Lagrangian L = N m i 2 s2 L 2 ẋ 2 i V (Lx ij ) + m s 2 ṡ2 Gk B T ln s + M 2 2 P 0, (8.94) i> j which is worked out in detail in the original work of Nosé (1984a; 1984b). Another constant-temperature scheme was introduced by Berendsen et al. (1984) with the parameter η given by ( ) η = 1 N m i v 2 i Gk B T, (8.95) m s which can be interpreted as a similar form of the constraint that differs from the Hoover Nosé form in the choice of η. For a review on the subject, see Nosé (1991). Constant bond length Another issue we have to deal with in practice is that for large molecular systems, such as biopolymers, the bond length of a pair of nearest neighbors does not change very much even though the angle between a pair of nearest bonds does. If we want to obtain accurate simulation results, we have to choose a time step much smaller than the period of the vibration of each pair of atoms. This costs a lot of computing time and might exclude the applicability of the simulation to more complicated systems, such as biopolymers. A procedure commonly known as the SHAKE algorithm (Ryckaert, Ciccotti, and Berendsen, 1977; van Gunsteren and Berendsen, 1977) was introduced to deal with the constraint on the distance between a pair of particles in the system. The idea of this procedure is to adjust each pair of particles iteratively to have ( r 2 ij ) d2 ij /d 2 ij (8.96) in each time step. Here d ij is the distance constraint between the ith and jth particles and is the tolerance in the simulation. The adjustment of the position of each particle is performed after each time step of the molecular dynamics simulation. Assume that we are working on a specific pair of particles and for the lth constraint and that we would like to have (r ij + δr ij ) 2 d 2 ij = 0, (8.97)

246 Molecular dynamics simulations where r ij = r j r i is the new position vector difference after a molecular time step starting from r (0) ij and the adjustments for the l 1 constraints have been completed. Here δr ij = δr j δr i is the total amount of adjustment needed for both particles. One can show, in conjunction with the Verlet algorithm, that the adjustments needed are given by m i δr i = g ij r (0) ij = m j δr j, (8.98) with g ij as a parameter to be determined. The center of mass of these two particles remains the same during the adjustment. If we substitute δr i and δr j given in Eq. (8.98), we obtain ( r (0) ij ) 2 g 2 ij + 2µ ijr (0) ij r ij g ij + µ 2 ij ( r 2 ij d2) = 0, (8.99) where µ ij = m i m j /(m i + m j ) is the reduced mass of the two particles. If we keep only the linear term in g ij,wehave g ij = µ ij ( d 2 2r (0) ij ij r r ij) 2, (8.100) ij which is reasonable, because g ij is a small number during the simulation. More importantly, by the end of the iteration, all the constraints will be satisfied as well; all g ij go to zero at the convergence. Equation (8.100) is used to estimate each g ij for each constraint in each iteration. After one has the estimate of g ij for each constraint, the positions of the relevant particles are all adjusted. The adjustments have to be performed several times until the convergence is reached. For more details on the algorithm, see Ryckaert et al. (1977). This procedure has been used in the simulation of chain-like systems as well as of proteins and nucleic acids. Interested readers can find some detailed discussions on the dynamics of proteins and nucleic acids in McCammon and Harvey (1987). 8.7 Structure and dynamics of real materials In this section, we will discuss some typical methods used to extract information about the structure and dynamics of real materials in molecular dynamics simulations. A numerical simulation of a specific material starts with a determination of the interaction potential in the system. In most cases, the interaction potential is formulated in a parameterized form, which is usually determined separately from the available experimental data, first principles calculations, and condition of the system under study. The accuracy of the interaction potential determines the validity of the simulation results. Accurate model potentials have been developed for many realistic materials, for example, the Au (100) surface (Ercolessi, Tosatti, and Parrinello, 1986) and Si 3 N 4 ceramics (Vashishta et al., 1995). In the next

8.7 Structure and dynamics of real materials 247 section, we will discuss an ab initio molecular dynamics scheme in which the interaction potential is obtained by calculating the electronic structure of the system at each particle configuration. We then need to set up a simulation box under the periodic boundary condition. Because most experiments are performed in a constant-pressure environment, we typically use the constant-pressure scheme developed by Andersen (1980) or its generalization (Parrinello and Rahman, 1980; 1981). The size of the simulation box has to be decided together with the available computing resources and the accuracy required for the quantities to be evaluated. The initial positions of the particles are usually assigned at the lattice points of a closely packed structure, for example, a face-centered cubic structure. The initial velocities of the particles are drawn from the Maxwell distribution for a given temperature. The temperature can be changed by rescaling the velocities. This is extremely useful in the study of phase transitions with varying temperature, such as the transition between different lattice structures, glass transition under quenching, or liquid solid transition when the system is cooled down slowly. The advantage of simulation over actual experiment also shows up when we want to observe some behavior that is not achievable experimentally due to the limitations of the technique or equipment. For example, the glass transition in the Lennard Jones system is observed in molecular dynamics simulations but not in the experiments for liquid Ar, because the necessary quenching rate is so high that it is impossible to achieve it experimentally. Studying the dynamics of different materials requires a more general timedependent density density correlation function C(r, r ; t) = ˆρ(r + r, t)ˆρ(r, 0), (8.101) with the time-dependent density operator given by N ˆρ(r, t) = δ[r r i (t)]. (8.102) If the system is homogeneous, we can integrate out r in the time-dependent density density correlation function to reach the van Hove time-dependent distribution function (van Hove, 1954) G(r, t) = 1 ρ N N δ{r [r i (t) r j (0)]}. (8.103) i, j The dynamical structure factor measured in an experiment, for example, neutron scattering, is given by the Fourier transform of G(r, t)as S(k,ω) = ρ e i(ωt k r) G(r, t) dr dt. (8.104) 2π The above equation reduces to the static case with sin kr S(k) 1 = 4πρ [g(r) 1]r 2 dr (8.105) kr

248 Molecular dynamics simulations if we realize that and G(r, 0) = g(r) + δ(r) ρ (8.106) S(k) = S(k,ω) dω, (8.107) where g(r) is the pair distribution discussed earlier in this chapter and S(k) is the angular average of S(k). Here G(r, t) can be interpreted as the probability of observing one of the particles at r at time t if a particle was observed at r = 0 at t = 0. This leads to the numerical evaluation of G(r, t), which is the angular average of G(r, t). If we write G(r, t) in two parts, G(r, t) = G s (r, t) + G d (r, t), (8.108) with G s (r, t) the probability of observing the same particle that was at r = 0at t = 0, and G d (r, t) the probability of observing other particles, we have G d (r, t) 1 ρ N(r, r; t), (8.109) (r, r) where (r, r) 4πr 2 r is the volume of a spherical shell with radius r and thickness r, and N(r, r; t) is the number of particles in the spherical shell at time t. The position of each particle at t = 0 is chosen as the origin in the evaluation of G d (r, t) and the average is taken over all the particles in the system. Note that this is different from the evaluation of g(r), in which we always select a particle position as the origin and take the average over time. We can also take the average over all the particles in the evaluation of g(r). Here G s (r, t) can be evaluated in a similar fashion. Because G s (r, t) represents the probability for a particle to be at a distance r at time t from its original position at t = 0, we can introduce 2n (t) = 1 N [r i (t) r i (0)] 2n = r 2n G s (r, t) dr (8.110) N in the evaluation of the diffusion coefficient with n = 1. The diffusion coefficient can also be evaluated from the autocorrelation function c(t) = v(t) v(0) = 1 N [v i (t) v i (0)], (8.111) N with D = 1 c(t) dt, (8.112) 3c(0) 0 because the velocity of each particle at each time step v i (t) is known from the simulation. The velocity correlation function can also be used to obtain the power spectrum P(ω) = 6 c(t) cos ωt dt, (8.113) πc(0) 0