rizer.io.minplascalc.fit_elastic_cross_sections#
Fit the electron cross section from LXCat to the formula used in minplascalc.
WORK IN PROGRESS.
TODO:
[ ] Upgrade fit quality, especially for cross section with hollows.
[ ] Transform values to use \(\tau\) instead of \(\varepsilon\).
[ ] Add more cross sections.
Attributes#
Functions#
|
Fit function for the electron cross section. |
|
Fit the electron cross section from LXCat to the formula used in cross_section_fit. |
|
Convert coefficients of cross_section_fit to coefficients for minplascalc. |
Module Contents#
- rizer.io.minplascalc.fit_elastic_cross_sections.cross_section_fit(e_ev: numpy.ndarray, D1: float, D2: float, D3: float, D4: float) numpy.ndarray#
Fit function for the electron cross section.
Here, it is implied that the cross section is given in terms of energy.
- Parameters:
e_ev (
numpy.ndarray) – Energy values in eV.D1 (
float) – The value of D1.D2 (
float) – The value of D2.D3 (
float) – The value of D3.D4 (
float) – The value of D4.
- Returns:
The values of the cross section.
- Return type:
- rizer.io.minplascalc.fit_elastic_cross_sections.fit_from_lxcat_to_minplascalc(energy: numpy.ndarray, cross_section: numpy.ndarray, with_hollow: bool = False) tuple[float, float, float, float]#
Fit the electron cross section from LXCat to the formula used in cross_section_fit.
- Parameters:
energy (
numpy.ndarray) – Energy values in eV.cross_section (
numpy.ndarray) – Cross section values in m^2.with_hollow (
bool, optional) – If True, the cross section has a hollow. If False, the cross section has a peek.
- Returns:
The values of D1, D2, D3, D4.
- Return type:
Note
The fit used in cross_section_fit is given by:
\[\sigma(E) = D_1 + D_2 E^{D_3/2} \exp(-D_4 E)\]where \(D_1\), \(D_2\), \(D_3\), and \(D_4\) are the fit parameters.
The fit is done using the following approximation:
The first value of the cross section is assumed to be at zero energy: \(\sigma(0) = D_1\).
The extremum of the cross section is found:
If the cross section has a hollow, the minimum is found.
If the cross section has a peek, the maximum is found.
Defining \(g(E)=\sigma(E)/D_1\), the derivative of \(g(E)\) is:
\[g'(E) = \frac{D_2}{D_1} E^{D_3/2} \exp(-D_4 E) \left( \frac{D_3}{2 E} - D_4 \right)\]Setting \(g'(E) = 0\) and solving for \(E\), we find the extremum:
\[D_4 = \frac{D_3}{2 E_{extremum}}\]At the extremum, we have:
\[g(E_{extremum}) = \frac{\sigma(E_{extremum})}{D_1} = 1 + \frac{D_2}{D_1} E^{D_3/2} \exp(-\frac{D_3}{2})\]Therefore, we can find \(D_3\):
\[D_3 = 2 \frac{\log\left(\frac{\sigma(E_{extremum}) - 1}{D_2/D_1}\right)} {\log(E_{extremum}) - 1}\]The last value required is \(D_2\). We used a non-linear least squares fit to find it. The previous steps are used in the fit function to calculate the other parameters.
- rizer.io.minplascalc.fit_elastic_cross_sections.convert_coefficients_from_energy_to_tau(D1: float, D2: float, D3: float, D4: float) tuple[float, float, float, float]#
Convert coefficients of cross_section_fit to coefficients for minplascalc.
The coefficients of cross_section_fit are given in terms of energy, i.e. assuming \(\sigma = \sigma(\varepsilon)\). The coefficients of minplascalc are given in terms of \(\tau = \frac{m_e v_e}{\hbar}\), i.e. assuming \(\sigma = \sigma(\tau)\).
- Parameters:
- Returns:
The values of D1, D2, D3, and D4, assuming \(\sigma = \sigma(\tau)\).
- Return type:
Note
In [minplascalcPaper] (& [minplascalcPaper]), equation 24, the cross section is given in terms of \(\tau\):
\[\tau = \frac{\sqrt{2 m_r k_b T}}{\hbar}\]where \(m_r\) is the reduced mass, \(k_b\) is the Boltzmann constant, \(T\) is the temperature, and \(\hbar\) is the reduced Planck constant.
The cross section is given by:
\[\sigma(\tau) = D_1 + D_2 (\frac{m_r g}{\hbar})^{D_3} \exp(-D_4 (\frac{m_r g}{\hbar})^2)\]where \(g\) is the relative velocity.
For the case of an elastic collision between an electron and an heavy particle, the reduced mass is given by \(m_r = m_e\) and the relative velocity is given by \(g=v_e\).
Using the relation \(k_b T = \frac{1}{2} m_e v_e\), (/!/!/!False? Missing prefactor 3/2 /!/!/!) one arrives at \(\frac{m_r g}{\hbar} = \frac{m_e v_e}{\hbar} = \tau\).
Using \(k_b T = \frac{2}{3} \varepsilon[J] = \frac{2}{3} \varepsilon[eV] e `, with :math:\)varepsilon` the energy and \(e\) the elementary charge, one can convert the coefficients from energy to \(\tau\):
\[ \begin{align}\begin{aligned}\tau = \frac{\sqrt{2 m_r k_b T}}{\hbar} = \frac{1}{\alpha} \sqrt{\varepsilon[eV]} \alpha = \frac{\sqrt{4/3 m_r e}}{\hbar}\\\sqrt{\varepsilon[eV]} = \alpha \tau\\\sigma(\varepsilon[eV]) = D_1 + D_2 \varepsilon^{D_3} \exp(-D_4 \varepsilon^2) \sigma(\tau) = D_1 + D_2 (\alpha \tau)^{D_3} \exp(-D_4 (\alpha \tau)^2) = D_1 + D_2 \alpha^{D_3} \tau^{D_3} \exp(-D_4 \alpha^2 \tau^2)\end{aligned}\end{align} \]