Title: Cadarache 2
1Monte-Carlo Primer
Motto Sir, In your otherwise beautiful poem (The
vision of Sin) there is a verse which
reads Every moment dies a man every moment
one is born Obviously, this cannot be true and I
suggest that in the next edition you have it
read Every moment dies a man every moment 1
and 1/16 is born Even this value is slightly in
error but should be sufficiently accurate for
poetry. ....Charles Babbage (in a letter to Lord
Tennyson)
2PROGRAM
- Introduction
- History of Monte Carlo
- Basics of Monte-Carlo
- Random Number Generators
- Cross sections
- Monte-Carlo vs Deterministic Methods
- Particle Transport Simulations
- Estimators and Statistical Analysis
- Non-analog Monte Carlo
- Variance Reduction Technique
3Introduction Monte Carlo
The Monte Carlo method has been used for almost
60 years to solve radiation transport problems in
high energy physics, nuclear reactor analysis,
radiation shielding, medical imaging, oil
well-logging, etc. Individual particle histories
are simulated using random numbers, highly
accurate representations of particle interaction
probabilities, and exact models of 3D problem
geometry. Monte Carlo methods are sometimes the
only viable methods for analyzing complex,
demanding particle transport problems.
4Modern applications of Monte Carlo
- Nuclear reactor design
- Quantum chromodynamics
- Radiation cancer therapy
- Traffic flow
- Stellar evolution
- Econometrics
- Dow-Jones forecasting
- Oil well exploration
- VLSI design
5History of Monte Carlo
- John Von Neumann invented scientific computing
in 1940s - stored programs, software
- algorithms flowcharts
- assisted with hardware design as well ordinary
computers are called Von Neumann machines - John Von Neumann invented Monte Carlo particle
transport in 1940s - Highly accurate - no essential approximations
- Expensive -typically method of last resort
- Monte Carlo codes for particle transport have
been proven to work effectively on all computers - Vector, parallel, supercomputers, workstations,
clusters of workstations, . .
6Prominent Figures in Computing
If I have seen further it is by standing on the
shoulders of Giants in Isaac Newtons Letter to
Robert Hooke
- Gottfried Wilhelm Leibniz (1646 -1716)
- Charles Babbage (1791-1871)
- Augusta Ada Byron (King), countess of Lovelace,
Lady Lovelace (1815-1852), the first computer
programmer 1979, Programming Language ADA
7The First Digital Computer
Mid-1830s
8John von Neumann, 1903-57, American
mathematician, b. Hungary, Ph.D. Univ. of
Budapest, 1926
He came to the United States in 1930 and was
naturalized in 1937. He taught (1930-33) at
Princeton and after 1933 was associated with the
Institute for Advanced Study. In 1954 he was
appointed a member of the Atomic Energy
Commission. A founder of the mathematical theory
of games, he also made fundamental contributions
to quantum theory and to the development of the
atomic bomb (Stan Ulam was another great
mathematician in this environment). He was a
leader in the design and development of
high-speed electronic computers his development
of maniac-an acronym for mathematical analyzer,
numerical integrator, and computer-enabled the
United States to produce and test (1952) the
world's first hydrogen bomb. With Oskar
Morgenstern he wrote Theory of Games and Economic
Behavior). Von Neumann's other writings include
Mathematical Foundations of Quantum Mechanics
(1926), Computer and the Brain (1958), and Theory
of Self-reproducing Automata (1966).
9Parties and nightlife held a special appeal for
von Neumann. While teaching in Germany, von
Neumann had been a denizen of the Cabaret-era
Berlin nightlife circuit.
10Terminology
1) Deterministic
2) Probabilistic
11Basics of M-C
- Two basic ways to approach the use of Monte
Carlo methods for solving the transport equation - mathematical technique for numerical integration
- computer simulation of a physical process
-
- Each is correct
- mathematical approach useful for
- importance sampling, convergence, variance
reduction, random sampling techniques, . ... - simulation approach useful for
- collision physics, tracking, tallying, . . . . .
- For Monte Carlo approach, consider the integral
form of the Boltzmann equation. - Most theory on Monte Carlo deals with
fixed-source problems. - Eigenvalue problems are needed for reactor
physics calculations
12Major Components of a Monte Carlo Algorithm
- The primary components of a Monte Carlo
simulation method - Probability distribution functions (pdf's) - the
physical (or mathematical) system must be
described by a set of pdf's. - Random number generator - a source of random
numbers uniformly distributed on the unit
interval must be available. - Sampling rule - a prescription for sampling from
the specified pdf's, assuming the availability of
random numbers on the unit interval, must be
given. - Scoring (or tallying) - the outcomes must be
accumulated into overall tallies or scores for
the quantities of interest. - Error estimation - an estimate of the statistical
error (variance) as a function of the number of
trials and other quantities must be determined. - Variance reduction techniques - methods for
reducing the variance in the estimated solution
to reduce the computational time for Monte Carlo
simulation - Parallelization and vectorization - algorithms to
allow Monte Carlo methods to be implemented
efficiently on advanced computer architectures.
13Major Shortcoming of Deterministic Appoach Too
Many Simplifications
- Physical simplifications
- Collision model
- Isotropic scattering in Lab-system
- Continuous slowing-down, etc.
- Mathematical simplifications
- Diffusion model, boundary conditions, etc.
- Multi-group model
- Discretization,
- Technological simplifications
- Geometrical simplifications
- Homogenization,
14Diffusion Model
Transport equation
Q0
Transport eq.
Free surface
x 0
Diffusion eq.
15Multi-Group Approximation
16Geometrical Simplifications
17Discretization
In space
In angle
It completely falls out
18Advantages of Monte Carlo
- Very complex 3-D configurations
- Continuous space variables
- Continuous angle variables
- Continuous energy variable
The errors in Monte Carlo calculations take the
form of stochastic uncertainties
19The Theoretical Foundation of MC
x1
x2
x3
xN
µ
z
20Elements of Random Variables
21Distribution Sampling
We want to generate a series of random numbers
that are distributed according to the number of
mean free paths
22Rejection Technique
1
0
1
23Example of Simple Simulation
x1
x2
x3
xN
24Principles of a Nuclear Reactor
Leakage
E
N2
2 MeV
N1
Fast fission
n n/fission
Energy
Slowing down
Resonance abs.
? 2.5
Non-fuel abs.
Non-fissile abs.
1 eV
Fission
200 MeV/fission
Leakage
25(No Transcript)
26Flux/Current Estimators
27The Essence of Monte Carlo
Random numbers
Monte Carlo
RESULTS
Probability Distribution
28The Essence of Monte Carlo
29Simple Monte Carlo Example
Mathematical approach For k 1, . . . . N
choose randomly in (0,1) G (1-0) average
value of g(x)
Simulation approach darts game For k 1, . .
. . N choose
30Simulation approach darts game For k 1, . .
. . N choose
G area under curve
31M-C as integration tool
Monte Carlo is often the method-of-choice for
applications with integration over many
dimensions Examples high-energy physics,
particle transport (ADS)
32Probability Density Functions
Continuous Probability Density
Discrete Probability Density
x1 x2 x3 xN
x
33Basic parameters
Mean, Average, Expected Value (1st statistical
moment)
Variance (2nd statistical moment), standard
deviation
standard deviation
34Basic functions
35The key of MC methods is the notion of RANDOM
sampling
The problem can be stated this way Given a
probability density, f(x), produce a sequence of
The should be distributed in the same
manner as f(x).
- The use of random sampling distinguishes Monte
Carlo from all other methods - When Monte Carlo is used to solve the integral
Boltzmann transport equation - Random sampling models the outcome of physical
events (e.g., neutron collisions, fission
process, source, . . . . . ) - Computational geometry models the arrangement of
materials
36Transport Equation
- Assumptions
- static homogeneous medium
- time-independent
- Markovian - next event depends only on current
(r,v) not on previous events - particles do not interact with each other
- neglect relativistic effects
- no long-range forces (particles fly in straight
lines between events) - material properties are not affected by particle
reactions - etc., etc.
- ? can use superposition principle
37Basis for Monte Carlo Solution Method
Note that collision k depends only on the results
of collision k-l, and not on any prior collisions
k-2, k-3, . . .
38Statistical approach to determining ?k
interpret terms in the following manner
- Monte Carlo method
- Randomly sample p from ?k-1(p)
- Given p, randomly sample p from R (p?p)
- If p lies within dpi at pi, tally 1 in bin i
- ? Repeat steps 1,2,3 N times,
- then
dp
p
pi
39Histories (trajectories)
After repeated substitution for ?k
A history (trajectory) is a sequence of states
(p0,p1,p2,p3...)
p1
p4
p0
p3
p3
p0
p2
p2
p1
For estimates in a given region, tally the
occurrences for each collision of each history
within a region
40Transport Equation
- Monte Carlo approach
- Generate a sequence of States, (p0, p1, . . . .
pk), i.e., a history by - Randomly sample from PDF for source ?0(p0)
- Randomly sample from PDF for kth transition R
(pk-1 ? pk) - Generate estimates of results, by averaging over
M histories
41Simulations
- Simulation approach to particle transport
- Faithfully simulate the history of a single
particle from birth to death - During the particle history,
- model collisions using physics equations
cross-section data - model free-flight using computational geometry
- tally the occurrences of events in each region
Repeat the simulation for many histories,
accumulating the tallies
Fundamental rule Think like a neutron or other
projectile (proton)
42MC rules for simulations
Source Random sampling E, ? -analytic, discrete,
or piecewise-tabulated PDFs Computational
geometry r -sample from region in 3-D space, or
from discrete PDF Tracking Random
sampling dcollide-distance to collision, from mfp
or exponential PDF Computational geometry dgeom -
distance-to-boundary, ray-tracing, next-region,
.... Collisions Random sampling E, ? -
analytic, discrete, or piecewise-tabulated
PDFs Physics ?, f(?) - cross-section data,
angular PDFs, kinematics, ... Tallies Statistics V
ariance Reduction Random sampling
43MC rules for simulations
- Single particle
- random-walk for particle history
- simulate events, from birth to death
- tally events of interest
- Batch of histories (generation)
- random-walk for many particle histories
- tally the aggregate behavior
- Overall
- timesteps
- geometry changes
- material changes
- fuel depletion
- burnable absorbers
- control rods
44Random number generators
- Truly random - is defined as exhibiting true"
randomness, such as the time between tics" from
a Geiger counter exposed to a radioactive element - Pseudorandom - is defined as having the
appearance of randomness, but nevertheless
exhibiting a specific, repeatable pattern. - Quasi-random - is defined as filling the solution
space sequentially (in fact, these sequences are
not at all random - they are just comprehensive
at a preset level of granularity). For example,
consider the integer space 0, 100. One
quasi-random sequence which fills that space is
0, 1, 2,...,99, 100. Another is 100, 99,
98,...,2, 1, 0. Yet a third is 23, 24, 25,...,
99, 100, 0, 1,..., 21, 22. Pseudorandom sequences
which would fill the space are pseudorandom
permutations of this set (they contain the same
numbers, but in a different, random" order).
45Random number generators
- Desirable Properties
- Random numbers are used to determine
- attributes (such as outgoing direction, energy,
etc.) for launched particles, - Interactions of particles with the medium.
- Physically, the following properties are
desirable - The attributes of particles should not be
correlated. The attributes of each particle
should be independent of those attributes of any
other particle. - The attributes of particles should be able to
fill the entire attribute space in a manner which
is consistent with the physics. E.g. if we are
launching particles into a hemispherical space
above a surface, then we should be able to
approach completely filling the hemisphere with
outgoing directions, as we approach an infinite
number of particles launched. At the very least,
holes" or sparseness in the outgoing directions
should not affect the answers significantly.
Also, if we are sampling from an energy
distribution, with an increasing number of
particles, we should be able to duplicate the
energy distribution better and better, until our
simulated distribution is good enough."
46Random number generators Desirable properties
- Mathematically, the sequence of random numbers
used to effect a Monte Carlo model should possess
the following properties - Uncorrelated Sequences - The sequences of random
numbers should be serially uncorrelated. Any
subsequence of random numbers should not be
correlated with any other subsequence of random
numbers. Most especially, n-tuples of random
numbers should be independent of one another. For
example, if we are using the random number
generator to generate outgoing directions so as
to fill the hemispherical space above a point (or
area), we should generate no unacceptable
geometrical patterns in the distribution of
outgoing directions - Long Period - The generator should be of long
period (ideally, the generator should not repeat
practically, the repetition should occur only
after the generation of a very large set of
random numbers).
47- Uniformity - The sequence of random numbers
should be uniform, and unbiased. That is, equal
fractions of random numbers should fall into
equal areas" in space. For example, if random
numbers on 0,1) are to be generated, it would be
poor practice were more than half to fall into
0, 0.1), presuming the sample size is
sufficiently large. Often, when there is a lack
of uniformity, there are n-tuples of random
numbers which are correlated. In this case, the
space might be filled in a definite, easily
observable pattern. Thus, the properties of
uniformity and uncorrelated sequences are loosely
related. - Efficiency - The generator should be efficient.
In particular, the generator used on vector
machines should be vectorizable, with low
overhead. On massively parallel architectures,
the processors should not have to communicate
among themselves, except perhaps during
initialization. This is not generally a
signiffcant issue. With minimal effort, random
number generators can be implemented in a high
level language such as C or FORTRAN, and be
observed to consume well less than 1 of overall
CPU time over a large suite of applications.
48Multiplicative, Linear, Congruential Generators -
the one most commonly used for generating random
integers.
49The Essence of Monte Carlo
Random numbers
Monte Carlo
RESULTS
Probability Distribution
50(No Transcript)
51THE HEART OF THE MONTE CARLO sampling of mean
free path
x, x - random numbers
52Cross sections probability distribution
functions!
53DATA LIBRARIES ARE OF TWO FORMS
- Pointwise
- Cross sections are specified at a sufficient
number of energy points to faithfully reproduce
the evaluated cross section - Used with
- Continuous energy Monte Carlo codes
- Multigroup
- All data are collapsed and averaged into energy
groups - Used with
- Diffusion codes
- Discrete ordinate codes
- Multigroup Monte Carlo codes
54CROSS-SECTION LIBRARIES
- Pointwise
- User does not have to worry about
- Group structure
- Flux spectrum
- Self-shielding
- Small amount of work in processing code
- Large amount of work in transport code
- Multigroup
- User needs to worry about everything
- Large amount of work in processing code
- Small amount of work in transport code
55238Np - fission cross section
sf (barn)
sf (barn)
E (eV)
56235U - fission cross section - pointwise JEF2
Resonance region
sf (barn)
E (eV)
E (eV)
57235U - fission and capture cross sections JEF2
multigroup
pointwise
s (barn)
E (eV)
E (eV)
58235U - fission cross sections in resonanse
region Pointwise and multigroup JEF2 data
s (barn)
E (eV)
59Neutron cross section data contain
- Cross sections for reactions
- elastic scattering, (n,2n), (n,3n), (n,n,p)
- inelastic scattering (n,n) continuum, (n,g),
(n,p) and (n,a) - total, absorption, proton prod. and a production
- Angular distrubutions for different reactions (45
in MCNP) - Energy distrubution for some reactions (4)
- Heating numbers and Q-values
- Photon production cross sections, angular
distributions for (n,g), (n,n), (n,2n) and n,3n)
60Classes of cross-section data (MCNP)
- C - Continuous-energy neutron
- D - Discrete reaction neutron
- Y - Neutron dosimetry
- T - Neutron S(a,b) thermal
- P - Continuous-energy photon
- M- Multigroup neutron
- G - Multigroup photon
- E - Continuous-energy electron
61Major Neutron Physics Approximations
- (n,xn) sampled independently
- (n,f),(n,xn) happen instantly
- unresolved resonances treated as average cross
section - no delayed gamma production
- no charged particle production
62 Experimental Data Theoretical Codes
ENDF/B Evaluations
T-2 Evaluations
LLNL Evaluations
NJOY/TRANSX Processing codes T-2
Multigroup or Continuous Energy File
MCPOINT CLYDE Processing Codes
Checking Codes Processsing Codes Data Analysis
Feedback to Evaluators Experimentalists, and
Processors
Multigroup or Continuous Energy File
Test Data in Transport Codes
Include Data in Libarary
63Approximations in generating data
- Evaluation Assumptions
- choice of experiments
- choice of representations, i.e., discrete lines
for continuous distributions - interpolation (model codes)
- bin sizes
- tresholds, Q-values, particularly for elements
- Processing Assumptions
- representation of angular distributions as
equiprobable bins - resonance parameter treatment
64Things to consider when choosing neutron
cross-section data
- Differences in evaluators philosophy
- Neutron energy spectrum
- Temperature at which set was processed
- Availability of photon-production data
- Sensitivity of results to different evaluations
- Use the best data that you can afford
65THERMAL EFFECTS
- Target motion (gas liquid, solid) --gt incident
neutron sees targets with various velocities,
i.e., many different relative velocities - so average cross section is changed
- kinematics are different
- neutron upscattering
- Doppler broadening
66THERMAL EFFECTS (cont.)
- Lattice structure (solid)
At high energy - wavelength of neutron ltlt lattice
spacing
Lattice spacing
At low energy - wavelength of neutron _at_ lattice
spacing
- Cross sections show very jagged behaviour, each
peak corresponds to a particular set of crystal
planes - Coherent scattering (interference of scattered
waves) add constructively in some directions and
add destructively in others - gtAngular distribution changed
- Bragg scattering
67THERMAL EFFECTS (cont.)
- Molecular energy levels (liquid, solid)
- vibrational and rotational levels
- 0.1 eV spacing below a few eV
- Neutron loses or gains energy in discrete amounts
- gt modify DOUBLE-DIFFERENTIAL
- thermal inelastic scattering
68Deterministic Monte-Carlo
- simulates individual particles and records some
aspects of their behaviour - supplies information only about the specific
sampled distribution (tally) - No transport equation need to be written to solve
a transport problem by Monte Carlo - but -
equation of the probability density of particles
integral transport equation
- solves the transport equation (integro-differentia
l) for the average particle behaviour - gives fairly complete information (e.g. flux)
throughout the phase space of the problem
69Deterministic Monte-Carlo
- the discrete ordinates method visualises the
phase space to be divided into many small boxes,
the particles move from one box to another. Boxes
get progressively smaller, particles moving from
box to box take differential amount of time to
move and differential distance in space ----gt
approaches the integro differential tarnsport
- Monte-Carlo transports particle between events
(e.g. collisions) that are separated in space and
time. Neither differntial space nor time are
inherent parameters of Monte-Carlo. The integral
equation does not have time or space derivatives
70Phase space
mean value - Xn
simulation results
Accuracy measure of how close the mean is to the
TRUE PHYSICAL quantity (TRUE VALUE) being
estimated
TRUE VALUE
- Sometimes called the systematic error
- Monte Carlo cannot directly estimate this
- Factors related to accuracy
- Code accuracy (physics models etc.)
- Problem modelling (geometry, dource, etc
- User errors/abuse
71Phase space
mean value - Xn
simulation results
TRUE VALUE
Precision the uncertainty in Xn the statistical
fluctuations in the sampled xj
- Monte-Carlo can estimate this
72PRINCIPLES
- Central Limit Theorem
- The distribution of the sum of n independent,
identically distrubuted random variables
Conditions Mean and Variance must exist (i.e. be
finite)
73PRINCIPLES
- Probability Distributions
- Discrete Probability Density Function n discrete
events
p2
pi probability per event
p1
........
pn
n
1 2
74PRINCIPLES
- Probability Distributions
- Continuous Probability Density Function
p(x) probability per unit of x
p(x)
Normalisation
x
Cumulative Probability Function
75DEFINITIONS
standard deviation of population s
76DEFINITIONS
77DEFINITIONS
78Reminder
79Key of Symbols in Monte Carlo
- W - particle weight, Ws - source weight
- E- particle energy (MeV) ED - energy deposited
(MeV) - m- cosine of angle between surface normal and
trajectory - A- surface area (cm2) V - cell volume (cm3)
- l - track length (cm)
- p(m) - probability density function m - cosine
of angle between particle - trajectory and detector
- s - total mean free path to the detector
- R- distance to the detector
- sT(E)- microscopic cross section (barns), sf(E)
- fission x-section - H(E) - heating number (MeV/collision)
- Q - fission heating Q-value (MeV)
- ra - atom density (atoms/barn-cm), m - cell mass
(g)
80ESTIMATORS
- Definitions
- Particle speed - v(cm/s)
- Particle density - n (particles/cm3), a function
of position, energy, angle, and time - Flux (particles/cm2s)
- Fluence (particles/cm2)
- Cell fluence estimator (track length)
81- Total heating
- Fission Heating
- keff
82DEFINITIONS
Precision the uncertainty in Xn caused by the
statistical fluctuations in the sampled xis
- Monte Carlo codes can estimate this (relative
error)
- User controlled factors related to precision
- Forward versus adjoint calculation
- Estimator type (tally)
- Variance reduction technique
- Number of histories run
83DEFINITIONS
Efficiency a measure of how quickly the desired
precision is achieved
- Monte Carlo codes can estimate this (Figure of
Merit - FOM)
FOM should be constant with N Larger FOM more
efficient
- Factors affecting efficiency
- History-scoring efficiency
- Dispersions in nonzero history scores
- Computer time per history
84VARIANCE REDUCTION MOTIVATION
ý
q fraction with xi¹0
R2eff
R2non
R2eff can be a significant part of the relative
error Variance reduction techniques should strive
to equalize the xi scores as well as reduce the
fraction of zero scores.
85VARIANCE REDUCTION TECHNIQUE
Type Time and energy cutoffs
T Weight window generator P Energy splitting
and Russian roulette P Forced
collisions M Exponential transform D
86TYPES OF VARIANCE REDUCTION
(T) Truncation method - trancates parts of phase
space that do not contribute significantly to the
solution (P) Population control method - uses
particle splitting and Russian roulette to
control the number of samples taken in various
regions of phase space (M) Modified sampling
method - alters the statistical sampling of a
problem to increase the amount of information
squeezed from each trajectory. Sampling is done
from distributions that send particles in desired
directions or into other desired regions of phase
space such as time, energy, or change the
location or type of collision (D) Partially
deterministic methods - circumvents part of the
normal random walk process (e.g. next event
estimator)
87VARIANCE REDUCTION TECHNIQUE
Implicit Capture - a splitting process where the
particle is split into absorbed weight (which is
not followed) and serviving weight. Applied after
each collision Surviving weight is given by
Generally this decreases Reff faster than
increasing T.
88VARIANCE REDUCTION TECHNIQUE
Weight cutoff - Russian roulette is played if a
particles weight drops below a user-specified
weight cutoo. The particle is either killed or
its weight is increased. Unlike other cutoffs,
weight cutoff is NOT biased. Applied when W lt Rj
WC2 and survival is given by probability
W/(WC1 Rj) weight WC1 Rj
Rj ratio of source cell/ cell j
importances
This decreases Rnon faster than increasing T
89VARIANCE REDUCTION TECHNIQUE
Geometry splitting and Russian roulette -
particles in important regions are increased in
number (or weight) for better sampling and
decreased in number in other regions.
Applied at surface crossing. If importance ratio
(previous cell to new) is an integer gt 2, the
particle is split into n particles with weight
W/n If ratio is less than one, Russian roulette
is played.
This decreases Reff faster than increasing T
90 SPLITTING
Lower importance region
Higher importance region
91 RUSSIAN ROULETTE
Bang!
Lower importance region
Higher importance region
92VARIANCE REDUCTION TECHNIQUE
General source biasing - allows the production of
more source particles. with suitably reduced
weights, in the more important regimes of each
variables. Most common variables Angle Ene
rgy Position This decrease Rnon and Reff
faster than increasing T.
93The END
94EXPONENTIAL TRANSFORM
Requirements for preserving expected
collided weight
uncollided weight
95VARIANCE REDUCTION CAUTIONSI could have it done
in a much more complicated way said the red
Queen, immensely proudLewis Caroll
- Be cautious
- the advantage of one variance reduction technique
may cancel another - balance user time with computation time
- analyse carefully the results
- make cells small enough so neighbouring
importances do not exceed a factor of 8-10
96Monte Carlo and Transport Equation
Boltzman Transport Equation - Time-independent,
Linear A general integral form
97Monte Carlo and Transport Equation
Source term for the Boltzmann equation
98Photon Physics
- Coherent (Thomson) Scattering Form Factors
- Inhorenet (Compton) Scattering Form Factors
- Pair Production
- Photoelectric Absorption and Fluorescence
- Thick-Target Bremsstrahlung
99Photon Physics Approximations
- Only K,L edges treated for photoelectric
absorption - Distance to collision sampled, not distance to
scatter - Thick/thin-target bremsstrahlung
- No distinction between pair and triplet
production - No anomalous scattering factors
- No photoneutrons
100Surface flux
- Cell flux estimator
- Surface flux estimator
l
m
d
A