analistica/notes/sections/4.md

241 lines
8.0 KiB
Markdown
Raw Normal View History

2020-03-06 02:24:32 +01:00
# Exercise 4
2020-05-29 19:32:03 +02:00
## Kinematic dip derivation
Consider a great number of non-interacting particles having random momenta
$\vec{P}$, with magnitude between 0 and $P_{\text{max}}$, at an angle $\theta$
wrt to some coordinate system ($\hat{x}$, $\hat{y}$, $\hat{z}$).
The vertical and horizontal components of a particle momentum, which will be
referred as $\vec{P_v}$ and $\vec{P_h}$ respectively, are shown in
@fig:components.
If $\theta$ is uniformly distributed on the unit sphere and $P$ is uniformly
distributed in $[0, P^\text{max}]$, what will be the average value
$|P_v|$ of the particles with a given $P_h$?
2020-03-06 02:24:32 +01:00
\begin{figure}
\hypertarget{fig:components}{%
\centering
2020-04-23 23:56:53 +02:00
\begin{tikzpicture}[font=\scriptsize]
2020-03-06 02:24:32 +01:00
% Axes
\draw [thick, ->] (5,2) -- (5,8);
\draw [thick, ->] (5,2) -- (2,1);
\draw [thick, ->] (5,2) -- (8,1);
\node at (1.5,0.9) {$x$};
\node at (8.5,0.9) {$y$};
\node at (5,8.4) {$z$};
% Momentum
\definecolor{cyclamen}{RGB}{146, 24, 43}
\draw [ultra thick, ->, cyclamen] (5,2) -- (3.8,6);
\draw [thick, dashed, cyclamen] (3.8,0.8) -- (3.8,6);
\draw [thick, dashed, cyclamen] (5,7.2) -- (3.8,6);
\draw [ultra thick, ->, pink] (5,2) -- (5,7.2);
\draw [ultra thick, ->, pink] (5,2) -- (3.8,0.8);
2020-05-12 22:38:14 +02:00
\node at (4.8,1.1) {$\vec{P_h}$};
\node at (5.5,6.6) {$\vec{P_v}$};
\node at (3.3,5.5) {$\vec{P}$};
2020-03-06 02:24:32 +01:00
% Angle
\draw [thick, cyclamen] (4.4,4) to [out=80,in=210] (5,5);
\node at (4.7,4.2) {$\theta$};
\end{tikzpicture}
\caption{Momentum components.}\label{fig:components}
}
\end{figure}
2020-05-29 19:32:03 +02:00
2020-05-12 22:38:14 +02:00
Since the aim is to compute $\langle |P_v| \rangle (P_h)$, the conditional
distribution probability of $P_v$ given a fixed value of $P_h = x$ must first
be determined. It can be computed as the ratio between the probability of
2020-05-29 19:32:03 +02:00
getting a fixed value of $P_v$ given $x$ to the total probability of
2020-05-12 22:38:14 +02:00
getting that $x$:
2020-04-23 23:56:53 +02:00
$$
f (P_v | P_h = x) = \frac{f_{P_h , P_v} (x, P_v)}
{\int_{\{ P_v \}} d P_v f_{P_h , P_v} (x, P_v)}
= \frac{f_{P_h , P_v} (x, P_v)}{I}
$$
2020-05-29 19:32:03 +02:00
where $f_{P_h , P_v}$ is the joint PDF of the two variables $P_v$ and $P_h$ and
2020-05-12 22:38:14 +02:00
the integral $I$ runs over all the possible values of $P_v$ given a certain
$P_h$.
2020-05-29 19:32:03 +02:00
$f_{P_h , P_v}$ can simply be computed from the joint PDF of $\theta$ and $P$
with a change of variables. For the PDF of $\theta$ $f_{\theta} (\theta)$, the
2020-05-12 22:38:14 +02:00
same considerations done in @sec:3 lead to:
2020-03-06 02:24:32 +01:00
$$
2020-04-23 23:56:53 +02:00
f_{\theta} (\theta) = \frac{1}{2} \sin{\theta} \chi_{[0, \pi]} (\theta)
2020-03-06 02:24:32 +01:00
$$
2020-05-29 19:32:03 +02:00
whereas, being $P$ uniform:
2020-04-23 23:56:53 +02:00
$$
2020-05-12 22:38:14 +02:00
f_P (P) = \chi_{[0, P_{\text{max}}]} (P)
2020-04-23 23:56:53 +02:00
$$
2020-03-06 02:24:32 +01:00
2020-04-23 23:56:53 +02:00
where $\chi_{[a, b]} (y)$ is the normalized characteristic function which value
2020-05-12 22:38:14 +02:00
is $1/N$ between $a$ and $b$ (where $N$ is the normalization term) and 0
2020-05-29 19:32:03 +02:00
elsewhere. Since $P,\theta$ are independent variables, their joint PDF is
simply given by the product:
2020-03-06 02:24:32 +01:00
$$
2020-05-12 22:38:14 +02:00
f_{\theta , P} (\theta, P) = f_{\theta} (\theta) f_P (P)
2020-04-23 23:56:53 +02:00
= \frac{1}{2} \sin{\theta} \chi_{[0, \pi]} (\theta)
2020-05-12 22:38:14 +02:00
\chi_{[0, P_{\text{max}}]} (P)
2020-03-06 02:24:32 +01:00
$$
2020-05-29 19:32:03 +02:00
and they are related to the vertical and horizontal components
by a standard polar coordinate transformation:
2020-03-06 02:24:32 +01:00
2020-05-29 19:32:03 +02:00
\begin{align*}
2020-04-23 23:56:53 +02:00
\begin{cases}
P_v = P \cos(\theta) \\
P_h = P \sin(\theta)
\end{cases}
2020-05-29 19:32:03 +02:00
&&
2020-04-23 23:56:53 +02:00
\begin{cases}
P = \sqrt{P_v^2 + P_h^2} \\
2020-05-29 19:32:03 +02:00
\theta = \text{atan2}(P_h, P_v)
2020-04-23 23:56:53 +02:00
\end{cases}
2020-05-29 19:32:03 +02:00
\end{align*}
where:
2020-03-06 02:24:32 +01:00
2020-05-29 19:32:03 +02:00
- $\theta \in [0, \pi]$,
- and atan2 is defined by:
2020-03-06 02:24:32 +01:00
$$
2020-05-29 19:32:03 +02:00
\begin{cases}
\arctan(P_h/P_v) &\incase P_v > 0 \\
\arctan(P_h/P_v) + \pi &\incase P_v < 0 \\
\pi/2 &\incase P_v = 0
\end{cases}
2020-04-23 23:56:53 +02:00
$$
2020-05-29 19:32:03 +02:00
The Jacobian of the inverse transformation is easily found to be:
$$
|J^{-1}| = \frac{1}{\sqrt{P_v^2 + P_h^2}}
$$
Hence, the PDF written in the new coordinates is:
$$
2020-04-23 23:56:53 +02:00
f_{P_h , P_v} (P_h, P_v) =
2020-05-29 19:32:03 +02:00
\frac{1}{2} \sin\left[ \text{atan2}(P_h, P_v) \right]
\chi_{[0, \pi]} \left[\text{atan2}(P_h, P_v)\right] \cdot \\
\frac{\chi_{[0, p_{\text{max}}]} \left(\sqrt{P_v^2 + P_h^2} \right)}
2020-04-23 23:56:53 +02:00
{\sqrt{P_v^2 + P_h^2}}
2020-03-06 02:24:32 +01:00
$$
2020-05-29 19:32:03 +02:00
The integral $I$ can now be computed. Note that the domain
is implicit in the characteristic function:
2020-03-06 02:24:32 +01:00
$$
2020-05-29 19:32:03 +02:00
I(x) = \int_{-\infty}^{+\infty} dP_v \, f_{P_h , P_v} (x, P_v)
= \int \limits_{- \sqrt{P_{\text{max}}^2 - P_h}}
^{\sqrt{P_{\text{max}}^2 - P_h}}
dP_v \, f_{P_h , P_v} (x, P_v)
2020-03-06 02:24:32 +01:00
$$
2020-05-29 19:32:03 +02:00
With some basic calculus and the identity
2020-03-06 02:24:32 +01:00
$$
2020-05-29 19:32:03 +02:00
\sin[ \text{atan2}(P_h, P_v)] = \frac{P_h}{\sqrt{P_h^2 + P_v^2}},
2020-03-06 02:24:32 +01:00
$$
2020-05-29 19:32:03 +02:00
the integral can be evaluated to give
2020-04-23 23:56:53 +02:00
$$
2020-05-29 19:32:03 +02:00
I = 2 \, \arctan \left( \sqrt{\frac{P_{\text{max}}^2}{x^2} - 1} \right),
2020-04-23 23:56:53 +02:00
$$
from which:
$$
2020-05-29 19:32:03 +02:00
f (P_v | P_h = x) =
\frac{x}{P_v^2 + x^2} \cdot
\frac{\chi_{[0, \pi]} \left[\text{atan2}(P_h, P_v)\right]
\chi_{[0, p_{\text{max}}]} \left(\sqrt{P_v^2 + P_h^2}\right)}{2 \, \arctan
2020-04-23 23:56:53 +02:00
\left( \sqrt{\frac{P_{\text{max}}^2}{x^2} - 1} \right)}
$$
2020-03-06 02:24:32 +01:00
2020-05-12 22:38:14 +02:00
Finally, putting all the pieces together, the average value of $|P_v|$ can be
computed:
$$
2020-05-29 19:32:03 +02:00
\langle |P_v| \rangle(x)
= \int P_v f (P_v | P_h = x) dP_v
= \frac{x \ln \left( \frac{P_{\text{max}}}{x} \right)}
{\arctan \left( \sqrt{ \frac{P^2_{\text{max}}}{x^2} - 1} \right)}
2020-05-12 22:38:14 +02:00
$$ {#eq:dip}
2020-03-06 02:24:32 +01:00
2020-05-29 19:32:03 +02:00
The result is plotted in the figure below:
2020-03-06 02:24:32 +01:00
2020-05-29 19:32:03 +02:00
![Plot of the expected dependence of $\langle |P_v| \rangle$ with
2020-05-20 18:45:27 +02:00
$P_{\text{max}} = 10$.](images/4-expected.pdf){#fig:plot}
2020-03-06 02:24:32 +01:00
2020-04-01 01:36:28 +02:00
## Monte Carlo simulation
2020-03-06 02:24:32 +01:00
2020-05-29 19:32:03 +02:00
This dependence should be found by running a Monte Carlo simulation and
computing a binned average of the vertical momentum. A number of $N = 50000$
particles were generated as pair of values ($P$, $\theta$), with $P$
uniformly distributed between 0 and $P_{\text{max}}$ and $\theta$ given by the
same procedure described in @sec:3, namely:
2020-03-06 02:24:32 +01:00
$$
2020-05-29 19:32:03 +02:00
\theta = \arccos(1 - 2x)
2020-03-06 02:24:32 +01:00
$$
2020-05-29 19:32:03 +02:00
where $x$ is uniformly distributed between 0 and 1.
The binning turned out to be quite a challenge: once a $P$ is sampled and
$P_h$ computed, the bin containing the latter has to be found. If
the range $[0, P_{\text{max}}]$ is divided into $n$ equal bins
of the width
2020-03-06 02:24:32 +01:00
$$
2020-05-12 22:38:14 +02:00
w = \frac{P_{\text{max}}}{n}
2020-03-06 02:24:32 +01:00
$$
2020-05-29 19:32:03 +02:00
then (counting from zero) $P_h$ goes into the $i$-th bin where
2020-03-06 02:24:32 +01:00
$$
2020-05-29 19:32:03 +02:00
i = \left\lfloor \frac{P_h}{w} \right\rfloor
2020-03-06 02:24:32 +01:00
$$
2020-05-29 19:32:03 +02:00
Then, the sum $S_j$ of all the $|P_v|$ values relative to the $P_h$ of the
$j$-th bin itself and number num$_j$ of the bin counts are stored in an array
and iteratively updated. Once every bin has been updated, the average value of
$|P_v|_j$ is computed as $S_j / \text{num}_j$.
2020-05-12 22:38:14 +02:00
For the sake of clarity, for each sampled couple the procedure is the
following. At first $S_j = 0 \wedge \text{num}_j = 0 \, \forall \, j$, then:
2020-03-06 02:24:32 +01:00
2020-05-12 22:38:14 +02:00
- the couple $(P, \theta)$ is generated,
- $P_h$ and $P_v$ are computed,
- the $j^{\text{th}}$ bin containing $P_h$ is found,
- num$_j$ is increased by 1,
- $S_j$ is increased by $|P_v|$.
2020-03-06 02:24:32 +01:00
2020-05-12 22:38:14 +02:00
For $P_{\text{max}} = 10$ and $n = 50$, the following result was obtained:
2020-03-06 02:24:32 +01:00
2020-05-20 18:45:27 +02:00
![Sampled points histogram.](images/4-dip.pdf)
2020-03-06 02:24:32 +01:00
2020-05-29 19:32:03 +02:00
In order to assert the compatibility of the expected function (@eq:dip)
with the histogram, a least squares minimization was applied. Being a simple
one-parameter fit, the $\chi^2$ was implemented manually and minimised
without using a general LSQ routine. The error of the estimation of
$P_{\text{max}}$ was computed as the inverse of the $\chi^2$ second derivative
at the minimum, according to the Cramér-Rao bound.
2020-05-12 22:38:14 +02:00
The following results were obtained:
2020-05-29 19:32:03 +02:00
\begin{align*}
P^{\text{oss}}_{\text{max}} = 10.005 \pm 0.018 && \chi^2 &= 0.071 \\
&& \text{P}(x > \chi^2) &= 0.79
\end{align*}
2020-05-29 19:32:03 +02:00
The $\chi^2$ and $p$-value show a very good agreement.
2020-05-12 22:38:14 +02:00
In order to compare $P^{\text{oss}}_{\text{max}}$ with the expected value
2020-05-28 20:49:08 +02:00
$P_{\text{max}} = 10$, the following compatibility $t$-test was applied:
2020-04-28 22:24:09 +02:00
$$
p = 1 - \text{erf}\left(\frac{t}{\sqrt{2}}\right)\ \with
2020-05-12 22:38:14 +02:00
t = \frac{|P^{\text{oss}}_{\text{max}} - P_{\text{max}}|}
{\Delta P^{\text{oss}}_{\text{max}}}
2020-04-28 22:24:09 +02:00
$$
2020-05-12 22:38:14 +02:00
where $\Delta P^{\text{oss}}_{\text{max}}$ is the $P^{\text{oss}}_{\text{max}}$
uncertainty. At 95% confidence level, the values are compatible if $p > 0.05$.
2020-04-28 22:24:09 +02:00
In this case:
2020-04-28 23:44:24 +02:00
- t = 0.295
- p = 0.768
2020-04-28 22:24:09 +02:00
which allows to assert that the sampled points actually follow the predicted
2020-05-29 19:32:03 +02:00
function. In @fig:fit, the fit function superimposed on the histogram is
2020-04-28 23:44:24 +02:00
shown.
2020-05-12 22:38:14 +02:00
![Fitted sampled data. $P^{\text{oss}}_{\text{max}} = 10.005
2020-05-29 19:32:03 +02:00
\pm 0.018$, $\chi^2 = 0.071$.](images/4-fit.pdf){#fig:fit}