the monte carlo method: an introduction detlev reiter research centre jülich (fzj) d -52425 jülich...
TRANSCRIPT
![Page 1: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/1.jpg)
The Monte Carlo Method: an Introduction
Detlev Reiter
Research Centre Jülich (FZJ)D -52425 Jülichhttp://www.fz-juelich.dee-mail: [email protected].: 02461 / 61-5841
Vorlesung HHU Düsseldorf, WS 07/08 March 2008
![Page 2: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/2.jpg)
There are two dominant methods of simulation for complex many particle systems
1) Molecular Dynamics• Solve the classical equations of motion from mechanics.• Particles interact via a given interaction potential.• Deterministic behaviour (within numerical precision).• Find temporal evolution.
2) Monte Carlo Simulation• Find mean values (expectation values) of some system components.• Random behaviour from given probability distribution laws.
The Monte Carlo technique is a very far spread technique, because it is not limited to systems of particles.
![Page 3: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/3.jpg)
This lecture
•Brief introduction: simulation
•What is the Monte Carlo Method
•Random number generation
•Integration by Monte Carlo
Tomorrow: one (of many) particular application:
•particle transport by Monte Carlo
![Page 4: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/4.jpg)
4
ASDEX-UPDRADE (IPP Garching)
![Page 5: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/5.jpg)
Monte Carlo particle trajectories, ions and neutral particles
![Page 6: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/6.jpg)
Trilateral Eureg io Cluster
TEC
Inst itu t f ü r PlasmaphysikA ssoziat ion EU RA TO M -Fo rschungszentrum Jü l ich
![Page 7: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/7.jpg)
![Page 8: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/8.jpg)
![Page 9: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/9.jpg)
![Page 10: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/10.jpg)
Basic principle of the Monte Carlo method
• The task: calculate (estimate) a number I (one number only. Not an entire functional dependence).
Historic example: A dull way to calculate – Numerically: look for an appropriate convergent series and
evaluate this approximately– by Monte Carlo: look for a stochastic model (i.e.: (p, X): probability space with random variable X)
Example: throw a needle an a sheet with equidistant parallel stripes. Distance between stripes: D, length of needle: L, L<D.
![Page 11: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/11.jpg)
The needle experiment of Comte de Buffon, 1733(french biologist, 1707-1788)
What is the probability p, that a needle (length L), which randomly fallson a sheet, crosses one of the lines (distance D)?
First application of Monte Carlo Method
(N trials, n „hits“)
![Page 12: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/12.jpg)
Yt =1, if crossing, Yt=0 else, then
![Page 13: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/13.jpg)
Today:
Using a computer to generate random events:
We need to be able to generate random numbers Xwith any given probability function f(x), ora given cumulative distribution F(x) .
1) Uniformly distributed random numbers 2) General random numbers: can be obtained from a sequence of independent uniform random numbers
![Page 14: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/14.jpg)
a b
f(x)
1/(b-a)
Random number generation
![Page 15: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/15.jpg)
![Page 16: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/16.jpg)
![Page 17: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/17.jpg)
We will see next:
Any continuous distribution can be generated fromuniform random numbers on [0,1]
Any discrete distribution can be generated fromuniform random numbers on [0,1]
Hence:
Any given distribution can be generated fromuniform random numbers on [0,1]
![Page 18: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/18.jpg)
![Page 19: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/19.jpg)
Strategy: try to transform F to another distribution, such thatinverse of new F is explicitly known.
![Page 20: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/20.jpg)
Example: Normal (Gaussian) distribution
Cumulative distr. function Inverse cumul. distr. fct.
best format of storing distributions for Monte Carlo applications:„Inverse cumulative distribution function F-1(x)“, x uniform [0,1]
![Page 21: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/21.jpg)
Exercise (and most important example:)
Generate random numbers from a Gaussian.
Let X, Y two independent Gaussian random numbers.
Transform to polar coordiantes (Jacobian!) R, Φ
Sample Φ (trivial, it is uniform on 2π)Apply inversion method for R
Transform sampled Φ, R back to X, Y.This is a pair of Gaussians. (Box-Muller Method)
![Page 22: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/22.jpg)
Exponential distribution by „inversion“
(see tomorrow)
Note:Z and 1-Z havesame distrib.
![Page 23: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/23.jpg)
![Page 24: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/24.jpg)
Cauchy:e.g.: naturalLine broadening
![Page 25: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/25.jpg)
(stepwise constant, with steps at points T)
![Page 26: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/26.jpg)
![Page 27: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/27.jpg)
![Page 28: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/28.jpg)
X
y=f(x)
sample x from f(x)
f(x): distribution densityenclosing rectangle
z, uniform
yuniform
Reject zAccept z, take x=z
Rejection
![Page 29: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/29.jpg)
NEXT:
Any Monte Carlo estimate can be regarded asa mean value, i.e. an integral (or sum) over a given probability distribution, ususally in a highdimensional space (e.g. of random walks….)
Generic Monte Carlo: Integration
Hence: How does Monte Carlo integration work?
![Page 30: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/30.jpg)
![Page 31: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/31.jpg)
X
f(x)
I = ∫ f(x) dx
I: unknown areaknown area
x1, uniform
x2
uniform
misshit
Hit or Miss
![Page 32: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/32.jpg)
![Page 33: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/33.jpg)
![Page 34: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/34.jpg)
![Page 35: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/35.jpg)
![Page 36: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/36.jpg)
![Page 37: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/37.jpg)
![Page 38: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/38.jpg)
Suggestion: try again with previous example from dull and crude Monte Carlo
![Page 39: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/39.jpg)
![Page 40: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/40.jpg)
![Page 41: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/41.jpg)
![Page 42: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/42.jpg)
![Page 43: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/43.jpg)
![Page 44: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/44.jpg)
![Page 45: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/45.jpg)
![Page 46: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/46.jpg)
![Page 47: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/47.jpg)
Outlook: next lecture (tomorrow)
![Page 48: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/48.jpg)
![Page 49: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/49.jpg)
END
![Page 50: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/50.jpg)
![Page 51: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/51.jpg)
![Page 52: The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D -52425 Jülich e-mail: d.reiter@fz-juelich.ded.reiter@fz-juelich.de](https://reader036.vdocument.in/reader036/viewer/2022062314/56649d835503460f94a69b4e/html5/thumbnails/52.jpg)