Fit Function: h_eex_janev_12

Fit Function \[\sigma_{ex}^{n=1 \rightarrow 2} =\begin{cases} \frac{5.984 \times 10^{-16}}{IX} \Bigg[ \sum_{j=1}^5 \frac{A_j}{X^{j-1}} + A_6 \ln X\Bigg]; X=\frac{E}{I}; \; (E > 12.23) \\ A_7; \; (E > 11.56, E < 12.23) \\ 10^{-16} \big[A_8 + A_9(E - I) \big]; \; (E < 11.56). \end{cases}\]
Comments Python code requires NumPy imported as `np`.

Python

Arguments
namedescriptionunitstype(s)
E impact energy eV float, np.ndarray
A1 fit coefficient eV cm2 float
A2 fit coefficient eV cm2 float
A3 fit coefficient eV cm2 float
A4 fit coefficient eV cm2 float
A5 fit coefficient eV cm2 float
A6 fit coefficient eV cm2 float
A7 fit coefficient cm2 float
A8 fit coefficient cm2 float
A9 fit coefficient eV-1 cm2 float
I threshold energy eV float
Return values
namedescriptionunitstype(s)
sigma cross section cm2 float, np.ndarray
Code
def h_eex_janev_12(E, A1, A2, A3, A4, A5, A6, A7, A8, A9, I):
    """
    This function calculates electron impact excitation cross sections (in cm2) of 
    H n=1 to n=2
    param E: requested electron-impact energy in eV
    type E: np.ndarray
    param Ai: fit coefficient 
    type Ai: float
    param I: threshold energy in eV
    type I: float
    """
    sigma = (5.984e-16/E)*(A1/(E/I)**0 + A2/(E/I)**1 + A3/(E/I)**2 + 
                           A4/(E/I)**3 + A5/(E/I)**4 + A6*np.log(E/I))
    ind_below = np.where(E < 12.23)
    for ind in ind_below[0]:
        if E[ind] < 11.56:
            sigma[ind] = 1e-16*(A8 + A9*(E[ind]-I))
        else:
            sigma[ind] = A7
    return sigma