jesterTOV.tov module
The TOV (Tolman-Oppenheimer-Volkoff) module solves the stellar structure equations for neutron stars.
Functions for solving the TOV equations. Main source of inspiration: NMMA code https://github.com/nuclear-multimessenger-astronomy/nmma/blob/f03ea14fcd6cafc9b189c7a1dd088ddd5b7fe898/nmma/eos/tov.py This script assumes geometric units.
Mathematical Background
The TOV equations describe the structure of a spherically symmetric, static star in general relativity:
\[\frac{dP}{dr} = -\frac{G(\varepsilon + P)(M + 4\pi r^3 P)}{r(r - 2GM)}\]
\[\frac{dM}{dr} = 4\pi r^2 \varepsilon\]
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)