Go to the documentation of this file.
23 #ifndef O2SCL_FERMION_DERIV_NR_H
24 #define O2SCL_FERMION_DERIV_NR_H
34 #include <o2scl/constants.h>
35 #include <o2scl/root_cern.h>
37 #include <o2scl/part_deriv.h>
38 #include <o2scl/classical_deriv.h>
40 #ifndef DOXYGEN_NO_O2NS
226 template<
class fp_t=
double>
257 f.
kf=cbrt(6.0*this->
pi2/f.
g*f.
n);
286 f.
kf=sqrt(2.0*f.
ms*(f.
nu-f.
m));
320 fp_t pfac2=f.
g*pow(f.
ms*temper/2.0/this->pi,1.5)/temper, y;
328 fp_t half=gsl_sf_fermi_dirac_half(y);
329 fp_t mhalf=gsl_sf_fermi_dirac_mhalf(y);
330 fp_t thalf=gsl_sf_fermi_dirac_3half(y);
333 f.
n=pfac2*half*temper;
336 f.
ed=pfac2*temper*temper*1.5*thalf;
344 f.
en=((f.
ed-f.
n*f.
m)/0.6-(f.
nu-f.
m)*f.
n)/temper;
352 f.
en=(5.0*f.
ed/3.0-f.
nu*f.
n)/temper;
359 f.
dndT=pfac2*(1.5*half-y*mhalf);
361 f.
dsdT=pfac2*(3.75*thalf-3.0*y*half+y*y*mhalf);
373 "fermion_deriv_nr_tl<fp_t>::calc_density().",
exc_einval);
377 "fermion_deriv_nr_tl<fp_t>::calc_density().",
exc_einval);
381 "fermion_deriv_nr_tl<fp_t>::calc_density().",
exc_einval);
457 this,std::placeholders::_1,std::ref(f),temper);
476 nex=-(f.
nu-f.
m)/temper;
483 if (nex>-GSL_LOG_DBL_MIN*0.9) nex=-GSL_LOG_DBL_MIN/2.0;
485 funct mf=std::bind(std::mem_fn<fp_t(fp_t,fp_t,fp_t)>
487 this,std::placeholders::_1,f.
n/f.
g,f.
ms*temper);
503 nex=-(f.
nu-f.
m)/temper;
511 O2SCL_ERR(
"Solver failed in fermion_nonrel::nu_from_n().",ret);
516 f.
nu=-nex*temper+f.
m;
536 virtual const char *
type() {
return "fermion_deriv_nr"; };
540 #ifndef DOXYGEN_INTERNAL
555 if (((-x)<GSL_LOG_DBL_MIN) || !std::isfinite(x)) nden=0.0;
556 else nden=gsl_sf_fermi_dirac_half(-x)*sqrt(this->
pi)/2.0;
558 nden*=pow(2.0*msT,1.5)/4.0/this->
pi2;
581 nden=gsl_sf_fermi_dirac_half(y)*sqrt(this->
pi)/2.0;
582 nden*=f.
g*pow(2.0*f.
ms*T,1.5)/4.0/this->
pi2;
592 nden=gsl_sf_fermi_dirac_half(y)*sqrt(this->
pi)/2.0;
593 nden*=f.
g*pow(2.0*f.
ms*T,1.5)/4.0/this->
pi2;
607 typedef fermion_deriv_nr_tl<double> fermion_deriv_nr;
609 #ifndef DOXYGEN_NO_O2NS
fp_t dsdT
Derivative of entropy density with respect to temperature.
virtual void calc_density(part_tl< fp_t > &p, fp_t temper)
Calculate properties as function of density.
virtual int calc_mu(fermion_deriv &f, fp_t temper)
Calculate properties as function of chemical potential.
Compute properties of a fermion including derivatives [abstract base].
Equation of state for a nonrelativistic fermion.
virtual int solve(fp_t &x, func_t &func)=0
fp_t dndT
Derivative of number density with respect to temperature.
fp_t mu
Chemical potential.
fp_t ms
Effective mass (Dirac unless otherwise specified)
#define O2SCL_ERR2(d, d2, n)
virtual int pair_density(fermion_deriv &f, fp_t temper)
Calculate properties with antiparticles as function of density.
virtual void calc_density_zerot(fermion_deriv &f)
Calculate properties as function of density at .
bool non_interacting
True if the particle is non-interacting (default true)
virtual int pair_mu(fermion_deriv &f, fp_t temper)
Calculate properties with antiparticles as function of chemical potential.
fp_t g
Degeneracy (e.g. spin and color if applicable)
fp_t flimit
The limit for the Fermi functions (default 20.0)
void 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_deriv_nr")
virtual int nu_from_n(fermion_deriv &f, fp_t temper)
Calculate effective chemical potential from density.
virtual void calc_mu_zerot(fermion_deriv &f)
Calculate properties as function of chemical potential at .
bool inc_rest_mass
If true, include the mass in the energy density and chemical potential (default true)
fp_t dndmu
Derivative of number density with respect to chemical potential.
root_cern def_density_root
The default solver for npen_density() and pair_density()
virtual void anti(part_tl &ax)
Make ap an anti-particle with the same mass and degeneracy.
fp_t solve_fun(fp_t x, fp_t nog, fp_t msT)
Function to compute chemical potential from density.
fp_t pair_fun(fp_t x, fermion_deriv &f, fp_t T)
Function to compute chemical potential from density when antiparticles are included.
std::function< double(double)> funct
virtual int calc_density(fermion_deriv &f, fp_t temper)
Calculate properties as function of density.
fermion_deriv unc
Storage for the most recently calculated uncertainties.
fermion_deriv_nr_tl()
Create a fermion with mass m and degeneracy g.
fp_t nu
Effective chemical potential.
root * density_root
Solver to compute chemical potential from density.
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).