eff_fermion Class Reference

Fermion class from fitting method. More...

#include <eff_fermion.h>

Inheritance diagram for eff_fermion:

fermion_T fermion part eff_quark

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

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 too small (less than about -200), the above procedure fails. To handle this, this class uses the classical result if $ \psi $ < min_psi, where min_psi defaults to -200.

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 .

Note:
It is important to note that the coefficients are static and apply to all objects of type eff_fermion.

The coefficients are stored in static data, and there is a small possibility of a memory leak in a multithreaded program if more than one instance of eff_fermion tries to initialize these coefficients in the constructor. This can easily be avoided by ensuring that the static coefficients are initialized by a single thread beforehand.

Todo:
There's still def_err_hnd.set_mode(0) in the testing code, probably because the solver has a hard time for extreme values.
Idea for future:
Use bracketing to speed up one-dimensional root finding.

Definition at line 101 of file eff_fermion.h.


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.
static int load_coefficients (int ctype)
 Load coefficients.

Public Member Functions

 eff_fermion (double mass=0.0, double dof=0.0)
 Create a fermion with mass mass and degeneracy dof.
virtual int calc_mu (const double temper)
 Calculate thermodynamic properties as function of chemical potential.
virtual int calc_density (const double temper)
 Calculate thermodynamic properties as function of density.
virtual int pair_mu (const double temper)
 Calculate thermodynamic properties with antiparticles as function of chemical potential.
virtual int pair_density (const double temper)
 Calculate thermodynamic properties with antiparticles as function of density.
int set_psi_root (root< double, funct< double > > &rp)
 Set the solver for use in calculating $ \psi $.
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 ("eff_fermion").

Data Fields

double tlimit
 If the temperature is less than tlimit then the zero-temperature functions are used (default 0).
cern_mroot_root< double, funct
< double > > 
def_psi_root
 The default solver for $ \psi $.
cern_mroot_root< double, funct
< double > > 
def_density_root
 The default solver for calc_density() and pair_density().
double min_psi
 The minimum value of $ \psi $ (default -200).

Protected Member Functions

int solve_fun (double x, double &y, double &psi)
 The function which solves for $ f $ from $ \psi $.
int density_fun (double x, double &y, double &temper)
 Fix density for calc_density().
int pair_density_fun (double x, double &y, double &temper)
 Fix density for pair_density().

Protected Attributes

root< double, funct< double > > * psi_root
 The solver for $ \psi $.
root< double, funct< double > > * density_root
 The other solver for calc_density().

Static Protected Attributes

static double ** Pmnf
 The matrix of coefficients.
static double parma
 The parameter $ a $.
static int sizem
 The array row size.
static int sizen
 The array column size.

Member Function Documentation

virtual int calc_density ( const double  temper  )  [virtual]

Warning:
This function needs a guess for the chemical potential, and will fail if that guess is not sufficiently accurate.

Implements fermion_T.

Reimplemented in eff_quark.

virtual int calc_mu ( const 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 fermion_T.

Reimplemented in eff_quark.

static int load_coefficients ( int  ctype  )  [static]

The argument ctype Should be one of the constants below.

virtual int pair_mu ( const double  temper  )  [virtual]

Warning:
This function needs a guess for the chemical potential, and will fail if that guess is not sufficiently accurate.

Implements fermion_T.

Reimplemented in eff_quark.


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

Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.

Project hosting provided by SourceForge.net Logo, O2scl Sourceforge Project Page