Particles and Nuclei Sub-Library: Version 0.910
sn_nr_fermion.h
00001 /*
00002   -------------------------------------------------------------------
00003   
00004   Copyright (C) 2006-2012, Andrew W. Steiner
00005   
00006   This file is part of O2scl.
00007   
00008   O2scl is free software; you can redistribute it and/or modify
00009   it under the terms of the GNU General Public License as published by
00010   the Free Software Foundation; either version 3 of the License, or
00011   (at your option) any later version.
00012   
00013   O2scl is distributed in the hope that it will be useful,
00014   but WITHOUT ANY WARRANTY; without even the implied warranty of
00015   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016   GNU General Public License for more details.
00017   
00018   You should have received a copy of the GNU General Public License
00019   along with O2scl. If not, see <http://www.gnu.org/licenses/>.
00020 
00021   -------------------------------------------------------------------
00022 */
00023 #ifndef O2SCL_SN_NR_FERMION_H
00024 #define O2SCL_SN_NR_FERMION_H
00025 
00026 #include <string>
00027 #include <iostream>
00028 #include <fstream>
00029 #include <cmath>
00030 #include <o2scl/constants.h>
00031 #include <o2scl/cern_mroot_root.h>
00032 
00033 #include <o2scl/deriv_part.h>
00034 
00035 #ifndef DOXYGENP
00036 namespace o2scl {
00037 #endif
00038 
00039   /** \brief Equation of state for a nonrelativistic fermion
00040 
00041       This does not include the rest mass energy in the chemical 
00042       potential or the rest mass energy density in the energy density
00043       to alleviate numerical precision problems at low densities
00044 
00045       This implements an equation of state for a nonrelativistic fermion
00046       using direct integration. After subtracting the rest mass from
00047       the chemical potentials, the distribution function is
00048       \f[
00049       \left\{1+\exp\left[\left(\frac{k^2}
00050       {2 m^{*}}-\nu\right)/T\right]\right\}^{-1}
00051       \f]
00052       where \f$ \nu \f$ is the effective chemical potential, \f$ m \f$ is
00053       the rest mass, and \f$ m^{*} \f$ is the effective mass.
00054       For later use, we define \f$ E^{*} = k^2/2/m^{*} \f$ .
00055 
00056       Uncertainties are given in \ref unc.
00057 
00058       \b Evaluation \b of \b the \b derivatives
00059 
00060       The relevant derivatives of the distribution function are
00061       \f[
00062       \frac{\partial f}{\partial T}=
00063       f(1-f)\frac{E^{*}-\nu}{T^2}
00064       \f]
00065       \f[
00066       \frac{\partial f}{\partial \nu}=
00067       f(1-f)\frac{1}{T}
00068       \f]
00069       \f[
00070       \frac{\partial f}{\partial k}=
00071       -f(1-f)\frac{k}{m^{*} T}
00072       \f]
00073       \f[
00074       \frac{\partial f}{\partial m^{*}}=
00075       f(1-f)\frac{k^2}{2 m^{*2} T}
00076       \f]
00077 
00078       We also need the derivative of the entropy integrand w.r.t. the 
00079       distribution function, which is quite simple
00080       \f[
00081       {\cal S}\equiv f \ln f +(1-f) \ln (1-f) \qquad
00082       \frac{\partial {\cal S}}{\partial f} = \ln 
00083       \left(\frac{f}{1-f}\right) = 
00084       \left(\frac{\nu-E^{*}}{T}\right)
00085       \f]
00086       where the entropy density is
00087       \f[
00088       s = - \frac{g}{2 \pi^2} \int_0^{\infty} {\cal S} k^2 d k
00089       \f]
00090 
00091       The derivatives can be integrated directly
00092       or they may be converted to integrals
00093       over the distribution function through an integration by parts
00094       \f[
00095       \int_a^b f(k) \frac{d g(k)}{dk} dk = \left.f(k) g(k)\right|_{k=a}^{k=b}
00096       - \int_a^b g(k) \frac{d f(k)}{dk} dk 
00097       \f]
00098       using the distribution function for \f$ f(k) \f$ and 0 and \f$
00099       \infty \f$ as the limits, we have
00100       \f[
00101       \frac{g}{2 \pi^2} \int_0^{\infty} \frac{d g(k)}{dk} f dk =
00102       \frac{g}{2 \pi^2} \int_0^{\infty} g(k) f (1-f) \frac{k}{E^{*} T} dk 
00103       \f]
00104       as long as \f$ g(k) \f$ vanishes at \f$ k=0 \f$ .
00105       Rewriting,
00106       \f[
00107       \frac{g}{2 \pi^2} \int_0^{\infty} h(k) f (1-f) dk =
00108       \frac{g}{2 \pi^2} \int_0^{\infty} f \frac{T m^{*}}{k} 
00109       \left[ h^{\prime} - \frac{h}{k}\right] d k
00110       \f]
00111       as long as \f$ h(k)/k \f$ vanishes at \f$ k=0 \f$ .
00112 
00113       \b Explicit \b forms
00114 
00115       1) The derivative of the density wrt the chemical potential
00116       \f[
00117       \left(\frac{d n}{d \mu}\right)_T = 
00118       \frac{g}{2 \pi^2} \int_0^{\infty} \frac{k^2}{T} f (1-f) dk
00119       \f]
00120       Using \f$ h(k)=k^2/T \f$ we get
00121       \f[
00122       \left(\frac{d n}{d \mu}\right)_T = 
00123       \frac{g}{2 \pi^2} \int_0^{\infty} 
00124       m^{*} f dk
00125       \f]
00126 
00127       2) The derivative of the density wrt the temperature
00128       \f[
00129       \left(\frac{d n}{d T}\right)_{\mu} = 
00130       \frac{g}{2 \pi^2} \int_0^{\infty} \frac{k^2(E^{*}-\nu)}{T^2} 
00131       f (1-f) dk
00132       \f]
00133       Using \f$ h(k)=k^2(E^{*}-\nu)/T^2 \f$ we get
00134       \f[
00135       \left(\frac{d n}{d T}\right)_{\mu} = 
00136       \frac{g}{2 \pi^2} \int_0^{\infty} \frac{f}{T} 
00137       \left[m^{*} \left(E^{*}-\nu\right) -k^2\right] d k
00138       \f]
00139 
00140       3) The derivative of the entropy wrt the chemical potential
00141       \f[
00142       \left(\frac{d s}{d \mu}\right)_T = 
00143       \frac{g}{2 \pi^2} \int_0^{\infty} k^2 f (1-f) 
00144       \frac{(E^{*}-\nu)}{T^2} dk
00145       \f]
00146       This verifies the Maxwell relation
00147       \f[
00148       \left(\frac{d s}{d \mu}\right)_T =
00149       \left(\frac{d n}{d T}\right)_{\mu}
00150       \f]
00151 
00152       4) The derivative of the entropy wrt the temperature
00153       \f[
00154       \left(\frac{d s}{d T}\right)_{\mu} = 
00155       \frac{g}{2 \pi^2} \int_0^{\infty} k^2 f (1-f) 
00156       \frac{(E^{*}-\nu)^2}{T^3} dk
00157       \f]
00158       Using \f$ h(k)=k^2 (E^{*}-\nu)^2/T^3 \f$ 
00159       \f[
00160       \left(\frac{d s}{d T}\right)_{\mu} = 
00161       \frac{g}{2 \pi^2} \int_0^{\infty} 
00162       f \frac{m^{*}}{T^2} \left[\left( E^{*}-\nu \right)^2 
00163       +\frac{2 k^2}{m^{*}} \left(E^{*}-\nu\right)\right] d k
00164       \f]
00165 
00166       5) The derivative of the density wrt the effective mass
00167       \f[
00168       \left(\frac{d n}{d m^{*}}\right)_{T,\mu} = 
00169       \frac{g}{2 \pi^2} \int_0^{\infty} 
00170       \frac{k^2}{2 m^{* 2} T} f (1-f) k^2 dk
00171       \f]
00172       Using \f$ h(k)=k^4/(2 m^{* 2} T) \f$ we get
00173       \f[
00174       \left(\frac{d n}{d m^{*}}\right)_{T,\mu} = 
00175       \frac{g}{2 \pi^2} \int_0^{\infty} f
00176       \frac{3 k^2}{2 m^{*}} d k 
00177       \f]
00178 
00179       <b> New section</b>
00180 
00181       \f$ u = k^2/2/m^{*}/T \f$ and \f$ y=\mu/T \f$, so
00182       \f[
00183       k d k = m^{*} T d u 
00184       \f]
00185       or
00186       \f[
00187       d k = \frac{m^{*} T}{\sqrt{2 m^{*} T u}} d u =
00188       \sqrt{\frac{m^{*} T}{2 u}} d u 
00189       \f]
00190       
00191       1) The derivative of the density wrt the chemical potential
00192       \f[
00193       \left(\frac{d n}{d \mu}\right)_T = 
00194       \frac{g m^{* 3/2} \sqrt{T}}{2^{3/2} \pi^2} \int_0^{\infty} 
00195       u^{-1/2} f d u
00196       \f]
00197 
00198       2) The derivative of the density wrt the temperature
00199       \f[
00200       \left(\frac{d n}{d T}\right)_{\mu} = 
00201       \frac{g m^{* 3/2} \sqrt{T}}
00202       {2^{3/2} \pi^2} \int_0^{\infty} f d u
00203       \left[ 3 u^{1/2} - y u^{-1/2}\right]
00204       \f]
00205 
00206       4) The derivative of the entropy wrt the temperature
00207       \f[
00208       \left(\frac{d s}{d T}\right)_{\mu} = 
00209       \frac{g m^{* 3/2} T^{1/2}}{2^{3/2} \pi^2} \int_0^{\infty} 
00210       f \left[ 5 u^{3/2} - 6 y u^{1/2} + y^2 u^{-1/2}\right] d u
00211       \f]
00212 
00213       5) The derivative of the density wrt the effective mass
00214       \f[
00215       \left(\frac{d n}{d m^{*}}\right)_{T,\mu} = 
00216       \frac{3 g m{* 1/2} T^{3/2}}{2^{3/2} \pi^2} 
00217       \int_0^{\infty} u^{1/2} f d u
00218       \f]
00219 
00220   */
00221   class sn_nr_fermion : public fermion_deriv_thermo {
00222 
00223   public:
00224 
00225     /// Create a fermion with mass \c m and degeneracy \c g
00226     sn_nr_fermion();
00227     virtual ~sn_nr_fermion();
00228     
00229     /** \brief The limit for the Fermi functions (default 20.0)
00230     
00231         sn_nr_fermion will ignore corrections smaller than about
00232          \f$ \exp(-\mathrm{f{l}imit}) \f$ . 
00233      */
00234     double flimit;
00235     
00236     /// Storage for the most recently calculated uncertainties 
00237     fermion_deriv unc;
00238     
00239     /** \brief If true, use the present value of the chemical potential as
00240         a guess for the new chemical potential
00241     */
00242     bool guess_from_nu;
00243     
00244     /** \brief Calculate properties as function of chemical potential
00245     */
00246     virtual void calc_mu(fermion_deriv &f, double temper);
00247 
00248     /** \brief Calculate properties as function of density
00249      */
00250     virtual void calc_density(fermion_deriv &f, double temper);
00251 
00252     /** \brief Calculate properties with antiparticles as function of
00253         chemical potential
00254     */
00255     virtual void pair_mu(fermion_deriv &f, double temper);
00256 
00257     /** \brief Calculate properties with antiparticles as function of
00258         density
00259      */
00260     virtual void pair_density(fermion_deriv &f, double temper);
00261 
00262     /// Calculate effective chemical potential from density
00263     virtual void nu_from_n(fermion_deriv &f, double temper);
00264 
00265     /** \brief Set the solver for use in calculating the chemical
00266         potential from the density */
00267     void set_density_root(root<funct> &rp) {
00268       density_root=&rp;
00269       return;
00270     }
00271 
00272     /// The default solver for npen_density() and pair_density()
00273     cern_mroot_root<funct> def_density_root;
00274 
00275     /// Return string denoting type ("sn_nr_fermion")
00276     virtual const char *type() { return "sn_nr_fermion"; };
00277 
00278   protected:
00279 
00280 #ifndef DOXYGEN_INTERNAL
00281 
00282     /// Desc
00283     double T;
00284 
00285     /// Desc
00286     fermion_deriv *fp;
00287 
00288     /// Solver to compute chemical potential from density
00289     root<funct> *density_root;
00290     
00291     /// Function to compute chemical potential from density
00292     double solve_fun(double x);
00293 
00294     /** \brief Function to compute chemical potential from density
00295         when antiparticles are included
00296      */
00297     double pair_fun(double x);
00298 
00299 #endif
00300 
00301   };
00302 
00303 #ifndef DOXYGENP
00304 }
00305 #endif
00306 
00307 #endif
 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.