Go to the documentation of this file.
26 #ifndef O2SCL_EOS_CS2_POLY_H
27 #define O2SCL_EOS_CS2_POLY_H
29 #include <gsl/gsl_sf_hyperg.h>
31 #include <o2scl/constants.h>
32 #include <o2scl/err_hnd.h>
82 void fix_params(
double nb0,
double cs20,
double nb1,
double cs21,
83 double a3,
double a4) {
86 double nb0a3=pow(nb0,a3);
87 double nb1a3=pow(nb1,a3);
88 a1i=(cs21*nb0a3-cs20*nb1a3-a4*cs20*nb0a3*nb1a3+a4*cs21*nb0a3*nb1a3)/
90 a2i=(cs20-cs21)*(1.0+a4*nb0a3)*(1.0+a4*nb1a3)/(nb0a3-nb1a3);
100 double na3=pow(nb2,
a3i);
101 if (fabs(-
a4i*na3)>1.0) {
102 O2SCL_ERR2(
"Fourth argument of hyperg_2F1 greater than 1 ",
115 double nba3=pow(nb,
a3i);
132 double na3=pow(nb,
a3i);
133 if (fabs(-
a4i*na3)>1.0) {
134 O2SCL_ERR2(
"Fourth argument of hyperg_2F1 greater than 1 ",
181 double nb1=(ed1+pr1)/mub1;
182 C1=mub1*pow(nb1,-
cs2);
192 return C1*pow(nb,
cs2);
208 return pow((ed-
C2)*(1.0+
cs2)/
C1,1.0/(1.0+
cs2));
double pr_from_nb(double nb)
Return the pressure in given the baryon density in .
double a2i
Second speed of sound parameter.
void fix_params(double nb0, double cs20, double nb1, double cs21, double a3, double a4)
Fix and based on fitting to the sound speed at two different densities.
#define O2SCL_ERR2(d, d2, n)
double C1
Chemical potential integration constant.
double cs2_from_nb(double nb)
Return the squared sound speed given the baryon density in .
double C2
Energy density integration constant.
void fix_integ_consts(double nb1, double mu1, double nb2, double ed2)
Fix the integration constants by specifying the chemical potential at some baryon density and the ene...
double a4i
Fourth speed of sound parameter.
void fix_integ_consts(double mub1, double ed1, double pr1)
Fix the integration constants by specifying the pressure, baryon chemical potential,...
EOS with a constant speed of sound.
double C1
Chemical potential integration constant.
double C2
Energy density integration constant.
double ed_from_nb(double nb)
Return the energy density in , including the rest mass energy density, given the baryon density in .
double ed_from_nb(double nb)
Return the energy density in , including the rest mass energy density, given the baryon density in .
double cs2
Speed of sound.
double a1i
First speed of sound parameter.
double a3i
Third speed of sound parameter.
An EOS based on a polynomial speed of sound.
double mu_from_nb(double nb)
Return the chemical potential in , including the rest mass, given the baryon density in .
double pr_from_nb(double nb)
Return the pressure in given the baryon density in .
double nb_from_ed(double ed)
Return the energy density in , including the rest mass energy density, given the baryon density in .
double mu_from_nb(double nb)
Return the chemical potential in , including the rest mass, given the baryon density in .
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).