Reference

Computing TOV solutions

Full solution

auto EOS_Toolkit::get_tov_star(const eos_barotr eos, const real_t rho_center, const star_accuracy_spec acc = star_acc_simple()) -> spherical_star

Compute spherical neutron star model.

This returns an object providing all global NS properties as well as the stellar profile.

Parameters
  • eos – The (barotropic) EOS of the NS.

  • rho_center – The central baryonic mass density. Units are the same as used by the EOS.

  • acc – Specifies required accuracies for NS properties

Returns

Stellar model


Only global properties

auto EOS_Toolkit::get_tov_properties(const eos_barotr eos, const real_t rho_center, const star_accuracy_spec acc = star_acc_simple()) -> spherical_star_properties

Compute properties of spherical neutron star.

This returns an object providing all global NS properties but not the stellar profile.

Parameters
  • eos – The (barotropic) EOS of the NS.

  • rho_center – The central baryonic mass density. Units are the same as used by the EOS.

  • acc – Specifies required accuracies for NS properties

Returns

Stellar model properties


NS representations

class spherical_star_properties

Class to describe a spherical neutron star.

This collects scalar measures of a spherical neutron star solution, but not the radial profile. It also provides the EOS. All quantities are in the same geometric units used by the EOS.

Subclassed by EOS_Toolkit::spherical_star

Public Functions

spherical_star_properties(const spherical_star_properties&) = default

Copy constructor.

spherical_star_properties(spherical_star_properties&&) = default

Move constructor.

spherical_star_properties &operator=(const spherical_star_properties&) = default

Assignment operator.

spherical_star_properties &operator=(spherical_star_properties&&) = default

Move assignment operator.

spherical_star_properties(eos_barotr eos_, spherical_star_info info_, deform_t deform_, bulk_t bulk_)

The constructor.

auto center_state() const -> eos_barotr::state

Central matter state.

auto center_rho() const -> real_t

Central baryonic mass density.

auto center_gm1() const -> real_t

Central pseudo enthalpy \( g - 1 \).

auto center_eps() const -> real_t

Central specific internal energy \( \epsilon \).

auto center_press() const -> real_t

Central pressure.

auto center_csnd() const -> real_t

Central sound speed.

auto center_ye() const -> real_t

Central electron fraction.

This is only available if supported by the EOS, otherwise an exception is thrown.

auto grav_mass() const -> real_t

Gravitational mass \( M_g \).

auto bary_mass() const -> real_t

Baryonic mass \( M_b \).

auto binding_energy() const -> real_t

Binding energy \( M_b - M_g \).

auto circ_radius() const -> real_t

Circumferential surface radius.

auto proper_volume() const -> real_t

Proper volume.

auto moment_inertia() const -> real_t

Moment of inertia.

auto has_deform() const -> bool

Whether the tidal deformability is known.

auto has_bulk() const -> bool

Whether the bulk properties are known.

auto deformability() const -> const spherical_star_tidal&

Tidal deformability measures.

Throws exception if not available

auto bulk() const -> const spherical_star_bulk&

Bulk properties.

Throws exception if not available

auto eos() const -> const eos_barotr&

The EOS.


class spherical_star : public EOS_Toolkit::spherical_star_properties

Class representing a spherical neutron star model.

This provides everything spherical_star_properties does, and in addition the radial profiles for metric and matter quantities. The profiles are provided as functions of circumferential radius that can be evaluated both inside and outside the star. All quantities are in the same geometric units used by the EOS.

Public Functions

spherical_star(spherical_star_info info_, deform_t deform_, bulk_t bulk_, pprof_t pprof_)

Constructor.

spherical_star(const spherical_star&) = default

Copy constructor.

spherical_star(spherical_star&&) = default

Move constructor.

spherical_star &operator=(const spherical_star&) = default

Assignment operator.

spherical_star &operator=(spherical_star&&) = default

Move assignment operator.

auto nu_from_rc(real_t rc) const -> real_t

Metric potential \( \nu \) at given circumferential radius.

auto lambda_from_rc(real_t rc) const -> real_t

Metric potential \( \lambda \) at given circumferential radius.

auto mbary_from_rc(real_t rc) const -> real_t

Baryonic mass within given circumferential radius.

auto pvol_from_rc(real_t rc) const -> real_t

Proper volume within given circumferential radius.

auto state_from_rc(real_t rc) const -> eos_barotr::state

Matter state at circumferential radius.

auto gm1_from_rc(real_t rc) const -> real_t

Pseudo enthalpy \( g - 1 \) at circumferential radius.

auto rho_from_rc(real_t rc) const -> real_t

Baryonic mass density \( \rho \) at circumferential radius.

auto press_from_rc(real_t rc) const -> real_t

Pressure \( P \) at circumferential radius.

auto eps_from_rc(real_t rc) const -> real_t

Specific internal energy \( \epsilon \) at circumferential radius.

auto csnd_from_rc(real_t rc) const -> real_t

Sound speed \( c_s \) at circumferential radius.

auto ye_from_rc(real_t rc) const -> real_t

Electron fraction \( Y_e \) at circumferential radius.

This is only available if supported by the EOS, otherwise an exception is thrown.

auto temp_from_rc(real_t rc) const -> real_t

Temperature \( T [MeV] \) at circumferential radius.

This is only available if supported by the EOS, otherwise an exception is thrown.

Accuracy specification

struct star_accuracy_spec

Class for specifying maximum allowed relative error for NS properties.

Public Functions

star_accuracy_spec(real_t acc_mass_, real_t acc_radius_, real_t acc_minertia_, std::size_t minsteps_, bool need_deform_, real_t acc_deform_, bool need_bulk_)

Constructor.

Public Members

const real_t acc_mass

Tolerance for relative error of mass (grav, baryonic)

const real_t acc_radius

Tolerance for relative error of length (radius, volume^1/3)

const real_t acc_minertia

Tolerance for relative error of moment of inertia.

const std::size_t minsteps

Minimum number of sample points within star.

const bool need_deform

If tidal deformability is needed.

const real_t acc_deform

Tolerance for relative error of deformability (lambda, k2)

const bool need_bulk

If bulk properties are needed.


auto EOS_Toolkit::star_acc_simple(bool need_deform = true, bool need_bulk = false, real_t acc_tov = 1e-6, real_t acc_deform = 1e-3, std::size_t minsteps = 20) -> star_accuracy_spec

Convenience function for NS solution accuracy specification

This allows a basic accuracy specification for use in TOV solvers, with default values reasonable for most applications. One can specify an accuracy for tidal deformability and another one for all other NS properties. For more fine-grained control, use star_acc_detailed() instead. If the tidal deformability is not needed this can be indicated, which reduces computational costs by not solving the tidal ODE. One can also request computation of the “bulk radius” which is not done by default. Finally, one can specify a minimum resolution (number of points within star) for ODE solving and radial profile interpolation. This is usually not required, a suitable resolution is chosen from the specified accuracies using calibrated heuristics.

auto EOS_Toolkit::star_acc_detailed(bool need_deform = true, bool need_bulk = false, real_t acc_mass = 1e-6, real_t acc_radius = 1e-6, real_t acc_minertia = 1e-5, real_t acc_deform = 1e-3, std::size_t minsteps = 20) -> star_accuracy_spec

Convenience function for NS solution accuracy specification

This allows a detailed accuracy specification for use in TOV solvers. One can specify an accuracy for masses (gravitational and baryonic), radii (circumferential and based on proper volume), moment of inertia, and tidal deformability. For a more simplistic description, use star_acc_simple() instead. If the tidal deformability is not needed this can be indicated, which reduces computational costs by not solving the tidal ODE. One can also request computation of the “bulk radius” which is not done by default. Finally, one can specify a minimum resolution (number of points within star) for ODE solving and radial profile interpolation. This is usually not required, a suitable resolution is chosen from the specified accuracies using calibrated heuristics.

Other

The following low level functions should rarely be needed, usually it is more convenient to use the star sequence functionality.

auto EOS_Toolkit::find_rhoc_tov_max_mass(eos_barotr eos, const real_t rhobr0, const real_t rhobr1, const int bits = 28, const real_t acc = 1e-8, unsigned int max_steps = 30) -> real_t

Find maximum mass TOV model.

This finds the model with maximum gravitational mass within a specified range of the central baryonic mass density. The provided range is first limited to the validity range of the EOS. Since the EOS framework guarantees causality, the returned value might be the one for the maximum causal central density, instead of a true maximum (i.e. zero derivative). Similarly, if the provided range does not contain the maximum, the returned value will be at the border.

Parameters
  • eos – The (barotropic) EOS of the NS

  • rhobr0 – Lower bound of central density for search

  • rhobr1 – Upper bound of central density for search

  • bits – Accuracy of maximum search (number significant bits)

  • acc – Accuracy for TOV solving

  • max_steps – Maximum steps for maximum search

Returns

Central baryonic mass density of maximum mass model


auto EOS_Toolkit::find_rhoc_tov_of_mass(eos_barotr eos, real_t mg, const real_t rhobr0, const real_t rhobr1, real_t acc = 1e-8, unsigned int max_steps = 30) -> real_t

Find TOV model with gravitational mass.

This finds a TOV solution of given gravitational mass. It is up to the user to provide an initial bracket for the central density, such that the mass as function of density is monotonic (beware the different TOV solution branches).

Parameters
  • eos – The (barotropic) EOS of the NS

  • mg – Gravitational mass

  • rhobr0 – Lower bound of central density for search

  • rhobr1 – Upper bound of central density for search

  • acc – Accuracy for TOV solving and root finding

  • max_steps – Maximum steps for root finding

Returns

Central baryonic mass density of TOV model with given mass