NIHES EERC Oct. 25, 2002 Monte Carlo Methods Mark A. Novotny Dept. of Physics and Astronomy Mississippi State U. Supported in part.

Slides:



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

Stochastic Simulations Monday, 9/9/2002 Monte Carlo simulations are generally concerned with large series of computer experiments using uncorrelated random.
Monte Carlo Simulation Wednesday, 9/11/2002 Stochastic simulations consider particle interactions. Ensemble sampling Markov Chain Metropolis Sampling.
Monte Carlo Methods and Statistical Physics
CHAPTER 8 A NNEALING- T YPE A LGORITHMS Organization of chapter in ISSO –Introduction to simulated annealing –Simulated annealing algorithm Basic algorithm.
CHAPTER 16 MARKOV CHAIN MONTE CARLO
Lecture 3: Markov processes, master equation
1 Quantum Monte Carlo Methods Jian-Sheng Wang Dept of Computational Science, National University of Singapore.
1 CE 530 Molecular Simulation Lecture 8 Markov Processes David A. Kofke Department of Chemical Engineering SUNY Buffalo
Monte Carlo Simulation Methods - ideal gas. Calculating properties by integration.
Simulation Where real stuff starts. ToC 1.What, transience, stationarity 2.How, discrete event, recurrence 3.Accuracy of output 4.Monte Carlo 5.Random.
Computational statistics 2009 Random walk. Computational statistics 2009 Random walk with absorbing barrier.
Using random numbers Simulation: accounts for uncertainty: biology (large number of individuals), physics (large number of particles, quantum mechanics),
1 Cluster Monte Carlo Algorithms & softening of first-order transition by disorder TIAN Liang.
Pseudorandom Number Generators
Statistics.
Continuous Time Monte Carlo and Driven Vortices in a Periodic Potential V. Gotcheva, Yanting Wang, Albert Wang and S. Teitel University of Rochester Lattice.
The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D Jülich
Monte Carlo Methods in Partial Differential Equations.
Computer Simulation A Laboratory to Evaluate “What-if” Questions.
Lecture 12 Monte Carlo Simulations Useful web sites:
Monte Carlo Methods H. Rieger, Saarland University, Saarbrücken, Germany Summerschool on Computational Statistical Physics, NCCU Taipei, Taiwan.
6. Markov Chain. State Space The state space is the set of values a random variable X can take. E.g.: integer 1 to 6 in a dice experiment, or the locations.
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:
Monte Carlo Methods: Basics
Classical and Quantum Monte Carlo Methods Or: Why we know as little as we do about interacting fermions Erez Berg Student/Postdoc Journal Club, Oct
01/24/05© 2005 University of Wisconsin Last Time Raytracing and PBRT Structure Radiometric quantities.
1 IE 607 Heuristic Optimization Simulated Annealing.
Scientific Computing Topics for Final Projects Dr. Guy Tel-Zur Version 2,
Introduction to Monte Carlo Simulation. What is a Monte Carlo simulation? In a Monte Carlo simulation we attempt to follow the `time dependence’ of a.
Monte Carlo Simulation and Personal Finance Jacob Foley.
F.F. Assaad. MPI-Stuttgart. Universität-Stuttgart Numerical approaches to the correlated electron problem: Quantum Monte Carlo.  The Monte.
1 Lesson 3: Choosing from distributions Theory: LLN and Central Limit Theorem Theory: LLN and Central Limit Theorem Choosing from distributions Choosing.
Modeling and Simulation
1 Worm Algorithms Jian-Sheng Wang National University of Singapore.
Basic Monte Carlo (chapter 3) Algorithm Detailed Balance Other points.
© 2003, Carla Ellis Simulation Techniques Overview Simulation environments emulation exec- driven sim trace- driven sim stochastic sim Workload parameters.
Monte Carlo Methods in Statistical Mechanics Aziz Abdellahi CEDER group Materials Basics Lecture : 08/18/
Monte Carlo Methods1 T Special Course In Information Science II Tomas Ukkonen
1 Elements of Queuing Theory The queuing model –Core components; –Notation; –Parameters and performance measures –Characteristics; Markov Process –Discrete-time.
Monte Carlo Methods So far we have discussed Monte Carlo methods based on a uniform distribution of random numbers on the interval [0,1] p(x) = 1 0  x.
APPENDIX D R ANDOM N UMBER G ENERATION Organization of chapter in ISSO* – General description and linear congruential generators Criteria for “good” random.
Stochastic Growth in a Small World and Applications to Scalable Parallel Discrete-Event Simulations H. Guclu 1, B. Kozma 1, G. Korniss 1, M.A. Novotny.
Simulating extended time and length scales using parallel kinetic Monte Carlo and accelerated dynamics Jacques G. Amar, University of Toledo Kinetic Monte.
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.
Molecular Modelling - Lecture 2 Techniques for Conformational Sampling Uses CHARMM force field Written in C++
Incremental Integration of Computational Physics into Traditional Undergraduate Courses Kelly R. Roos, Department of Physics, Bradley University Peoria,
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.
The Markov Chain Monte Carlo Method Isabelle Stanton May 8, 2008 Theory Lunch.
Javier Junquera Random numbers and the central limit theorem Alberto García.
An Introduction to Monte Carlo Methods in Statistical Physics Kristen A. Fichthorn The Pennsylvania State University University Park, PA
1 1 Slide Simulation Professor Ahmadi. 2 2 Slide Simulation Chapter Outline n Computer Simulation n Simulation Modeling n Random Variables and Pseudo-Random.
Javier Junquera Importance sampling Monte Carlo. Cambridge University Press, Cambridge, 2002 ISBN Bibliography.
CS774. Markov Random Field : Theory and Application Lecture 15 Kyomin Jung KAIST Oct
Introduction to Sampling Methods Qi Zhao Oct.27,2004.
SS r SS r This model characterizes how S(t) is changing.
Monte Carlo Simulation of Canonical Distribution The idea is to generate states i,j,… by a stochastic process such that the probability  (i) of state.
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,
Pattern Formation via BLAG Mike Parks & Saad Khairallah.
Computational Physics (Lecture 10)
Advanced Statistical Computing Fall 2016
Sequential Algorithms for Generating Random Graphs
Markov chain monte carlo
14. TMMC, Flat-Histogram and Wang-Landau Method
Lesson 4: Application to transport distributions
Presentation transcript:

NIHES EERC Oct. 25, 2002 Monte Carlo Methods Mark A. Novotny Dept. of Physics and Astronomy Mississippi State U. Supported in part by NSF DMR and ITR/AP(MPS) Random topics about random things for random people

NIHES EERC Oct. 25, 2002 Where is Monte Carlo? Europe Principality of Monaco Monte Carlo is 1 of 5 regions of Monaco Monte Carlo founded in 1866 by Prince Charles III Renowned casino, luxurious hotels, beaches, …

NIHES EERC Oct. 25, 2002 What is a Monte Carlo simulation? In a Monte Carlo simulation we attempt to follow the `time dependence’ of a model for which change, or growth, does not proceed in some rigorously predefined fashion (e.g. according to Newton’s equations of motion) but rather in a stochastic manner which depends on a sequence of random numbers which is generated during the simulation. Landau and Binder, A Guide to Monte Carlo Simulations in Statistical Physics (Cambridge U. Press, Cambridge U.K., 2000), p. 1.

NIHES EERC Oct. 25, 2002 Birth of the Monte Carlo method Los Alamos National Laboratory 1953 Physical Review Metropolis, Rosenbluth, Teller, and Teller Conferences/MonteCarloMethods/ “The only good Monte Carlo is a dead Monte Carlo.” Trotter and Turkey, 1954

NIHES EERC Oct. 25, 2002 OUTLINE Random numbers Integrals via Monte Carlo Importance Sampling Monte Carlo Dynamic Monte Carlo Decay of nuclei (birth- death processes) Random motion in 1 dimension Long-time simulations (Monte Carlo with Absorbing Markov Chains, MCAMC) Parallel dynamic Monte Carlo simulations

NIHES EERC Oct. 25, 2002 OUTLINE Random numbers Integrals via Monte Carlo Importance Sampling Monte Carlo Dynamic Monte Carlo Decay of nuclei (birth- death processes) Random motion in 1 dimension Long-time simulations (Monte Carlo with Absorbing Markov Chains, MCAMC) Parallel dynamic Monte Carlo simulations

NIHES EERC Oct. 25, 2002 (not-really, but almost) Random Numbers Uniformly distributed numbers in [0,1] How good is `good enough’? `religious question’ R2504-tapLinear congruential, R250, Marsaglia, 4-tap, system supplied Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin. John von Neumann (1951)

NIHES EERC Oct. 25, 2002 (not-really, but almost) Random Numbers from R250 X n = XOR( X n-p, X n-q ) XOR(,) is exclusive OR operator With p 2 +q 2 +1=prime (p and q are Mersine primes) R98: p=98, q=27 R250: p=250, q=103 R1279: p=1279, q=216 or 418 R9689: p=9689, q=84, 471, 1836, 2444, or 4187

NIHES EERC Oct. 25, 2002 OUTLINE Random numbers Integrals via Monte Carlo Importance Sampling Monte Carlo Dynamic Monte Carlo Decay of nuclei (birth- death processes) Random motion in 1 dimension Long-time simulations (Monte Carlo with Absorbing Markov Chains, MCAMC) Parallel dynamic Monte Carlo simulations

NIHES EERC Oct. 25, 2002 Calculate p =pi using Monte Carlo Set N in =0 Do N times oCalculate 3 random numbers, r 1, r 2, r 3 oLet x=r 1 oLet y=r 2 oUse r 3 to choose quadrant (change signs of x and y) oIf x 2 +y 2.le.1 set N in =N in +1 Estimate for p =pi = 4 N in / N

Calculate p using Monte Carlo N=10 3 N=10 4 N=10 5 Live or die by the Law of Large Numbers

NIHES EERC Oct. 25, 2002 OUTLINE Random numbers Integrals via Monte Carlo Importance Sampling Monte Carlo Dynamic Monte Carlo Decay of nuclei (birth- death processes) Random motion in 1 dimension Long-time simulations (Monte Carlo with Absorbing Markov Chains, MCAMC) Parallel dynamic Monte Carlo simulations

NIHES EERC Oct. 25, 2002 Importance Sampling Monte Carlo Old way: choose points with equal probability from rectangle with a<x i <b and 0<y<y 0 ; and then use estimate y estimate = S i f(x i ) (b-a) y 0 Rather choose points with importance of the value of the function at that point to the integral, p(x) Estimate of integral y estimate = S i p -1 (x i ) f(x i ) a b y00y00

NIHES EERC Oct. 25, 2002 OUTLINE Random numbers Integrals via Monte Carlo Importance Sampling Monte Carlo Dynamic Monte Carlo Decay of nuclei (birth- death processes) Random motion in 1 dimension Long-time simulations (Monte Carlo with Absorbing Markov Chains, MCAMC) Parallel dynamic Monte Carlo simulations

NIHES EERC Oct. 25, 2002 Dynamic Monte Carlo For Static Monte Carlo the order of generation of points does not matter (like finding the integrals) For Dynamic Monte Carlo the order does matter This gives a Markov chain method, governed by the Master Equation

NIHES EERC Oct. 25, 2002 OUTLINE Random numbers Integrals via Monte Carlo Importance Sampling Monte Carlo Dynamic Monte Carlo Decay of nuclei (birth- death processes) Random motion in 1 dimension Long-time simulations (Monte Carlo with Absorbing Markov Chains, MCAMC) Parallel dynamic Monte Carlo simulations

NIHES EERC Oct. 25, 2002 Birth and Death processes Decay (death) of nuclei (organisms) rate l =0.001 /msec N 0 =100 N(t) = N 0 exp(- l t) t 1/2 = ln(2)/ l =

NIHES EERC Oct. 25, 2002 Birth and Death processes Start with N=N 0 individuals Start time t=0 Assume that decay (death) constant l <1 For each nucleus which has not yet decayed uGenerate a random number 0<r<1  Nucleus decays if r< l, and set N=N-1, else the nucleus remains When done sampling all remaining nuclei, set t=t+1 Repeat until all nuclei have decayed

NIHES EERC Oct. 25, 2002 Birth and Death processes Event Driven --- n-fold way Start with N=N 0 individuals Start time t=0 Assume that decay (death) constant l <1 For each nucleus which has not yet decayed uGenerate a random number 0<r<1  Nucleus decays if r< l, and set N=N-1, else the nucleus remains When done sampling all remaining nuclei, set t=t+1 Repeat until all nuclei have decayed May be VERY SLOW if decay rate l is small!!! Does the nucleus decay? No no no no no no no no no no no no no no no...

NIHES EERC Oct. 25, 2002 Birth and Death processes Event Driven -- or -- n-fold way Start with N=N 0 individuals Start time t=0 Assume that decay (death) constant l <1 Until all the nuclei have decayed do: uGenerate two random number 0<r 1,r 2 <1  Calculate time to leave current state: D t=-ln(r 1 )/(N l )  S et t = t + D t uSet N = N - 1 uUse r 2 to pick which of remaining nuclei decayed One decay every algorithmic step, no matter how small l is

NIHES EERC Oct. 25, 2002 Birth and Death processes Birth and death of organisms l grow =0.001 /msec  l die =0.001 /msec N 0 =100

NIHES EERC Oct. 25, 2002 OUTLINE Random numbers Integrals via Monte Carlo Importance Sampling Monte Carlo Dynamic Monte Carlo Decay of nuclei (birth- death processes) Random motion in 1 dimension Long-time simulations (Monte Carlo with Absorbing Markov Chains, MCAMC) Parallel dynamic Monte Carlo simulations

NIHES EERC Oct. 25, 2002 Random Walker coagulation Albena, Bulgaria model (2002)

NIHES EERC Oct. 25, 2002 Random Walker coagulation Albena, Bulgaria model (2002)

NIHES EERC Oct. 25, 2002 Random Walker coagulation

NIHES EERC Oct. 25, 2002 Random Walker coagulation Event driven (n-fold way) One algorithmic step step from current configuration

NIHES EERC Oct. 25, 2002 Random Walker coagulation Monte Carlo with Absorbing Markov Chains (MCAMC) (s=2) In one algorithmic step step out of low valleys

NIHES EERC Oct. 25, 2002 Random Walker coagulation Average time until coagulation All algorithms statistically the same

NIHES EERC Oct. 25, 2002 Random Walker coagulation Different algorithms require different amounts of computer time

NIHES EERC Oct. 25, 2002 Random motion --- ion channel flow Random motion (of a random walker) through a channel

NIHES EERC Oct. 25, 2002 Random motion --- ion channel flow

NIHES EERC Oct. 25, 2002 Random motion --- ion channel flow

NIHES EERC Oct. 25, 2002 Random motion --- ion channel flow

NIHES EERC Oct. 25, 2002 Random motion --- ion channel flow

NIHES EERC Oct. 25, 2002 Random motion --- ion channel flow Average lifetimes the same for all algorithms Computer times different for different algorithms

NIHES EERC Oct. 25, 2002 Random motion --- ion channel flow Square lattice for random walker, lifetime is time to get from one end to another

NIHES EERC Oct. 25, 2002 OUTLINE Random numbers Integrals via Monte Carlo Importance Sampling Monte Carlo Dynamic Monte Carlo Decay of nuclei (birth- death processes) Random motion in 1 dimension Long-time simulations (Monte Carlo with Absorbing Markov Chains, MCAMC) Parallel dynamic Monte Carlo simulations

NIHES EERC Oct. 25, 2002 Monte Carlo for Ising models

NIHES EERC Oct. 25, 2002 Monte Carlo for Ising models Use spin classes for Ising model --- square lattice has 10 spin classes Every spin belongs to one of 10 classes Probability of flipping a spin in each class is the same If chosen, probability of flipping spin in class i is p(i) Number of spins in class i is c i

NIHES EERC Oct. 25, 2002 Monte Carlo for Ising models A GAME

NIHES EERC Oct. 25, 2002 Monte Carlo for Ising models MCAMC n-fold way

NIHES EERC Oct. 25, 2002 Monte Carlo for Ising models n-fold way with needed Bookkeeping

NIHES EERC Oct. 25, 2002 Monte Carlo for Ising models MCAMC

NIHES EERC Oct. 25, 2002 Monte Carlo for Ising models Square lattice Ising model

NIHES EERC Oct. 25, 2002 Monte Carlo for Ising models MCAMC results square Ising

NIHES EERC Oct. 25, 2002 Monte Carlo for Ising models Age of universe in femtoseconds? seconds

NIHES EERC Oct. 25, 2002 OUTLINE Random numbers Integrals via Monte Carlo Importance Sampling Monte Carlo Dynamic Monte Carlo Decay of nuclei (birth- death processes) Random motion in 1 dimension Long-time simulations (Monte Carlo with Absorbing Markov Chains, MCAMC) Parallel dynamic Monte Carlo simulations

NIHES EERC Oct. 25, 2002 Dynamic Monte Carlo Parallel Discrete Event Simulations Dynamics for Materials Dynamics for biological and ecological models Dynamics of Magnets Cell-phone switching Spread of infectious diseases Resource allocation following terrorist attacks War-game scenarios

NIHES EERC Oct. 25, 2002 “Nature” ? “Nature” ? computers & algorithms Parallel Discrete Event Simulations Best is trivial parallelization Each processor runs same program with different random number sequence

NIHES EERC Oct. 25, 2002 Two approaches to parallelization  Conservative  PE “idles” if causality is not guaranteed  utilization,  u  : fraction of non-idling PEs ii (site index) i d=1  Optimistic (or speculative)  PEs assume no causality violations  Rollbacks to previous states once causality violation is found (extensive state saving or reverse simulation)  Rollbacks can cascade (“avalanches”) d=2

NIHES EERC Oct. 25, 2002 Non-equilibrium surface growth e.g., kinetic roughening as in Molecular Beam Epitaxy Surface width = w Surface is FRACTAL

NIHES EERC Oct. 25, 2002  Utilization/efficiency Finite-size effects for the density of local minima/average growth rate (steady state): (d=1)

NIHES EERC Oct. 25, 2002 Implications for scalability Simulation reaches steady state for long times  Simulation phase: scalable  Measurement (data management) phase: not scalable  u   asymptotic average growth rate (simulation speed or utilization) is non-zero measurement at  meas :

NIHES EERC Oct. 25, 2002 Actual implementation 1. Local time incremented 2. If chosen site is on the boundary, PE must wait until  min{  nn } Dynamics of a thin magnetic film

NIHES EERC Oct. 25, 2002 The Physics of Queuing PDES applicable to many situations Can be made scalable (patent applied for) Use ideas from physics to understand & improve computer science & biological applications

NIHES EERC Oct. 25, 2002 References and Links Novotny and coworkers For a review of advanced dynamic methods see: M.A. Novotny in Annual Reviews of Computational Physics IX, ed. D. Stauffer, (World Scientific, Singapore, 2001), p. 153; preprint xxx.lanl.gov/cond- mat/ click---HERE.HERE Metastability: Physical Review Letters, 81, 834 (1998). Monte Carlo with Absorbing Markov Chains: Physical Review Letters, 74, 1 (1995); erratum 75, 1424 (1995). Discrete-time n-fold way: Computers in Physics, 9, 46 (1995). Parallel Discrete Event Simulations, General: Physical Review Letters, 84, 1351 (2000). Implementation of non-trivial parallel Monte Carlo: Journal of Computational Physics, 153, 488 (1999). Projective Dynamics: Physical Review Letters, 80, 3384 (1998). Constrained Transfer Matrix for metastability: Physical Review Letters, 71, 3898 (1993).