Equation of State Sub-Library: Version 0.910
hadronic_eos.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_HADRONIC_EOS_H
00024 #define O2SCL_HADRONIC_EOS_H
00025 
00026 #include <iostream>
00027 #include <string>
00028 #include <o2scl/deriv.h>
00029 #include <o2scl/gsl_deriv.h>
00030 #include <o2scl/mroot.h>
00031 #include <o2scl/gsl_mroot_hybrids.h>
00032 #include <o2scl/mm_funct.h>
00033 
00034 #include <o2scl/eos.h>
00035 #include <o2scl/eff_fermion.h>
00036 #include <o2scl/part.h>
00037 
00038 #ifndef DOXYGENP
00039 namespace o2scl {
00040 #endif
00041 
00042   /** \brief Hadronic equation of state [abstract base]
00043 
00044       Denote the number density of neutrons as \f$ n_n \f$, the number
00045       density of protons as \f$ n_p \f$, the total baryon density \f$
00046       n_B = n_n + n_p \f$, the asymmetry \f$ \alpha \equiv
00047       (n_n-n_p)/n_B \f$, the nuclear saturation density as \f$ n_0
00048       \approx 0.16~\mathrm{fm}^{-3} \f$, and the quantity \f$ \eta
00049       \equiv (n-n_0)/3n_0 \f$. Then the energy per baryon of nucleonic
00050       matter matter can be written as an expansion around 
00051       \f$ \epsilon =\alpha = 0 \f$
00052       \f[
00053       E(n_B,\alpha) = -B + \frac{\tilde{K}}{2!} {\epsilon}^2 + 
00054       \frac{Q_0}{3!} {\epsilon}^3 + \alpha^2 \left(S + L \epsilon + 
00055       \frac{K_{\mathrm{sym}}}{2!} {\epsilon}^2
00056       + \frac{Q_{\mathrm{sym}}}{3!} \epsilon^3 \right) + 
00057       E_4(n_B,\alpha) + {\cal O}(\alpha^6)
00058       \qquad \left(\mathrm{Eq.}~1\right)
00059       \f]
00060       where \f$ E_4 \f$ represents the quartic terms
00061       \f[
00062       E_4(n_B,\alpha) 
00063       = \alpha^4 \left(S_4 + L_4 \epsilon + \frac{K_4}{2!} {\epsilon}^2
00064       + \frac{Q_4}{3!} \epsilon^3 \right) \qquad
00065       \left(\mathrm{Eq.}~2\right)
00066       \f]
00067       (Adapted slightly from \ref Piekarewicz09). From this, one can
00068       compute the energy density of nuclear matter \f$
00069       \varepsilon(n_B,\alpha) = n_B E(n_B,\alpha) \f$, the chemical
00070       potentials \f$ \mu_i \equiv (\partial \varepsilon) / (\partial
00071       n_i ) \f$ and the pressure \f$ P = -\varepsilon + \mu_n n_n +
00072       \mu_p n_p \f$. This expansion motivates the definition of
00073       several separate terms. The binding energy \f$ B \f$ of
00074       symmetric nuclear matter (\f$ \alpha = 0 \f$) is around 16 MeV.
00075 
00076       The compression modulus is usually defined by \f$ \chi = -1/V
00077       (dV/dP) = 1/n (dP/dn)^{-1} \f$ . In nuclear physics it has
00078       become common to use the incompressibility (or bulk) modulus
00079       with an extra factor of 9, \f$ K=9/(n \chi) \f$ and refer to \f$
00080       K \f$ simply as the incompressibility. Here, we define the
00081       function
00082       \f[
00083       K(n_B,\alpha) \equiv 9 \left( \frac{\partial P}{\partial n_B} 
00084       \right) = 9 n_B \left(\frac{\partial^2 \varepsilon}
00085       {\partial n_B^2}\right)
00086       \f]
00087       This quantity is computed by the function \ref fcomp() by
00088       computing the first derivative of the pressure, which is more
00089       numerically stable than the second derivative of the energy
00090       density (and most \o2 EOSs compute the pressure exactly). 
00091       This function is typically evaluated at the 
00092       point \f$ (n_B=n_0,\alpha=0) \f$ and is stored in \ref comp.
00093       This quantity is not always the same as \f$ \tilde{K} \f$, 
00094       defined here as
00095       \f[
00096       \tilde{K}(n_B,\alpha) = 9 n_B^2 \left(\frac{\partial^2 E}{\partial 
00097       n_B^2}\right) = K(n_B,\alpha) - \frac{1}{n_B} 18 P(n_B,\alpha)
00098       \f]
00099       We denote \f$ K \equiv K(n_B=n_0,\alpha=0) \f$ and similarly for
00100       \f$ \tilde{K} \f$, the quantity in Eq. 1 above. In nuclear
00101       matter at saturation, the pressure is zero and \f$ K = \tilde{K}
00102       \f$. See \ref Chabanat97 for a discussion of this distinction.
00103 
00104       The symmetry energy \f$ S(n_B,\alpha) \f$ can be defined as
00105       \f[
00106       S(n_B,\alpha) \equiv \frac{1}{2 n_B}\frac{\partial^2 \varepsilon}
00107       {\partial \alpha^2}
00108       \f]
00109       and the parameter \f$ S \f$ in Eq. 1 is just \f$ S(n_0,0) \f$. 
00110       Using
00111       \f[
00112       \left(\frac{\partial \varepsilon}{\partial \alpha}\right)_{n_B} = 
00113       \frac{\partial \varepsilon}{\partial n_n} 
00114       \left(\frac{\partial n_n}{\partial \alpha}\right)_{n_B} +
00115       \frac{\partial \varepsilon}{\partial n_p} 
00116       \left(\frac{\partial n_p}{\partial \alpha}\right)_{n_B} 
00117       = \frac{n_B}{2} \left(\mu_n - \mu_p \right)
00118       \f]
00119       this can be rewritten 
00120       \f[
00121       S(n_B,\alpha) = \frac{1}{4} \frac{\partial}{\partial \alpha}
00122       \left(\mu_n - \mu_p\right)
00123       \f]
00124       where the dependence of the chemical potentials on \f$ n_B \f$
00125       and \f$ \alpha \f$ is not written explicitly. This quantity is
00126       computed by function \ref fesym(). Note that many of the
00127       functions in this class are written in terms of the proton
00128       fraction \f$ x_p = (1-\alpha)/2 \f$ denoted as <tt>'pf'</tt>
00129       instead of as functions of \f$ \alpha \f$. Frequently, \f$
00130       S(n_B,\alpha) \f$ is evaluated at \f$ \alpha=0 \f$ to give a
00131       univariate function of the baryon density. It is sometimes also
00132       evaluated at the point \f$ (n_B=n_0, \alpha=0) \f$, and this
00133       value is denoted by \f$ S \f$ above and is typically stored in
00134       \ref esym. Alternatively, one can define the symmetry energy by
00135       \f[
00136       \tilde{S}(n_B) \approx E(n_B,\alpha=1)-E(n_B,\alpha=0)
00137       \f]
00138       which is computed by function \ref fesym_diff() . The
00139       functions \f$ S(n_B,\alpha=0) \f$ and \f$ \tilde{S}(n_B) \f$
00140       are equal when \f$ {\cal O}(\alpha^4) \f$ terms are zero. 
00141       In this case, \f$ \mu_n - \mu_p \f$ is proportional to 
00142       \f$ \alpha \f$ and so 
00143       \f[
00144       S(n_B) = \tilde{S}(n_B) = \frac{1}{4} 
00145       \frac{(\mu_n-\mu_p)}{\alpha} \, .
00146       \f]
00147       
00148       The symmetry energy slope parameter \f$ L \f$, can be defined
00149       by 
00150       \f[
00151       L(n_B,\alpha) \equiv 3 n_B \frac{\partial S(n_B,\alpha)}
00152       {\partial n_B} = 3 n_B \frac{\partial}{\partial n_B} \left[ 
00153       \frac{1}{2 n_B} \frac{\partial^2 \varepsilon}{\partial \alpha^2}
00154       \right]
00155       \f]
00156       This can be rewritten as 
00157       \f[
00158       L(n_B,\alpha) = \frac{3 n_B}{4} \frac{\partial}{\partial n_B}
00159       \frac{\partial}{\partial \alpha} \left(\mu_n - \mu_p\right)
00160       \f]
00161       (where the derivatives can be evaluated in either order) 
00162       or alternatively using 
00163       \f[
00164       \left(\frac{\partial \varepsilon}{\partial n_B}\right)_{\alpha} = 
00165       \frac{\partial \varepsilon}{\partial n_n} 
00166       \left(\frac{\partial n_n}{\partial n_B}\right)_{\alpha} +
00167       \frac{\partial \varepsilon}{\partial n_p} 
00168       \left(\frac{\partial n_p}{\partial n_B}\right)_{\alpha} 
00169       = \frac{1}{2} \left(\mu_n + \mu_p \right)
00170       \f]
00171       \f$ L \f$ can be rewritten
00172       \f{eqnarray*}
00173       L(n_B,\alpha) &=& 3 n_B \left[\frac{-1}{2 n_B^2} 
00174       \frac{\partial^2 \varepsilon}{\partial \alpha^2} + 
00175       \frac{1}{4 n_B} \frac{\partial^2}{\partial \alpha^2} 
00176       \left(\mu_n + \mu_p\right)\right] \\
00177       &=& \frac{3}{4}\frac{\partial^2}{\partial \alpha^2} 
00178       \left(\mu_n + \mu_p\right) - 3 S(n_B,\alpha) \, .
00179       \f}
00180 
00181       The third derivative with respect to the baryon density is
00182       sometimes called the skewness. Here, we define
00183       \f[
00184       Q_0(n_B,\alpha) = 27 n_B^3 \frac{\partial^3}{\partial n_B^3} 
00185       \left(\frac{\varepsilon}{n_B}\right) = 
00186       27 n_B^3 \frac{\partial^2}{\partial n_B^2} 
00187       \left(\frac{P}{n_B^2}\right)
00188       \f]
00189       and this function is computed in \ref fkprime() .
00190 
00191       The second derivative of the symmetry energy with respect
00192       to the baryon density is
00193       \f[
00194       K_{\mathrm{sym}}(n_B,\alpha) = 9 n_B^2 
00195       \frac{\partial^2}{\partial n_B^2} S(n_B,\alpha)
00196       \f]
00197 
00198       The third derivative of the symmetry energy with respect
00199       to the baryon density is
00200       \f[
00201       Q_{\mathrm{sym}}(n_B,\alpha) = 27 n_B^3 
00202       \frac{\partial^3}{\partial n_B^3} S(n_B,\alpha)
00203       \f]
00204 
00205       Note that solving for the baryon density for which \f$ P=0 \f$
00206       gives, to order \f$ \alpha^2 \f$ (\ref Piekarewicz09)
00207       \f[
00208       n_B = n_0 \left[ 1 + \frac{6 K}{Q} 
00209       + \alpha^2 \left( \frac{3 L}{K}-\frac{6 K_{\mathrm{sym}}}{Q} + 
00210       \frac{6 K Q_{\mathrm{sym}}}{Q^2} \right) \right]
00211       \f]
00212 
00213       The quartic symmetry energy \f$ S_4(n_B,\alpha) \f$ can be defined as
00214       \f[
00215       S_4(n_B,\alpha) \equiv \frac{1}{24 n_B}\frac{\partial^4 \varepsilon}
00216       {\partial \alpha^4}
00217       \f]
00218       However, fourth derivatives are difficult numerically, and so an
00219       alternative quantity is preferable. Instead, one can evaluate
00220       the extent to which \f$ {\cal O}(\alpha^4) \f$ terms are
00221       important from
00222       \f[
00223       \eta(n_B) \equiv \frac{E(n_B,1)-E(n_B,1/2)}
00224       {3 \left[E(n_B,1/2)-E(n_B,0)\right]}
00225       \f]
00226       as described in \ref Steiner06 . This function can be expressed
00227       either in terms of \f$ \tilde{S} \f$ or \f$ S_4 \f$
00228       \f[
00229       \eta(n_B) = \frac{5 \tilde{S}(n_B) - S(n_B,0)}
00230       {\tilde{S}(n_B) + 3 S(n_B,0)} =
00231       \frac{5 S_4(n_B,0) + 4 S(n_B,0)}
00232       {S_4(n_B,0) + 4 S(n_B,0)} 
00233       \f]
00234 
00235       Evaluating this function at the saturation density gives
00236       \f[
00237       \eta(n_0) = \frac{4 S + 5 S_4}{4 S + S_4}
00238       \f]
00239       (Note that \f$ S_4 \f$ is referred to as \f$ Q \f$ in 
00240       \ref Steiner06). Sometimes it is useful to separate out
00241       the kinetic and potential parts of the energy density when
00242       computing \f$ \eta(n_B) \f$, and the class \ref sym4_eos_base
00243       is useful for this purpose. 
00244 
00245       \future Could write a function to compute the "symmetry free energy"
00246       or the "symmetry entropy"
00247   */
00248   class hadronic_eos : public eos {
00249   public:
00250     
00251     hadronic_eos();
00252 
00253     virtual ~hadronic_eos() {};
00254 
00255     /// Binding energy
00256     double eoa;
00257 
00258     /// Compressibility
00259     double comp;
00260 
00261     /// Symmetry energy
00262     double esym;
00263   
00264     /// Saturation density
00265     double n0;
00266 
00267     /// Effective mass (neutron)
00268     double msom;
00269 
00270     /// Skewness
00271     double kprime;
00272     
00273     /// \name Equation of state
00274     //@{
00275     /** \brief Equation of state as a function of the chemical potentials
00276     */
00277     virtual int calc_p(fermion &n, fermion &p, thermo &th)=0;
00278 
00279     /** \brief Equation of state as a function of density
00280     */
00281     virtual int calc_e(fermion &n, fermion &p, thermo &th)=0;
00282     //@}
00283 
00284     /// \name EOS properties
00285     //@{
00286     /** \brief Calculate the incompressibility in \f$ \mathrm{fm}^{-1} \f$ 
00287         using calc_e()
00288 
00289         This function computes \f$ K (n_B,\alpha) = 9 n_B \partial^2
00290         \varepsilon /(\partial n_B^2) = 9 \partial P / (\partial n_B)
00291         \f$ . The value of \f$ K(n_0,0) \f$, often referred to as the
00292         "compressibility", is stored in \ref comp by \ref saturation() 
00293         and is about 240 MeV at saturation density.
00294     */
00295     virtual double fcomp(double nb, const double &alpha=0.0);
00296 
00297     /** \brief Calculate the energy per baryon in \f$ \mathrm{fm}^{-1} \f$ 
00298         using calc_e()
00299 
00300         This function computes the energy per baryon of matter 
00301         without the nucleon rest masses at the specified baryon
00302         density, \c nb, and isospin asymmetry \c alpha. 
00303     */
00304     virtual double feoa(double nb, const double &alpha=0.0);
00305 
00306     /** \brief Calculate symmetry energy of matter in 
00307         \f$ \mathrm{fm}^{-1} \f$ using \ref calc_dmu_alpha() .
00308 
00309         This function computes the symmetry energy,
00310         \f[
00311         \left(\frac{1}{2 n_B}\frac{d^2 \varepsilon}{d \alpha^2}
00312         \right) = \frac{1}{4} \frac{\partial}{\partial \alpha}
00313         \left(\mu_n - \mu_p \right)
00314         \f]
00315         at the value of \f$ n_B \f$ given in \c nb and \f$ \alpha \f$
00316         given in \c alpha. The symmetry energy at \f$ \alpha=0 \f$ at
00317         the saturation density and is stored in \ref esym by 
00318         \ref saturation().
00319     */
00320     virtual double fesym(double nb, const double &alpha=0.0);
00321 
00322     /** \brief Calculate symmetry energy of matter and its
00323         uncertainty
00324 
00325         This estimates the uncertainty due to the numerical
00326         differentiation, assuming that difference betwen the neutron
00327         and proton chemical potentials is computed exactly by \ref
00328         calc_dmu_alpha() .
00329     */
00330     virtual double fesym_err(double nb, double &alpha, 
00331                              double &unc);
00332     
00333     /** \brief The symmetry energy slope parameter
00334         
00335         This returns the value of the "slope parameter" 
00336         of the symmetry energy
00337         \f[
00338         L=3 n_{B} \left(\frac{\partial E_{sym}}{\partial n_{B}}\right)
00339         \f]
00340         in inverse Fermis. 
00341 
00342         where \f$ n_B \f$ is the baryon density. This ranges 
00343         between about zero and 200 MeV for many EOSs. 
00344     */
00345     virtual double fesym_slope(double nb, const double &alpha=0.0);
00346 
00347     /** \brief The curvature of the symmetry energy
00348      */
00349     virtual double fesym_curve(double nb, const double &alpha=0.0);
00350 
00351     /** \brief The skewness of the symmetry energy
00352      */
00353     virtual double fesym_skew(double nb, const double &alpha=0.0);
00354 
00355     /** \brief Calculate symmetry energy of matter as energy of 
00356         neutron matter minus the energy of nuclear matter
00357 
00358         This function returns the energy per baryon of neutron matter
00359         minus the energy per baryon of nuclear matter. This will
00360         deviate significantly from the results from fesym() only if
00361         the dependence of the symmetry energy on \f$ \delta \f$ is not
00362         quadratic.
00363     */
00364     virtual double fesym_diff(double nb);
00365 
00366     /** \brief The strength parameter for quartic terms in the 
00367         symmetry energy
00368     */
00369     virtual double feta(double nb);
00370 
00371     /** \brief Calculate skewness of nuclear matter using calc_e()
00372 
00373         The skewness is defined to be 
00374         \f$ 27 n^3 d^3 (\varepsilon/n)/(d n^3) = 
00375         27 n^3 d^2 (P/n^2) / (d n^2) \f$ 
00376         and is denoted 'kprime'. This definition seems to be ambiguous
00377         for densities other than the saturation density and is not
00378         quite analogous to the compressibility.
00379     */
00380     virtual double fkprime(double nb, const double &alpha=0.0);
00381 
00382     /** \brief Calculate reduced neutron effective mass using calc_e()
00383 
00384         Neutron effective mass (as stored in \ref part::ms) divided by
00385         vacuum mass (as stored in \ref part::m) in nuclear matter at
00386         saturation density. Note that this simply uses the value of
00387         n.ms from calc_e(), so that this effective mass could be
00388         either the Landau or Dirac mass depending on the context. Note
00389         that this may not be equal to the reduced proton effective
00390         mass.
00391     */
00392     virtual double fmsom(double nb, const double &alpha=0.0);
00393 
00394     /** \brief Calculate saturation density using calc_e()
00395 
00396         This function finds the baryon density for which the pressure 
00397         vanishes. 
00398     */
00399     virtual double fn0(double alpha, double &leoa);
00400 
00401     /** \brief Calculates some of the EOS properties at the saturation 
00402         density
00403         
00404         \future It would be great to provide numerical uncertainties
00405         in the saturation properties.
00406     */
00407     virtual int saturation();
00408     //@}
00409 
00410     /** \brief Calculate coefficients for \gradient \part of Hamiltonian
00411 
00412         \note This is still somewhat experimental.
00413 
00414         We want the \gradient \part of the Hamiltonian in the form
00415         \f[
00416         {\cal H}_{\mathrm{grad}} = \frac{1}{2} \sum_{i=n,p}
00417         \sum_{j=n,p} Q_{ij}
00418         \vec{\nabla} n_i \cdot \vec{\nabla} n_j
00419         \f]
00420 
00421         The expression for the \gradient terms from \ref Pethick95 is 
00422         \f{eqnarray*}
00423         {\cal H}_{\mathrm{grad}}&=&-\frac{1}{4}
00424         \left(2 P_1 + P_{1;f}-P_{2;f}\right) 
00425         \nonumber \\
00426         && +\frac{1}{2} \left( Q_1+Q_2 \right) 
00427         \left(n_n \nabla^2 n_n+n_p \nabla^2 n_p\right) \nonumber \\
00428         && + \frac{1}{4}\left( Q_1-Q_2 \right) 
00429         \left[\left(\nabla n_n\right)^2+\left(\nabla n_p\right)^2
00430         \right] \nonumber \\
00431         && + \frac{1}{2} \frac{d Q_2}{d n} 
00432         \left( n_n \nabla n_n + n_p \nabla n_p \right) \cdot \nabla n
00433         \f}
00434         This can be rewritten
00435         \f{eqnarray*}
00436         {\cal H}_{\mathrm{grad}}&=&\frac{1}{2}\left(\nabla n\right)^2
00437         \left[ \frac{3}{2} P_1+n \frac{d P_1}{d n}\right] \nonumber \\
00438         && - \frac{3}{4} \left[ \left( \nabla n_n\right)^2 + 
00439         \left( \nabla n_p \right)^2 \right] \nonumber \\
00440         && -\frac{1}{2} \left[ \right] \cdot \nabla n \frac{d Q_1}{d n}
00441         \nonumber \\ && - \frac{1}{4} \left( \nabla n\right)^2 P_2
00442         - \frac{1}{4} \left[ \left( \nabla n_n\right)^2 +
00443         \left( \nabla n_p \right)^2 \right] Q_2
00444         \f}
00445         or
00446         \f{eqnarray*}
00447         {\cal H}_{\mathrm{grad}}&=&\frac{1}{4} \left( \nabla n\right)^2
00448         \left[3 P_1 + 2 n \frac{d P_1}{d n}-P_2\right] \nonumber \\
00449         && - \frac{1}{4} \left( 3 Q_1+Q_2 \right)
00450         \left[ \left( \nabla n_n\right)^2 + 
00451         \left( \nabla n_p \right)^2 \right] \nonumber \\
00452         && - \frac{1}{2} \frac{d Q_1}{d n}
00453         \left[ n_n \nabla n_n + n_p \nabla n_p \right]
00454         \cdot \nabla n 
00455         \f}
00456         or
00457         \f{eqnarray*}
00458         {\cal H}_{\mathrm{grad}}&=&\frac{1}{4} \left( \nabla n\right)^2
00459         \left[3 P_1 + 2 n \frac{d P_1}{d n}-P_2\right] \nonumber \\
00460         && - \frac{1}{4} \left( 3 Q_1+Q_2 \right)
00461         \left[ \left( \nabla n_n\right)^2 + 
00462         \left( \nabla n_p \right)^2 \right] \nonumber \\
00463         && - \frac{1}{2} \frac{d Q_1}{d n}
00464         \left[ n_n \left( \nabla n_n \right)^2 +
00465         n_p \left( \nabla n_p \right)^2 + n \nabla n_n \cdot
00466         \nabla n_p \right]
00467         \f}
00468 
00469         Generally, for Skyrme-like interactions
00470         \f{eqnarray*}
00471         P_i &=& \frac{1}{4} t_i \left(1+\frac{1}{2} x_i \right) \nonumber \\
00472         Q_i &=& \frac{1}{4} t_i \left(\frac{1}{2} + x_i \right) \, .
00473         \f}
00474         for \f$ i=1,2 \f$ .
00475 
00476         This function uses the assumption \f$ x_1=x_2=0 \f$ to 
00477         calculate \f$ t_1 \f$ and \f$ t_2 \f$ from the neutron
00478         and proton effective masses assuming the Skyrme form. The
00479         values of \f$ Q_{ij} \f$ and their derivatives are then computed.
00480 
00481         The functions set_n_and_p() and set_thermo() will be called by
00482         gradient_qij(), to facilitate the use of the \c n, \c p, and
00483         \c th parameters.
00484        
00485     */
00486     int gradient_qij(fermion &n, fermion &p, thermo &th, 
00487                      double &qnn, double &qnp, double &qpp, 
00488                      double &dqnndnn, double &dqnndnp,
00489                      double &dqnpdnn, double &dqnpdnp,
00490                      double &dqppdnn, double &dqppdnp);
00491     
00492     /// \name Functions for calculating physical properties
00493     //@{
00494 
00495     /** \brief Compute the difference between neutron and proton chemical
00496         potentials as a function of the isospin asymmetry
00497     */
00498     double calc_dmu_alpha(double alpha, const double &nb);
00499     
00500     /** \brief Compute the sum of the neutron and proton chemical
00501         potentials as a function of the isospin asymmetry
00502     */
00503     double calc_musum_alpha(double alpha, const double &nb);
00504 
00505     /** \brief Compute the pressure as a function of baryon density
00506         at fixed isospin asymmetry
00507 
00508         Used by fcomp().
00509     */
00510     double calc_pressure_nb(double nb, const double &alpha=0.0);
00511 
00512     /** \brief Compute the energy density as a function of baryon density
00513         at fixed isospin asymmetry
00514 
00515         This function calls \ref hadronic_eos::calc_e() with the
00516         internally stored neutron and proton objects.
00517      */
00518     double calc_edensity_nb(double nb, const double &alpha=0.0);
00519 
00520     /** \brief Compute derivatives at constant proton fraction
00521      */
00522     void const_pf_derivs(double nb, double pf, 
00523                          double &dednb_pf, double &dPdnb_pf);
00524 
00525     /** \brief Calculate pressure / baryon density squared in nuclear
00526         matter as a function of baryon density at fixed isospin asymmetry
00527         
00528         Used by fkprime().
00529     */
00530     double calc_press_over_den2(double nb, const double &alpha=0.0);
00531 
00532     /** \brief Calculate energy density as a function of the
00533         isospin asymmetry at fixed baryon density
00534 
00535         Used by fesym().
00536 
00537         This function calls \ref hadronic_eos::calc_e() with the
00538         internally stored neutron and proton objects.
00539     */
00540     double calc_edensity_alpha(double alpha, const double &nb);
00541     //@}
00542 
00543     /// \name Other functions
00544     //@{
00545     /** \brief Nucleonic matter from calc_p()
00546     */
00547     int nuc_matter_p(size_t nv, const ovector_base &x, ovector_base &y, 
00548                      double *&pa);
00549     
00550     /** \brief Nucleonic matter from calc_e()
00551     */
00552     int nuc_matter_e(size_t nv, const ovector_base &x, ovector_base &y, 
00553                      double *&pa);
00554     //@}
00555 
00556     /// \name Set auxilliary objects
00557     //@{
00558     /** \brief Set class mroot object for use in calculating chemical
00559         potentials from densities 
00560 
00561         \note While in principle this allows one to use any \ref mroot
00562         object, in practice some of the current EOSs require \ref
00563         gsl_mroot_hybrids because it automatically avoids regions
00564         where the equations are undefined.
00565     */
00566     virtual int set_mroot(mroot<mm_funct<> > &mr);
00567 
00568     /** \brief Set class mroot object for use calculating saturation density
00569 
00570         \note While in principle this allows one to use any \ref mroot
00571         object, in practice some of the current EOSs require \ref
00572         gsl_mroot_hybrids because it automatically avoids regions
00573         where the equations are undefined.
00574      */
00575     virtual int set_sat_root(root<funct > &mr);
00576     
00577     /// Set \ref deriv object to use to find saturation properties
00578     virtual int set_sat_deriv(deriv<funct > &de);
00579 
00580     /** \brief Set the second \ref deriv object to use to find
00581         saturation properties
00582 
00583         Computing the slope of the symmetry energy at the saturation
00584         density requires two derivative objects, because it has to
00585         take an isospin derivative and a density derivative. Thus this
00586         second \ref deriv object is used in the function
00587         fesym_slope().
00588     */
00589     virtual int set_sat_deriv2(deriv<funct> &de);
00590     
00591     /// Set neutron and proton 
00592     virtual int set_n_and_p(fermion &n, fermion &p);
00593     //@}
00594 
00595     /// The defaut neutron
00596     fermion def_neutron;
00597 
00598     /// The defaut proton
00599     fermion def_proton;
00600 
00601     /// \name Default solvers and derivative classes
00602     //@{
00603     /** \brief The default object for derivatives
00604         
00605         The value of gsl_deriv::h is set to \f$ 10^{-3} \f$ in 
00606         the hadronic_eos constructor.
00607     */
00608     gsl_deriv<funct > def_deriv;
00609     
00610     /** \brief The second default object for derivatives
00611         
00612         The value of gsl_deriv::h is set to \f$ 10^{-3} \f$ in 
00613         the hadronic_eos constructor.
00614     */
00615     gsl_deriv<funct> def_deriv2;
00616 
00617     /** \brief The default solver
00618 
00619         Used by calc_e() to solve nuc_matter_p() (2 variables) and by
00620         calc_p() to solve nuc_matter_e() (2 variables).
00621     */
00622     gsl_mroot_hybrids<mm_funct<> > def_mroot;
00623     
00624     /** \brief The default solver for calculating the saturation 
00625         density
00626 
00627         Used by fn0() (which is called by saturation()) to solve
00628         saturation_matter_e() (1 variable).
00629     */
00630     cern_mroot_root<funct > def_sat_root;
00631     //@}
00632     
00633     /// Return string denoting type ("hadronic_eos")
00634     virtual const char *type() { return "hadronic_eos"; }
00635 
00636 #ifndef DOXYGEN_INTERNAL
00637 
00638   protected:
00639 
00640     /// Compute t1 for gradient_qij().
00641     double t1_fun(double barn);
00642     
00643     /// Compute t2 for gradient_qij().
00644     double t2_fun(double barn);
00645     
00646     /// The EOS solver
00647     mroot<mm_funct<> > *eos_mroot;
00648     
00649     /// The solver to compute saturation properties
00650     root<funct> *sat_root;
00651 
00652     /// The derivative object for saturation properties
00653     deriv<funct> *sat_deriv;
00654 
00655     /// The second derivative object for saturation properties
00656     deriv<funct> *sat_deriv2;
00657 
00658     /// The neutron object
00659     fermion *neutron;
00660 
00661     /// The proton object
00662     fermion *proton;
00663 
00664 #endif
00665     
00666   };
00667 
00668   /// A hadronic EOS based on a function of the densities [abstract base]
00669   class hadronic_eos_eden : public hadronic_eos {
00670   public:
00671 
00672     /** \brief Equation of state as a function of density
00673     */
00674     virtual int calc_e(fermion &n, fermion &p, thermo &th)=0;
00675     
00676     /** \brief Equation of state as a function of the chemical potentials
00677     */
00678     virtual int calc_p(fermion &n, fermion &p, thermo &th);
00679 
00680   };
00681 
00682   /** \brief A hadronic EOS based on a function of the chemical 
00683       potentials [abstract base]
00684   */
00685   class hadronic_eos_pres : public hadronic_eos {
00686   public:
00687 
00688     /** \brief Equation of state as a function of the chemical potentials
00689     */
00690     virtual int calc_p(fermion &n, fermion &p, thermo &th)=0;
00691     
00692     /** \brief Equation of state as a function of density
00693     */
00694     virtual int calc_e(fermion &n, fermion &p, thermo &th);
00695 
00696   };
00697 
00698   /// A finite temperature hadronic EOS
00699   class hadronic_eos_temp : public hadronic_eos {
00700 
00701 #ifndef DOXYGEN_INTERNAL
00702     
00703   protected:
00704 
00705     /// Desc
00706     fermion_eval_thermo *fet;
00707 
00708     /// The temperature
00709     double lT;
00710 
00711     /// Solve for nuclear matter at finite temperature given density
00712     int nuc_matter_temp_e(size_t nv, const ovector_base &x, 
00713                           ovector_base &y, double *&pa);
00714     
00715     /// Solve for nuclear matter at finite temperature given mu
00716     int nuc_matter_temp_p(size_t nv, const ovector_base &x, 
00717                           ovector_base &y, double *&pa);
00718     
00719 #endif
00720 
00721   public:
00722 
00723     hadronic_eos_temp() {
00724       fet=&def_fet;
00725     }
00726 
00727     virtual ~hadronic_eos_temp() {}
00728 
00729     /// Desc
00730     eff_fermion def_fet;
00731 
00732     /** \brief Equation of state as a function of density
00733     */
00734     virtual int calc_e(fermion &n, fermion &p, thermo &th)=0;
00735     
00736     /** \brief Equation of state as a function of densities at 
00737         finite temperature
00738     */
00739     virtual int calc_temp_e(fermion &n, fermion &p, double T, 
00740                             thermo &th)=0;
00741 
00742     /** \brief Equation of state as a function of the chemical potentials
00743     */
00744     virtual int calc_p(fermion &n, fermion &p, thermo &th)=0;
00745 
00746     /** \brief Equation of state as a function of the chemical potentials
00747         at finite temperature
00748     */
00749     virtual int calc_temp_p(fermion &n, fermion &p, double T, 
00750                             thermo &th)=0;
00751     
00752   };
00753 
00754   /** \brief A hadronic EOS at finite temperature
00755       based on a function of the densities [abstract base]
00756   */
00757   class hadronic_eos_temp_eden : public hadronic_eos_temp {
00758   public:
00759 
00760     /** \brief Equation of state as a function of density
00761     */
00762     virtual int calc_e(fermion &n, fermion &p, thermo &th)=0;
00763     
00764     /** \brief Equation of state as a function of densities at 
00765         finite temperature
00766     */
00767     virtual int calc_temp_e(fermion &n, fermion &p, double T, 
00768                             thermo &th)=0;
00769 
00770     /** \brief Equation of state as a function of the chemical potentials
00771     */
00772     virtual int calc_p(fermion &n, fermion &p, thermo &th);
00773 
00774     /** \brief Equation of state as a function of the chemical potentials
00775         at finite temperature
00776     */
00777     virtual int calc_temp_p(fermion &n, fermion &p, double T, 
00778                             thermo &th);
00779     
00780   };
00781 
00782   /** \brief A hadronic EOS at finite temperature based on a function
00783       of the chemical potentials [abstract base]
00784   */
00785   class hadronic_eos_temp_pres : public hadronic_eos_temp {
00786   public:
00787 
00788     /** \brief Equation of state as a function of the chemical potentials
00789     */
00790     virtual int calc_p(fermion &n, fermion &p, thermo &th)=0;
00791 
00792     /** \brief Equation of state as a function of the chemical potentials
00793         at finite temperature
00794     */
00795     virtual int calc_temp_p(fermion &n, fermion &p, double T, 
00796                             thermo &th)=0;
00797     
00798     /** \brief Equation of state as a function of density
00799     */
00800     virtual int calc_e(fermion &n, fermion &p, thermo &th);
00801 
00802     /** \brief Equation of state as a function of densities at 
00803         finite temperature
00804     */
00805     virtual int calc_temp_e(fermion &n, fermion &p, double T, 
00806                             thermo &th);
00807   };
00808 
00809 #ifndef DOXYGENP
00810 }
00811 #endif
00812 
00813 #endif
00814 
 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.