pynucastro.eos.fermi_integrals module

pynucastro.eos.fermi_integrals module#

Classes that enable the computation of Fermi-Dirac integrals to high precision. This uses the methods of Aparicio (1998) and Gong (2001), described in https://iopscience.iop.org/article/10.1086/313121 and https://www.sciencedirect.com/science/article/abs/pii/S001046550100145X?via%3Dihub.

The method consist on breaking down the Fermi-integrals (eta, theta) integration domain into four subintervals and apply Gauss-Legendre or the Gauss laguerre quadrature methods with 200 points over each domain to guarantee accuracy beyond double-precision.

In the first subinterval, a x=z^2 change of variable is applied to overcome the kernel singularity near the origin.

class pynucastro.eos.fermi_integrals.BreakPoints(*, itype='F')[source]#

Bases: object

The break points used in splitting the integral from [0, inf] into 4 separate integrals over smaller domains. These are described in Gong et al. 2001. Different choices of the break points are made depending on whether we are computing the integral itself or one of its derivatives with respect to eta (the degeneracy parameter).

Parameters:

itype (str) –

the type of integral we are doing—mainly this concerns the eta derivatives. Valid choices are:

  • ”F” : the Fermi-Dirac integral

  • ”dF/deta” : the first derivative of the F-D integral with respect to eta.

  • ”d2F/deta2” : the second derivative of the F-D integral with respect to eta.

  • ”d3F/deta3” : the third derivative of the F-D integral with respect to eta.

get_points(eta)[source]#

Return the 3 break points that define the 4 sub-intervals of integration

Parameters:

eta (float) – The degeneracy parameter.

Returns:

S_1, S_2, S_3 – The break points.

Return type:

float

class pynucastro.eos.fermi_integrals.FermiIntegral(k, eta, beta)[source]#

Bases: object

Construct the integral

\[F_k(\eta, \beta) = \int_0^\infty \frac{x^k [1 + (x\beta/2)]^{1/2}}{e^{x-\eta} + 1} dx\]

using the method from Gong et al. 2001. This splits the integration into 4 intervals, and uses Legendre quadrature for the first 3 parts and Laguerre quadrature for the last interval. For the first interval, a change of variables is done to avoid singularities (effectively integrating in terms of momentum instead of energy).

First and second derivatives with respect to \(\eta\) and \(\beta\) are supported.

Parameters:
  • k (float) – The index of the Fermi-Dirac integral

  • eta (float) – The degeneracy parameter (\(\eta = \mu / k_B T\))

  • beta (float) – The dimenionless temperature (relativity parameter) (\(\beta = k_B T / m_e c^2\))

evaluate(*, do_first_derivs=True, do_second_derivs=True)[source]#

Perform the integration for the Fermi-Dirac function and its derivatives (if desired)

Parameters:
  • do_first_derivs (bool) – do we compute the first derivatives?

  • do_second_derivs (bool) – do we compute the second derivatives?