Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
o2scl::fermion_eff Class Reference

Fermion class from fitting method. More...

#include <fermion_eff.h>

Inheritance diagram for o2scl::fermion_eff:
o2scl::fermion_eval_thermo o2scl::fermion_zerot

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.
 
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 $ \psi $.
 
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")
 
- Public Member Functions inherited from o2scl::fermion_eval_thermo
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...
 
- Public Member Functions inherited from o2scl::fermion_zerot
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

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 $ \psi $.
 
root_cern def_density_root
 The default solver for calc_density() and pair_density()
 
double min_psi
 The minimum value of $ \psi $ (default -200)
 
- Public Attributes inherited from o2scl::fermion_eval_thermo
root_cern def_massless_root
 The default solver for massless_calc_density() More...
 

Protected Member Functions

double density_fun (double x, fermion &f, double temper)
 The function which solves for the chemical potential given the density.
 
double pair_density_fun (double x, fermion &f, double temper)
 The function which solves for the chemical potential given the density (including antiparticles)
 
double solve_fun (double x, double &psi)
 The function which solves for $ f $ from $ \psi $.
 
- Protected Member Functions inherited from o2scl::fermion_eval_thermo
double massless_solve_fun (double x, fermion &f, double temper)
 Solve for the chemical potential for massless fermions.
 

Protected Attributes

ubmatrix Pmnf
 The matrix of coefficients.
 
double parma
 The parameter $ a $.
 
int sizem
 The array row size.
 
int sizen
 The array column size.
 
rootpsi_root
 The solver for $ \psi $.
 
rootdensity_root
 The other solver for calc_density()
 
- Protected Attributes inherited from o2scl::fermion_eval_thermo
rootmassless_root
 A pointer to the solver 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.
 
void load_coefficients (int ctype)
 Load coefficients. More...
 

Detailed Description

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 fermion_rel.

If the temperature is less than or equal to tlimit (which defaults to zero), the zero-temperature expressions from the parent class fermion_zerot 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)

\[ \psi= 2 \sqrt{1+f/a}+\log\left(\frac{\sqrt{1+f/a}-1} {\sqrt{1+f/a}+1}\right) \]

for $ f $ given $ \psi=(\mu-m)/T $. If $ f/a<10^{-10} $, then the alternative expression

\[ \psi= 2 \left[1+f/(2 a)\right]+\log\left\{\frac{f/(2 a)} {\left[1+f/(2 a)\right]}\right\} \]

is used. The pressure, energy density, and entropy, are determined as polynomials in $ f $ with a set of precomputed coefficients as done in Johns96 .

If $ \psi $ is less than min_psi (which defaults to -4) then the non-dengenerate approximation from fermion_eval_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 $ \psi $ 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 $ f $, 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 .

Todo:
Fix higher densities in fermion_eff_ts.cpp.
Idea for Future:
Use bracketing to speed up one-dimensional root finding.

Definition at line 105 of file fermion_eff.h.

Member Function Documentation

◆ calc_density()

virtual int o2scl::fermion_eff::calc_density ( fermion f,
double  temper 
)
virtual
Warning
This function needs a guess for the chemical potential, and will fail if that guess is not sufficiently accurate.

Implements o2scl::fermion_eval_thermo.

◆ calc_mu()

virtual void o2scl::fermion_eff::calc_mu ( fermion f,
double  temper 
)
virtual

If the quantity $ (\mu-m)/T $ (or $ (\nu-m^{*})/T $ 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.

Todo:
Should see if the function actually works if $ (\mu-m)/T = -199 $ .

Implements o2scl::fermion_eval_thermo.

◆ load_coefficients()

void o2scl::fermion_eff::load_coefficients ( int  ctype)

The argument ctype Should be one of the constants below.

◆ pair_mu()

virtual void o2scl::fermion_eff::pair_mu ( fermion f,
double  temper 
)
virtual
Warning
This function needs a guess for the chemical potential, and will fail if that guess is not sufficiently accurate.

Implements o2scl::fermion_eval_thermo.


The documentation for this class was generated from the following file:

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).