Monte Carlo Sampling

Similar documents
MCRT L10: Scattering and clarification of astronomy/medical terminology

Monte Carlo Radiation Transfer I

Enrico Fermi and the FERMIAC. Mechanical device that plots 2D random walks of slow and fast neutrons in fissile material

MCRT L9: Neutron Transport

MCRT: L4 A Monte Carlo Scattering Code

If light travels past a system faster than the time scale for which the system evolves then t I ν = 0 and we have then

Reflection Nebulae: can reflections from grains diagnose albedo?

Mean Intensity. Same units as I ν : J/m 2 /s/hz/sr (ergs/cm 2 /s/hz/sr) Function of position (and time), but not direction

Applied Nuclear Physics (Fall 2006) Lecture 19 (11/22/06) Gamma Interactions: Compton Scattering

Interaction theory Photons. Eirik Malinen

Monte Carlo Radiation Transport Kenny Wood

Radiation Processes. Black Body Radiation. Heino Falcke Radboud Universiteit Nijmegen. Contents:

PHYS 390 Lecture 23 - Photon gas 23-1

Spectroscopy Lecture 2

Lecture 06. Fundamentals of Lidar Remote Sensing (4) Physical Processes in Lidar

Goal: The theory behind the electromagnetic radiation in remote sensing. 2.1 Maxwell Equations and Electromagnetic Waves

We start with a reminder of a few basic concepts in probability. Let x be a discrete random variable with some probability function p(x).

Bethe-Block. Stopping power of positive muons in copper vs βγ = p/mc. The slight dependence on M at highest energies through T max

2. NOTES ON RADIATIVE TRANSFER The specific intensity I ν

Compton Scattering I. 1 Introduction

Monte Carlo Radiation Transport Kenny Wood

Opacity and Optical Depth

Lecture 3: Specific Intensity, Flux and Optical Depth

Advanced Heat and Mass Transfer by Amir Faghri, Yuwen Zhang, and John R. Howell

Interstellar Medium Physics

Laser Beam Interactions with Solids In absorbing materials photons deposit energy hc λ. h λ. p =

Chemistry 795T. Lecture 7. Electromagnetic Spectrum Black body Radiation. NC State University

Chemistry 795T. Black body Radiation. The wavelength and the frequency. The electromagnetic spectrum. Lecture 7

1 Radiative transfer etc

Chemistry 4531 Spring 2009 QUANTUM MECHANICS 1890's I. CLASSICAL MECHANICS General Equations LaGrange Hamilton

PHYS 5012 Radiation Physics and Dosimetry

Sources of radiation

Blackbody radiation. Main Laws. Brightness temperature. 1. Concepts of a blackbody and thermodynamical equilibrium.

AST1100 Lecture Notes

Chapter 7: Quantum Statistics

1. Why photons? 2. Photons in a vacuum

Radiative transfer in planetary atmospheres

PHYS 5012 Radiation Physics and Dosimetry

Numerical Heat and Mass Transfer

Radiative Processes in Astrophysics. Lecture 9 Nov 13 (Wed.), 2013 (last updated Nov. 13) Kwang-Il Seon UST / KASI

Addition of Opacities and Absorption

Radiation processes and mechanisms in astrophysics I. R Subrahmanyan Notes on ATA lectures at UWA, Perth 18 May 2009

AST1100 Lecture Notes

Chapter 7: Quantum Statistics

Chapter 3 Energy Balance and Temperature. Astro 9601

What is it good for? RT is a key part of remote sensing and climate modeling.

ASTR240: Radio Astronomy

de = j ν dvdωdtdν. (1)

MIDSUMMER EXAMINATIONS 2001

Radiative Processes in Flares I: Bremsstrahlung

Astrophysics with the Computer: Propagation of Ionization Fronts in Interstellar Gas

Electromagnetic Spectra. AST443, Lecture 13 Stanimir Metchev

Fundamental Stellar Parameters

Chapter 3 Energy Balance and Temperature. Topics to be covered

The Electromagnetic Spectrum

The Stellar Opacity. F ν = D U = 1 3 vl n = 1 3. and that, when integrated over all energies,

Fundamental Concepts of Radiation -Basic Principles and Definitions- Chapter 12 Sections 12.1 through 12.3

Outline. Today we will learn what is thermal radiation

Basics of Monte Carlo Simulation

Electromagnetic Radiation. Physical Principles of Remote Sensing

SAMPLING SPECIAL DISTRIBUTIONS

Reflection = EM strikes a boundary between two media differing in η and bounces back

INFRAMET. 2.1 Basic laws

Chapter 3. Electromagnetic Theory, Photons. and Light. Lecture 7

Synchrotron Radiation II

Lecture 2: principles of electromagnetic radiation

Interactions of Photons with Matter Compton Scatter (Part 2)

SISD Training Lectures in Spectroscopy

Synchrotron Radiation: II. Spectrum

Infrared thermography

Solar Energy. PEN : Lectures Week3

Beer-Lambert (cont.)

2. Basic assumptions for stellar atmospheres

11 Quantum theory: introduction and principles

Compton Scattering II

ATM 507 Lecture 4. Text reading Chapters 3 and 4 Today s topics Chemistry, Radiation and Photochemistry review. Problem Set 1: due Sept.

Tomography and Reconstruction

Integrals in cylindrical, spherical coordinates (Sect. 15.7)

Astronomy 203 practice final examination

Stellar Astrophysics: The Continuous Spectrum of Light

Electrodynamics of Radiation Processes

Optical Imaging Chapter 5 Light Scattering

ν is the frequency, h = ergs sec is Planck s constant h S = = x ergs sec 2 π the photon wavelength λ = c/ν

Lecture 4* Inherent optical properties, IOP Theory. Loss due to absorption. IOP Theory 12/2/2008

I ν. di ν. = α ν. = (ndads) σ ν da α ν. = nσ ν = ρκ ν

Chapter 13. Phys 322 Lecture 34. Modern optics

The Radiative Transfer Equation

12.815/12.816: RADIATIVE TRANSFER PROBLEM SET #1 SOLUTIONS

2. Basic Assumptions for Stellar Atmospheres

I. Rayleigh Scattering. EE Lecture 4. II. Dipole interpretation

Linear and circular polarization in GRB afterglows

Ay 20 Basic Astronomy and the Galaxy Problem Set 2

Chapter 2 Bremsstrahlung and Black Body

3 The Friedmann-Robertson-Walker metric

Astrophysical Radiation Processes

Radiation in the atmosphere

ATMO/OPTI 656b Spring 2009

Lecture Notes Prepared by Mike Foster Spring 2007

p(θ,φ,θ,φ) = we have: Thus:

Waves & Oscillations

Transcription:

Monte Carlo Sampling Sampling from PDFs: given F(x) in analytic or tabulated form, generate a random number ξ in the range (0,1) and solve the equation to get the randomly sampled value X X ξ = F(x)dx = C(X) x min Solve this analytically, numerically, or by clever means X P(θ) F(ξ) θ i θ A ξ i 1 ξ

Power Law Spectrum General power law spectrum: y = a x n + c Choose random frequency ν R from a power law spectrum: F(ν) ~ ν -α with ν 1 < ν < ν 2 Synchrotron spectrum from electrons spiraling in a magnetic field

Power Law Spectrum General power law spectrum: y = a x n + c Choose random frequency ν R from a power law spectrum: F(ν) ~ ν -α with ν 1 < ν < ν 2 ξ = ν R ν 1 ν 2 ν α dν ν α dν = ν R [ ν 1 α ] ν 1 [ ν 1 α ] ν 1 ( [ ]) 1/(1 α ) ν 2 ν R = ν 1 1 α + ξ ν 2 1 α ν 1 1 α ν 1

Neutron Interactions Choose interaction event to be: absorption, scattering, or fission σ T = σ A + σ S + σ F Absorption Scattering Fission ran = ξ if (ran.lt. σ A /σ T ) then neutron absorbed elseif(ran.lt. (σ A +σ S )/σ T ) then neutron scattered else fission event endif

Tabulated Spectrum Solar spectrum: example of using numerical integration Given arrays of wavelengths, λ(i), and corresponding flux values, F(i), with i = 1, 2, N Numerical integration by trapezoidal rule: F(λ) dλ N 1 i=1 1 ( 2 F + F )( i+1 i λ i+1 λ ) i sum = 0 do i=1, N-1 sum = sum + 0.5*[F(i+1)+F(i)]*[lam(i+1)-lam(i)] end do Numerically compute and store the cumulative distribution λ λ function C(i): C(λ) = max F(λ') dλ'/ F(λ') dλ' λ min λ min

F(x) Trapezoidal Rule x i x i+1 x Area = [x i+1 x i ] [F(x i ) + F(x i+1 )] / 2

Tabulated Spectrum Recall that C(λ) increases monotonically from 0 to 1 Also recall Monte Carlo sampling: λ ξ = F(λ')dλ'= C(λ) λ min So, given a random number ξ, search C(i) to find C values that bracket ξ, and the corresponding indices i, i+1 Interpolate to get wavelength and flux corresponding to ξ, e.g., linear interpolation: ξ C(i) λ = λ(i) + [ λ(i +1) λ(i) ] C(i +1) C(i) F = F(i) + [ F(i +1) F(i) ] λ λ λ(i) λ(i +1) λ(i)

λ(1) Search an array by bisection Given a wavelength, λ 0, search an array of wavelengths λ(i), where i = 1, 2, N, to find the λs and i-values that bracket λ 0 λ(nlow) λ 0 λ(nlow+1) When exit the do-loop, λ 0 will be bracketed by the indices i = Nlow and i = Nlow + 1, λ(nlow) < λ 0 < λ(nlow + 1) λ(n) Nup = Ν Νlow=1 mid=(nup+nlow)/2 do while(nup Nlow.gt. 1) mid=(nup+nlow)/2) if (lam0.gt. lam(mid)) then Nup=Nup Nlow=mid else Nup=mid Nlow=Nlow endif end do

Setting the opacity If Monte Carlo simulation has source emitting a spectrum, then need to set optical properties (cross sections, opacities, etc) for the ensuing random walk for the wavelength randomly sampled from the spectrum Wavelength λ randomly sampled from source spectrum, find bracketing location as above in array of wavelengths for cross sections, interpolate to get optical properties: σ(λ) = σ(i) + [ σ(i +1) σ(i) ] λ λ(i) λ(i +1) λ(i)

Volume emission from uniform sphere Choose x, y, z randomly in the range (-1, 1) Reject if x 2 + y 2 + z 2 > 1 Choose new random set of x, y, z until x 2 + y 2 + z 2 < 1 OR sample from volume element dv = r 2 sinθ dr dθ dφ Choose r, θ, φ from appropriate pdfs group tutorial exercise Can use this algorithm to select source locations for neutrons when computing critical mass of a Uranium sphere

Cylinders or rods Choose z using: z = ξ h Choose x, y randomly in the range (-r, r) Reject if x 2 + y 2 > r 2 Choose new random set of x, y until x 2 + y 2 < r 2 OR choose z as above, but sample r, θ from appropriate pdfs for uniformly sampling points within a circle group tutorial exercise

Emission from a galaxy with stellar emission approximated as a smooth emissivity: j(r, z) ~ exp(- z / Z) exp(- r / R). Defined over 0 < r < R max, 0 < z < Z max Split into separate probabilities for r and z ξ = r 0 R 0 exp( r max r exp( r / R) dr = R log 1 = / R) dr [1 exp( r [1 exp( R / R)] / R)] ( ξ [1 exp( R / R)] ) max max

Laser beams Techniques for sampling from collimated laser beams, e.g., Gaussian beam profile

Launching from a collimated beam For a circular beam of uniform intensity can use rejection method to sample (x, y) launch positions of photons Choose x, y randomly in the range (-R, R) Reject if x 2 + y 2 > R 2 Choose new random set of x, y until x 2 + y 2 < R 2 Gaussian beam profile: exp[-(r/b) 2 ] Choose (r, φ) by: r = b ln(ξ) φ = 2π ξ See Jacques (2009) review eq 5.27 Use trigonometry to get (x, y)

Clever techniques Not as crucial now, but something still to consider when trying to speed up codes be efficient! Cost of evaluating functions: addition < division < exponentials < trig functions, etc Cashwell & Carter (1977) Third Monte Carlo Sampler, contains algorithms for sampling lots of functions

Isotropic emission or scattering Choosing isotropic direction cosines Simple method: µ = cosθ = 2ξ 1 φ = 2π ξ n x = 1 µ 2 sinφ n y = 1 µ 2 cosφ n z = µ From John von Neumann, to avoid evaluating sin φ, cos φ: Efficiency = π / 4 Choose x = 2ξ - 1, y = 2ξ 1 (different ξs!!) Reject if x 2 + y 2 > 1 cos φ = x/sqrt(x 2 + y 2 ), sin φ = y/sqrt(x 2 + y 2 ) Double angle formula avoids taking square root: cos φ = (x 2 y 2 )/(x 2 + y 2 ), sin φ = 2xy/(x 2 + y 2 )

Energy of fission neutrons Fission produced by an incident neutron of energy E 0. Sample energy E from the normalised fission spectrum, which can be approximated by the Maxwell spectrum: X(E) = 2 π 1/ 2 T(E 0) 3 / 2 E 1/ 2 e E /T (E 0 ) where T(E 0 ) is the nuclear temperature (in energy units) which is tabulated as a function of energy in nuclear data tables. Use three random numbers to get: + % π E = T(E 0 ) lnξ 1 ( lnξ 2 )cos 2 2 ξ (. - ' 3* 0, & )/

U235 Fission Spectrum

Blackbody Radiation Sample frequency ν from Planck function. Use the normalised Planck function with x = hν/kt B ν (T ) = 2hν 3 c 2 1 e hν /kt 1 ; b x = 15x 3 π 4 ( e x 1) Set: ' l ) π 4 L = min( l ; j 4 ξ 0 *) 90 j =1 + ), -) The notation {x; F(x)} means the set of all x satisfying F(x) Then: x = L 1 ln( ξ 1 ξ 2 ξ 3 ξ ) 4

Blackbody Radiation

Scattering Isotropic scattering: neutrons, photons See later lectures for non-isotropic scattering, polarization, and rotating angles from scattering to lab frame Non-isotropic: electrons, dust, molecules, biological tissue Rayleigh, Thompson/Compton, Klein-Nishina, Mie theory, Heyney-Greenstein functions