1 CE 530 Molecular Simulation Lecture 3 David A. Kofke Department of Chemical Engineering SUNY Buffalo

Slides:



Advertisements
Similar presentations
Statistical mechanics
Advertisements

How to setup the initial conditions for a Molecular Dynamic Simulation
Molecular Dynamics at Constant Temperature and Pressure Section 6.7 in M.M.
Probability Distributions CSLU 2850.Lo1 Spring 2008 Cameron McInally Fordham University May contain work from the Creative Commons.
Incorporating Solvent Effects Into Molecular Dynamics: Potentials of Mean Force (PMF) and Stochastic Dynamics Eva ZurekSection 6.8 of M.M.
1 CE 530 Molecular Simulation Lecture 8 Markov Processes David A. Kofke Department of Chemical Engineering SUNY Buffalo
Analyzing the Results of a Simulation and Estimating Errors Jason Cooper.
Simulation.
1 CE 530 Molecular Simulation Lecture 16 Dielectrics and Reaction Field Method David A. Kofke Department of Chemical Engineering SUNY Buffalo
Experimental Evaluation
1 CE 530 Molecular Simulation Lecture 2 David A. Kofke Department of Chemical Engineering SUNY Buffalo
Modern Navigation Thomas Herring
Gravity and Orbits The gravitational force between two objects:
Standard error of estimate & Confidence interval.
CE 400 Honors Seminar Molecular Simulation Prof. Kofke Department of Chemical Engineering University at Buffalo, State University of New York Class 1.
1 CE 530 Molecular Simulation Lecture 7 David A. Kofke Department of Chemical Engineering SUNY Buffalo
Simulation of Random Walk How do we investigate this numerically? Choose the step length to be a=1 Use a computer to generate random numbers r i uniformly.
Advanced methods of molecular dynamics Monte Carlo methods
1 Statistical Mechanics and Multi- Scale Simulation Methods ChBE Prof. C. Heath Turner Lecture 11 Some materials adapted from Prof. Keith E. Gubbins:
1 Physical Chemistry III Molecular Simulations Piti Treesukol Chemistry Department Faculty of Liberal Arts and Science Kasetsart University :
01/24/05© 2005 University of Wisconsin Last Time Raytracing and PBRT Structure Radiometric quantities.
1 Sampling and Sampling Distributions Dr. Jerrell T. Stracener, SAE Fellow Leadership in Engineering EMIS 7370/5370 STAT 5340 : PROBABILITY AND STATISTICS.
Empirical Research Methods in Computer Science Lecture 2, Part 1 October 19, 2005 Noah Smith.
October 14, 2014Computer Vision Lecture 11: Image Segmentation I 1Contours How should we represent contours? A good contour representation should meet.
Estimation of Statistical Parameters
Javier Junquera Molecular dynamics in the microcanonical (NVE) ensemble: the Verlet algorithm.
Molecular Dynamics Simulation Solid-Liquid Phase Diagram of Argon ZCE 111 Computational Physics Semester Project by Gan Sik Hong (105513) Hwang Hsien Shiung.
1 CE 530 Molecular Simulation Lecture 17 Beyond Atoms: Simulating Molecules David A. Kofke Department of Chemical Engineering SUNY Buffalo
Chapter 25 Electric Potential Electrical Potential and Potential Difference When a test charge is placed in an electric field, it experiences a.
Ch 9 pages Lecture 23 – The Hydrogen Atom.
1 CE 530 Molecular Simulation Lecture 15 Long-range forces and Ewald sum David A. Kofke Department of Chemical Engineering SUNY Buffalo
Module 1: Statistical Issues in Micro simulation Paul Sousa.
1 CE 530 Molecular Simulation Lecture 6 David A. Kofke Department of Chemical Engineering SUNY Buffalo
Faculty of Engineering Sciences Department of Basic Science 5/26/20161W3.
For a new configuration of the same volume V and number of molecules N, displace a randomly selected atom to a point chosen with uniform probability inside.
1 Statistical Mechanics and Multi- Scale Simulation Methods ChBE Prof. C. Heath Turner Lecture 14 Some materials adapted from Prof. Keith E. Gubbins:
8. Selected Applications. Applications of Monte Carlo Method Structural and thermodynamic properties of matter [gas, liquid, solid, polymers, (bio)-macro-
Ch 6-1 © 2004 Pearson Education, Inc. Pearson Prentice Hall, Pearson Education, Upper Saddle River, NJ Ostwald and McLaren / Cost Analysis and Estimating.
Statistical Mechanics and Multi-Scale Simulation Methods ChBE
Plan Last lab will be handed out on 11/22. No more labs/home works after Thanksgiving. 11/29 lab session will be changed to lecture. In-class final (1hour):
Chapter 5 Parameter estimation. What is sample inference? Distinguish between managerial & financial accounting. Understand how managers can use accounting.
Statistics Presentation Ch En 475 Unit Operations.
Statistics : Statistical Inference Krishna.V.Palem Kenneth and Audrey Kennedy Professor of Computing Department of Computer Science, Rice University 1.
Molecular Modelling - Lecture 2 Techniques for Conformational Sampling Uses CHARMM force field Written in C++
1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo
7. Metropolis Algorithm. Markov Chain and Monte Carlo Markov chain theory describes a particularly simple type of stochastic processes. Given a transition.
Interacting Molecules in a Dense Fluid
Monte Carlo methods (II) Simulating different ensembles
October 1, 2013Computer Vision Lecture 9: From Edges to Contours 1 Canny Edge Detector However, usually there will still be noise in the array E[i, j],
1 Statistical Mechanics and Multi- Scale Simulation Methods ChBE Prof. C. Heath Turner Lecture 20 Some materials adapted from Prof. Keith E. Gubbins:
MSc in High Performance Computing Computational Chemistry Module Parallel Molecular Dynamics (i) Bill Smith CCLRC Daresbury Laboratory
1 Statistical Mechanics and Multi- Scale Simulation Methods ChBE Prof. C. Heath Turner Lecture 17 Some materials adapted from Prof. Keith E. Gubbins:
1 Molecular Simulations Macroscopic EOS (vdW, PR) Little molecular detail Empirical parameters (  ) Seeking understanding of complex systems Surfactants.
Measurements and Their Analysis. Introduction Note that in this chapter, we are talking about multiple measurements of the same quantity Numerical analysis.
1 CE 530 Molecular Simulation Lecture 21 Histogram Reweighting Methods David A. Kofke Department of Chemical Engineering SUNY Buffalo
Lecture 8: Measurement Errors 1. Objectives List some sources of measurement errors. Classify measurement errors into systematic and random errors. Study.
Statistical Mechanics and Multi-Scale Simulation Methods ChBE
Building Valid, Credible & Appropriately Detailed Simulation Models
+ The Practice of Statistics, 4 th edition – For AP* STARNES, YATES, MOORE Chapter 8: Estimating with Confidence Section 8.1 Confidence Intervals: The.
Computational Physics (Lecture 10) PHY4370. Simulation Details To simulate Ising models First step is to choose a lattice. For example, we can us SC,
Review on Coulomb’s Law and the electric field definition
Systematic errors of MC simulations Equilibrium error averages taken before the system has reached equilibrium  Monitor the variables you are interested.
Computational Physics (Lecture 10)
Accuracy and Precision
Molecular Modelling - Lecture 3
Lecture 2 – Monte Carlo method in finance
Figure 21.1  A cubical box with sides of length d containing an ideal gas. The molecule shown moves with velocity vi. Fig. 21.1, p.641.
Figure 21.1  A cubical box with sides of length d containing an ideal gas. The molecule shown moves with velocity vi. Fig. 21.1, p.641.
CE 530 Molecular Simulation
Presentation transcript:

1 CE 530 Molecular Simulation Lecture 3 David A. Kofke Department of Chemical Engineering SUNY Buffalo

2 Boundary Conditions  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) Click here to view an applet demonstrating PBCClick here

3 Issues with Periodic Boundary Conditions 1.  Minimum image convention Consider only nearest image of a given particle when looking for collision partners Nearest images of colored sphere

4 Issues with Periodic Boundary Conditions 2.  Caution not to miss collisions click here for a bad simulationclick here These two are checked... …but these will collide

5 Issues with Periodic Boundary Conditions 3.  Correlations new artificial correlations supressed long-range correlations  Other issues arise when dealing with longer-range potentials accounting for long-range interactions nearest image not always most energetic splitting of molecules (charges) discuss details later  Other geometries possible any space-filling unit cell hexagonal in 2D truncated octahedrontruncated octahedron in 3D rhombic dodecahedronrhombic dodecahedron in 3D surface of a (hyper)sphere variable aspect ratio useful for solids relieves artificial stresses

6 Implementing Cubic Periodic Boundaries 1.  Details vary with representation of coordinates Box size unit box, coordinates scaled by edge length dr.x = dimensions.x * (r1.x - r2.x); //difference in x coordinates full-size box, coordinates represent actual values Box origin center of box, coordinates range from -L/2 to +L/2 corner of box, coordinates range from 0 to L  Two approaches decision based (“if” statements) function based (rounding (nint), truncation, modulo) relative speed of each approach may vary substantially from one computer platform to another (0,0)

7 Implementing Cubic Periodic Boundaries 2. Central-image codes  Involved in most time-consuming part of simulation  (0,1) coordinates, decision based r.x -= (r.x > 0.0) ? Math.floor(r.x) : Math.ceil(r.x-1.0); //Java syntax examples: -0.2  +0.8; -1.4  +0.4; +0.4  +0.4; +0.6  +0.6; +1.5  +0.5  (0,L) coordinates, decision based r.x -= dimensions.x * ((r.x > 0.0) ? Math.floor(r.x/dimensions.x) : Math.ceil(r.x/dimensions.x-1.0));  (-1/2, 1/2), decision based if(r.x > 0.5) r.x -= 1.0; if(r.x < -0.5) r.x += 1.0; //only first shell examples: -0.2  -0.2; -1.4  -0.4; +0.4  +0.4; +0.6  -0.4; +1.5  +0.5  (-1/2, 1/2), function based r.x -= Math.round(r.x);//nearest integer (r.x must be float, not double)  (0,L), function based r.x %= dimensions.x; if(r.x < 0.0) r.x += dimensions.x;//modulo operator N.B. Most code segments are untested

8 Implementing Cubic Periodic Boundaries 3. Nearest-image codes  Simply apply (-1/2,1/2) central-image code to raw difference! dr.x = r1.x - r2.x; //unit box length if(dr.x > 0.5) dr.x -= 1.0; if(dr.x < -0.5) dr.x += 1.0; dr.x *= dimensions.x;  Or… dr.x = r1.x - r2.x; //true box length dr.x -= dimensions.x * Math.round(dr.x/dimensions.x);  Take care not to lose correct sign, if doing force calculation  Nearest image for non-cubic boundary not always given simply in terms of a central-image algorithm

9 Structure of a Molecular Simulation 1. Initialization Reset block sums Compute block average Compute final results “cycle” or “sweep” “block” Move each atom once (on average) 100’s or 1000’s of cycles Independent “measurement” moves per cycle cycles per block New configuration Add to block sum blocks per simulation

10 Structure of a Molecular Simulation 2. tt m1m1 m2m2 m3m3 m4m4 m5m5 m6m6 m7m7 m8m8 m9m9 m b-1 mbmb m7m7 MD time step or MC cycle  property value m i Simulation block  block average Complete simulation  simulation average  simulation error bar …. Progress of simulation

11 Confidence Limits on Simulation Averages 1.  Given a set of measurements {m i }, for some property M  There exists a distribution of values from which these measurements were sampled  We do not know, a priori, any details of this distribution  We wish to use our measurements {m i } to estimate the mean of the true distribution  Not surprisingly, the best estimate of the mean of the true distribution is given by the mean of the sample  We need to quantify our confidence in the value of this estimate for the mean  We must do this using only the sample data p(M) M 01 {0.01, 0.1, 0.9, 0.06, 0.5, 0.3, 0.02} ? = ( )/7 = 0.27

12 Confidence Limits on Simulation Averages 2.  Imagine repeating this experiment many (infinity) times, each time taking a sample of size n.  If we say “67% of all the sample means lie within [some value] of the true mean.”…  …then [some value] serves as a confidence limit  According to the Central Limit Theorem, the distribution of observations of the sample mean will follow a gaussian, with mean variance  Our confidence limit is then  We can only estimate this using the sample variance p( ) = 0.12 (true value)

13 Confidence Limits on Simulation Averages 3.  Expression for confidence limit (error bar) assumes independent samples successive configurations in a simulation are (usually) not independent block averages are independent for “sufficiently large” blocks  Often 2  is used for error bar (95% confidence interval) when reporting error bars it is good practice to state definition  Confidence limits quantify only statistical errors. Sometimes other sources of error are more significant systematic errors poor sampling (non-ergodic) finite-size effects insufficient equilibration programming errors conceptual errors limitations of the molecular model

14 Simulation Initialization  Need to establish initial values for atom positions and momenta before simulation can begin  Two options use values from end of another simulation generate configuration from scratch  Often an equilibration period is warranted lets system “forget” artificial initial configuration length of period depends on relaxation time of system 5000 cycles typical Relaxation cyclesProduction cycles Re-zero simulation sums

15 Generating an Initial Configuration  Placement on a lattice is a common choice gives rise to “magic” numbers frequently seen in simulations 2D; N = 2n 2 (8, 18, 32, 50, 72, 98, 128, …) 3D, face-center cubic (fcc); N = 4n 3 (32, 128, 256, 500, 864, 1372, 2048,…)  Other options involve “simulation” place at random, then move to remove overlaps randomize at low density, then compress other techniques invented as needed  Orientations done similarly lattice or random, if possible hexagonal inc ompatible with cubic PBC PBC image atoms

16 Initial Velocities  Random direction randomize each component independently randomize direction by choosing point on spherical surface  Magnitude consistent with desired temperature. Choices: Maxwell-Boltzmann: Uniform over (-1/2,+1/2), then scale so that Constant at Same for y, z components  Be sure to shift so center-of-mass momentum is zero  Unnecessary for Monte Carlo simulations (of course)

17 Summary of Simulation Elements  Specification of state  Units and dimensions, scaling  Initialization  Generation of configurations  Property measurement  Confidence limits  Cycles and blocks  Periodic boundaries  Organizing and cycling through atom lists