02.05.2014 Views

PENELOPE 2003 - OECD Nuclear Energy Agency

PENELOPE 2003 - OECD Nuclear Energy Agency

PENELOPE 2003 - OECD Nuclear Energy Agency

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1.2. Random sampling methods 17<br />

the corresponding cumulative distribution function is P(r) = 1−exp(−r 2 /2). Therefore,<br />

r can be generated by the inverse transform method as<br />

√<br />

√<br />

r = −2 ln(1 − ξ) = −2 ln ξ.<br />

The two independent normal random variables are given by<br />

√<br />

x 1 = −2 ln ξ 1 cos(2πξ 2 ),<br />

x 2 =<br />

√<br />

−2 ln ξ 1 sin(2πξ 2 ), (1.54)<br />

where ξ 1 and ξ 2 are two independent random numbers. This procedure is known as the<br />

Box-Müller method. It has the advantages of being exact and easy to program (it can<br />

be coded as a single fortran statement).<br />

The mean and variance of the normal variable are 〈x〉 = 0 and var(x) = 1. The<br />

linear transformation<br />

X = m + σx (σ > 0) (1.55)<br />

defines a new random variable. From the properties (1.14) and (1.29), we have<br />

The PDF of X is<br />

〈X〉 = m and var(X) = σ 2 . (1.56)<br />

p(X) = p G (x) dx<br />

dX = 1 [<br />

]<br />

σ √ 2π exp (X − m)2<br />

− , (1.57)<br />

2σ 2<br />

i.e. X is normally distributed with mean m and variance σ 2 . Hence, to generate X<br />

we only have to sample x using the Box-Müller method and apply the transformation<br />

(1.55).<br />

Example 2. Uniform distribution on the unit sphere<br />

In radiation transport, the direction of motion of a particle is described by a unit vector<br />

ˆd. Given a certain frame of reference, the direction ˆd can be specified by giving either<br />

its direction cosines (u, v, w) (i.e. the projections of ˆd on the directions of the coordinate<br />

axes) or the polar angle θ and the azimuthal angle φ, defined as in fig. 1.5,<br />

Notice that θ ∈ (0, π) and φ ∈ (0, 2π).<br />

ˆd = (u, v, w) = (sin θ cos φ, sin θ sin φ, cos θ). (1.58)<br />

A direction vector can be regarded as a point on the surface of the unit sphere.<br />

Consider an isotropic source of particles, i.e. such that the initial direction (θ, φ) of<br />

emitted particles is a random point uniformly distributed on the surface of the sphere.<br />

The PDF is<br />

p(θ, φ) dθ dφ = 1<br />

[ ] [ ]<br />

sin θ 1<br />

4π sin θ dθ dφ = 2 dθ 2π dφ . (1.59)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!