Class nstar_cold (o2scl)

O2scl : Class List

class nstar_cold

Static neutron star at zero temperature.

This class provides a simplified interface for computing the equation of state (EOS) of zero-temperature beta-equilibrated neutron star matter and computing the mass-radius curve.

The beta-equilibrium EOS can be computed with the function calc_eos() and the mass-radius curve with the function calc_nstar(). The function fixed() computes the profile of a fixed gravitational mass star. By default the crust EOS is given by that in o2scl::eos_tov_interp::default_low_dens_eos() .

There is an example for the usage of this class given in the :ref:Cold Neutron Star Structure section of the User’s Guide.

The neutron, proton, electron and muon are given masses according to their values in the o2scl_mks namespace after a conversion to units of \( 1/\mathrm{fm} \). The default neutron and proton objects have their values of inc_rest_mass set to true. The user can change this to false, but the energy density and chemical potential columns in the output always include the rest mass so that the TOV solver can use the table. The functions calc_nstar() and fixed() expect that the energy density includes the rest mass energy density.

If err_nonconv is true (the default) and the solver fails, the error handler is called.

The baryon density range is specified by nb_start, nb_end and dnb. Given the value of \( f \) defined by

\[ f = \frac{\mathrm{nb\_start} - \mathrm{nb\_end}}{\mathrm{dnb}} \]
if \( f<1 \) or \( f>10^8 \), then the error handler is called.

Note that not all equations of state lead to physical neutron stars, and the function calc_eos() will not warn you about this. However, the function calc_nstar() will call the error handler if the speed of sound becomes negative or becomes larger than the speed of light at a density smaller than the central density of the maximum mass star.

EOS Output

The function calc_eos() generates an object of type table_units, which contains the following columns

  • ed in units of \( 1/\mathrm{fm}^4 \), the total energy density of neutron star matter, \( \varepsilon \)

  • pr in units of \( 1/\mathrm{fm}^4 \), the total pressure of neutron star matter, \( P \)

  • nb in units of \( 1/\mathrm{fm}^3 \), the baryon number density, \( n_B \)

  • mun in units of \( 1/\mathrm{fm} \), the neutron chemical potential, \( \mu_n \)

  • mup in units of \( 1/\mathrm{fm} \), the proton chemical potential, \( \mu_p \)

  • mue in units of \( 1/\mathrm{fm} \), the electron chemical potential, \( \mu_e \)

  • nn in units of \( 1/\mathrm{fm}^3 \), the neutron number density, \( n_n \)

  • np in units of \( 1/\mathrm{fm}^3 \), the proton number density, \( n_p \)

  • ne in units of \( 1/\mathrm{fm}^3 \), the electron number density, \( n_e \)

  • kfn in units of \( 1/\mathrm{fm} \), the neutron Fermi momentum, \( k_{F,n} \)

  • kfp in units of \( 1/\mathrm{fm} \), the proton Fermi momentum, \( k_{F,p} \)

  • kfe in units of \( 1/\mathrm{fm} \), the electron Fermi momentum, \( k_{F,e} \)

If include_muons is true (the default), the table has additional columns

  • mumu in units of \( 1/\mathrm{fm} \), the muon chemical potential, \( \mu_{\mu} \)

  • nmu in units of \( 1/\mathrm{fm}^3 \), the muon number density, \( n_{\mu} \)

  • kfmu in units of \( 1/\mathrm{fm} \), the muon Fermi momentum, \( k_{F,\mu} \)

After computing the equation of state, then calc_eos() also adds the following columns

  • cs2 (unitless), the squared speed of sound divided by \( c^2 \)

  • logp, the natural logarithm of the pressure stored in pr

  • loge, the natural logarithm of the energy density stored in ed

  • s in units of \( 1/\mathrm{fm} \), the semi-perimeter of the Urca triangle

  • urca in units of \( 1/\mathrm{fm}^4 \), the squared area of the Urca triangle

  • ad_index, the adiabatic index, \( \Gamma \)

The columns cs2 and ad_index are computing from derivatives using the current table interpolation type.

The condition for the direct Urca process is the area of the triangle formed by the neutron, proton, and electron Fermi momenta. Using the definition of the semi-perimeter,

\[ s \equiv \left( k_{F,n}+k_{F,p}+k_{F,e} \right)/2 \]
Heron’s formula gives the triangle area as
\[ a=\sqrt{s(s-k_{F,n})(s-k_{F,p})(s-k_{F,e})} \, . \]
The column in the eos table labeled urca is \( a^2 \) . If this quantity is positive, then direct Urca is allowed. The variable allow_urca_nb is the smallest density for which the direct Urca process turns on, and deny_urca_nb is the smallest density for which the direct Urca process turns off.

The squared speed of sound (in units of \( c \) ) is calculated by

\[ c_s^2 = \frac{ d P }{d \varepsilon} \]
and this is placed in the column labeled cs2. If cs2 is larger than 1, the EOS is said to be “acausal”. The variables acausal_nb, acausal_ed, and acausal_pr record the baryon density, energy density, and pressure where the EOS becomes acausal. The adabatic index is calculated by
\[ \Gamma = \frac{ d \ln P} { d \ln \varepsilon} \]
Note that \( \Gamma \) must be greater than \( 4/3 \) at the center of the neutron star for stability. (This is a necessary, but not sufficient condition.)

TOV Output

The TOV table contains all the columns typically generated for mass versus radius tables in tov_solve, as well as columns containing the central values of al the densities and chemical potentials, and all the other columns computed for the EOS above.

Idea for Future:

Warn if the EOS becomes pure neutron matter.

Some of the auxillary quantities can be computed directly without using the table methods and the EOS calculation would be a bit faster.

Note

The function set_eos() stores a pointer to the EOS object so the user must take care that the pointer is valid.

Subclassed by o2scl::nstar_hot

Output

bool eos_neg

If true, the pressure or energy density became negative at some baryon density.

double pressure_dec_nb

The smallest baryon density where the pressure starts to decrease.

If this is zero after calling calc_eos(), then the pressure does not decrease in the specified range of baryon density

double allow_urca_nb

The smallest density where Urca becomes allowed.

If this is zero after calling calc_eos(), then direct Urca is never allowed.

double deny_urca_nb

The smallest density where Urca becomes disallowed.

If this is zero after calling calc_eos(), then direct Urca is not disallowed at a higher density than it becomes allowed.

double acausal_nb

The density at which the EOS becomes acausal.

If this is zero, then the EOS is causal at all baryon densities in the specified range

double acausal_pr

The pressure at which the EOS becomes acausal.

If this is zero, then the EOS is causal at all baryon densities in the specified range

double acausal_ed

The energy density at which the EOS becomes acausal.

If this is zero, then the EOS is causal at all baryon densities in the specified range

double nb_last

The last valid baryon density in the EOS (in \( \mathrm{fm}^{-3} \); default 2.0)

This value is computed by calc_eos() .

double nb_last_min

The minimum last valid baryon density in the EOS (in \( \mathrm{fm}^{-3} \); default 0.48)

The function calc_eos() requires that the EOS must be computable up to at least this density.

size_t max_row

The table row which contains the maximum gravitational mass.

This value is computed by calc_nstar().

inline void set_eos_table(std::shared_ptr<table_units<>> t)

Set the EOS table.

In order for the calc_nstar() function to use this table, it must contain at least the columns ed, pr, and nB which store the energy density, pressure, and baryon density.

inline std::shared_ptr<table_units<>> get_eos_results()

Get the eos table (after having called calc_eos())

inline std::shared_ptr<table_units<>> get_tov_results()

Get the results from the TOV solver (after having called calc_nstar() or fixed())

Configuration

int verbose

Verbosity parameter (default 0)

bool remove_rows

If true, remove rows beyond the maximum mass (default true)

Note that if the M-R curve has multiple branches, this class will not remove all unstable configurations.

double nb_start

The starting baryon density in \( \mathrm{fm}^{-3} \) (default 0.05)

double nb_end

The final baryon density in \( \mathrm{fm}^{-3} \) (default 2.0)

double dnb

The baryon density stepsize in \( \mathrm{fm}^{-3} \) (default 0.01)

bool include_muons

If true, include muons (default true)

bool err_nonconv

If true, throw an exception if the solver fails or if the EOS is unphysical (default true)

inline int set_tov(tov_solve &ts)

Specify the object for solving the TOV equations.

The default uses the low-density equation of state with tov::verbose=0. In calc_nstar(), the units are set by calling tov_solve::set_units().

Default objects

fermion neut

The default neutron.

fermion prot

The default proton.

fermion e

The electron.

fermion mu

The muon.

fermion_zerot fzt

Zero-temperature fermion thermodynamics (for the leptons)

tov_solve def_tov

The default TOV equation solver.

eos_tov_interp def_eos_tov

Default EOS object for the TOV solver.

mroot_hybrids mh

The EOS solver.

The value of mroot_hybrids::err_nonconv is set to false in the constructor so that this class can manage solver convergence errors.

bool eos_set

True if equation of state has been set.

eos_had_base *hep

A pointer to the equation of state.

tov_solve *tp

A pointer to the TOV object.

std::shared_ptr<table_units<>> eost

Storage for the EOS table.

int solve_fun(size_t nv, const ubvector &x, ubvector &y, thermo &hb, double n_B)

Solve to ensure zero charge in \( \beta \)-equilibrium.

This function takes as input (in x[0]) the proton density and outputs (in y[0]) returns the net charge density in beta-equilibrium, i.e.

\[ n_p - n_e - n_{\mu} \]

This function returns a non-zero value if the densities are negative or if the EOS fails.

This function is very similar to o2scl::eos_had_base::solve_beta_eq_T0().

Basic operation

inline void set_eos(eos_had_base &he)

Set the equation of state.

This function stores a pointer to the EOS object and should be called before calling calc_eos().

int calc_eos(double np_0 = 0.0)

Calculate the given equation of state.

double calc_urca(double np_0 = 0.0)

Compute the density at which the direct Urca process is allowe.

This is faster than using calc_eos() since it does nothing other than computes the critical density. It does not store the equation of state.

int calc_nstar()

Calculate the M vs. R curve.

int fixed(double target_mass)

Calculate the profile for a fixed gravitational mass.

Public Types

typedef boost::numeric::ublas::vector<double> ubvector

Public Functions

nstar_cold()