Monte Carlo History Statistical sampling Buffon s needles and estimates of π 1940s: neutron transport in fissile material Origin of name People: Ulam, von Neuman, Metropolis, Teller Other areas of use: population growth, statistics, finance anywhere where the occurrence of events can be described with a probability distribution function
Brief History Buffon s needles first Monte Carlo simulation Statistical sampling draw conclusions on an entire population by conducting a study on a small subset of the population. Used in maths since 1800s, but slow before computers. Lord Kelvin studied kinetic theory using random sampling to evaluate integrals. Generated random numbers by pulling pieces of paper from a jar. Fission of 235 U by neutrons discovered in 1938, possibility of chain reactions for power and explosives Enrico Fermi developed mechanical machine, the FERMIAC, to simulate neutron random walks
Enrico Fermi and the FERMIAC Mechanical device that plots 2D random walks of slow and fast neutrons in fissile material
Los Alamos Development of computers from the 1940s made Monte Carlo practical the ENIAC, MANIAC, etc Ideas from Metropolis, Ulam, von Neumann, Teller developed for neutron propagation
No whining about fortran!!!! Stan Ulam with the FERMIAC The ENIAC Electronic Numerical Integrator and Computer MANIAC: Mathematical Analyzer Numerical Integrator and Computer
Stan Ulam had ideas on numerical simulations when he was ill and playing solitaire (patience) Technique given name by Nick Metropolis First declassified paper published in 1949 by Metropolis & Ulam: The Monte Carlo Method
Los Alamos Computational cost of calculating trigonometric and exponential functions led to very elegant techniques and efficient ways for sampling from probability distribution functions, e.g., replacing computation of trigonometric functions with ratios Will show some examples of these techniques in a later lecture
Throwing dice Random number generator gives ξ i in range (0,1) 0 1 2 3 4 5 6 ran = ξ * 6. if (ran.lt. 1.) then dice = 1 elseif(ran.lt. 2.) then dice = 2 elseif etc, etc endif
Monte Carlo integration Use the relation: I = a b f (x) dx = (b a) f Generate n random values x i = a + ξ i (b - a), compute f(x i ) to give: f = 1 n n i=1 f (x i ) Estimate integral: I = (b a) n n i=1 f (x i ) This is brute force Monte Carlo Variance reduction techniques algorithms for reducing variance in estimate of I
Radiation transport: What happens? Photons emitted, travel some distance, interact with material Scattered, absorbed, re-emitted Photon interactions heat material; change level populations of atoms, ions, molecules; alter ionization balance and hence change opacity If medium in hydrostatic equilibrium: density structure related to temperature structure Density structure may depend on radiation field and vice versa radiation hydrodynamics
Monte Carlo Radiation Transport Emit from location (x, y, z) in direction n = (n x, n y, n z ) z n n x = sinθ cosφ x φ θ y Particle (photon, neutron, electron, etc) travels a distance before it interacts function of particle energy, geometry, density structure, and composition of the medium Interaction occurs: n y = sinθ sinφ n z = cosθ Scattering: change direction and possibly energy Absorption: deposit energy, emit new particle Fission: produce secondary neutrons and photons
Monte Carlo Radiation Transport Example of electron transport in fayalite (Fe 2 SiO 4 )
Monte Carlo Radiation Transport Photon transport through skin around a blood vessel mcxyz.c by Steve Jacques
Monte Carlo Radiation Transport Need probability distribution functions to describe: Emission location: point sources, extended volume emission (e.g., in astronomy can approximate stars as points, extended emission from gaseous nebulae) Emission direction: isotropic, beamed or collimated Interaction cross sections probability for a particular type of interaction to occur Scattering: isotropic (neutrons), non isotropic (dust, clouds, electrons, skin)
Monte Carlo Radiation Transport Generate lots of particles and follow their random walks not practical to store all information as we want quantities to compare to measurement: fluxes, pressure, temperatures, etc Monte Carlo detectors and estimators for mean intensities, fluxes, radiation pressure, heating and ionization rates, number of fissions, etc Not solving equation of radiation transport, but performing a numerical simulation of the transport processes and interactions Sample from probability distribution functions that describe the processes, so need a good random number generator
How far can we get without these? Equation of radiation transfer: 1 c t I ν + Ω.. I ν + ( k ν,s + k ) ν,a I ν = j ν + 1 4 π c k ν,s I ν dω Ω Boltzmann transport equation: f t + p m f. f + F. p = $ & f % t ' ) ( collisions
Your first Monte Carlo code: Estimate π using rejection method 2 R FORTRAN: Pick N random positions (x i, y i ): x i in range [-R, R]: x i = (2ξ - 1) R y i in range [-R, R]: y i = (2ξ - 1) R Reject (x i, y i ) if x i 2 + y i 2 > R 2 Number accepted / N = π R 2 / 4R 2 N A / N = π / 4 Increase accuracy: large N do i = 1, N x = 2.*ran 1. y = 2.*ran 1. if ( (x*x + y*y).lt. 1. ) NA = NA + 1 end do pi = 4.*NA / N