![]() |
Equation of State Sub-Library: Version 0.910
|
Class to solve the Tolman-Oppenheimer-Volkov equations. More...
#include <tov_solve.h>
In units where , the TOV equations (i.e. Einstein's equations for a static spherically symmetric object) are
where is the radial coordinate,
is the gravitational mass enclosed within a radius
, and
and
are the energy density and pressure at
, and
is the gravitational constant. The boundary conditions are
the condition
for some fixed radius
. These boundary conditions give a series of solutions to the TOV equations as a function of the radius, although they do not necessarily have a solution for all radii.
The gravitational mass is given by
The gravitational potential, can be determined from
The proper boundary condition for the gravitational potential is
which ensures that as
.
The surface gravity is
which is given in inverse kilometers and the redshift is
which is unitless.
The baryonic mass is typically defined by
where is the baryon number density at radius
and
is the mass of one baryon. Then the "binding energy" of the neutron star is defined to be
. If you can specify the product
in the EOS (analogous to the rest mass energy density), it will compute the associated baryonic mass for you.
In the case of slow rigid rotation with angular velocity , the moment of inertia is
where the function is the solution of
and the function is defined by
The boundary conditions for are
at
and
The equation of state may be changed at any time, by specifying the appropriate tov_eos object
Screen output:
verbose=0
- Nothingverbose=1
- Basic informationverbose=2
- For each profile computation, report solution information at every kilometer.verbose=3
- Report profile information at every 20 grid points. A keypress is required after each profile.The functions fixed() and max() produce output tables which represent the profile of the neutron star of the requested mass. The columns are
gm
, the enclosed gravitational mass in solar massesr
, the radial coordinate in gp
, the gravitational potential (unitless) when calcgpot is truebm
, the baryonic mass in solar masses (when tov_eos::baryon_column is true).pr
, the pressureed
, the energy densitynb
, the baryon density (if tov_eos::baryon_column is true)sg
, the local surface gravity (in rs
, the local redshift (unitless),dmdr
, the derivative of the enclosed gravitational mass in dlogpdr
, the derivative of the natural logarithm of the pressuredgpdr
, the derivative of the gravitational potential in dbmdr
, the derivative of the enclosed baryonic mass (if tov_eos::baryon_column is true). The function mvsr() produces a different kind of output table corresponding to the mass versus radius curve. Some points on the curve may correspond to unstable branches.
gm
, the total gravitational mass in solar massesr
, the radius in gp
, the gravitational potential at the surface (unitless) when calcgpot is truebm
, total the baryonic mass in solar masses (when tov_eos::baryon_column is true).pr
, the central pressureed
, the central energy densitynb
, the central baryon density (if tov_eos::baryon_column is true)sg
, the surface gravity (in rs
, the redshift at the surface,dmdr
, the derivative of the gravitational massdlogpdr
, the derivative of the natural logarithm of the pressuredgpdr
, the derivative of the gravitational potential in dbmdr
, the derivative of the enclosed baryonic mass (if tov_eos::baryon_column is true). The present code, as demonstrated in the tests, gives the correct central pressure and energy density of the analytical solution by Buchdahl to within less than 1 part in .
gsl_efailed
without calling the error handler in the case that the solver can recover gracefully from, for example, a negative pressure.xmev_kg
, etc.Definition at line 243 of file tov_solve.h.
Public Member Functions | |
Basic operation | |
int | set_eos (tov_eos &ter) |
Set the EOS to use. | |
int | set_units (double s_efactor=1.0, double s_pfactor=1.0, double s_nbfactor=1.0) |
Set units. | |
int | set_units (std::string eunits="", std::string punits="", std::string nunits="") |
Set units. | |
virtual int | mvsr () |
Calculate the mass vs. radius curve. | |
virtual int | fixed (double d_tmass) |
Calculate the profile of a star with fixed mass. | |
virtual int | max () |
Calculate the profile of the maximum mass star. | |
o2_shared_ptr< table_units >::type | get_results () |
Return the results data table. | |
int | solution_check () |
Check the solution (unfinished) | |
Control numerical methods | |
int | set_kmax (int s_maxoutsize=400, int s_kmax=80000) |
Set maximum storage for integration. | |
int | set_mroot (mroot< mm_funct<> > &s_mrp) |
Set solver. | |
int | set_minimize (minimize< funct > &s_mp) |
Set minimizer. | |
int | set_stepper (adapt_step< ode_funct<> > &sap) |
Set the adaptive stepper. | |
Data Fields | |
gsl_min_brent< funct > | def_min |
The default minimizer. | |
gsl_mroot_hybrids< mm_funct<> > | def_solver |
The default solver. | |
gsl_astep< ode_funct<> > | def_stepper |
The default adaptive stepper. | |
bool | compute_ang_vel |
If true, compute the angular velocity (default false) | |
double | cap_omega |
The angular velocity. | |
Basic properties | |
double | mass |
mass | |
double | rad |
radius | |
double | bmass |
baryonic mass | |
double | gpot |
gravitational potential | |
Solution parameters | |
These parameters can be changed at any time. | |
bool | generel |
Use general relativistic version (default true) | |
bool | calcgpot |
calculate the gravitational potential and the enclosed baryon mass (default false) | |
double | hmin |
smallest allowed radial stepsize (default 1.0e-4) | |
double | hmax |
largest allowed radial stepsize (default 0.05) | |
double | hstart |
initial radial stepsize (default 4.0e-3) | |
int | verbose |
control for output (default 1) | |
double | maxradius |
maximum radius for integration in km (default 60) | |
Mass versus radius parameters | |
double | prbegin |
Beginning pressure (default 7.0e-7) | |
double | prend |
Ending pressure (default 8.0e-3) | |
double | princ |
Increment for pressure (default 1.1) | |
bool | logmode |
Use 'princ' as a multiplier, not an additive increment (default true) | |
double | prguess |
Guess for central pressure in solar masses per km3 (default ![]() | |
double | max_begin |
Beginning pressure for maximum mass guess (default 7.0e-5) | |
double | max_end |
Ending pressure for maximum mass guess (default 5.0e-3) | |
double | max_inc |
Increment for pressure for maximum mass guess (default 1.3) | |
Protected Member Functions | |
int | make_unique_name (std::string &col, std::vector< std::string > &cnames) |
Ensure col does not match strings in cnames . | |
int | ang_vel () |
Compute the angular velocity. | |
virtual int | derivs (double x, size_t nv, const ovector_base &y, ovector_base &dydx) |
The ODE step function. | |
virtual int | derivs_ang_vel (double x, size_t nv, const ovector_base &y, ovector_base &dydx) |
The ODE step function for the angular velocity. | |
virtual int | profile_out (double xx) |
Construct a stellar profile. | |
virtual double | maxfun (double maxx) |
The minimizer function to compute the maximum mass. | |
virtual int | starfun (size_t ndvar, const ovector_base &ndx, ovector_base &ndy) |
The solver function to compute the stellar profile. | |
Protected Attributes | |
double | mev_kg |
To convert MeV to kilograms. | |
double | mev_per_fm3_msun_km3 |
To convert ![]() | |
double | tmass |
Target mass. | |
tov_eos * | te |
The EOS. | |
bool | eos_set |
True if the EOS has been set. | |
int | kmax |
maximum storage size (default 40000) | |
int | maxoutsize |
maximum size of output file (default 400) | |
double | presmin |
Smallest allowed pressure for integration (default: -100) | |
sm_interp | smi |
Interpolation object for derivs_ang_vel() | |
o2_shared_ptr< table_units >::type | out_table |
The output table. | |
mroot< mm_funct<> > * | mroot_ptr |
The solver. | |
minimize< funct > * | min_ptr |
The minimizer. | |
adapt_step< ode_funct<> > * | as_ptr |
The adaptive stepper. | |
double | schwarz_km |
The schwarzchild radius in km. | |
User EOS units | |
std::string | eunits |
Units for energy density. | |
std::string | punits |
Units for pressure. | |
std::string | nunits |
Units for baryon density. | |
double | efactor |
unit conversion factor for energy density (default 1.0) | |
double | pfactor |
unit conversion factor for pressure (default 1.0) | |
double | nfactor |
unit conversion factor for baryon density (default 1.0) | |
Integration storage | |
ovector | rky [6] |
ODE functions. | |
ovector | rkx |
Radial coordinate (in kilometers) | |
ovector | rkdydx [6] |
The derivatives of the ODE functions. |
int tov_solve::make_unique_name | ( | std::string & | col, |
std::vector< std::string > & | cnames | ||
) | [protected] |
Underscores are added to col
until it matches none of the strings in cnames
.
virtual int tov_solve::profile_out | ( | double | xx | ) | [protected, virtual] |
int tov_solve::set_units | ( | std::string | eunits = "" , |
std::string | punits = "" , |
||
std::string | nunits = "" |
||
) |
Valid entries for the units of energy density and pressure are:
Valid entries for the units of baryon density are:
int tov_solve::set_kmax | ( | int | s_maxoutsize = 400 , |
int | s_kmax = 80000 |
||
) |
The variable s_kmax
is the maximum number of radial integration stepsk while s_maxoutsize
is the maximum number of points that will be output for any profile.
If s_kmax
is less than zero, there is no limit on the number of radial steps.
double tov_solve::tmass [protected] |
Negative values to indicate a mass measured relative to the maximum mass. For example, if the EOS has a maximum mass of 2.0, then -0.15 will give the profile of a 1.85 solar mass star.
Definition at line 261 of file tov_solve.h.
double tov_solve::presmin [protected] |
This quantity can't be much smaller than -100 since we need to compute numbers near
Definition at line 303 of file tov_solve.h.
ovector tov_solve::rky[6] [protected] |
The vector rky
[0] is the gravitational mass in solar masses, and the vector rky
[1] is the natural logarithm of the pressure in solar masses per cubic kilometer. When calcgpot is true, the next vector in this list is the gravitational potential (which is unitless), and when tov_eos::baryon_column is true, the next vector in this list is the baryonic mass in solar masses.
Definition at line 317 of file tov_solve.h.
double tov_solve::prguess |
This guess is used in the function fixed().
Definition at line 427 of file tov_solve.h.
Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).