Table of Contents
Fetching ...

gr-Orbit-Toolkit: A Python-Based Software for Simulating and Visualizing Relativistic Orbits

Milagros Delgado, Wladimir E. Banda-Barragán

TL;DR

Gr-orbit-toolkit addresses the need for accessible numerical tools to compare classical Newtonian orbits with general-relativistic post-Newtonian corrections in teaching and research. The authors implement and compare multiple ODE integrators—Euler-Trapezoidal, RK3, and SciPy's DOP853—to solve the equations of motion, including the classical form $d^{2}u/d\phi^{2} + u = GM/h^{2}$ and the GR form $d^{2}u/d\phi^{2} + u = GM/h^{2} + 3 GM u^{2}/c^{2}$, and demonstrate relativistic precession $\Delta\phi = 6\pi GM/(a(1-e^{2})c^{2})$. They show relativistic effects are negligible for the Earth-Sun-like system but become significant near massive centers, e.g., a precession of $0.930$ radians per orbit for a body around a $5\times 10^{6} M_\odot$ black hole with $e=0$. The work provides seven simulations, convergence analyses, and notebooks in a public repository, establishing gr-orbit-toolkit as a practical digital twin for GR orbital mechanics in education and research.

Abstract

Creating software dedicated to simulation is essential for teaching and research in Science, Technology, Engineering, and Mathematics (STEM). Physics lecturing can be more effective when digital twins are used to accompany theory classes. Research in physics has greatly benefited from the advent of modern, high-level programming languages, which facilitate the implementation of user-friendly code. Here, we report our own Python-based software, the gr-orbit-toolkit, to simulate orbits in classical and general relativistic scenarios. First, we present the ordinary differential equations (ODEs) for classical and relativistic orbital accelerations. For the latter, we follow a post-Newtonian approach. Second, we describe our algorithm, which numerically integrates these ODEs to simulate the orbits of small-sized objects orbiting around massive bodies by using Euler and Runge-Kutta methods. Then, we study a set of sample two-body models with either the Sun or a black hole in the center. Our simulations confirm that the orbital motions predicted by classical and relativistic ODEs drastically differ for bodies near the Schwarzschild radius of the central massive body. Classical mechanics explains the orbital motion of objects far away from a central massive body, but general relativity is required to study objects moving at close proximity to a massive body, where the gravitational field is strong. Our study on objects with different eccentricities confirms that our code captures relativistic orbital precession. Our convergence analysis shows the toolkit is numerically robust. Our gr-orbit-toolkit aims at facilitating teaching and research in general relativity, so a comprehensive user and developer guide is provided in the public code repository.

gr-Orbit-Toolkit: A Python-Based Software for Simulating and Visualizing Relativistic Orbits

TL;DR

Gr-orbit-toolkit addresses the need for accessible numerical tools to compare classical Newtonian orbits with general-relativistic post-Newtonian corrections in teaching and research. The authors implement and compare multiple ODE integrators—Euler-Trapezoidal, RK3, and SciPy's DOP853—to solve the equations of motion, including the classical form and the GR form , and demonstrate relativistic precession . They show relativistic effects are negligible for the Earth-Sun-like system but become significant near massive centers, e.g., a precession of radians per orbit for a body around a black hole with . The work provides seven simulations, convergence analyses, and notebooks in a public repository, establishing gr-orbit-toolkit as a practical digital twin for GR orbital mechanics in education and research.

Abstract

Creating software dedicated to simulation is essential for teaching and research in Science, Technology, Engineering, and Mathematics (STEM). Physics lecturing can be more effective when digital twins are used to accompany theory classes. Research in physics has greatly benefited from the advent of modern, high-level programming languages, which facilitate the implementation of user-friendly code. Here, we report our own Python-based software, the gr-orbit-toolkit, to simulate orbits in classical and general relativistic scenarios. First, we present the ordinary differential equations (ODEs) for classical and relativistic orbital accelerations. For the latter, we follow a post-Newtonian approach. Second, we describe our algorithm, which numerically integrates these ODEs to simulate the orbits of small-sized objects orbiting around massive bodies by using Euler and Runge-Kutta methods. Then, we study a set of sample two-body models with either the Sun or a black hole in the center. Our simulations confirm that the orbital motions predicted by classical and relativistic ODEs drastically differ for bodies near the Schwarzschild radius of the central massive body. Classical mechanics explains the orbital motion of objects far away from a central massive body, but general relativity is required to study objects moving at close proximity to a massive body, where the gravitational field is strong. Our study on objects with different eccentricities confirms that our code captures relativistic orbital precession. Our convergence analysis shows the toolkit is numerically robust. Our gr-orbit-toolkit aims at facilitating teaching and research in general relativity, so a comprehensive user and developer guide is provided in the public code repository.

Paper Structure

This paper contains 14 sections, 11 equations, 4 figures, 2 tables.

Figures (4)

  • Figure 1: Workflow diagram of the orbital simulation module orbits.py for gr-orbit-toolkit. Created using Graphviz Online Graphviz.
  • Figure 2: Classical (blue dashed line) versus relativistic (red dotted line) orbits of two systems: (a) an Earth-Sun-like system ($e=0.01671$) and (b) an Earth-black hole-like system ($e=0.0$). All models were run with the RK3 method. The theoretical classical orbit (yellow solid line) is shown for reference. For central objects with little mass, such as the Sun (a), classical and relativistic orbits are indistinguishable, while for supermassive central objects (b), such as a black hole, relativistic precession is observed.
  • Figure 3: (a) Relativistic orbits of various objects with different eccentricities surrounding a black hole, run with Trapezoidal integration. (b) Relativistic orbits of an Earth-like planet-black hole system with $e=0.01671$, using several ODE integration methods. Objects with lower eccentricities follow more circular paths, and higher eccentricities dictate a more elliptical path rotation. The Trapezoidal and RK3 integration methods slightly underestimate the orbit, but are consistent with SciPy's higher-order method.
  • Figure 4: Convergence analysis showing the RMS error of the Trapezoidal and RK3 schemes with respect to the reference method (SciPy's DOP853) for several time steps. The RMS error increases as the time step becomes larger. For all the considered time steps (time resolutions), the RK3 method is more accurate than the Trapezoidal one.