Equation of state for a relativistic fermion. More...
#include <fermion_rel.h>
Public Member Functions | |
fermion_rel () | |
Create a fermion with mass m and degeneracy g . | |
virtual void | calc_mu (fermion &f, double temper) |
Calculate properties as function of chemical potential. | |
virtual int | calc_density (fermion &f, double temper) |
Calculate properties as function of density. More... | |
virtual void | pair_mu (fermion &f, double temper) |
Calculate properties with antiparticles as function of chemical potential. | |
virtual int | pair_density (fermion &f, double temper) |
Calculate properties with antiparticles as function of density. | |
virtual int | nu_from_n (fermion &f, double temper) |
Calculate effective chemical potential from density. More... | |
virtual const char * | type () |
Return string denoting type ("fermion_rel") | |
![]() | |
virtual bool | calc_mu_ndeg (fermion &f, double temper, double prec=1.0e-18, bool inc_antip=false) |
Non-degenerate expansion for fermions. More... | |
virtual bool | calc_mu_deg (fermion &f, double temper, double prec=1.0e-18) |
Degenerate expansion for fermions. More... | |
void | set_massless_root (root<> &rp) |
Set the solver for use in massless_calc_density() | |
virtual double | calibrate (fermion &f, int verbose=0, std::string fname="") |
Test the thermodynamics of calc_density() and calc_mu() More... | |
virtual void | massless_calc_mu (fermion &f, double temper) |
Finite temperature massless fermions. | |
virtual void | massless_calc_density (fermion &f, double temper) |
Finite temperature massless fermions. | |
virtual void | massless_pair_mu (fermion &f, double temper) |
Finite temperature massless fermions and antifermions. | |
virtual void | massless_pair_density (fermion &f, double temper) |
Finite temperature massless fermions and antifermions. More... | |
![]() | |
void | kf_from_density (fermion &f) |
Calculate the Fermi momentum from the density. More... | |
void | energy_density_zerot (fermion &f) |
Energy density at T=0 from fermion::kf and part::ms. More... | |
void | pressure_zerot (fermion &f) |
Pressure at T=0 from fermion::kf and part::ms. More... | |
virtual void | calc_mu_zerot (fermion &f) |
Zero temperature fermions from part::mu or part::nu and part::ms. | |
virtual void | calc_density_zerot (fermion &f) |
Zero temperature fermions from part::n and part::ms. | |
Public Attributes | |
fermion | unc |
Storage for the uncertainty. | |
bool | use_expansions |
If true, use expansions for extreme conditions (default true) | |
std::shared_ptr< inte<> > | nit |
The non-degenerate integrator. | |
std::shared_ptr< inte<> > | dit |
The degenerate integrator. | |
std::shared_ptr< root<> > | density_root |
The solver for calc_density() | |
Numerical parameters | |
bool | err_nonconv |
If true, call the error handler when convergence fails (default true) | |
double | min_psi |
The smallest value of ![]() | |
double | deg_limit |
The critical degeneracy at which to switch integration techniques (default 2) | |
double | exp_limit |
The limit for exponentials to ensure integrals are finite (default 200) | |
double | upper_limit_fac |
The factor for the degenerate upper limits (default 20) | |
double | deg_entropy_fac |
A factor for the degenerate entropy integration (default 30) | |
![]() | |
root_cern | def_massless_root |
The default solver for massless_calc_density() More... | |
Protected Member Functions | |
double | density_fun (double u, fermion &f, double T) |
The integrand for the density for non-degenerate fermions. | |
double | energy_fun (double u, fermion &f, double T) |
The integrand for the energy density for non-degenerate fermions. | |
double | entropy_fun (double u, fermion &f, double T) |
The integrand for the entropy density for non-degenerate fermions. | |
double | deg_density_fun (double u, fermion &f, double T) |
The integrand for the density for degenerate fermions. | |
double | deg_energy_fun (double u, fermion &f, double T) |
The integrand for the energy density for degenerate fermions. | |
double | deg_entropy_fun (double u, fermion &f, double T) |
The integrand for the entropy density for degenerate fermions. | |
double | solve_fun (double x, fermion &f, double T) |
Solve for the chemical potential given the density. | |
double | pair_fun (double x, fermion &f, double T, bool log_mode) |
Solve for the chemical potential given the density with antiparticles. More... | |
![]() | |
double | massless_solve_fun (double x, fermion &f, double temper) |
Solve for the chemical potential for massless fermions. | |
Additional Inherited Members | |
![]() | |
root * | massless_root |
A pointer to the solver for massless fermions. | |
This class computes the thermodynamics of a relativistic fermion either as a function of the density or the chemical potential. It employs direct integration, using two different integrators for the degenerate and non-degenerate regimes. The default integrators are inte_qag_gsl (for degenerate fermions) and inte_qagiu_gsl (for non-degenerate fermions). For the functions calc_mu() and calc_density(), if the temperature argument is less than or equal to zero, the functions fermion_zerot::calc_mu_zerot() and fermion_zerot::calc_density_zerot() will be used to compute the result.
Define the degeneracy parameter
where is the effective chemical potential (including the rest mass) and
is the effective mass. For
smaller than min_psi, the non-degenerate expansion in fermion_eval_thermo::calc_mu_ndeg() is attempted first. If that fails, then integration is used. For
greater than deg_limit (degenerate regime), a finite interval integrator is used and for
less than deg_limit (non-degenerate regime), an integrator over the interval from
is used. In the case where part::inc_rest_mass is false, the degeneracy parameter is
Integration limits:
The upper limit on the degenerate integration is given by
where and
is fermion_rel::upper_limit_fac . In the case where part::inc_rest_mass is false, the result is
The entropy is only significant at the Fermi surface, thus in the degenerate case, the lower limit of the entropy integral can be given be determined by the value of which solves
The solution is
but this solution is only valid if . In the case where part::inc_rest_mass is false, the result is
which is valid if .
Entropy integrand:
In the degenerate regime, the entropy integrand
where is the fermionic distribution function can lose precision when
is negative and sufficiently large in absolute magnitude. Thus when
where
is stored in deg_entropy_fac (default is -30), the integrand is written as
If is less than -1 times exp_limit (e.g. less than -200), then the entropy integrand is assumed to be zero.
Non-degenerate integrands:
The integrands in the non-degenerate regime are written in a dimensionless form, by defining with the relation
,
, and
. The density integrand is
the energy integrand is
and the entropy integrand is
where
The default settings for for this class give an accuracy of at least 1 part in (and frequently better than this).
When the integrators provide numerical uncertainties, these uncertainties are stored in unc. In the case of calc_density() and pair_density(), the uncertainty from the numerical accuracy of the solver is not included. (There is also a relatively small inaccuracy due to the mathematical evaluation of the integrands which is not included in unc.)
One can improve the accuracy to within 1 part in using
which decreases the both the relative and absolute tolerances for both the degenerate and non-degenerate integrators and improves the accuracy of the solver which determines the chemical potential from the density. Of course if these tolerances are too small, the calculation may fail.
false
. There should not be a need to check if ret
is finite.ll
) makes bm_part2.cpp worse.Definition at line 216 of file fermion_rel.h.
|
virtual |
This function uses the current value of nu
(or mu
if the particle is non interacting) for an initial guess to solve for the chemical potential. If this guess is too small, then this function may fail.
Implements o2scl::fermion_eval_thermo.
|
virtual |
|
protected |
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).