jesterTOV.tov module#
The TOV (Tolman-Oppenheimer-Volkoff) module solves the stellar structure equations for neutron stars.
Tolman-Oppenheimer-Volkoff (TOV) equation solver for neutron star structure.
This module provides functions to solve the TOV equations, which describe the hydrostatic equilibrium of a spherically symmetric, static star in General Relativity. The implementation follows the approach used in the NMMA code.
Units: All calculations are performed in geometric units where \(G = c = 1\).
Reference: NMMA code nuclear-multimessenger-astronomy/nmma
- calc_k2(R, M, H, b)[source]#
Calculate the second Love number k₂ for tidal deformability.
The Love number k₂ relates the tidal deformability to the neutron star’s mass and radius. It is computed from the auxiliary variables H and β obtained from the TOV integration.
The tidal deformability is given by:
\[\Lambda = \frac{2}{3} k_2 C^{-5}\]where \(C = M/R\) is the compactness.
- tov_ode(h, y, eos)[source]#
TOV ordinary differential equation system.
This function defines the coupled ODE system for the TOV equations plus tidal deformability. The system is solved in terms of the enthalpy h as the independent variable (decreasing from center to surface).
The TOV equations are:
\[\begin{split}\frac{dr}{dh} &= -\frac{r(r-2m)}{m + 4\pi r^3 p} \\ \frac{dm}{dh} &= 4\pi r^2 \varepsilon \frac{dr}{dh} \\ \frac{dH}{dh} &= \beta \frac{dr}{dh} \\ \frac{d\beta}{dh} &= -(C_0 H + C_1 \beta) \frac{dr}{dh}\end{split}\]where H and \(\beta\) are auxiliary variables for tidal deformability.
- tov_solver(eos, pc)[source]#
Solve the TOV equations for a given central pressure.
This function integrates the TOV equations from the center of the star (where r=0, m=0) outward to the surface (where p=0), using the enthalpy as the integration variable. The integration starts slightly off-center to avoid singularities.
The solver uses the Dormand-Prince 5th order adaptive method (Dopri5) with proper error control for numerical stability.
- Parameters:
- Returns:
tuple –
A tuple containing:
M: Gravitational mass [geometric units]
R: Circumferential radius [geometric units]
k2: Second Love number for tidal deformability
Note
The integration is performed from center to surface, with the enthalpy decreasing from h_center to 0. Initial conditions are set using series expansions valid near the center.
Mathematical Background#
The TOV equations describe the structure of a spherically symmetric, static star in general relativity:
where: - \(P(r)\) is the pressure at radius \(r\) - \(\varepsilon(r)\) is the energy density at radius \(r\) - \(M(r)\) is the mass enclosed within radius \(r\) - \(G\) is the gravitational constant (set to 1 in geometric units)