#include <rel_fermion.h>
This implements an equation of state for a relativistic fermion using direct integration. Define the degeneracy parameter
where is the effective chemical potential and
is the effective mass. 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. The upper limit on the degenerate integration is given by
where is rel_fermion::upper_limit_fac .
In the degenerate regime, the entropy integrand
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.
The integrands in the non-degenerate regime are written in a dimensionless form, by defining and
. The density integrand is
the energy integrand is
and the entropy integrand is
where
The default integrators are gsl_inte_qag (for degenerate particles) and gsl_inte_qagiu (for non-degenerate particles).
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 way to improve the accuracy of the computation is just to decrease the tolerances on the default integration objects. This can be done, using, for example
rel_fermion rf(1.0,2.0); rf.def_dit.tolx/=1.0e2; rf.def_dit.tolf/=1.0e2; rf.def_nit.tolx/=1.0e2; rf.def_nit.tolf/=1.0e2;
rf.def_density_root.tolx/=1.0e2; rf.def_density_root.tolf/=1.0e2;
Definition at line 164 of file rel_fermion.h.
Public Member Functions | |
rel_fermion (double m=0.0, double g=0.0) | |
Create a fermion with mass m and degeneracy g . | |
virtual int | calc_mu (double temper) |
Calculate properties as function of chemical potential. | |
virtual int | calc_density (double temper) |
Calculate properties as function of density. | |
virtual int | pair_mu (double temper) |
Calculate properties with antiparticles as function of chemical potential. | |
virtual int | pair_density (double temper) |
Calculate properties with antiparticles as function of density. | |
virtual int | nu_from_n (double temper) |
Calculate effective chemical potential from density. | |
int | set_inte (inte< double, funct< double > > &non_it, inte< double, funct< double > > °_it) |
Set integrators. | |
int | set_density_root (root< double, funct< double > > &rp) |
Set the solver for use in calculating the chemical potential from the density. | |
virtual const char * | type () |
Return string denoting type ("rel_fermion"). | |
Data Fields | |
fermion | unc |
Storage for the uncertainty. | |
bool | guess_from_nu |
If true, use the present value of the chemical potential as a guess for the new chemical potential. | |
cern_mroot_root< double, funct < double > > | def_density_root |
The default solver for calc_density(). | |
gsl_inte_qag< double, funct < double > > | def_dit |
The default integrator for degenerate fermions. | |
gsl_inte_qagiu< double, funct < double > > | def_nit |
The default integrator for non-degenerate fermions. | |
Numerical parameters | |
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). | |
Protected Member Functions | |
double | density_fun (double u, double &pa) |
The integrand for the density for non-degenerate fermions. | |
double | energy_fun (double u, double &pa) |
The integrand for the energy density for non-degenerate fermions. | |
double | entropy_fun (double u, double &pa) |
The integrand for the entropy density for non-degenerate fermions. | |
double | deg_density_fun (double u, double &pa) |
The integrand for the density for degenerate fermions. | |
double | deg_energy_fun (double u, double &pa) |
The integrand for the energy density for degenerate fermions. | |
double | deg_entropy_fun (double u, double &pa) |
The integrand for the entropy density for degenerate fermions. | |
int | solve_fun (double x, double &yy, double &pa) |
Solve for the chemical potential given the density. | |
int | pair_fun (double x, double &yy, double &pa) |
Solve for the chemical potential given the density with antiparticles. | |
Protected Attributes | |
inte< double, funct< double > > * | nit |
The non-degenerate integrator. | |
inte< double, funct< double > > * | dit |
The degenerate integrator. | |
root< double, funct< double > > * | density_root |
The solver for calc_density(). |
Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.
Project hosting provided by
,
O2scl Sourceforge Project Page