General Relativity TOV Solver#
This page describes the standard Tolman-Oppenheimer-Volkoff (TOV) equations in general relativity and their numerical implementation in jester.
Background#
The structure of a spherically symmetric, non-rotating neutron star in hydrostatic equilibrium is governed by the TOV equations, first derived by Tolman [1] and Oppenheimer & Volkoff [2]. In geometric units (\(G = c = 1\)), the equations read
where \(r\) is the circumferential radius, \(p(r)\) is the pressure, \(\varepsilon(r)\) is the energy density, and \(m(r)\) is the gravitational mass enclosed within radius \(r\).
All calculations in jester are carried out in geometric units, and the results are converted to physical units (solar masses and kilometres) only at the final output stage.
Reformulation in terms of the specific enthalpy#
In practice it is numerically advantageous to integrate the TOV equations using the specific enthalpy
as the independent variable rather than the radius \(r\). The enthalpy decreases monotonically from its central value \(h_c\) to zero at the stellar surface, which gives a natural stopping condition for the integration. Inverting the relation \(dh/dr = -(1/(\varepsilon + p))(dp/dr)\) and substituting Eq. (1) yields
and consequently
These are the two equations integrated by the GRTOVSolver in jester.
The pressure \(p\) and energy density \(\varepsilon\) at a given enthalpy value are recovered by interpolating the pre-computed EOS table (stored in EOSData).
Tidal deformability#
In addition to the stellar structure, jester computes the tidal deformability \(\Lambda\), which is directly measurable from gravitational wave observations and is defined as
where \(C = M/R\) is the compactness and \(k_2\) is the second tidal Love number [3, 4]. To compute \(k_2\), a linear perturbation \(H(r)\) to the metric is evolved alongside the stellar structure. Expressed in terms of the enthalpy, the two auxiliary ODEs are
where \(\beta \equiv dH/dr\) and the coefficients \(C_0\), \(C_1\) depend on the local stellar structure via
with \(A = (1 - 2m/r)^{-1}\) being the metric function. At the stellar surface, the Love number \(k_2\) is extracted from the ratio \(y = R\,\beta(R)/H(R)\) through the closed-form expression (see [4])
where the denominator \(D(C, y)\) is
Numerical implementation#
The four coupled ODEs — Eqs. (4), (5), (7), (8) — are integrated from \(h_c\) down to zero using the Dormand-Prince 5th-order Runge-Kutta method (Dopri5) provided by the Diffrax library, with an adaptive PID step-size controller (relative tolerance \(10^{-5}\), absolute tolerance \(10^{-6}\)).
Initial conditions. The state vector \((r, m, H, \beta)\) is initialised just off-centre at \(h_0 = h_c - 10^{-3} h_c\) using a series expansion valid near \(r = 0\):
where \(\Delta h = h_0 - h_c = -10^{-3} h_c\).
Enthalpy clamping. Diffrax’s adaptive step controller can evaluate the ODE at trial points where \(h \leq 0\), causing undefined logarithmic operations in the EOS interpolation routines. jester guards against this by clamping the enthalpy to the minimum tabulated value before any EOS lookup, which freezes the ODE derivatives at their surface value without affecting the converged solution.
Family construction. To build a full mass-radius-tidal family, the TOV equations are solved for a logarithmically spaced grid of central pressures \(p_c\) running from a minimum density (set by min_nsat, in units of saturation density \(n_\mathrm{sat} = 0.16\,\mathrm{fm}^{-3}\)) up to the maximum pressure at which the EOS remains causal (\(c_s^2 < 1\)). JAX’s vmap is used to evaluate all central pressures in parallel, making the family construction efficient on GPU hardware. The stable branch of the \(M(R)\) curve (up to the maximum mass \(M_\mathrm{TOV}\)) is retained, and the family is re-sampled onto a uniform mass grid for downstream inference.
Further resources#
API reference:
jesterTOV.tov.gr.GRTOVSolver
References
Richard C. Tolman. Static solutions of Einstein's field equations for spheres of fluid. Phys. Rev., 55:364–373, 1939. doi:10.1103/PhysRev.55.364.
J. R. Oppenheimer and G. M. Volkoff. On massive neutron cores. Phys. Rev., 55:374–381, 1939. doi:10.1103/PhysRev.55.374.
Eanna E. Flanagan and Tanja Hinderer. Constraining neutron star tidal Love numbers with gravitational wave detectors. Phys. Rev. D, 77:021502, 2008. arXiv:0709.1915, doi:10.1103/PhysRevD.77.021502.
Tanja Hinderer. Tidal Love numbers of neutron stars. Astrophys. J., 677:1216–1220, 2008. [Erratum: Astrophys.J. 697, 964 (2009)]. arXiv:0711.2420, doi:10.1086/533487.