Skip to content

Solving the Tolman-Oppenheimer-Volkoff (TOV) equations in Julia

License

Notifications You must be signed in to change notification settings

svretina/TOV.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TOV.jl Logo

TOV.jl

Stable Dev Build Status Aqua.jl JET.jl License: GPL v3

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.

Why TOV.jl?

  • Precision & Speed: Uses OrdinaryDiffEq.jl with 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 CairoMakie producing high-DPI, LaTeX-labeled figures.

Quick Start

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)

Results Gallery

Stellar Structure Dashboard

Full internal profiles (Pressure, Density, Metric, Sound Speed) are generated automatically.

Star Dashboard

Mass-Radius Relation

Compute sequences to identify stable branches and maximum mass limits.

Mass Radius Curve

Installation

using Pkg
Pkg.add(url="https://github.com/svretina/TOV.jl")

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines. Use issues to report bugs or request features.

License

This project is licensed under the GNU General Public License v3.0.

About

Solving the Tolman-Oppenheimer-Volkoff (TOV) equations in Julia

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages