Reference

Representation of Sequences

class star_seq

Class representing sequences of neutron stars or similar.

This class allows to store precomputed properties for a sequence of spherical stars and provide those as functions of the central pseudo-enthalpy. For this, monotonic spline interpolation is used. The unit system can be chosen when creating sequences, but is assumed to be geometric. It is stored for bookkeeping.

Sequence objects can be cheaply copied since they only store a reference-counted pointer to the actual (immutable) data. Using the objects is thread-save.

Subclassed by EOS_Toolkit::star_branch

Public Functions

inline explicit star_seq(spimpl_t seq)

Constructor is not intended for direct use.

star_seq() = default

Default constructor.

Creates uninitialized object. Any attemt to use it throws an exception. One can use it after assigning an initialized one to it.

star_seq(const star_seq&) = default

Copy constructor.

star_seq(star_seq&&) = default

Move constructor.

star_seq &operator=(const star_seq&) = default

Assignment operator.

star_seq &operator=(star_seq&&) = default

Move assignment operator.

auto grav_mass_from_center_gm1(real_t gm1c) const -> real_t

Compute gravitational mass.

Parameters

gm1c – Central pseudo enthalpy \( g-1 \)

Returns

Gravitational mass of the star

auto bary_mass_from_center_gm1(real_t gm1c) const -> real_t

Compute baryonic mass.

Parameters

gm1c – Central pseudo enthalpy \( g-1 \)

Returns

Baryonic mass of the star

auto circ_radius_from_center_gm1(real_t gm1c) const -> real_t

Compute circumferential radius.

Parameters

gm1c – Central pseudo enthalpy \( g-1 \)

Returns

Proper circumferential radius of the star

auto moment_inertia_from_center_gm1(real_t gm1c) const -> real_t

Compute moment of inertia.

Parameters

gm1c – Central pseudo enthalpy \( g-1 \)

Returns

Moment of inertia of the star

auto lambda_tidal_from_center_gm1(real_t gm1c) const -> real_t

Compute dimensionless tidal deformability.

Parameters

gm1c – Central pseudo enthalpy \( g-1 \)

Returns

Dimensionless tidal deformability

auto range_center_gm1() const -> range_t

Range of central pseudo-enthalpy.

Returns

The avaialable range of the pseudo-enthalpy \( g-1 \)

auto contains_gm1(real_t gm1c) const -> bool

Check if given central pseudo enthalpy is within available range.

Parameters

gm1c – Central pseudo enthalpy \( g-1 \)

Returns

If it is covered by the sequence

void save(datasink s) const

Save sequence to a datastore.

Helper function used internally by the sequence file functionality.

auto units_to_SI() const -> const units&

Obtain unit system of sequence.

Returns

The (geometric) unit system used for the sequence.

Public Static Functions

static auto from_datasource(datasource s, units u) -> spimpl_t

Load sequence from a datastore.

Helper function used internally by the sequence file functionality.


class star_branch : public EOS_Toolkit::star_seq

Class representing a stable branch of a star sequence.

It inherits the interface of star_seq. In addition, it provides star properties as function of gravitational mass.

Public Functions

inline explicit star_branch(star_seq::spimpl_t seq, spimpl_t brnch)

Constructor is not intended for direct use.

star_branch() = default

Default constructor.

Creates uninitialized object. Any attemt to use it throws an exception. One can use it after assigning an initialized one to it.

star_branch(const star_branch&) = default

Copy constructor.

star_branch(star_branch&&) = default

Move constructor.

star_branch &operator=(const star_branch&) = default

Assignment operator.

star_branch &operator=(star_branch&&) = default

Move assignment operator.

auto center_gm1_from_grav_mass(real_t mg) const -> real_t

Compute central pseudo enthalpy from gravitational mass.

Parameters

mg – Gravitational mass

Returns

Central pseudo enthalpy \( g-1 \)

auto bary_mass_from_grav_mass(real_t mg) const -> real_t

Compute baryonic mass from gravitational mass.

Parameters

mg – Gravitational mass

Returns

Baryonic mass

auto circ_radius_from_grav_mass(real_t mg) const -> real_t

Compute circumferential radius from gravitational mass.

Parameters

mg – Gravitational mass

Returns

Proper circumferential radius

auto moment_inertia_from_grav_mass(real_t mg) const -> real_t

Compute moment of inertia from gravitational mass.

Parameters

mg – Gravitational mass

Returns

Moment of inertia

auto lambda_tidal_from_grav_mass(real_t mg) const -> real_t

Compute tidal deformability from gravitational mass.

Parameters

mg – Gravitational mass

Returns

Dimensionless tidal deformability

auto range_center_gm1() const -> range_t

Range of central pseudo-enthalpy.

The upper bound is the central pseudo-enthalpy of the maximum mass model unless it was not within the EOS validity range. This can be checked with includes_maximum().

Returns

The avaialable range of the pseudo-enthalpy \( g-1 \)

auto contains_gm1(real_t gm1c) const -> bool

Check if given central pseudo enthalpy is within available range.

Parameters

gm1c – Central pseudo enthalpy \( g-1 \)

Returns

If it is covered by the sequence

auto grav_mass_from_center_gm1(real_t gm1c) const -> real_t

Compute gravitational mass from central pseudo enthalpy.

Parameters

gm1c – Central pseudo enthalpy \( g-1 \)

Returns

Gravitational mass of the star

auto bary_mass_from_center_gm1(real_t gm1c) const -> real_t

Compute baryonic mass from central pseudo enthalpy.

Parameters

gm1c – Central pseudo enthalpy \( g-1 \)

Returns

Baryonic mass of the star

auto circ_radius_from_center_gm1(real_t gm1c) const -> real_t

Compute circumferential radius from central pseudo enthalpy.

Parameters

gm1c – Central pseudo enthalpy \( g-1 \)

Returns

Proper circumferential radius of the star

auto moment_inertia_from_center_gm1(real_t gm1c) const -> real_t

Compute moment of inertia from central pseudo enthalpy.

Parameters

gm1c – Central pseudo enthalpy \( g-1 \)

Returns

Moment of inertia of the star

auto lambda_tidal_from_center_gm1(real_t gm1c) const -> real_t

Compute dimensionless tidal deformability from central pseudo enthalpy.

Parameters

gm1c – Central pseudo enthalpy \( g-1 \)

Returns

Dimensionless tidal deformability

auto range_grav_mass() const -> range_t

Available range of gravitational mass.

The upper bound is the maximum mass unless the maximum mass model central density was not within the EOS validity range. This can be checked with includes_maximum().

Returns

Gravitational mass range

auto contains_grav_mass(real_t mg) const -> bool

Check if given gravitational mass is within available range.

Parameters

mg – Gravitational mass

Returns

If it is covered by the sequence

void save(datasink s) const

Save branch to a datastore.

Helper function used internally by the sequence file functionality.

Public Static Functions

static auto from_datasource(datasource s, units u) -> spimpl_t

Load branch from a datastore.

Helper function used internally by the sequence file functionality.

Creating star sequences

Computing TOV Sequences

auto EOS_Toolkit::make_tov_seq(eos_barotr eos, interval<real_t> rg_gm1, const star_accuracy_spec acc = star_acc_simple(), unsigned int num_samp = 500) -> star_seq

Compute sequence of TOV solutions.

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

  • rg_gm1 – Range of central pseudo enthalpy \( g-1 \)

  • acc – Accuracy requirements for TOV solutions

  • num_samp – Sample resolution of the sequence.

Returns

A star_seq object describing the TOV sequence.


auto EOS_Toolkit::make_tov_branch_stable(eos_barotr eos, const star_accuracy_spec acc, real_t mg_cut_low_rel = 0.2, real_t mg_cut_low_abs = 0.0, real_t gm1_initial = 1.2, real_t gm1_step = 0.004, real_t max_margin = 1e-2) -> star_branch

Compute stable branch of TOV solutions.

This function employs heuristic algorithm to find the stable branch of TOV solutions for a given EOS.

Since there may be more than one such branch, one has to provide a central pseudo-enthalpy to indicate the correct one. If the given value is on a stable branch, that branch will be returned. If the value lies on an unstable branch, the adjacent stable branch at lower densities will be returned. The default value should work for any remotely realistic NS EOS.

For most astrophysical applications, the low-mass part of a branch is not relevant. One can specify a low-mass cutoff to indicate that lower masses are not needed. There are two cutoff parameters, one for mass and one for the ratio of mass to maximum mass. The default cutoff is 1/5 of the maximum mass. If the mass cutoff is below the actual minimum mass of the stable branch, the branch will extend down to the minimum mass. Set the cutoff to zero if the goal is to find the minimum mass.

The parameter for the accuracy refers to the accuracy of the TOV solutions, but does not include the interpolation error of the resulting star sequence. The algorithm samples the TOV sequence using regular steps in log(g-1), g being the central pseudo-enthalpy. The sample point of maximum mass will be moved closer to the true maximum using a quadratic approximation around the maximum.

The stepsize can be controled by a parameter. The default stepsize is chosen such that the total error is dominated by the TOV solution error for the default TOV solver accurracy. Changing the step size should only be required when extreme accuracy is required, or when accuracy is less important than speed. The computational costs are roughly antiproportional to the stepsize parameter.

For some EOS, the maximum NS mass is limited by the EOS validity range and not by the physical maximum of TOV solutions. This case can be queried using the includes_maximum() method of the returned branch object. For this, the maxmimum is considered physical based on a simple heuristics: (g_max-1)*(1+max_margin) < g_eos, where g_max and g_eos are the the central pseudo-enthalpy of the maximum mass model and the EOS upper validity bound.

Parameters
  • eos – Barotropic EOS of the NS

  • acc – Accuracy requirements for TOV solutions

  • mg_cut_low_rel – Low-mass cutoff (in terms of maximum mass).

  • mg_cut_low_abs – Low-mass cutoff (absolute).

  • gm1_initial – Central enthalpy to indicate desired branch.

  • gm1_step – Sample resolution in terms of (delta g) / (g-1)

  • max_margin – Defines when maximum is considered physical.

Returns

A star_branch object describing the stable branch.

Create from existing data

auto EOS_Toolkit::make_star_seq(std::vector<real_t> mg, std::vector<real_t> mb, std::vector<real_t> rc, std::vector<real_t> mi, std::vector<real_t> lt, star_seq::range_t rg_gm1, units u) -> star_seq

Create sequence of NS properties from existing data.

for this function, the sample points must be uniformly spaced in the central pseudo enthalpy.

Parameters
  • mg – Sample points of gravitational mass

  • mb – Sample points of baryonic mass

  • rc – Sample points of proper circumferential radius

  • mi – Sample points of moment of inertia

  • lt – Sample points of dimensionless tidal deformability

  • rg_gm2 – Range of central pseudo enthalpy

  • u – Unit system of the sequence, assumed geometric.

Returns

A star_seq object describing a NS sequence.

Sequence Files

File operations

void EOS_Toolkit::save_star_seq(std::string fname, const star_seq &seq)

Save NS sequence to file.

This will save the sequence to file. Internally, the file format uses SI units. Conversion is preformed using the units stored in the sequence object.

Parameters
  • fname – File name

  • seq – Sequence to save


void EOS_Toolkit::save_star_branch(std::string fname, const star_branch &seq)

Save NS branch to file.

This will save the branch to file. Internally, the file format uses SI units. Conversion is preformed using the units stored in the branch object.

Parameters
  • fname – File name

  • seq – Branch to save


auto EOS_Toolkit::load_star_seq(std::string fname, const units &u = units::geom_solar()) -> star_seq

Load NS sequence from file.

Parameters
  • fname – File name of sequence file

  • Unit – system the returned sequence should use. The unit system needs to be geometric, i.e. \( G=c=1 \). Default is to fix the mass unit to \( 1 M_\odot \). Note this does not refer to the units in the file, which is always in SI units.

Returns

Star sequence


auto EOS_Toolkit::load_star_branch(std::string fname, const units &u = units::geom_solar()) -> star_branch

Load NS branch sequence from file.

Parameters
  • fname – Filename of branch sequence file

  • Unit – system the returned sequence should use.

Returns

Star sequence branch