Rotating neutron star class based on RNS v1.1d from N. Stergioulas et al. More...
#include <nstar_rot.h>
Several changes have been made to the original code. The code using Numerical Recipes has been removed and replaced with an equivalent based on GSL and O2scl . The overall interface has been changed and some code has been updated with C++ equivalents.
Usage
Initial guess
The original RNS code suggests that the initial guess is typically a star with a smaller angular momentum.
References
The original RNS v1.1d can be obtained from http://www.gravity.phys.uwm.edu/rns/ , and you may find Nick Stergioulas's web page http://www.astro.auth.gr/~niksterg/ , or Sharon Morsink's page http://fermi.phys.ualberta.ca/~morsink/ useful. See Bonazzola73, Bonazzola94, Cook92, Cook94, Friedman88, Gourgoulhon94, Komatsu89, Laarakkers99, Nozawa98, Stergioulas95, and Stergioulas03 .
Make a GSL-like set() function
Rework EOS interface and implement better integration with the other O2scl_eos EOSs.
Remove the unit-indexed arrays.
Try moving some of the storage to the heap?
Some of the arrays seem larger than necessary.
The function o2scl::nstar_rot::new_search() is inefficient because it has to handle the boundary conditions separately. This could be improved.
Make the solvers more robust. The ang_vel() and ang_vel_alt() functions appear particularly unstable.
Draft documentation
This class retains the definition of the specific enthalpy from the original code, namely that
but note that the factor of is dropped before taking the log in the internal copy of the EOS table. Typically,
is around 931 MeV.
For spherical stars, the isotropic radius is defined by
Quadrupole moments
Quadrupole moments computed using the method in Laarakkers99.
Axisymmetric Instability
Friedman88 shows that a secular axisymmetric instability sets in when the mass becomes maximum along a sequence of constant angular momentum. Equivalently, Cook92 shows that the instability occurs when the angular momentum becomes minimum along a sequence of constant rest mass.
A GR virial theorem for a stationary and axisymmetric system was found in Bonazzola73. A more general two-dimensional virial identity was found in Bonazzola94. The three-dimensional virial identity found in Gourgoulhon94 is a generalization of the Newtonial virial theorem.
Using the stationary and axisymmetric metric ( )
one solves for the four metric functions ,
,
and
.
It is assumed that matter is a perfect fluid, and the stress-energy tensor is
Einstein's field equations imply four field equations for a specified rotation law,
for some function .
Using Eq. (27) in Cook92, one can write
where the function is defined by
This function is stored in f_rho . Similar definitions are made for f_gamma and f_omega .
The Keplerial orbit at the equator is
(eq. 31 in Stergioulas03 )
Definition at line 531 of file nstar_rot.h.
Classes | |
class | polytrope_solve |
Subclass of nstar_rot which specifies the function to invert a polytropic EOS. More... | |
Public Types | |
typedef boost::numeric::ublas::vector< double > | ubvector |
typedef boost::numeric::ublas::range | ub_range |
typedef boost::numeric::ublas::vector_range< boost::numeric::ublas::vector< double > > | ubvector_range |
typedef boost::numeric::ublas::matrix< double > | ubmatrix |
Public Member Functions | |
void | resize (int MDIV_new, int SDIV_new, int LMAX_new, int RDIV_new) |
Resize the grid. | |
int | set_solver (o2scl::mroot<> &m) |
Set new solver. | |
Basic Usage | |
void | set_eos (eos_nstar_rot &eos) |
Set the EOS. | |
void | polytrope_eos (double index) |
Use a polytropic EOS with a specified index. | |
int | fix_cent_eden_axis_rat (double cent_eden, double axis_rat, bool use_guess=false) |
Construct a configuration with a fixed central energy density and a fixed axis ratio. More... | |
int | fix_cent_eden_grav_mass (double cent_eden, double grav_mass) |
Construct a configuration with a fixed central energy density and a fixed gravitational mass. More... | |
int | fix_cent_eden_bar_mass (double cent_eden, double bar_mass) |
Construct a configuration with a fixed central energy density and a fixed baryonic mass. More... | |
int | fix_cent_eden_with_kepler (double cent_eden) |
Construct a configuration with a fixed central energy density and the Keplerian rotation rate. More... | |
int | fix_cent_eden_with_kepler_alt (double cent_eden, bool use_guess=false) |
Experimental alternate form for fix_cent_eden_with_kepler() | |
int | fix_cent_eden_grav_mass_alt (double cent_eden, double grav_mass, bool use_guess=false) |
Experimental alternate form for fix_cent_eden_grav_mass() | |
int | fix_cent_eden_bar_mass_alt (double cent_eden, double bar_mass, bool use_guess=false) |
Experimental alternate form for fix_cent_eden_bar_mass() | |
int | fix_cent_eden_ang_vel_alt (double cent_eden, double ang_vel, bool use_guess=false) |
Experimental alternate form for fix_cent_eden_ang_vel() | |
int | fix_cent_eden_ang_mom_alt (double cent_eden, double ang_mom, bool use_guess=false) |
Experimental alternate form for fix_cent_eden_ang_mom() | |
int | fix_cent_eden_non_rot (double cent_eden) |
Construct a non-rotating configuration with a fixed central energy density. More... | |
int | fix_cent_eden_ang_vel (double cent_eden, double ang_vel) |
Construct a configuration with a fixed central energy density and a fixed angular velocity. More... | |
int | fix_cent_eden_ang_mom (double cent_eden, double ang_mom) |
Construct a configuration with a fixed central energy density and a fixed angular momentum. More... | |
Testing functions | |
All these compare with hard-coded results obtained with the RNS code. | |
void | test1 (o2scl::test_mgr &t) |
Test determining configuration with fixed central energy density and fixed radius ratio with EOS C. | |
void | test2 (o2scl::test_mgr &t) |
Test configuration rotating and Keplerian frequency with a fixed central energy density and EOS C. | |
void | test3 (o2scl::test_mgr &t) |
Test fixed central energy density and fixed gravitational mass with EOS C. | |
void | test4 (o2scl::test_mgr &t) |
Test fixed central energy density and fixed baryonic mass with EOS C. | |
void | test5 (o2scl::test_mgr &t) |
Test fixed central energy density and fixed angular velocity with EOS C. | |
void | test6 (o2scl::test_mgr &t) |
Test fixed central energy density and fixed angular momentum with EOS C. | |
void | test7 (o2scl::test_mgr &t) |
Test a series of non-rotating stars on a energy density grid with EOS C. | |
void | test8 (o2scl::test_mgr &t) |
Test Keplerian frequency for a polytrope. | |
Public Attributes | |
int | MDIV |
The number of grid points in the ![]() | |
int | SDIV |
The number of grid points in the ![]() | |
int | LMAX |
The number of Legendre polynomials. | |
o2scl::mroot_hybrids | def_mroot |
Default solver. | |
Output | |
double | e_center |
Central energy density (in units of ![]() | |
double | r_ratio |
Ratio of polar to equatorial radius. | |
double | r_e |
Coordinate equatorial radius. | |
Quantities computed by nstar_rot::comp() (in order) | |
double | r_p |
Radius at pole. | |
double | s_p |
The value of the s-coordinate at the pole. | |
double | s_e |
The value of the s-coordinate at the equator. | |
double | velocity_equator |
The velocity at the equator. | |
double | R_e |
Circumferential radius in cm (i.e. the radius defined such that ![]() | |
double | Mass_p |
Proper mass (in ![]() | |
double | Mass |
Gravitational mass (in ![]() | |
double | Mass_0 |
Baryonic mass (in ![]() | |
double | J |
Angular momentum (in ![]() | |
double | Omega |
Angular velocity (in ![]() | |
double | T |
Total rotational kinetic energy. | |
double | I |
Moment of inertia. | |
double | W |
Gravitational binding energy. | |
double | Z_p |
Polar redshift. | |
double | Z_f |
Forward equatorial redshift. | |
double | Z_b |
Backward equatorial redshift. | |
double | Omega_K |
Kepler rotation frequency (in 1/s) | |
double | eccentricity |
The eccentricity. | |
ubvector | v_plus |
Desc. | |
ubvector | v_minus |
Desc. | |
double | vel_plus |
Desc. | |
double | vel_minus |
Desc. | |
double | h_plus |
Height from surface of last stable co-rotating circular orbit in equatorial plane. More... | |
double | h_minus |
Height from surface of last stable counter-rotating circular orbit in equatorial plane. More... | |
double | Omega_plus |
Desc. | |
double | u_phi |
Desc. | |
double | Omega_p |
Angular velocity of a particle in a circular orbit at the equator. | |
double | grv2 |
Desc. | |
double | grv2_new |
Desc. | |
double | grv3 |
Desc. | |
double | om_over_Om |
Ratio of potential ![]() ![]() | |
double | mass_quadrupole |
Mass quadrupole moment. | |
Settings | |
double | cf |
The convergence factor (default 1.0) | |
Protected Member Functions | |
int | solve_kepler (size_t nv, const ubvector &x, ubvector &y) |
Solve for the Keplerian velocity. | |
int | solve_grav_mass (size_t nv, const ubvector &x, ubvector &y, double grav_mass) |
Solve for the gravitational mass. | |
int | solve_bar_mass (size_t nv, const ubvector &x, ubvector &y, double bar_mass) |
Solve for the gravitational mass. | |
int | solve_ang_vel (size_t nv, const ubvector &x, ubvector &y, double ang_vel) |
Solve for the gravitational mass. | |
int | solve_ang_mom (size_t nv, const ubvector &x, ubvector &y, double ang_mom) |
Solve for the gravitational mass. | |
EOS functions | |
double | e_at_p (double pp) |
Compute ![]() More... | |
double | p_at_e (double ee) |
Compute ![]() More... | |
double | p_at_h (double hh) |
Pressure at fixed enthalpy. More... | |
double | h_at_p (double pp) |
Enthalpy at fixed pressure. More... | |
double | n0_at_e (double ee) |
Baryon density at fixed energy density. More... | |
Derivatives on the grid | |
double | s_deriv (ubvector &f, int s) |
Returns the derivative w.r.t. s of an array f[SDIV+1]. | |
double | m_deriv (ubvector &f, int m) |
Returns the derivative w.r.t. mu of an array f[MDIV+1]. | |
double | deriv_s (ubmatrix &f, int s, int m) |
Returns the derivative w.r.t. s | |
double | deriv_m (ubmatrix &f, int s, int m) |
Returns the derivative w.r.t. mu. | |
double | deriv_sm (ubmatrix &f, int s, int m) |
Returns the derivative w.r.t. s and mu. | |
Initialization functions | |
double | legendre (int n, double x) |
Returns the Legendre polynomial of degree n, evaluated at x. More... | |
void | comp_f_P () |
Compute two-point functions. More... | |
void | make_grid () |
Create computational mesh. More... | |
void | make_center (double e_center) |
Compute central pressure and enthalpy from central energy density. More... | |
Post-processing functions | |
void | comp_omega () |
Compute Omega and Omega_K. | |
void | comp_M_J () |
Compute rest mass and angular momentum. | |
void | comp () |
Compute various quantities. More... | |
For computing spherical stars | |
void | spherical_star () |
Computes a spherically symmetric star. More... | |
double | dm_dr_is (double r_is, double r, double m, double p) |
Derivative of gravitational mass with respect to isotropic radius. | |
double | dp_dr_is (double r_is, double r, double m, double p) |
Derivative of pressure with respect to isotropic radius. | |
double | dr_dr_is (double r_is, double r, double m) |
Derivative of radius with respect to isotropic radius. | |
void | integrate (int i_check, double &r_final, double &m_final, double &r_is_final) |
Integrate one of the differential equations for spherical stars. | |
int | iterate (double r_ratio, double tol_rel) |
Main iteration function. | |
Protected Attributes | |
o2scl::mroot * | mrootp |
Solver. | |
o2scl::root_bkt_cern< polytrope_solve > | rbc |
The polytrope solver. | |
o2scl::search_vec< ubvector_range > | sv_ub |
Array search object. | |
int | RDIV |
The number of grid points in integration of TOV equations for spherical stars. | |
double | SMAX |
Maximum value of s-coordinate (default 0.9999) | |
double | DS |
Spacing in ![]() ![]() | |
double | DM |
Spacing in ![]() ![]() | |
double | RMIN |
Minimum radius for spherical stars (default ![]() | |
Grid quantities set in make_grid() | |
ubvector | s_gp |
![]() | |
ubvector | s_1_s |
![]() | |
ubvector | one_s |
![]() | |
ubvector | mu |
![]() | |
ubvector | one_m2 |
![]() | |
ubvector | theta |
![]() ![]() | |
ubvector | sin_theta |
![]() | |
Grid values computed in integrate() for spherical_star() | |
ubvector | r_gp |
Isotropic radius. | |
ubvector | r_is_gp |
Radial coordinate. | |
ubvector | lambda_gp |
Metric function ![]() | |
ubvector | nu_gp |
Metric function ![]() | |
ubvector | m_gp |
Enclosed gravitational mass. | |
ubvector | e_d_gp |
Energy density. | |
ubmatrix | dgds |
Desc. | |
ubmatrix | dgdm |
Desc. | |
Metric functions | |
ubmatrix | rho |
potential ![]() | |
ubmatrix | gamma |
potential ![]() | |
ubmatrix | omega |
potential ![]() | |
ubmatrix | alpha |
potential ![]() | |
Initial guess computed by the comp() function | |
double | r_e_guess |
Guess for the equatorial radius. | |
ubmatrix | rho_guess |
Guess for ![]() | |
ubmatrix | gamma_guess |
Guess for ![]() | |
ubmatrix | omega_guess |
Guess for ![]() | |
ubmatrix | alpha_guess |
Guess for ![]() | |
EOS quantities | |
ubmatrix | energy |
Energy density ![]() | |
ubmatrix | pressure |
Pressure. | |
ubmatrix | enthalpy |
Enthalpy. | |
Other quantities defined over the full two-dimensional grid | |
ubmatrix | velocity_sq |
Proper velocity squared. | |
ubmatrix | da_dm |
Derivative of ![]() ![]() | |
Quantities defined for fixed values of mu | |
ubvector | gamma_mu_1 |
![]() ![]() | |
ubvector | gamma_mu_0 |
![]() ![]() | |
ubvector | rho_mu_1 |
![]() ![]() | |
ubvector | rho_mu_0 |
![]() ![]() | |
ubvector | omega_mu_0 |
![]() ![]() | |
double | gamma_pole_h |
The value of ![]() | |
double | gamma_center_h |
The value of ![]() | |
double | gamma_equator_h |
The value of ![]() | |
double | rho_pole_h |
The value of ![]() | |
double | rho_center_h |
The value of ![]() | |
double | rho_equator_h |
The value of ![]() | |
double | omega_equator_h |
The value of ![]() | |
double | Omega_h |
Angular velocity, ![]() | |
double | p_center |
Central pressure. | |
double | h_center |
Central enthalpy. | |
Desc | |
tensor3 | f_rho |
![]() | |
tensor3 | f_gamma |
![]() | |
tensor3 | f_omega |
![]() | |
Legendre polynomials | |
ubmatrix | P_2n |
Legendre polynomial ![]() | |
ubmatrix | P1_2n_1 |
Associated Legendre polynomial ![]() | |
ubmatrix | D1_rho |
Integrated term over m in eqn for ![]() | |
ubmatrix | D1_gamma |
Integrated term over m in eqn for ![]() | |
ubmatrix | D1_omega |
Integ. term over m in eqn for ![]() | |
ubmatrix | D2_rho |
Integrated term over s in eqn for ![]() | |
ubmatrix | D2_gamma |
Integrated term over s in eqn for ![]() | |
ubmatrix | D2_omega |
Integ. term over s in eqn for ![]() | |
ubmatrix | S_gamma |
source term in eqn for ![]() | |
ubmatrix | S_rho |
source term in eqn for ![]() | |
ubmatrix | S_omega |
source term in eqn for ![]() | |
double | tol_abs |
The tolerance for the functions with the prefix "fix" (default ![]() | |
Thermodyanmic quantities near the surface | |
double | p_surface |
Pressure at the surface. | |
double | e_surface |
Energy density at the surface. | |
double | enthalpy_min |
Minimum specific enthalpy. | |
Polytrope parameters | |
double | n_P |
Polytropic index. | |
double | Gamma_P |
Polytropic exponent. | |
Interpolation functions | |
int | n_nearest |
Cache for interpolation. | |
int | new_search (int n, ubvector &x, double val) |
Search in array x of length n for value val . | |
double | interp (ubvector &xp, ubvector &yp, int np, double xb) |
Driver for the interpolation routine. More... | |
double | interp_4_k (ubvector &xp, ubvector &yp, int np, double xb, int k) |
Driver for the interpolation routine. More... | |
double | int_z (ubvector &f, int m) |
Integrate f[mu] from m-1 to m. More... | |
EOS member variables | |
double | eq_radius_tol_rel |
Relative accuracy for the equatorial radius, ![]() ![]() | |
double | alt_tol_rel |
Accuracy for equatorial radius using alternate solvers (default ![]() | |
int | verbose |
Verbosity parameter. | |
bool | eos_set |
If true, then an EOS has been set. | |
bool | scaled_polytrope |
If true, then use a polytrope and rescale. | |
eos_nstar_rot * | eosp |
Pointer to the user-specified EOS. | |
nstar_rot () | |
void | output_table (o2scl::table3d &t) |
Create an output table. | |
void | calc_masses_J (ubmatrix &rho_0) |
Compute masses and angular momentum. | |
Internal constants | |
double | C |
Speed of light in vacuum (in CGS units) | |
double | G |
Gravitational constant (in CGS units) | |
double | MSUN |
Mass of sun (in g) | |
double | KAPPA |
Square of length scale in CGS units, ![]() | |
double | MB |
The mass of one baryon (in g) | |
double | KSCALE |
The value ![]() | |
double | PI |
The constant ![]() | |
void | constants_rns () |
Use the values of the constants from the original RNS code. | |
void | constants_o2scl () |
Use the O2scl values. | |
|
protected |
The main post-processing funciton
|
protected |
This function computes the 2-point functions used to integrate the potentials
and
(See Komatsu89 for details). Since the grid points are fixed, we can compute the functions f_rho, f_gamma, f_omega, P_2n, and P1_2n_1 once at the beginning.
See Eqs. 27-29 of Cook92 and Eqs. 33-35 of Komatsu89. This function is called by the constructor.
|
protected |
Used in dm_dr_is(), dp_dr_is(), integrate() and iterate().
int o2scl::nstar_rot::fix_cent_eden_ang_mom | ( | double | cent_eden, |
double | ang_mom | ||
) |
The central energy density should be in . The angular momentum should be in units of
.
int o2scl::nstar_rot::fix_cent_eden_ang_vel | ( | double | cent_eden, |
double | ang_vel | ||
) |
The central energy density should be in and the angular velocity should be in
. The final angular velocity (possibly slightly different than
ang_vel
is stored in Omega .
ang_vel
argument is different because it was rescaled by a factor of int o2scl::nstar_rot::fix_cent_eden_axis_rat | ( | double | cent_eden, |
double | axis_rat, | ||
bool | use_guess = false |
||
) |
The central energy density should be in and the axis ratio is unitless. This is fastest of the high-level interface functions as it doesn't require an additional solver.
int o2scl::nstar_rot::fix_cent_eden_bar_mass | ( | double | cent_eden, |
double | bar_mass | ||
) |
The central energy density should be in and the baryonic mass should be in solar masses.
int o2scl::nstar_rot::fix_cent_eden_grav_mass | ( | double | cent_eden, |
double | grav_mass | ||
) |
The central energy density should be in and the gravitational mass should be in solar masses.
int o2scl::nstar_rot::fix_cent_eden_non_rot | ( | double | cent_eden | ) |
The central energy density should be in .
int o2scl::nstar_rot::fix_cent_eden_with_kepler | ( | double | cent_eden | ) |
The central energy density should be in .
|
protected |
Used in make_center() and integrate().
|
protected |
This implements a 8-point closed Newton-Cotes formula.
Used in comp() .
First we find the tab. point nearest to xb, then we interpolate using four points around xb.
Used by int_z(), e_at_p(), p_at_e(), p_at_h(), h_at_p(), n0_at_e(), comp_omega(), comp_M_J(), comp(), spherical_star(), iterate().
|
protected |
Four point interpolation at a given offset the index of the first point k.
Used in comp() .
|
protected |
This uses the recurrence relation and is used in comp_f_P() which is called by the constructor.
|
protected |
For polytropic EOSs, this also computes rho0_center
.
|
protected |
Create the computational mesh for (where
is the coordinate equatorial radius) and
using
When ,
, when
,
, and when
,
. Inverting the relationship between
and
gives
.
Points in the mu-direction are stored in the array mu[i]
. Points in the s-direction are stored in the array s_gp[j]
.
This function sets s_gp, s_1_s, one_s, mu, one_m2, theta and sin_theta . All of these arrays are unit-indexed. It is called by the constructor.
|
protected |
Used in comp_M_J() and comp() .
|
protected |
Used in make_center() and integrate().
|
protected |
Used in iterate().
|
protected |
double o2scl::nstar_rot::alt_tol_rel |
Definition at line 1072 of file nstar_rot.h.
double o2scl::nstar_rot::eq_radius_tol_rel |
Used in iterate() .
Definition at line 1067 of file nstar_rot.h.
double o2scl::nstar_rot::h_minus |
If this is zero then all orbits are stable.
Definition at line 1154 of file nstar_rot.h.
double o2scl::nstar_rot::h_plus |
If this is zero then all orbits are stable.
Definition at line 1148 of file nstar_rot.h.
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).