Particles and Nuclei Sub-Library: Version 0.910
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
rel_fermion Class Reference

Equation of state for a relativistic fermion. More...

#include <rel_fermion.h>

Inheritance diagram for rel_fermion:
fermion_eval_thermo fermion_zerot

Detailed Description

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 gsl_inte_qag (for degenerate fermions) and gsl_inte_qagiu (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.


Degeneracy parameter:

Define the degeneracy parameter

\[ \psi=(\nu-m^{*})/T \]

where $ \nu $ is the effective chemical potential and $ m^{*} $ is the effective mass. For $ \psi $ greater than deg_limit (degenerate regime), a finite interval integrator is used and for $ \psi $ less than deg_limit (non-degenerate regime), an integrator over the interval from $ [0,\infty) $ is used. In the case where part::inc_rest_mass is false, the degeneracy parameter is

\[ \psi=(\nu+m-m^{*})/T \]

Integration limits:

The upper limit on the degenerate integration is given by

\[ \mathrm{upper~limit} = \sqrt{{\cal L}^2-m^{*,2}} \]

where $ {\cal L}\equiv u T+\nu $ and $ u $ is rel_fermion::upper_limit_fac . In the case where part::inc_rest_mass is false, the result is

\[ \mathrm{upper~limit} = \sqrt{(m+{\cal L})^2-m^{*2}} \]

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 $ k $ which solves

\[ - u = \frac{\sqrt{k^2+m^{* 2}}-\nu}{T} \]

The solution is

\[ \mathrm{lower~limit} = \sqrt{(-u T+{\nu})^2-m^{*,2}} \]

but this solution is only valid if $ (m^{*}-\nu)/T < -u $. In the case where part::inc_rest_mass is false, the result is

\[ \mathrm{lower~limit} = \sqrt{(-u T + m +\nu)^2-m^{*,2}} \]

which is valid if $ (m^{*}-\nu - m)/T < -u $.

Entropy integrand:

In the degenerate regime, the entropy integrand

\[ - k^2 \left[ f \log f + \left(1-f\right) \log \left(1-f \right) \right] \]

where $ f $ is the fermionic distribution function can lose precision when $ (E^{*} - \nu)/T $ is negative and sufficiently large in absolute magnitude. Thus when $ (E^{*} - \nu)/T < S $ where $ S $ is stored in deg_entropy_fac (default is -30), the integrand is written as

\[ -k^2 \left( E/T-\nu/T \right) e^{E/T-\nu/T} \, . \]

If $ (E - \nu)/T < S $ 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 $ p = \sqrt{\left(T u + m^{*}\right)^2-m^{* 2}} $, $ \nu \equiv y T $, and $ m^{*} \equiv \mathrm{mx}~T $. The density integrand is

\[ \left(\mathrm{mx}+u\right) \sqrt{u^2+2 (\mathrm{mx}) u} \left(\frac{e^{y}}{e^{\mathrm{mx}+u}+e^{y}}\right) \, , \]

the energy integrand is

\[ \left(\mathrm{mx}+u\right)^2 \sqrt{u^2+2 (\mathrm{mx}) u} \left(\frac{e^{y}}{e^{\mathrm{mx}+u}+e^{y}}\right) \, , \]

and the entropy integrand is

\[ \left(\mathrm{mx}+u\right) \sqrt{u^2+2 (\mathrm{mx}) u} \left(t_1+t_2\right) \, , \]

where

\begin{eqnarray*} t_1 &=& \log \left(1+e^{y-\mathrm{mx}-u}\right)/ \left(1+e^{y-\mathrm{mx}-u}\right) \nonumber \\ t_2 &=& \log \left(1+e^{\mathrm{mx}+u-y}\right)/ \left(1+e^{\mathrm{mx}+u-y}\right) \, . \end{eqnarray*}


Accuracy:

The default settings for for this class give an accuracy of at least 1 part in $ 10^6 $ (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;

which decreases the both the relative and absolute tolerances for both the degenerate and non-degenerate integrators. If one is using either the calc_density() or pair_density() functions, one may also have to improve the accuracy of the solver which determines the chemical potential from the density. For the default solver, this could be done with

      rf.def_density_root.tolx/=1.0e2;
      rf.def_density_root.tolf/=1.0e2;

Of course if these tolerances are too small, the calculation may fail.


Todos:

Idea for Future:
The expressions which appear in in the integrand functions density_fun(), etc. could likely be improved, especially in the case where inc_rest_mass=false. There should not be a need to check if ret is finite.
Idea for Future:
It appears this doesn't compute the uncertainty in the chemical potential or density with calc_density(). This could be fixed.
Idea for Future:
I'd like to change the lower limit on the entropy integration, but the value in the code at the moment (stored in ll) makes bm_part2.cpp worse.
Idea for Future:
pair_mu() should set the antiparticle integrators as done in sn_fermion.

Definition at line 215 of file rel_fermion.h.

Public Member Functions

 rel_fermion ()
 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 void calc_density (fermion &f, double temper)
 Calculate properties as function of density.
virtual void pair_mu (fermion &f, double temper)
 Calculate properties with antiparticles as function of chemical potential.
virtual void pair_density (fermion &f, double temper)
 Calculate properties with antiparticles as function of density.
virtual void nu_from_n (fermion &f, double temper)
 Calculate effective chemical potential from density.
int set_inte (inte< funct > &non_it, inte< funct > &deg_it)
 Set integrators.
int set_density_root (root< funct > &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.
cern_mroot_root< functdef_density_root
 The default solver for calc_density().
gsl_inte_qag< functdef_dit
 The default integrator for degenerate fermions.
gsl_inte_qagiu< functdef_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)
 The integrand for the density for non-degenerate fermions.
double energy_fun (double u)
 The integrand for the energy density for non-degenerate fermions.
double entropy_fun (double u)
 The integrand for the entropy density for non-degenerate fermions.
double deg_density_fun (double u)
 The integrand for the density for degenerate fermions.
double deg_energy_fun (double u)
 The integrand for the energy density for degenerate fermions.
double deg_entropy_fun (double u)
 The integrand for the entropy density for degenerate fermions.
double solve_fun (double x)
 Solve for the chemical potential given the density.
double pair_fun (double x)
 Solve for the chemical potential given the density with antiparticles.

Protected Attributes

inte< funct > * nit
 The non-degenerate integrator.
inte< funct > * dit
 The degenerate integrator.
root< funct > * density_root
 The solver for calc_density()
double T
 Temperature.
fermionfp
 Current fermion pointer.

Member Function Documentation

virtual void rel_fermion::calc_density ( fermion f,
double  temper 
) [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 fermion_eval_thermo.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Friends

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

Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads.