Transcript Document

A typical experiment in a real (not virtual) space
1. Some material is put in a container at fixed T & P.
2. The material is in a thermal fluctuation, producing lots
of different configurations (a set of microscopic states)
for a given amount of time. It is the Mother Nature
who generates all the microstates.
3. An apparatus is plugged to measure an observable
(a macroscopic quantity) as an average over all
the microstates produced from thermal fluctuation.
P
T
How do we mimic the Mother Nature in a virtual space
to realize lots of microstates, all of which correspond to
a given macroscopic state?
How do we mimic the apparatus in a virtual space
to obtain a macroscopic quantity (or property or observable)
as an average over all the microstates?
How do we mimic the Mother Nature in a virtual space
to realize lots of microstates, all of which correspond to
a given macroscopic state? By MC or MD method!
microscopic states (microstates)
or microscopic configurations
t1
~1023
particles
t2
t3
under external constraints
(N or , V or P, T or E, etc.)
 Ensemble (micro-canonical,
canonical, grand canonical, etc.)
Average over
a collection of
microstates
In a real-space experiment
they’re generated naturally
from thermal fluctuation
In a virtual-space simulation
it is us who needs to generate
them by MC or MD methods.
Macroscopic quantities (properties, observables)
• thermodynamic –  or N, E or T, P or V, Cv, Cp, H, S, G, etc.
• structural – pair correlation function g(r), etc.
• dynamical – diffusion, etc.
These are what are
measured in true
experiments.
Molecular Dynamics (MD) vs. Monte Carlo (MC)
Molecular Dynamics Simulation (Deterministic)
• Starts from the initial microstate (a collection of positions & velocities)
• Solves the Newton equation of motion under the inter-particle potential V (and force F)
V
•
•
•
•
Microstates generated by integration over time
Time evolution (trajectory), dynamic behavior over time
Gives a direct connection with true experiments
Gives both equilibrium properties and dynamic properties
Monte Carlo Simulation (Stochastic = random or based on random numbers)
• Microstates generated by stochastic sampling involving a random number generator
• Gives equilibrium properties only (no time dependence, no dynamics!)
• Solves mathematical problems using stochastic sampling (like rolling a dice)
• Performs simulation of any process whose development is influenced by random factors,
but also the method enables artificial construction of a probabilistic model
• Randomly selects values to fit a probability distribution (e.g. bell curve, linear distribution,
etc.) to create scenarios of a problem
• Apt to consume large computing resources (“method of last resort”)
• Historically executed on the fastest computers available at the time
“Monte Carlo” Casino
History of Monte Carlo Simulation
• John von Neumann, Stan Ulam, and Nick Metropolis are considered to found the method
from the collaboration at Los Alamos on the Manhattan project during the World War II.
• The name "Monte Carlo" comes from the Monte Carlo Casino (gambling house) in Monaco
and first appeared in the article "The Monte Carlo Method" by Metropolis and Ulam (1949).
• Well before 1949, certain problems in statistics were solved by means of random sampling.
 Buffon experimentally determined a value of  by casting a needle on a ruled grid (1768)
and Fredericks & Levy showed how it can be used to solve boundary value problems (1928).
 Kelvin used random sampling techniques to initialize trajectories of particles undergoing
elastic collision with container walls (1901). This led to the failure of the equi-partition law
and the to foundation of statistical mechanics.
 Fermi used this method in the calculation of neutron diffusion in nuclear reactors (1930's).
 A formal foundation for the method was developed by von Neumann (PDE) (1940’s).
 However, simulation of random variables by hand was a laborious process.
• Stan Ulam realized the importance of the computer in the implementation of the approach.
• Using MC as a universal numerical technique became practical only with the advent of
computers (ENIAC, MANIAC, etc.) and high-quality pseudorandom number generators.
Various Applications of Monte Carlo Techniques
• Integration (especially of high-dimensional functions)
• System simulation
• Physical phenomena – nuclear power, radiation, thermodynamics, etc.
(The use of MC in the area of nuclear power has undergone an important evolution.)
• Quantum Monte Carlo – wave functions and expectation values
(QMC gives most accurate method for general quantum many-body systems.)
•
•
•
•
Simulation of games (bingo, solitaire, etc.)
Weather, Equipment Productivity, Risk Analysis and Management
VLSI designs - tolerance analysis
Computer graphics – rendering
Projects are often associated with a high degree of uncertainty and complexity resulting
from the unpredictable nature of events and the multi-dimensionality.
MC generates multiple scenarios depending upon the assumptions fed into the model.
MC calculates multiple scenarios by repeatedly inserting different sampling values from
probability distribution for the uncertain variables into the computerized spread-sheet.
MC Application No. 1.
How to evaluate integrals
f(x)
A
a
b
x
1. Analytical integration, if possible
Not for many functions (very limited)
2. Numerical integration (summation)
Rectangular/trapezoidal/parabolic rules
b
 f(x )dx
a
 lim
0
x 
N
 f(x )x
i 1
i
3. Numerical integration (Monte Carlo)
Random sampling of the area enclosed
by a<x<b and 0<y<fmax(x)
b
A  a f ( x)dx
MC Application No. 1. How to evaluate integrals
3. Numerical integration (Hit-and-Miss Monte Carlo)
Random sampling of the area enclosed by a<x<b and 0<y<fmax(x)
b
A  a
 #
f ( x)dx  f max ( x)(b  a)
# #



 AreaBox  Probability  y  f  x 
f(x) f (x)
max
f(x) f (x)
max
A
a
•
•
•
•
b
x
a
b
x
Choose at random M points in x  [a,b].
Designate the number of points lying under the curve y = f(x) by M'.
It is geometrically obvious that the area of A is approximately equal to the ratio M'/M.
The greater the number of drawings or trials (M), the greater the accuracy of this estimate.
1st example of MC: Let’s calculate !
Hit-and-Miss (or Rejection) MC Method
 = 4 A where A = area of the first quadrant of a circle of the radius r = 1
y
y  f ( x)  1  x2 , x  0,1
1
Equivalent to integrating
the equation of the circle
1
a
0
A   f ( x)dx   1  x 2 dx

Acircle
 A  Asqu are
4
Asqu are
A
(xi,yi)

O
1
x
4

x  y  r1
2
b
2
2
4
 1  P( yi  1  xi )
2
 1  P( xi  yi  1)
2
M
 lim
4 M  M

2
1st example of MC: Let’s calculate !
Hit-and-Miss (or Rejection) MC Method
 = 3.14159265359…
1st example of MC: Let’s calculate !
Hit-and-Miss (or Rejection) MC Method
N=
10,000
N=
100,000
N = 1,000,000
N = 10,000,000
…
Pi= 3.104385
Pi= 3.139545
Pi= 3.139668
Pi= 3.141774