Molecular Dynamics. The Molecular Dynamics (MD) method for classical systems (not H or He)

Similar documents
Molecular Dynamics 9/6/16

Molecular Dynamics. What to choose in an integrator The Verlet algorithm Boundary Conditions in Space and time Reading Assignment: F&S Chapter 4

What is Classical Molecular Dynamics?

Interatomic Potentials. The electronic-structure problem


Molecular Dynamics Simulations

Neighbor Tables Long-Range Potentials

Advanced Molecular Molecular Dynamics

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

Computer simulation methods (2) Dr. Vania Calandrini

Metropolis, 2D Ising model

Molecular dynamics simulation of Aquaporin-1. 4 nm

Molecular Dynamics. A very brief introduction

André Schleife Department of Materials Science and Engineering

Gear methods I + 1/18

Bioengineering 215. An Introduction to Molecular Dynamics for Biomolecules

Part 2: Molecular Dynamics. Literature History Practical Issues

Scientific Computing II

Multiple time step Monte Carlo

Basics of Statistical Mechanics

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

Introduction to molecular dynamics

Basics of Statistical Mechanics

Scientific Computing II

A MOLECULAR DYNAMICS SIMULATION OF A BUBBLE NUCLEATION ON SOLID SURFACE

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

Computer simulation methods (1) Dr. Vania Calandrini

Coarse-Grained Models!

Classical Equations of Motion

Molecular Dynamics Simulation of Argon

Molecular Dynamics Simulation of a Nanoconfined Water Film

PHY2053 Lecture 11 Conservation of Energy. Conservation of Energy Kinetic Energy Gravitational Potential Energy

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

Department of Chemical Engineering University of California, Santa Barbara Spring Exercise 3. Due: Thursday, 5/3/12

Analysis of the simulation

N-body simulations. Phys 750 Lecture 10

Random Walks A&T and F&S 3.1.2

LECTURE 6 : BASICS FOR MOLECULAR SIMULATIONS - Historical perspective - Skimming over Statistical Mechanics - General idea of Molecular Dynamics -

Speeding up path integral simulations

Molecular computer experiment

Computation of non-bonded interactions: Part 1

Introduction to model potential Molecular Dynamics A3hourcourseatICTP

Scalable, performant, and resilient large-scale applications of molecular process engineering

Monte Carlo Model of Comet Dust

arxiv: v1 [cond-mat.stat-mech] 7 Mar 2019

Intermolecular Forces and Monte-Carlo Integration 열역학특수연구

Example questions for Molecular modelling (Level 4) Dr. Adrian Mulholland

Error Analysis of the Poisson P 3 MForce Field Scheme for Particle-Based Simulations of Biological Systems

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

Developing Monovalent Ion Parameters for the Optimal Point Charge (OPC) Water Model. John Dood Hope College

CS 310 Advanced Data Structures and Algorithms

Non-bonded interactions

On the calculation of solvation free energy from Kirkwood- Buff integrals: A large scale molecular dynamics study

Non-bonded interactions

arxiv: v1 [physics.chem-ph] 4 Feb 2014

MOLECULAR DYNAMICS STUDY OF THE NUCLEATION OF BUBBLE

Molecular Dynamics. Timothy O Sullivan Supervised by Naida Lacevic & John Sader The University of Melbourne

Parallelization of Molecular Dynamics (with focus on Gromacs) SeSE 2014 p.1/29

Basics of molecular dynamics

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

Molecular Dynamics Simulations. Dr. Noelia Faginas Lago Dipartimento di Chimica,Biologia e Biotecnologie Università di Perugia

Physics 115/242 The leapfrog method and other symplectic algorithms for integrating Newton s laws of motion

NUCLEATION IN FINITE SYSTEMS: THEORY AND COMPUTER SIMULATION*t. M. RAO and B. J. BERNE. Chemistry Dept, Columbia University, New York, U.S.A.

Using Molecular Dynamics to Compute Properties CHEM 430

Introduction. Chapter The Purpose of Statistical Mechanics

Comprehensive Nuclear Materials Modelling Section (R. Stoller, Editor) Chapter 128 Molecular Dynamics.

CS115 Computer Simulation Project list

213 Midterm coming up

Molecular Dynamics Simulation of Heat Transfer and Phase Change During Laser Material Interaction

Brownian Motion and Langevin Equations

Multi-Ensemble Markov Models and TRAM. Fabian Paul 21-Feb-2018

Charge equilibration

Constructing a neighbour list

Randomized Selection on the GPU. Laura Monroe, Joanne Wendelberger, Sarah Michalak Los Alamos National Laboratory

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

Why Proteins Fold? (Parts of this presentation are based on work of Ashok Kolaskar) CS490B: Introduction to Bioinformatics Mar.

Exploring the energy landscape

Lecture V: The game-engine loop & Time Integration

Ab initio molecular dynamics and nuclear quantum effects

ICCP Project 2 - Advanced Monte Carlo Methods Choose one of the three options below

CHEM-UA 652: Thermodynamics and Kinetics

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

PHYSICS. Chapter 20 Lecture 4/E FOR SCIENTISTS AND ENGINEERS A STRATEGIC APPROACH RANDALL D. KNIGHT Pearson Education, Inc.

Javier Junquera. Statistical mechanics

A (short) practical introduction to kinetic theory and thermodynamic properties of gases through molecular dynamics

Welcome to Physics 40!

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

CS 188: Artificial Intelligence Spring Announcements

Kobe-Brown Simulation Summer School 2015 Project: DPD Simulation of a Membrane

Department of Chemical Engineering University of California, Santa Barbara Spring Exercise 2. Due: Thursday, 4/19/09

Monte Carlo. Lecture 15 4/9/18. Harvard SEAS AP 275 Atomistic Modeling of Materials Boris Kozinsky

Advanced Molecular Dynamics

Lecture IV: Time Discretization

AUTOMATED TEMPLATE MATCHING METHOD FOR NMIS AT THE Y-12 NATIONAL SECURITY COMPLEX

An Extended van der Waals Equation of State Based on Molecular Dynamics Simulation

Molecular Dynamics Simulation Study of Transport Properties of Diatomic Gases

Comparative study on methodology in molecular dynamics simulation of nucleation

Aspects of nonautonomous molecular dynamics

CE 530 Molecular Simulation

Transcription:

Molecular Dynamics What to choose in an integrator The Verlet algorithm Boundary Conditions in Space and time Reading Assignment: F&S Chapter 4 1 The Molecular Dynamics (MD) method for classical systems (not H or He) Pick particles, masses and forces (or potential). Initialize positions and momentum (boundary conditions in space and time). Solve F = m a to determine r(t), v(t). (the integrator) We need to make time discrete (t k ) not continuous Compute properties along the trajectory Estimate errors. Try to use the simulation to answer physical questions. Alder & Wainwright, J Chem. Phys. 27, 1208 (1957). Hard sphere interaction 2 1

Simple MD Program Initialize (state_now) Initialize verlet (state_now,state_old) Loop step=1,nsteps Find v_and_f ( R_now) Verlet (state_now,state_old) AverageProperties (state_now) Thermostat(state_now) Initialize (state=r,v) Set R=lattice (e.g. cubic lattice) Set V=random vector (mean=0, variance=kt/m) OR read state from previous run 3 Characteristics of simulations. Potentials are highly non-linear, with discontinuous higher derivatives either at the origin or at the box edge. Small changes in accuracy lead to totally different trajectories (the mixing or ergodic property). Long-time information is mostly statistical. We only need low accuracy because the potentials are not very realistic. Universality saves us: a badly integrated system is probably similar to our original system. Not true in the field of non-linear dynamics e.g. in studying the solar system. CPU time is totally dominated by the calculation of forces. We do not want to compute higher-order derivatives of the potential. They might not exist! What is a good measure of computer/algorithm efficiency? real time/computer time or CPU time/step (for fixed N). Memory limits are not too important. Energy conservation is important; roughly equivalent to time-reversal invariance. rule of thumb: allow 0.01k B T fluctuation in the total energy. 4 2

Criteria for an Integrator simplicity (How long does it take to write and debug?) efficiency (How fast to advance a given system?) stability (what is the long-term energy conservation?) reliability (Can it handle a variety of temperatures, densities, potentials?) Compare statistical errors (going as h -1/2 ) with time step errors (going as h p where p=2,3.) to pick the time step: Choose time step so that errors are balanced: statistical error~ systematic errors. 5 The Verlet Algorithm Ubiquitous choice for an integrator: Verlet (or leapfrog) r(t+h) = r(t) + v(t) h + 1/2 a(t) h 2 + b(t) h 3 + O(h 4 ) r(t-h) = r(t) - v(t) h + 1/2 a(t) h 2 - b(t) h 3 + O(h 4 ) Taylor expand Reverse time r(t+h) = 2 r(t) - r(t-h) + a(t) h 2 + O(h 4 ) v(t) = (r(t+h) - r(t-h))/(2h) + O(h 2 ) Add estimate velocities 1 2 3 4 5 6 7 8 9 10 11 12 13 Time reversal invariance is built in: the energy does not drift either up or down. Prove this. 6 3

Verlet Integrator Initialize verlet (state_now,state_old) Find_v_and_f (R_now) r_old r_now-h*v_now+ (h 2 /m)*f_now Verlet (State_now,state_old) r_new 2*r_now-r_old+(h 2 /m)*f_now v_new (r_new-r_old)/(2*h) State_old State_now State_now State_new 7 How to set the time step Adjust to get energy conservation to 1% of kinetic energy. Even if errors are large, you are close to the exact trajectory of a nearby physical system with a different potential. Since we don t really know the potential surface that accurately, this is often satisfactory. Leapfrog algorithm has a problem with round-off error. Use the equivalent velocity-verlet instead: r(t+h) = r(t) +h [ v(t) +(h/2) a(t)] v(t+h/2) = v(t)+(h/2) a(t) v(t+h)=v(t+h/2) + (h/2) a(t+h) 8 4

Higher Order Methods? Statistical error for fixed CPU time. Higher-order does not always mean better! Problem is that potentials are not analytic Systematic error Usually one tries to balance all sources of errors Berendsen 86 Gear methods 9 Quote from Berendsen How accurate a simulation has to be in order to provide reliable statistical results is still a matter of debate. The purpose is never to produce reliable trajectories. Whatever accuracy the forces and the algorithms have, significant deviations from the exact solution will inevitably occur. Also, in the real physical world, individual trajectories have no meaning: in a quantum mechanical sense they do not exist and even classically they become unpredictable in the long run due to the nonisolated character of any real system. So what counts are statistical averages. It seems that very little systematic evaluation of algorithm has been done with this in mind. We have the impression that a noise as high as 10% of the kinetic energy fluctuation is still acceptable, although the accuracy of fluctuations may not be sufficient to obtain thermodynamic data from them. With such a level of inaccuracy the Verlet or leap frog algorithm is always to be preferred. 10 5

Long-term stability of Verlet Verlettrajectory and exact trajectory must remain close together. There exists another Hamiltonian, H *, whose energy is exactly conserved by the Verlet trajectory. H * (P,R) H(P,R) ~O( t 4 ) The true and pseudo energy must remain close to each other for small time-step (so-called symplectic behavior that conserves phase space volume). Hence there are no long-term drifts in the (original) energy. Always use sympletic algorithms- higher order ones exist. 11 Spatial Boundary Conditions Important because spatial scales are limited. What BC can we choose? There are different possibilities: No boundaries; e.g. droplet, protein in vacuum. If droplet has 1 million atoms and surface layer is 5 atoms thick, then 25% of atoms are on the surface. Periodic Boundaries: most popular choice because there are no surfaces (see next slide) but there can still be problems. Simulations on a sphere External potentials Mixed boundaries (e.g. infinite in z, periodic in x and y) 12 6

Why use Periodic Boundary Conditions? Macroscopic systems O(10 23 ) particles. We eliminate surfaces from simulation. Allows us to get at bulk properties with few particles. Applied to solids, liquids, gases, and plasmas. Some finite-size effects remain, but can often be removed with scaling. 13 Periodic Boundary Conditions Is the system periodic or just an infinite array of images? How do you calculate distances in periodic system? 14 7

Periodic distances Minimum Image Convention: Take the closest distance r M = min (r+nl) -3L/2 -L -L/2 0 L/2 L 3L/2 How to handle the tail of the potential: Potential cutoff : V(r)=0 for r > L/2 continuous potential: V c (r) = V(r) - V(r c ) for r < r c. continuous V&F: V c (r) = V(r) - V(r c ) - V(r c )*(r-r c ) for r < r c. Image potential: V I = v(r i -r j + nl) For long-range potential this leads to the Ewald image potential. You need a charge background and convergence factor (more later) 15 LJ Force Computation! Loop over all pairs of atoms. do i=2,natoms do j=1,i-1!compute distance between i and j. r2 = 0 do k=1,ndim dx(k) = r(k,i) - r(k,j)!periodic boundary conditions. if(dx(k).gt. ell2(k)) dx(k) = dx(k)-ell(k) if(dx(k).lt.-ell2(k)) dx(k) = dx(k)+ell(k) r2 = r2 + dx(k)*dx(k) enddo We can do better with the PBC! dx(k)=dx(k)-ell(k)*nint(dx(k)/ell(k))!only compute for pairs inside radial cutoff. if(r2.lt.rcut2) then r2i=sigma2/r2 r6i=r2i*r2i*r2i!shifted Lennard-Jones potential. pot = pot+eps4*r6i*(r6i-1)- potcut!radial force. rforce = eps24*r6i*r2i*(2*r6i-1) do k = 1, ndim force(k,i)=force(k,i) + rforce*dx(k) force(k,j)=force(k,j) - rforce*dx(k) enddo endif enddo enddo Why? 16 8

Complexity of Force Calculations Complexity is defined as how a computer algorithm scales with the number of degrees of freedom (atoms). Number of terms in pair potential is N(N-1)/2 O(N 2 ) For short-range V(r), use neighbor tables to reduce it to O(N). Explicit Neighbor list (Verlet) for systems that move slowly (keep a list and update occassionally.) Bin Sort list (sort particles into bins and sum over neighboring bins) Long-range potentials require more sophisticated treatment: Ewald sums are O(N 3/2 ) Fast Multipole Algorithms are O(N), for very large N. Tree Methods More later 17 Neighbor Lists: O(N 2 ) to O(N) Pair Potentials: If V c (r) = 0 for r > r c (i.e., short-ranged), then Number of computations of the potential is mn, where m is average number of neighbors inside r c and is independent of system size! So, once we have the neighbor table, the calculation is O(N)! Constructing Neighbor Tables: O(N 2 ), must check if particles fall inside each other s radius. only have to reconstruct the table occasionally. 18 9

A Neighbor Table 19 Constructing Neighbor Lists: use skin depth Cut off table at r c + (a skin depth). allows a particle to move a while before new table needed. Keep track of the two largest distances traveled, d 1 and d 2, when d 1 + d 2, get new table. Choose to optimize efficiency As decreases, fewer neighbors and force evaluations. As increases, need to calculate neighbor table less often. Order(N 2 ) operation. Dynamically optimize by fitting t( ) to a polynomial and minimizing. 20 10

Improvements: the Cell Method divide box in cells of size L > r c +. Need only particle s own and neighboring cells. table construction is O(N)! To find neighbors use a linked list Memory is also N (not mn) 21 Next time Potentials for MD HW 1 due on Monday Jan 28. 22 11