1 Introduction to molecular dynamics Yves Lansac Université François Rabelais, Tours, France Visiting MSE, GIST for the summer
Molecular Simulation 2 Molecular simulation is a computational experiment. - Conducted on a molecular model - Done under various external constraints Number of atoms N (10 10 6 or more) Temperature T Pressure P Many microscopic configurations are generated; Averages are taken to perform measurements to give observables. - Thermodynamic properties: energy, temperature, pressure, diffusion, etc. - Structural quantities: pair correlation functions Molecular simulation has the character of both theory & experiments. Applicable to a wide range of molecules and systems (gases, polymers, metals, biological systems, etc.)
Examples of simulation (simple molecular models) 3 Bundle formation in mixture of short dsdna basic protamines MD NVT (3ns) - - - - - - - - + + + + + + + counterions + - Correlations between adsorbed protamines induce attractive interaction between DNA
Colloidal particles 4 only homogeneous phase? micelles lamellar phase pressure increasing inverted micelles repulsive potential can induce aggregation
Molecular Model 5 Fundamental to everything is the Schrödinger equation - Too expensive to solve for large systems Born-Oppenheimer approximation - Electrons move much faster than nuclei. - Usually nuclei are heavy enough to treat classically. Classical molecular models - Atomistic model : atom positions (balls) + interactions between atoms (springs) CH 3 -CH 2 -CH 3 - Idealized models : include only the most important qualitative features (shape) - - - - - - - - (chain & charges)
Potentials of Interaction = Force Field 6 Potential energy is expressed with simple empirical formula. Bonded interactions Non-bonded interactions (pairwise) U str stretch U bend bend U vdw van der Waals + - + - Repulsion Attraction U tors torsion U el electrostatic + - + U cross cross stretch-bend, etc.
An Example of Force Field 7 Lennard-Jones (LJ) U ij σ ij (very long-ranged) r ij ε ij
Force Field Parameters 8 Force fields may have thousands of independent parameters. Without good parameters, you can get totally useless results. Parameters are found by fitting to experiments or QM calculations. Parameters for interactions between atoms of different types - No ambiguity for Coulomb interaction - For van der Waals potentials (e.g., LJ) it is not clear what to do. Lorentz-Berthelot is a widely used choice.
Microscopic Configurations 9 Full specification of microstate of the system is given by the values of all positions r N and all momenta p N of all atoms. Γ = (p N,r N ) = point in phase space (6N-space dimensions) - We can sample only a small subset of all microstates satisfying the few constraints (e.g. fixed T or P) imposed. - Averages over microstates must give reliable equilibrium thermodynamic quantities. Γ Two methods to generate microstate contributing significantly - Monte Carlo (MC) : stochastic method (i.e. based on random number) following an importance-weighted random walk in phase space (only 3N-positions) - Molecular dynamics (MD) : deterministic method (i.e. based on integration of the equations of motion) following the true dynamics of the system to generate microstates) Ensemble average (MC) Time average (MD)
Equations of Motion 10 System of N atoms (same mass m) with cartesian coordinates r N = {r 1, r 2,, r N } interacting through the potential energy U(r N ) (System of N 2 nd -order differential equations) F Atomic momenta p N = {p 1, p 2,, p N } (System of 2N 1 st -order differential equations)
Integration Algorithms 11 Features of a good integrator minimal need to compute forces (a very expensive calculation) good stability for large time steps good accuracy conserves energy (noise less important than drift) The true (continuum) equations of motion display certain symmetries. time-reversible area-preserving (symplectic)
Velocity Verlet Algorithm 12 Forward Euler (irreversible integrator) well known to be bad (energy drift) unit mass Velocity Verlet Algorithm Implemented in stages - Evaluate current force - Compute r at new time - Add current-force term to velocity (gives v at half-time step) - Compute new force - Add new-force term to velocity
Velocity Verlet Algorithm. 2. Flow Diagram 13 t-δt t t+δt r v Given current position, velocity, and force F Schematic from Allen & Tildesley, Computer Simulation of Liquids
Velocity Verlet Algorithm. 2. Flow Diagram 14 t-δt t t+δt r v Compute new position F Schematic from Allen & Tildesley, Computer Simulation of Liquids
Velocity Verlet Algorithm. 2. Flow Diagram 15 t-δt t t+δt r v Compute velocity at half step F Schematic from Allen & Tildesley, Computer Simulation of Liquids
Velocity Verlet Algorithm. 2. Flow Diagram 16 t-δt t t+δt r v Compute force at new position F Schematic from Allen & Tildesley, Computer Simulation of Liquids
Velocity Verlet Algorithm. 2. Flow Diagram 17 t-δt t t+δt r v Compute velocity at full step F Schematic from Allen & Tildesley, Computer Simulation of Liquids
Velocity Verlet Algorithm. 2. Flow Diagram 18 t-2δt t-δt t t+δt r v Advance to next time step, repeat F Schematic from Allen & Tildesley, Computer Simulation of Liquids
Time Step & Ensemble 19 Time step (δt) - If δt is too small : Simulation should run long enough to have meaningful observables. - If δt is too large : System will be unstable. - Rule : δt should be 10~100 times smaller than the fastest motion in the system. (often bond stretching 1-100 ps) Molecular dynamics in other thermodynamic ensembles - Natural ensemble sampled by MD is NVE. - We often want to study a system at a fixed T (NVT) or P (NPT). - Two main possibilities (thermostat, similar for barostat) Stochastic collisions (periodic rescaling of atomic velocity) (Andersen) Modification of the equations of motion (thermostat of the system) (Nose-Hoover)
Generating an Initial Configuration 20 Placement on a lattice is a common choice Other options involve simulation - place at random, then move to remove overlaps - randomize at low density, then compress - other techniques invented as needed hexagonal Orientations done similarly - lattice or random, if possible
Initial Velocities 21 Random direction randomize each component independently randomize direction by choosing point on spherical surface Magnitude consistent with desired temperature. e.g. Maxwell-Boltzmann
Simulation Flow 22 Progress of simulation t δt MD time step m i = instantaneous value of an observable. m 1m2 m 3 m 5m6 m 7 m 9 m b-1 m 4 m8 Simulation block Block average m b. Complete simulation n independent values Simulation average & error
Boundary Conditions 23 Impractical to contain system with a real boundary Enhances finite-size effects Artificial influence of boundary on system properties Instead surround with replicas of simulated system Periodic Boundary Conditions (PBC) Minimum image convention Consider only nearest image of a given particle when looking for interactions Nearest images of colored sphere
Finding Neighbors Efficiently 24 Evaluation of all pair interactions is an O(N 2 ) calculation. Very expensive for large systems Not all interactions are relevant Potential attenuated or even truncated beyond some distance (e.g. vdw) Two efficient methods to locate neighbors of any molecule - Verlet neighbor list - Cell list r c
Verlet Neighbor List 25 Maintain a list of neighbors - Set neighbor cutoff radius as potential cutoff plus a skin Update list whenever a molecule travels a distance greater than the skin thickness Energy calculation is O(N). Neighbor list update is O(N 2 ). - but done less frequently r n r c
Cell List 26 The volume (box) is partitioned into a set of cells. Each cell keeps a list of the atoms inside it. Each cell keeps a list of its neighboring cells. r c r c = potential cutoff
Electrostatics 27 Electrostatics are long-ranged interactions. Cutoff introduces artifacts. A charge interacts - with all the other charges in the box; and - with all the charges in the periodic images of the box For efficient calculations: - Ewald method [O(N 3/2 )] - Particle Mesh Ewald - Particle-Particle Particle-Mesh [O(NlogN)] rapidly decreasing in real space cutoff (like vdw) rapidly decreasing in reciprocal space Interpolation of the charges on a grid & FFT
Available Simulation Codes 28 LAMMPS (Sandia National Lab) http://lammps.sandia.gov/ NAMD (and VMD) (Theoretical and Computational Biophysics Group) http://www.ks.uiuc.edu/research/namd/ DL_POLY (v4) Molecular Simulation Package Daresbury Laboratory by I.T. Todorov and W. Smith http://www.stfc.ac.uk/cse/randd/ccg/software/dl_poly/25526.aspx ESPResSo (Institute for Computational Physics of the University of Stuttgart) Extensible Simulation Package for the Research on Soft matter http://espressomd.org/ GROMACS (GROningen MAchine for Chemical Simulations) Biophysical Chemistry department of University of Groningen http://www.gromacs.org http://www.scalalife.eu/ (scalable Software Services for Life Sciences)
References David Kofke, Department of Chemical Engineering SUNY Buffalo http://www.etomica.org/app/ Java Applets (Etomica) Link to lecture notes on molecular simulations (several slides of this introduction were borrowed or adapted from D. Kofke) 29 Understanding Molecular Simulation: From Algorithms to Applications (2002) D. Frenkel and B. Smit Computer Simulation of Liquids (1989) M. Allen and D. Tildesley Molecular Modelling: Principles and Applications (2001) A. R. Leach Thank you very much!