TOV.jl is a high-performance Julia library for solving the Tolman-Oppenheimer-Volkoff (TOV) equations of relativistic stellar structure. Designed for researchers in Numerical Relativity and Nuclear Astrophysics, it provides a rigorous, modular framework for constructing and analyzing compact star models.
-
Precision & Speed: Uses
OrdinaryDiffEq.jlwith high-order solvers (Tsit5/Vern7) and callback-based surface detection for numerical precision$\sim 10^{-10}$ . -
Advanced Physics:
- Full support for Polytropes, Piecewise Polytropes, and Tabulated EOS (interpolated).
- Baryonic Mass conservation and Binding Energy calculation.
- Metric Matching at the surface for exact Schwarzschild exterior.
-
Diagnostics: Built-in runtime monitoring for Causality (
$c_s \le 1$ ) and Stability criteria. -
Publication Ready: Integrated plotting with
CairoMakieproducing high-DPI, LaTeX-labeled figures.
Solve a simple Polytropic star in 3 lines of code:
using TOV, CairoMakie
# 1. Define EOS (Polytrope K=100, Gamma=2)
eos = Polytrope(100.0, 2.0)
# 2. Solve for a central pressure (dimensionless units G=c=Msun=1)
star = solve_tov(eos, 1.0e-3)
# 3. Visualize
f = plot(star)
save("star.png", f)Full internal profiles (Pressure, Density, Metric, Sound Speed) are generated automatically.
Compute sequences to identify stable branches and maximum mass limits.
using Pkg
Pkg.add(url="https://github.com/svretina/TOV.jl")We welcome contributions! Please see CONTRIBUTING.md for guidelines. Use issues to report bugs or request features.
This project is licensed under the GNU General Public License v3.0.

