Fermion class from fitting method. More...
#include <fermion_eff.h>
Based on the fitting method of Johns96 which is an update of the method from Eggleton73 . This method is approximate, but very fast. For a more accurate (but slower) method, use o2scl::fermion_rel_tl.
If the temperature is less than or equal to tlimit (which defaults to zero), the zero-temperature expressions from the parent class fermion_zerot_tl are used.
Given the chemical potential and the temperature the functions calc_mu() and pair_mu() work by solving the equation (c.f. Eq. 15 in Johns96)
for given
. If
, then the alternative expression
is used. The pressure, energy density, and entropy, are determined as polynomials in with a set of precomputed coefficients as done in Johns96 .
If is less than min_psi (which defaults to -4) then the non-dengenerate approximation from fermion_thermo::calc_mu_ndeg() is used. The value of min_psi can be decreased to ensure that the expansion is not used, but values of
less than about -200 can cause the Johns96 procedure outlined above to fail. Values of min_psi larger than -4 are not useful.
When the density and temperature is given instead (calc_density() and pair_density()), then there are two ways to proceed.
Because the density is a complicated polynomial in , the former procedure does not work very well even though it might be less time consuming. In this class, the density is solved for the effective chemical potential instead. The initial guess is just taken from the present value of part::nu .
Use bracketing to speed up one-dimensional root finding.
Implement the same method of allowing the user to turn on or off the degenerate and nondegenerate expansions as in o2scl::fermion_rel_tl .
Definition at line 106 of file fermion_eff.h.
Public Types | |
typedef boost::numeric::ublas::vector< double > | ubvector |
typedef boost::numeric::ublas::matrix< double > | ubmatrix |
Public Member Functions | |
fermion_eff () | |
Create a fermion with mass mass and degeneracy dof . | |
![]() | |
bool | calc_mu_ndeg_tlate (fermion_t &f, double temper, double prec, bool inc_antip) |
Calculate thermodynamic properties from the chemical potential using a nondegenerate expansion. | |
bool | calc_mu_deg_tlate (fermion_t &f, double temper, double prec) |
Calculate thermodynamic properties from the chemical potential using a degenerate expansion. | |
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... | |
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 | set_massless_root (root<> &rp) |
Set the solver for use in massless_calc_density() | |
void | ndeg_terms (size_t j, double tt, double xx, double m, bool inc_rest_mass, bool inc_antip, double &pterm, double &nterm, double &enterm) |
Compute a term in the nondegenerate expansion. | |
![]() | |
void | kf_from_density (fermion_tl< double > &f) |
Calculate the Fermi momentum from the density. More... | |
void | energy_density_zerot (fermion_tl< double > &f) |
Energy density at T=0 from o2scl::fermion_tl::kf and o2scl::part_tl::ms. More... | |
void | pressure_zerot (fermion_tl< double > &f) |
Pressure at T=0 from o2scl::fermion_tl::kf and o2scl::part_tl::ms. More... | |
virtual void | calc_mu_zerot (fermion_tl< double > &f) |
Zero temperature fermions from o2scl::part_tl::mu or o2scl::part_tl::nu and o2scl::part_tl::ms. | |
virtual void | calc_density_zerot (fermion_tl< double > &f) |
Zero temperature fermions from o2scl::part_tl::n and o2scl::part_tl::ms. More... | |
Protected Member Functions | |
double | density_fun (double x, fermion &f, double temper) |
The function which solves for the chemical potential given the density. More... | |
double | pair_density_fun (double x, fermion &f, double temper) |
The function which solves for the chemical potential given the density (including antiparticles) More... | |
![]() | |
double | massless_solve_fun (double x, fermion &f, double temper) |
Solve for the chemical potential for massless fermions. | |
Coefficients for finite-temperature approximation | |
static const int | cf_fermilat3 =1 |
A set of coefficients from Jim Lattimer. | |
static const int | cf_fermijel2 =2 |
The smaller set of coefficients from Johns96. | |
static const int | cf_fermijel3 =3 |
The larger set of coefficients from Johns96. | |
static const int | cf_fermijel3cons =4 |
The set of coefficients from Johns96 which retains better thermodynamic consistency. | |
double | tlimit |
If the temperature is less than tlimit then the zero-temperature functions are used (default 0). | |
bool | err_nonconv |
If true, call the error handler when convergence fails (default true) | |
root_cern | def_psi_root |
The default solver for ![]() | |
root_cern | def_density_root |
The default solver for calc_density() and pair_density() | |
double | min_psi |
The minimum value of ![]() | |
ubmatrix | Pmnf |
The matrix of coefficients. | |
double | parma |
The parameter ![]() | |
int | sizem |
The array row size. | |
int | sizen |
The array column size. | |
root * | psi_root |
The solver for ![]() | |
root * | density_root |
The other solver for calc_density() | |
double | solve_fun (double x, double psi) |
The function which solves for ![]() ![]() | |
void | load_coefficients (int ctype) |
Load coefficients. More... | |
virtual void | calc_mu (fermion &f, double temper) |
Calculate thermodynamic properties as function of chemical potential. More... | |
virtual int | calc_density (fermion &f, double temper) |
Calculate thermodynamic properties as function of density. More... | |
virtual void | pair_mu (fermion &f, double temper) |
Calculate thermodynamic properties with antiparticles as function of chemical potential. More... | |
virtual int | pair_density (fermion &f, double temper) |
Calculate thermodynamic properties with antiparticles as function of density. | |
int | set_psi_root (root<> &rp) |
Set the solver for use in calculating ![]() | |
int | set_density_root (root<> &rp) |
Set the solver for use in calculating the chemical potential from the density. | |
virtual const char * | type () |
Return string denoting type ("fermion_eff") | |
Additional Inherited Members | |
![]() | |
root_cern | def_massless_root |
The default solver for massless_calc_density() More... | |
![]() | |
root * | massless_root |
A pointer to the solver for massless fermions. | |
![]() | |
double | pi |
Desc. | |
double | pi2 |
Desc. | |
|
virtual |
Implements o2scl::fermion_thermo_tl< double >.
|
virtual |
If the quantity (or
in the case of interacting particles) is less than -200, then this quietly sets the density, the scalar density, the energy density, the pressure and the entropy to zero and exits.
Implements o2scl::fermion_thermo_tl< double >.
|
protected |
void o2scl::fermion_eff::load_coefficients | ( | int | ctype | ) |
The argument ctype
Should be one of the constants below.
|
protected |
|
virtual |
Implements o2scl::fermion_thermo_tl< double >.
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).