CE 400 Honors Seminar Molecular Simulation Prof. Kofke Department of Chemical Engineering University at Buffalo, State University of New York Class 4.

Slides:



Advertisements
Similar presentations
PRAGMA – 9 V.S.S.Sastry School of Physics University of Hyderabad 22 nd October, 2005.
Advertisements

Review Of Statistical Mechanics
Molecular Dynamics at Constant Temperature and Pressure Section 6.7 in M.M.
Lecture 13: Conformational Sampling: MC and MD Dr. Ronald M. Levy Contributions from Mike Andrec and Daniel Weinstock Statistical Thermodynamics.
Monte Carlo Methods and Statistical Physics
Introduction to Statistical Thermodynamics (Recall)
General Concepts for Development of Thermal Instruments P M V Subbarao Professor Mechanical Engineering Department Scientific Methods for Construction.
Ch 11. Sampling Models Pattern Recognition and Machine Learning, C. M. Bishop, Summarized by I.-H. Lee Biointelligence Laboratory, Seoul National.
1 The Monte Carlo method. 2 (0,0) (1,1) (-1,-1) (-1,1) (1,-1) 1 Z= 1 If  X 2 +Y 2  1 0 o/w (X,Y) is a point chosen uniformly at random in a 2  2 square.
Markov Chains 1.
11 - Markov Chains Jim Vallandingham.
CS774. Markov Random Field : Theory and Application Lecture 16 Kyomin Jung KAIST Nov
1 CE 530 Molecular Simulation Lecture 8 Markov Processes David A. Kofke Department of Chemical Engineering SUNY Buffalo
MSEG 803 Equilibria in Material Systems 8: Statistical Ensembles Prof. Juejun (JJ) Hu
Computational statistics 2009 Random walk. Computational statistics 2009 Random walk with absorbing barrier.
MAE 552 – Heuristic Optimization Lecture 6 February 6, 2002.
Simulation.
CE 530 Molecular Simulation
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
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:
Introduction to (Statistical) Thermodynamics
Monte-Carlo simulations of the structure of complex liquids with various interaction potentials Alja ž Godec Advisers: prof. dr. Janko Jamnik and doc.
Free energies and phase transitions. Condition for phase coexistence in a one-component system:
Universal College of Engg. & Technology
1 Lesson 3: Choosing from distributions Theory: LLN and Central Limit Theorem Theory: LLN and Central Limit Theorem Choosing from distributions Choosing.
1 CE 530 Molecular Simulation Lecture 17 Beyond Atoms: Simulating Molecules David A. Kofke Department of Chemical Engineering SUNY Buffalo
CE 400 Honors Seminar Molecular Simulation Prof. Kofke Department of Chemical Engineering University at Buffalo, State University of New York Class 2.
1 CE 530 Molecular Simulation Lecture 18 Free-energy calculations David A. Kofke Department of Chemical Engineering SUNY Buffalo
Basic Monte Carlo (chapter 3) Algorithm Detailed Balance Other points.
Microscopic states (microstates) or microscopic configurations under external constraints (N or , V or P, T or E, etc.)  Ensemble (micro-canonical, canonical,
1 CE 530 Molecular Simulation Lecture 6 David A. Kofke Department of Chemical Engineering SUNY Buffalo
Monte Carlo Methods Versatile methods for analyzing the behavior of some activity, plan or process that involves uncertainty.
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-
Markov Chain Monte Carlo and Gibbs Sampling Vasileios Hatzivassiloglou University of Texas at Dallas.
1 CE 530 Molecular Simulation Lecture 22 Chain-Molecule Sampling Techniques David A. Kofke Department of Chemical Engineering SUNY Buffalo
Statistical Mechanics and Multi-Scale Simulation Methods ChBE
Suppressing Random Walks in Markov Chain Monte Carlo Using Ordered Overrelaxation Radford M. Neal 발표자 : 장 정 호.
1 Statistical Mechanics and Multi- Scale Simulation Methods ChBE Prof. C. Heath Turner Lecture 25 Some materials adapted from Prof. Keith E. Gubbins:
1 CE 530 Molecular Simulation Lecture 10 Simple Biasing Methods David A. Kofke Department of Chemical Engineering SUNY Buffalo
Lecture 2 Molecular dynamics simulates a system by numerically following the path of all particles in phase space as a function of time the time T must.
ChE 452 Lecture 17 Review Of Statistical Mechanics 1.
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.
Monte Carlo method: Basic ideas. deterministic vs. stochastic In deterministic models, the output of the model is fully determined by the parameter values.
Interacting Molecules in a Dense Fluid
An Introduction to Monte Carlo Methods in Statistical Physics Kristen A. Fichthorn The Pennsylvania State University University Park, PA
Monte Carlo in different ensembles Chapter 5
Javier Junquera Importance sampling Monte Carlo. Cambridge University Press, Cambridge, 2002 ISBN Bibliography.
1 Statistical Mechanics and Multi- Scale Simulation Methods ChBE Prof. C. Heath Turner Lecture 17 Some materials adapted from Prof. Keith E. Gubbins:
Other Partition Functions
1 Statistical Mechanics and Multi- Scale Simulation Methods ChBE Prof. C. Heath Turner Lecture 19 Some materials adapted from Prof. Keith E. Gubbins:
Introduction to Sampling Methods Qi Zhao Oct.27,2004.
1 CE 530 Molecular Simulation Lecture 21 Histogram Reweighting Methods David A. Kofke Department of Chemical Engineering SUNY Buffalo
Statistical Mechanics and Multi-Scale Simulation Methods ChBE
Chapter 6: Basic Methods & Results of Statistical Mechanics
Kevin Stevenson AST 4762/5765. What is MCMC?  Random sampling algorithm  Estimates model parameters and their uncertainty  Only samples regions of.
Computational Physics (Lecture 10) PHY4370. Simulation Details To simulate Ising models First step is to choose a lattice. For example, we can us SC,
Systematic errors of MC simulations Equilibrium error averages taken before the system has reached equilibrium  Monitor the variables you are interested.
The Monte Carlo Method/ Markov Chains/ Metropolitan Algorithm from sec in “Adaptive Cooperative Systems” -summarized by Jinsan Yang.
Boltzmann statistics, average values
Advanced Statistical Computing Fall 2016
Overview of Molecular Dynamics Simulation Theory
Markov chain monte carlo
Common Types of Simulations
CE 530 Molecular Simulation
Presentation transcript:

CE 400 Honors Seminar Molecular Simulation Prof. Kofke Department of Chemical Engineering University at Buffalo, State University of New York Class 4

2 Statistical Mechanics Theoretical basis for derivation of macroscopic behaviors from microscopic origins Two fundamental postulates of equilibrium statistical mechanics –microstates of equal energy are equally likely –time average is equivalent to ensemble average Formalism extends postulates to more useful situations –thermal, mechanical, and/or chemical equilibrium with reservoirs systems at constant T, P, and/or m –yields new formulas for probabilities of microstates derivation invokes thermodynamic limit of very large system Macroscopic observables given as a weighted sum over microstates –dynamic properties require additional formalism

3 Ensembles Definition of an ensemble –Collection of microstates subject to at least one extensive constraint “microstate” is specification of all atom positions and momenta fixed total energy, total volume, and/or total number of molecules unconstrained extensive quantities are represented by full range of possible values –Probability distribution p describing the likelihood of observing each state, or the weight that each state has in ensemble average Example: Some members of ensemble of fixed N –isothermal-isobaric (TPN) all energies and volumes represented Low-probability state

4 Commonly Encountered Ensembles

5 Markov Processes 1. Stochastic process –movement through a series of well-defined states in a way that involves some element of randomness –for our purposes,“states” are microstates in the governing ensemble Markov process –stochastic process that has no memory –selection of next state depends only on current state, and not on prior states –process is fully defined by a set of transition probabilities pij  ij = probability of selecting state j next, given that presently in state i. Transition-probability matrix  collects all  ij Application –we can visit the states of a system in proportion to their probability by application of a Markov process

6 Transition-Probability Matrix Example –system with three states Requirements of transition-probability matrix –all probabilities non-negative, and not greater than unity –sum of each row is unity –probability of staying in present state may be non-zero If in state 1, will move to state 3 with probability 0.4 If in state 1, will stay in state 1 with probability 0.1 Never go to state 3 from state 2

7 Example Here’s a transition-probability matrix for an eight-state system Let’s do a walk based on it…

8 Distribution of State Occupancies Consider process of repeatedly moving from one state to the next, choosing each subsequent state according to  –1  2  2  1  3  2  2  3  3  1  2  3  etc. Histogram the occupancy number for each state –n 1 = 3  1 = 0.33 –n 2 = 5  2 = 0.42 –n 3 = 4  3 = 0.25 After very many steps, a limiting distribution emerges Click here for an applet that demonstrates a Markov process and its approach to a limiting distributionClick here 1 2 3

9 Microscopic Reversibility The limiting distribution and the transition probabilities obey the principle of microscopic reversibility, a.k.a., detailed balance –Loosely: “net flow from state i to state j equals net flow from state j to state i” Consider the example –Limiting distribution:

10 Application? How does this apply to molecular simulation? Statistical mechanics provides the limiting distribution –Canonical ensemble The Markov process relates the limiting distribution and the transition probabilities What is needed to tie these together? How can it be done?

11 Metropolis Algorithm Standard method to form Markov process in molecular simulation –Metropolis, Rosenbluth, Rosenbluth, Teller and Teller, Journal of Chemical Physics, 21, 1087 (1953). Transition probabilities formulated to yield desired limiting distribution Each Markov transition is a two-step process –From state i select a trial state j with probability T ij –Accept trial with probability  Generate a uniform random deviate r on (0,1) If r < , accept, otherwise reject and use previous state as next one –With this recipe –Show that this obeys detailed balance

12 Monte Carlo Simulation MC techniques applied to molecular simulation Almost always involves a Markov process –move to a new configuration from an existing one according to a well-defined transition probability Simulation procedure –generate a new “trial” configuration by making a perturbation to the present configuration –accept the new configuration based on the ratio of the probabilities for the new and old configurations, according to the Metropolis algorithm –if the trial is rejected, the present configuration is taken as the next one in the Markov chain –repeat this many times, accumulating sums for averages State k State k+1

13 Trial Moves A great variety of trial moves can be made Basic selection of trial moves is dictated by choice of ensemble –almost all MC is performed at constant T no need to ensure trial holds energy fixed –must ensure relevant elements of ensemble are sampled all ensembles have molecule displacement, rotation; atom displacement isobaric ensembles have trials that change the volume grand-canonical ensembles have trials that insert/delete a molecule Significant increase in efficiency of algorithm can be achieved by the introduction of clever trial moves –reptation, crankshaft moves for polymers –multi-molecule movements of associating molecules –many more

14 General Form of Algorithm Move each atom once (on average) 100’s or 1000’s of cycles Independent “measurement” New configuration Initialization Reset block sums Compute block average Compute final results “cycle” or “sweep” “block” moves per cycle cycles per block Add to block sum blocks per simulation New configuration Entire Simulation Monte Carlo Move Select type of trial move each type of move has fixed probability of being selected Perform selected trial move Decide to accept trial configuration, or keep original

15 Displacement Trial Move 1. Specification Gives new configuration of same volume and number of molecules Basic trial: –

16 Gives new configuration of same volume and number of molecules Basic trial: –displace a randomly selected atom to a point chosen with uniform probability inside a cubic volume of edge 2d centered on the current position of the atom Select an atom at random Displacement Trial Move 1. Specification

17 Displacement Trial Move 1. Specification Gives new configuration of same volume and number of molecules Basic trial: –displace a randomly selected atom to a point chosen with uniform probability inside a cubic volume of edge 2d centered on the current position of the atom 22 Consider a region about it

18 Gives new configuration of same volume and number of molecules Basic trial: –displace a randomly selected atom to a point chosen with uniform probability inside a cubic volume of edge 2d centered on the current position of the atom Consider a region about it Displacement Trial Move 1. Specification

19 Gives new configuration of same volume and number of molecules Basic trial: –displace a randomly selected atom to a point chosen with uniform probability inside a cubic volume of edge 2d centered on the current position of the atom Move atom to point chosen uniformly in region Displacement Trial Move 1. Specification

20 Gives new configuration of same volume and number of molecules Basic trial: –displace a randomly selected atom to a point chosen with uniform probability inside a cubic volume of edge 2d centered on the current position of the atom Consider acceptance of new configuration ? Displacement Trial Move 1. Specification

21 Gives new configuration of same volume and number of molecules Basic trial: –displace a randomly selected atom to a point chosen with uniform probability inside a cubic volume of edge 2d centered on the current position of the atom Limiting probability distribution –canonical ensemble –for this trial move, probability ratios are the same in other common ensembles, so the algorithm described here pertains to them as well Examine underlying transition probabilities to formulate acceptance criterion ? Displacement Trial Move 1. Specification

22 2. Analysis of Trial Probabilities Detailed specification of trial moves and probabilities Forward-step trial probability v = (2  d Reverse-step trial probability  is formulated to satisfy detailed balance

23 3. Analysis of Detailed Balance Detailed balance Forward-step trial probability Reverse-step trial probability ii  ij jj  ji = Limiting distribution

24 3. Analysis of Detailed Balance Detailed balance Forward-step trial probability Reverse-step trial probability ii  ij jj  ji = Limiting distribution

25 3. Analysis of Detailed Balance Detailed balance Forward-step trial probability Reverse-step trial probability ii  ij jj  ji = Acceptance probability

26 4a. Examination of Java Code public void thisTrial(Phase phase) { double uOld, uNew; if(phase.atomCount==0) {return;} //no atoms to move int i = (int)(rand.nextDouble()*phase.atomCount); //pick a random number from 0 to N-1 Atom a = phase.firstAtom(); for(int j=i; --j>=0; ) {a = a.nextAtom();} //get ith atom in list uOld = phase.potentialEnergy.currentValue(a); //calculate its contribution to the energy a.displaceWithin(stepSize); //move it within a local volume phase.boundary().centralImage(a.coordinate.position()); //apply PBC uNew = phase.potentialEnergy.currentValue(a); //calculate its new contribution to energy if(uNew < uOld) { //accept if energy decreased nAccept++; return; } if(uNew >= Double.MAX_VALUE || //reject if energy is huge or doesn’t pass test Math.exp(-(uNew-uOld)/parentIntegrator.temperature) < rand.nextDouble()) { a.replace(); //...put it back in its original position return; } nAccept++; //if reached here, move is accepted } Have a look at a simple MC simulation appletsimple MC simulation applet

27 4b. Examination of Java Code Atom methods Space.Vector methods public void setRandomCube() { x = random.nextDouble() - 0.5; y = random.nextDouble() - 0.5; } public void PEa1Tv1(double a1, Vector u) { x += a1*u.x; y += a1*u.y;} public void E(Vector u) {x = u.x; y = u.y;} public final void displaceWithin(double d) { workVector.setRandomCube(); displaceBy(d,workVector);} public final void displaceBy(double d, Space.Vector u) { rLast.E(r); translateBy(d,u);} public final void translateBy(double d, Space.Vector u) {r.PEa1Tv1(d,u);} public final void replace() {r.E(rLast);}

28 5. Tuning Size of step is adjusted to reach a target rate of acceptance of displacement trials –typical target is 50% –for hard potentials target may be lower (rejection is efficient) Large step leads to less acceptance but bigger moves Small step leads to less movement but more acceptance

29 Assignments Summary 0. Send me an –completed 1. Construct and deploy a simple molecular simulation applet –completed 2. Find and review an article from the literature that applies molecular simulation –10/9: Notify me of paper to examine –10/16: Present 15-minute oral summary to class 3. Design, construct, test and deploy a molecular simulation –Must demonstrate a non-trivial collective behavior –Incorporation of game-like features is encouraged –10/23: Specification of simulation project due; prepare one design and an alternate in case of project duplication. In-class discussion of needed components by each group to complete their project. –12/4: Present and explain applets in class

30 In-class Exercise Construct a NPT Monte Carlo simulation –Lennard-Jones potential –Slider to adjust pressure –Meter and box display to show density –Measure density for several pressures –Use Lennard-Jones system of units Construct a NVT Monte Carlo simulation –NSelector to select density –MeterPressureSoft and box display to show density –Measure pressure for several densities Compare results. Do pressure/density data agree?