Monte Carlo method: Basic ideas. deterministic vs. stochastic In deterministic models, the output of the model is fully determined by the parameter values.

Slides:



Advertisements
Similar presentations
Time averages and ensemble averages
Advertisements

PRAGMA – 9 V.S.S.Sastry School of Physics University of Hyderabad 22 nd October, 2005.
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
1 CE 530 Molecular Simulation Lecture 8 Markov Processes David A. Kofke Department of Chemical Engineering SUNY Buffalo
The Calculation of Enthalpy and Entropy Differences??? (Housekeeping Details for the Calculation of Free Energy Differences) first edition: p
Lecture 3 The Debye theory. Gases and polar molecules in non-polar solvent. The reaction field of a non-polarizable point dipole The internal and the direction.
MAE 552 – Heuristic Optimization Lecture 6 February 6, 2002.
Monte Carlo Methods in Partial Differential Equations.
Lecture II-2: Probability Review
Gravity and Orbits The gravitational force between two objects:
Introduction to Monte Carlo Methods D.J.C. Mackay.
1 CE 530 Molecular Simulation Lecture 7 David A. Kofke Department of Chemical Engineering SUNY Buffalo
Advanced methods of molecular dynamics Monte Carlo methods
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.
1 Physical Chemistry III Molecular Simulations Piti Treesukol Chemistry Department Faculty of Liberal Arts and Science Kasetsart University :
Free energies and phase transitions. Condition for phase coexistence in a one-component system:
Javier Junquera Molecular dynamics in the microcanonical (NVE) ensemble: the Verlet algorithm.
Statistical Thermodynamics CHEN 689 Fall 2015 Perla B. Balbuena 240 JEB
TUTORIAL no. 2 Monte Carlo simulations: Lennard Jones gas G. Lattanzi Università degli studi di Bari “Aldo Moro” Trieste, July 10 th, 2012 CECAM school.
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
Chicago, July 22-23, 2002DARPA Simbiosys Review 1 Monte Carlo Particle Simulation of Ionic Channels Trudy van der Straaten Umberto Ravaioli Beckman Institute.
Basic Monte Carlo (chapter 3) Algorithm Detailed Balance Other points.
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
Monte Carlo Methods in Statistical Mechanics Aziz Abdellahi CEDER group Materials Basics Lecture : 08/18/
Integrals  In Chapter 2, we used the tangent and velocity problems to introduce the derivative—the central idea in differential calculus.  In much the.
Simulated Annealing.
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.
Chapter 24 Gauss’s Law. Let’s return to the field lines and consider the flux through a surface. The number of lines per unit area is proportional to.
1 Statistical Mechanics and Multi- Scale Simulation Methods ChBE Prof. C. Heath Turner Lecture 14 Some materials adapted from Prof. Keith E. Gubbins:
The Ideal Monatomic Gas. Canonical ensemble: N, V, T 2.
8. Selected Applications. Applications of Monte Carlo Method Structural and thermodynamic properties of matter [gas, liquid, solid, polymers, (bio)-macro-
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):
1 M.Sc. Project of Hanif Bayat Movahed The Phase Transitions of Semiflexible Hard Sphere Chain Liquids Supervisor: Prof. Don Sullivan.
 We just discussed statistical mechanical principles which allow us to calculate the properties of a complex macroscopic system from its microscopic characteristics.
Time-dependent Schrodinger Equation Numerical solution of the time-independent equation is straightforward constant energy solutions do not require us.
Ch 22 pp Lecture 2 – The Boltzmann distribution.
Molecular Modelling - Lecture 2 Techniques for Conformational Sampling Uses CHARMM force field Written in C++
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
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
The Boltzmann Distribution allows Calculation of Molecular Speeds Mathematically the Boltzmann Distribution says that the probability of being in a particular.
Review Session BS123A/MB223 UC-Irvine Ray Luo, MBB, BS.
Generalized van der Waals Partition Function
Monte Carlo methods (II) Simulating different ensembles
Monatomic Crystals.
Javier Junquera Importance sampling Monte Carlo. Cambridge University Press, Cambridge, 2002 ISBN Bibliography.
Review Of Statistical Mechanics Continued
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 Molecular Simulations Macroscopic EOS (vdW, PR) Little molecular detail Empirical parameters (  ) Seeking understanding of complex systems Surfactants.
1 Chapter 8: Model Inference and Averaging Presented by Hui Fang.
Statistical Mechanics and Multi-Scale Simulation Methods ChBE
Basic Monte Carlo (chapter 3) Algorithm Detailed Balance Other points non-Boltzmann sampling.
Lecture 14: Advanced Conformational Sampling Dr. Ronald M. Levy Statistical Thermodynamics.
Electrostatic field in dielectric media When a material has no free charge carriers or very few charge carriers, it is known as dielectric. For example.
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.
Computational Physics (Lecture 10)
Overview of Molecular Dynamics Simulation Theory
Haim Kaplan and Uri Zwick
Common Types of Simulations
Presentation transcript:

Monte Carlo method: Basic ideas

deterministic vs. stochastic In deterministic models, the output of the model is fully determined by the parameter values and the initial conditions Stochastic models possess some inherent randomness. The same set of parameter values and initial conditions will lead to an ensemble of different outputs 2

Molecular Dynamics and Monte Carlo Molecular dynamics (MD) is a deterministic method that solves the equations of motion to predict positions and velocities of all particles of a system. The statistical treatment of the information gained in this way allows predictions of thermodynamic and transport properties Monte Carlo is a stochastic method in which the configurations of a system are sampled, in non- chronological order. The statistical treatment of the information gained in this way allows predictions of thermodynamic properties but not of transport properties 3

A crude approach to Monte Carlo Suppose we begin with an empty simulation box of fixed volume and then randomly choose a position for each molecule in the box until achieving the desired density. We then “measure” the instantaneous values of the properties of interest. The experiment is repeated many times. If the temperature is constant, the probability of each state is: 4

A crude approach to Monte Carlo In high-density systems, it is very likely this simple way of placing molecules will cause overlaps. In the hard core (e.g., hard spheres) intermolecular potential, overlaps lead to infinite configuration energy. Therefore, the probability of observing a microscopic state with overlap is zero. 5

A crude approach to Monte Carlo In high-density systems, it is very likely this simple way of placing molecules will cause overlaps. In soft core intermolecular potentials (e.g., Lennard- Jones), overlaps lead to very high configuration energy. Therefore, the probability of observing a microscopic state with overlap is nearly zero. 6

A crude approach to Monte Carlo In summary: Many of the generated configurations have extremely low (or zero) probability of occurrence and, therefore, contribute little to computing the average. Such sampling approach is inefficient for computing average thermodynamic properties. Another problem: how to compute the denominator, as it requires adding the Boltzmann factor of all configurations? 7

Importance sampling Alternative: Devise procedures that sample more frequently the states that matter most to the average properties. This is called importance sampling. 8

Importance sampling Importance sampling in the canonical ensemble: In a box of fixed volume, place the desired number of molecules in an arrangement without overlaps, for example, according to a lattice (crystal) structure. Develop other configurations with a bias towards lower energy states to try avoid highly unlikely configurations. Note: configurations with higher energy will be possible – but there will be a bias towards lower energy. This introduces a bias in the sampling procedure. When computing averages, it is necessary to account for this bias. 9

Importance sampling Importance sampling in the canonical ensemble: There are several ways to devise schemes to introduce biases and accounting for them when computing average thermodynamic properties. The most widely used is the Metropolis scheme originally published in 1953 – in the early stage of the development of electronic computers. N. Metropolis, A.W. Rosenbluth, M.N. Rosenbluth, A.H. Teller, E. Teller, J. Chem. Phys. 21, 1087 (1953) 10

Markov chains The Metropolis procedure uses a Markov chain of states. In a Markov chain: There is a finite (or countable) set of states of the system; The probability of transition from one state to another depends on the properties of these two states and not on those of other states. 11

Markov chains To illustrate the features of a Markov chain, consider a system with four possible states, with the probability of transition between any two of them given by the values above the arrows: 12

Markov chains Let us organize these probabilities in a matrix, called transition matrix (columns and rows switched with respect to the book, but the discussion is equivalent): 13

Markov chains Let us organize these probabilities in a matrix, called transition matrix (columns and rows switched with respect to the book, but the discussion is equivalent): 14

Markov chains Why is the summation of the elements of each column equal to 1? 15

Markov chains Note: until now, we have probabilities for the transitions but we do not have probabilities for the states. Let us make an initial guess that all four states are equally likely: 16

Markov chains Let us assume an event takes place in the Markov chain. The new probability for the states is obtained by multiplying the transition matrix by the probability vector: 17

Markov chains The probability vector after each subsequent event takes place is calculated in similar fashion: It is possible to show (Perron-Frobenius theorem) that there is a single limiting distribution, independent of the initial value, for any Markovian matrix that represents an ergodic system. 18

Markov chains In our problem, successive transitions leads to the following vector for the state probabilities: 19

Markov chains In our problem, successive transitions leads to the following vector for the state probabilities: At the beginning, we only knew transition probabilities. Using the Markov chain, we found the state probabilities. 20

Metropolis method We note that: 21

Metropolis method In an ergodic* system in equilibrium, the average number of transitions that take to a state is equal to the number of transitions that leave this state. (If the number of transitions into the state were, for example, bigger, then the system would get stuck in such a state after some time). A way to satisfy this condition is to impose what is called “microscopic reversibility”: the number of transitions that take the system from one state to another is equal to the number of transitions in the opposite direction: 22 *ergodic: average over time is equal to average over states (phase space)

Metropolis method Let us add over index m: To sample in the canonical ensemble: 23

Metropolis method There is more than one way of setting transition matrices that satisfy the conditions outlined in the previous slides. Metropolis solution is: For microscopic reversibility: Note: 24

Monte Carlo method in the canonical ensemble We need the ratio of the probabilities in states n and m. In the canonical ensemble: 25

Monte Carlo method in the canonical ensemble All these details can be put to work in an algorithm for Monte Carlo simulations whose basic structure is relatively simple. With the N particles of a system initially placed in a box of fixed volume kept at constant temperature: 1) Make small perturbation to the system, e.g., by trying to move one of its particles; 2) Accept or reject the move according to the transition probability of the Markovian matrix. 26

Monte Carlo method in the canonical ensemble 1) Make small perturbation to the system, e.g., by trying to move one of its molecules; In the Metropolis formulation, this is governed by matrix Probability of moving the system from state m to state n. A solution: Randomly pick a molecule; Randomly pick a new position for it. 27

Monte Carlo method in the canonical ensemble 1) Make small perturbation to the system, e.g., by trying to move one of its molecules; A solution: Randomly pick a molecule – let us say, molecule i; Randomly pick a new position for it. Uniformly distributed random number between 0 & 1 Maximum allowed displacement 28

Monte Carlo method in the canonical ensemble The new position of molecule i is within a small box centered in its position in configuration m with sides equal to 29

Monte Carlo method in the canonical ensemble 2) Accept or reject the move according to the transition probability of the Markovian matrix. 30

Monte Carlo method in the canonical ensemble 2) Accept or reject the move according to the transition probability of the Markovian matrix. 31

Monte Carlo method in the canonical ensemble What is the practical meaning of these conditions? 32

Monte Carlo method in the canonical ensemble What is the practical meaning of these conditions? is the probability of selecting a particle and randomly displacing it to a new position. Once this is done, if the energy of the system remains equal or decreases, the move is accepted. What if the energy increases? 33

Monte Carlo method in the canonical ensemble What if the energy increases? The probability of accepting the move depends on the ratio: Draw a random number uniformly distributed between 0 and 1. If its equal to or smaller than this ratio, accept the move. Otherwise, reject it. 34

Monte Carlo method in the canonical ensemble Summary: 35

Monte Carlo method: details As in molecular dynamics, efficient implementation is very important. There are many “tricks”. Maximum allowed displacement: A large value means molecules can make big moves, but these are unlikely to succeed in a dense system. Most will result in overlaps and be rejected. The consequence is that the sampling is inadequate. 36

Monte Carlo method: details As in molecular dynamics, efficient implementation is very important. There are many “tricks”. Maximum allowed displacement: A small value means molecules can make small moves, likely to be accepted. But with small moves, a good sampling takes a lot of time. The consequence is that the sampling is inadequate. 37

Monte Carlo method: details As in molecular dynamics, efficient implementation is very important. There are many “tricks”. Maximum allowed displacement: Solution: Periodically, during the equilibration part of the simulation, the maximum allowed displacement is adjusted in such a way that about 50% of the attempted moves are accepted. During the production part, it should be kept fixed. 38

Monte Carlo method: details As in molecular dynamics, efficient implementation is very important. There are many “tricks”. Random numbers play a crucial role in the method – no wonder it is called Monte Carlo method. Computers do not really generate random numbers. They have deterministic functions that result in numbers that appear to be random (even though, they are not). 39

Monte Carlo method: details As in molecular dynamics, efficient implementation is very important. There are many “tricks”. Unlike molecular dynamics, there is no need to compute forces. Only energies matter to sample the states. Implementation tends to be simpler. 40

Monte Carlo method: details As in molecular dynamics, efficient implementation is very important. There are many “tricks”. Computing the total energy of the system is very time consuming because many pairs of particles need to be considered. In the canonical ensemble, this does not need to be done in every attempted move. When a move is attempted, all molecules remain in their positions, except for one (molecule i). The energy change is the energy change of molecule i. 41

Monte Carlo method: details As in molecular dynamics, efficient implementation is very important. There are many “tricks”. Cut-off distance Intermolecular interactions fade away very quickly with distance unless there are electrostatic interactions. Therefore, after a few molecular radii, the interaction is very small. To save time, it is usual to define a cut-off distance beyond which interactions are neglected. 42

Monte Carlo method: details As in molecular dynamics, efficient implementation is very important. There are many “tricks”. Neighbor list Also, it is useful to keep a list of neighbors, i.e., the particles that are inside the cut-off distance or nearby. 43

Periodic boundary conditions What to do if a particle leaves the box as it moves? 44

Periodic boundary conditions To avoid the effect of borders on simulation results, surround the system by replicas of itself. 45

Periodic boundary conditions If a molecule leaves the system, another enters from the opposite side. 46

Periodic boundary conditions Each particle interacts with the nearest replica of its neighbors. 47

Radial distribution function Molecular simulations provide a lot of information that we will uncover as we discuss more of the fundamentals of statistical thermodynamics. One type of information – the radial distribution function – has to do with the structure of the substance being simulated. Formal definitions apart, the radial distribution function gives information about the average population of neighboring molecules as function of the intermolecular distance to a central molecule. 48

Radial distribution function To evaluate it via molecular simulation, one splits the space around each central molecule in spherical concentric shells and counts how many neighboring particles have their center there. Image source: 49

Radial distribution function The radial distribution function is the probability of finding the center of a neighboring molecule at a certain distance from the central molecule divided by the same probability for an ideal gas of same density. 50

Radial distribution function Lennard-Jones fluid. Image source: Wikipedia 51

Dimensionless quantities Dimensionless quantities are defined as follows: 52

Average properties from canonical MC simulations MC simulations provide the average radial distribution function in numerical form. From it, thermodynamic properties can be evaluated using formulas from Chapter 11. For spherically symmetrical molecules: 53

Instantaneous properties in canonical molecular simulations The instantaneous values of the configuration energy are calculated as part of the procedure – they are readily available. Let us examine how to compute the instantaneous pressure. The force that acts on a particle i in the x-direction and the acceleration in that direction are related as follows: 54

Instantaneous properties in canonical molecular simulations 55

Instantaneous properties in canonical molecular simulations Now, integrate both sides of the equation over a certain period of time and divide by this time interval to obtain time averages: 56

Instantaneous properties in canonical molecular simulations Summing all molecules: The left-hand side has time derivatives of the total kinetic energy direction in the x-direction, which are zero for a system in equilibrium. Then: 57

Instantaneous properties in canonical molecular simulations Considering all three directions x, y, z: Using the relationship between average kinetic energy and temperature: 58

Instantaneous properties in canonical molecular simulations Then: In an ideal gas, there are no intermolecular forces. The only forces acting on the system are interactions of molecules with the wall that confines the fluid in a reservoir. In this case: 59

Instantaneous properties in canonical molecular simulations In a real fluid: 60

Instantaneous properties in canonical molecular simulations In a real fluid: 61

Instantaneous properties in canonical molecular simulations Using that: it can be shown that: 62

Instantaneous properties in canonical molecular simulations The last term appears as an average, but can be applied to a single configuration to obtain an instantaneous pressure: 63 valid for MC or MD