26 #ifndef O2SCL_NSE_EOS_H 27 #define O2SCL_NSE_EOS_H 29 #include <o2scl/classical.h> 30 #include <o2scl/constants.h> 31 #include <o2scl/nucdist.h> 32 #include <o2scl/mm_funct.h> 33 #include <o2scl/mroot_hybrids.h> 34 #include <o2scl/mmin_simp2.h> 36 #ifndef DOXYGEN_NO_O2NS 92 #ifndef DOXYGEN_INTERNAL 97 int solve_fun(
size_t nv,
const ubvector &x, ubvector &y,
98 double nn,
double np,
double T,
99 std::vector<o2scl::nucleus> &nd);
102 double minimize_fun(
size_t nv,
const ubvector &x,
double T,
104 std::vector<o2scl::nucleus> &nd);
142 void calc_mu(
double mun,
double mup,
double T,
double &nn,
143 double &np,
thermo &th, std::vector<nucleus> &nd);
160 int calc_density(
double nn,
double np,
double T,
double &mun,
161 double &mup,
thermo &th, std::vector<nucleus> &nd);
192 int make_guess(
double &mun,
double &mup,
double T,
193 thermo &th, std::vector<nucleus> &nd,
194 double nn_min=1.0e-20,
double nn_max=1.0e8,
195 double np_min=1.0e-20,
double np_max=1.0e8,
196 bool err_on_fail=
true);
205 double &mun,
double &mup,
thermo &th,
206 std::vector<nucleus> &nd);
219 double &mun,
double &mup,
thermo &th,
220 std::vector<nucleus> &nd);
248 #ifndef DOXYGEN_NO_O2NS
void set_mmin(mmin_base<> &mp)
Set the minimizer for use in density_min()
size_t make_guess_iters
The maximum number of iterations for make_guess() (default 60)
bool err_nonconv
If true, call the error handler if calc_density() does not converge (default true) ...
mmin_base * mmin_ptr
Minimizer.
int make_guess(double &mun, double &mup, double T, thermo &th, std::vector< nucleus > &nd, double nn_min=1.0e-20, double nn_max=1.0e8, double np_min=1.0e-20, double np_max=1.0e8, bool err_on_fail=true)
Find values for the chemical potentials which ensure that the densities are within a fixed range...
double make_guess_init_step
The initial stepsize for the chemical potentials relative to the temperature (default ) ...
int direct_solve(double nn, double np, double T, double &mun, double &mup, thermo &th, std::vector< nucleus > &nd)
Obtain chemical potentials from densities directly using a solver.
mmin_simp2 def_mmin
Default minimizer.
void set_mroot(mroot<> &rp)
Set the solver for use in direct_solve()
int density_min(double nn, double np, double T, double &mun, double &mup, thermo &th, std::vector< nucleus > &nd)
Obtain chemical potentials from densities using a minimizer.
classical cla
Compute particle properties assuming classical thermodynamics.
int calc_density(double nn, double np, double T, double &mun, double &mup, thermo &th, std::vector< nucleus > &nd)
Calculate the equation of state as a function of the densities.
double minimize_fun(size_t nv, const ubvector &x, double T, double nn, double np, o2scl::thermo &th, std::vector< o2scl::nucleus > &nd)
Function to minimize to match neutron and proton densities.
int verbose
Verbosity parameter (default 1)
mroot_hybrids def_mroot
Default solver.
Equation of state for nuclei in statistical equilibrium.
void calc_mu(double mun, double mup, double T, double &nn, double &np, thermo &th, std::vector< nucleus > &nd)
Calculate the equation of state as a function of the chemical potentials.
int solve_fun(size_t nv, const ubvector &x, ubvector &y, double nn, double np, double T, std::vector< o2scl::nucleus > &nd)
Function to solve to match neutron and proton densities.