next up previous contents
Next: 5.3.3 Direction Vector Calculation Up: 5.3 Generation of Random Previous: 5.3.1 Power Cosine Distribution

5.3.2 Coned Cosine Distribution

Next, the distribution introduced in (2.17) is considered, for which $ {g}({\theta})=\cos({\theta}/{a})$ for all $ {\theta}\in\left[0,{\theta}_{\text{cone}}\right]$ . Hence, all angles are within a cone with apex angle $ 2{\theta}_{\text{cone}}$ . This is the reason for the name of the distribution used in this work. $ {a}$ and $ {\theta}_{\text{cone}}$ are related by $ \frac{\pi}{2}{a}={\theta}_{\text{cone}}$ . To restrict the emission of particles to one hemisphere, $ {\theta}_{\text{cone}}$ must satisfy $ {\theta}_{\text{cone}}\leq\frac{\pi}{2}$ , which is equivalent to $ {a}\leq1$ . The probability density of the polar angle is given by

$\displaystyle {f}_{\theta}({\theta}) = \cos({\theta}/{a})\sin{\theta}.$ (5.40)

The corresponding cumulative distribution function is

$\displaystyle {F}_{\theta}({\theta}) = \begin{cases}\frac{ \sin{\theta}\sin({\t...
...{\pi}{2}{a})-{a} } & {a}<1, \\ \left(\sin{\theta}\right)^2 & {a}=1, \end{cases}$ (5.41)

Since it is not possible to calculate an explicit expression for the inverse function $ {F}_{\theta}^{-1}({\theta})$ , which is useful for the inverse method, the rejection technique is chosen instead [25]. For the rejection method an instrumental distribution $ {f}'_{\theta}({\theta})$ is necessary, which is an upper bound approximation of $ {f}_{\theta}({\theta})$ , and which leads to an invertable cumulative distribution function.

Using the inequalities

$\displaystyle \cos{x} \leq 1-\left({\textstyle\frac{2}{\pi}}{x}\right)^2 \quad \forall {x}\in{\textstyle\left[-\frac{\pi}{2},\frac{\pi}{2}\right]}$ (5.42)

and

$\displaystyle \sin{x} \leq {x} \quad \forall{x}\geq0$ (5.43)

(see Inequality 1 and Inequality 2 in Appendix C) such an instrumental probability density function for (5.40) is given by

$\displaystyle {f}'_{\theta}({\theta}) := \left(1-\frac{{\theta}^2}{{\theta}_{\t...
...theta}({\theta}) \quad \forall{\theta}\in\left[0,{\theta}_{\text{cone}}\right].$ (5.44)

The corresponding cumulative distribution function is

$\displaystyle {F}'_{\theta}({\theta}) = 1-\left(1-\left(\frac{{\theta}}{{\theta}_{\text{cone}}}\right)^2\right)^2.$ (5.45)

According to the rejection method a random polar angle following $ {f}_{\theta}$ can be generated by feeding the inverse of the instrumental cumulative distribution function

$\displaystyle {\theta} = {F}'^{-1}_{\theta}({u}) = {\theta}_{\text{cone}}\sqrt{1-\sqrt{1-{u}}}$ (5.46)

with uniformly distributed random variates $ {u}\in\left[0,1\right]$ and accepting $ {\theta}$ , if

$\displaystyle {u}'{f}'_{\theta}({\theta})\leq{f}_{\theta}({\theta}),$ (5.47)

where $ {u}'$ denotes another uniformly distributed variate on $ \left[0,1\right]$ . Algorithm 5.3 summarizes the entire procedure for determining random polar angles, which are distributed according to the coned cosine distribution.


\begin{algorithm}
% latex2html id marker 9486\caption{Generation of a $\cos(\f...
...heta}\leq{\theta}_{\text{cone}}$
\EndFunction
\end{algorithmic}}
\end{algorithm}

The efficiency $ {\gamma}$ of rejection sampling for this case, thus the fraction of successful attempts satisfying (5.47), is given by

$\displaystyle {\gamma} =\frac{ \int_{0}^{{\theta}_{\text{cone}}}{f}_{\theta}({\...
...\left(1-{a}^2\right)} & \text{if}\ 0<{a}<1,\\ 1 & \text{if}\ {a}=1. \end{cases}$ (5.48)

The presented algorithm shows a very high efficiency, since $ {\gamma}\geq\frac{8}{\pi^2}$ holds for all $ {a}\in\left]0,1\right]$ (see Inequality 3 in Appendix C), which corresponds to a success rate of approximately $ \SI{81}{\percent}$ in the worst case.


next up previous contents
Next: 5.3.3 Direction Vector Calculation Up: 5.3 Generation of Random Previous: 5.3.1 Power Cosine Distribution

Otmar Ertl: Numerical Methods for Topography Simulation