蒙特卡罗方法并行计算
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Monte Carlo Methods in Parallel Computing
Chuanyi Ding ding@
Eric Haskin haskin@
Copyright by UNM/ARC
November 1995
Outline
What Is Monte Carlo?
Example 1 - Monte Carlo Integration To Estimate Pi
Example 2 - Monte Carlo solutions of Poisson's Equation
Example 3 - Monte Carlo Estimates of Thermodynamic
Properties
General Remarks on Parallel Monte Carlo
What is Monte Carlo?
• A powerful method that can be applied to otherwise intractable problems
• A game of chance devised so that the outcome from a large number of plays is the value of the quantity sought
•On computers random number generators let us play the game
•The game of chance can be a direct analog of the process being studied or artificial
•Different games can often be devised to solve the same problem •The art of Monte Carlo is in devising a suitably efficient game.
Different Monte Carlo Applications
Radiation transport
Operations research
Nuclear criticality
Design of nuclear reactors
Design of nuclear weapons
Statistical physics
Phase transitions
Wetting and growth of thin films Atomic wave functions and eigenvalues Intranuclear cascade reactions Thermodynamic properties
Long chain coiling polymers
Reaction kinetics
Partial differential equations
Large sets of linear equations Numerical integration
Uncertainty analysis
Development of statistical tests
Cell population studies
Combinatorial problems
Search and optimization
Signal detection
WarGames
Probability Theory
•Probability Density Function
•Expection Value (Mean)
•Variance and Standard Deviation
Sampling a Cumulative Distribution Function
Fundamental Theorem
•Sample Mean, a Monte Carlo estimator of the expection value
•Fundamental theorem of Monte Carlo
Statistical Error in MC Estimator
•Variance and Standard Deviation of Estimator
•Central Limit Theorem
Example 1 - Monte Carlo Integration to Estimate Pi • A simple example to illustrate Monte Carlo principals
•Accelerate convergence using variance reduction techniques o Use if expectation values
o Importance sampling
•Adapt to a parallel environment
Monte Carlo Estimate of Pi
When to Consider Monte Carlo Integration
•Time required for Monte Carlo Integration to a standard error epsilon
•Time required for numerical integration in n dimensions with trunction error of order h to the power k. (Note: k for Simpson's 1/3 rule is 4)
•Rule of Thumb
Serial Monte Carlo Algoritm for Pi
Read N
Set SumG = 0.0
Do While i < N
Pick two random numbers xi and yi
If (xi*xi + yi*yi £ 1) then
SumG = SumG + 1
Endif
Enddo
Gbar = SumG / N
SigGbar = Sqrt(Gbar - Gbar2)
Print N, Gbar, SigGbar