Analytic Method
One method of generating a random number
with a specified
distribution
is to create a random event for the variable
such that the random event falls with frequency p(x)dx in the
interval
.
This method requires the normalization of
the probability density function over the interval (a,b)
 |
(A1) |
This is done by choosing a random number R uniformly distributed
in the interval [0,1] and requiring
 |
(A2) |
[6,56]. Note that
represents the cumulative probability distribution function for
.
In the variable stepsize Monte Carlo method, the stepsize is randomly
generated based on the probability that the photon will interact in a
given distance. If the unnormalized probability density function for
the distance
is
 |
(A3) |
then the normalized probability density function over the interval
 |
(A4) |
When the probability density function
is substituted
into (A.2), a generating function for
in obtained
![\begin{displaymath}
\Delta s = -\ln\left[1-R(1-\exp(-\tau))\right]
\end{displaymath}](img586.gif) |
(A5) |
If the random variable
is distributed over the interval
then the appropriate generating function is
 |
(A6) |
Since R is a random number uniformly distributed between zero
and one, so is (1-R). If R' is a random number uniformly
distributed between zero and one, then it may be substituted for
(1-R) and and Equation (A.6) may be simplified to
 |
(A7) |
A normalized phase function describes the probability density function
for the azimuthal and longitudinal angles for a photon when it is
scattered. If the phase function has no azimuthal dependence, then the
azimuthal angle
is uniformly distributed between 0 and ,
and may be generated by multiplying a pseudo-random number R
uniformly distributed over the interval [0,1] by
 |
(A8) |
The probability density function for the longitudinal angle
between the current photon direction and the scattered photon
direction is found by integrating the phase function over all azimuthal
angles .
For example, the probability density function
for an isotropic distribution is
 |
(A9) |
Substituting Equation (A.9) into Equation (A.2) yields the
following generating function for cosine of the longitudinal angle
 |
(A10) |
The probability density function corresponding to the Henyey-Greenstein
phase function is
 |
(A11) |
The generating function for this distribution obtained using
Equation (A.2) [68] is
![\begin{displaymath}
\cos\theta = {1\over 2g_{\mathrm{HG}}}\left\lbrace
1+g_{\ma...
...over1-g_{\mathrm{HG}}+2g_{\mathrm{HG}} R}\right]
\right\rbrace
\end{displaymath}](img595.gif) |
(A12) |
This equation should not be used for isotropic scattering--Equation
(A.10) should be used in that case. The probability density function
for the modified Henyey-Greenstein phase function is
 |
(A13) |
To generate a longitudinal angle with this distribution, two
random numbers (R0 and R) uniformly distributed between zero and
one are needed. In this distribution, light is either scattered
isotropically or anisotropically. The first random number is used to
determine which type of scattering occurs. The fraction of light
scattered isotropically ( )
is compared with the first random
number, if
then the photon is scattered isotropically
according to Equation (A.10), otherwise the photon is scattered using
the generating function given by Equation (A.12).
|