Class nstar_cold (o2scl)¶
-
class
o2scl
::
nstar_cold
¶ Naive static cold neutron star.
This uses eos_had_base::calc_e() to compute the equation of state of zero-temperature beta-equilibrated neutron star matter and tov_solve::mvsr() to compute the mass versus radius curve. By default the crust EOS is given by that in o2scl::eos_tov_interp::default_low_dens_eos() .
The neutron, proton, electron and muon are given masses according to their values in o2scl_mks after a conversion to units of \( 1/\mathrm{fm} \).
There is an example for the usage of this class given in the ex_nstar_cold_sect.
If err_nonconv is true and the solver fails, the error handler is called.
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} \)dednb_Ye
in units of \( 1/\mathrm{fm} \), \( ( d \varepsilon / d n_B )_{Y_e} \) where \( Y_e = n_e / n_B \) is the electron fraction (computed using eos_had_base::const_pf_derivs() )dPdnb_Ye
in units of \( 1/\mathrm{fm} \), \( ( d P / d n_B )_{Y_e} \) .fcs2
, the squared speed of sound at fixed electron fraction, the ratio of the previous two quantities
If include_muons is true, 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} \)
If the energy density is always positive and increasing, and the pressure is always positive and increasing, then the EOS is well-formed and well_formed is
true
. The variable pressure_dec records the lowest baryon density where the pressure decreases with increasing density. If err_nonconv is true and the EOS is not well formed, the error handler is called, and the remaining columns below are not computed.After computing the equation of state, 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 inpr
loge
, the natural logarithm of the energy density stored ined
s
in units of \( 1/\mathrm{fm} \), the semi-perimeter of the Urca triangleurca
in units of \( 1/\mathrm{fm}^4 \), the squared area of the Urca trianglead_index
, the adiabatic index, \( \Gamma \) If the eos is not well-formed and well_formed isfalse
, then the columnscs2
,logp
, andloge
are set to zero. The columnscs2
andad_indes
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 labeledurca
is \( a^2 \) . If this quantity is positive, then direct Urca is allowed. The variable allow_urca is the smallest density for which the direct Urca process turns on, and deny_urca 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 labeledcs2
. If the EOS is not well-formed, then this column is set to zero. Ifcs2
is larger than 1, the EOS is said to be “acausal”. The variables acausal, 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.) If the EOS is not well-formed then this column is set to zero.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.
- Idea for Future:
Some of the auxillary quantities can be computed directly without using the table methods and the EOS calculation would be a bit faster.
Basic operation
-
void
set_eos
(eos_had_base &he)¶ Set the equation of state.
This should be set 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.
Output
-
bool
well_formed
¶ If true, the energy density and pressure of the EOS is monotonically increasing and the pressure is always positive.
-
double
pressure_dec
¶ 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
¶ The smallest density where Urca becomes allowed.
If this is zero after calling calc_eos(), then direct Urca is never allowed.
-
double
deny_urca
¶ 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
¶ 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
solver_tol
¶ Solver tolerance (default \( 10^{-4} \))
-
int
verbose
¶ Verbosity parameter (default 0)
Set the EOS table.
In order for the calc_nstar() function to use this table, it must contain at least the columns
ed, pr
, andnB
which store the energy density, pressure, and baryon density.
-
std::shared_ptr<table_units<>>
get_eos_results
()¶ Get the eos table (after having called calc_eos())
-
std::shared_ptr<table_units<>>
get_tov_results
()¶ Get the results from the TOV (after having called calc_nstar())
Configuration
-
double
nb_start
¶ The starting baryon density (default 0.05)
-
double
nb_end
¶ The final baryon density (default 2.0)
-
double
dnb
¶ The baryon density stepsize (default 0.01)
-
bool
include_muons
¶ If true, include muons (default false)
-
bool
err_nonconv
¶ If true, throw an exception if the solver fails or if the EOS is not well-formed (default true)
-
int
set_root
(root<> &rf)¶ Set the equation solver for the EOS.
-
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
np
¶ The default neutron.
-
fermion
pp
¶ The default proton.
-
fermion_zerot
fzt
¶ Zero-temperature fermion thermodynamics.
-
root_cern
def_root
¶ The default equation solver for the EOS.
-
eos_tov_interp
def_eos_tov
¶ Default EOS object for the TOV solver.
-
bool
eos_set
¶ True if equation of state has been set.
-
fermion
e
¶ The electron.
-
fermion
mu
¶ The muon.
-
eos_had_base *
hep
¶ A pointer to the equation of state.
-
root *
rp
¶ A pointer to the solver.
-
std::shared_ptr<table_units<>>
eost
¶ Storage for the EOS table.
-
double
barn
¶ The baryon density.
-
double
solve_fun
(double x, thermo &hb)¶ Solve to ensure zero charge in \( \beta \)-equilibrium.
Public Functions
-
nstar_cold
()¶