I am currently trying to code the precession of a star orbiting around a black hole, the issue I am having though is that I have no clue what the values are and what they mean in the code, if anyone would know what the values mean I would appreciate the help. Here's the code I have currently and here's a link to Einsteinpy's website thank you


    import numpy as np

from einsteinpy.geodesic import Timelike
from einsteinpy.plotting.geodesic import GeodesicPlotter

position = [40., np.pi / 2, 0.]
momentum = [0., 0., 3.83405]
a = 1.
steps = 5500
delta = 1.

geod = Timelike(

gpl = GeodesicPlotter()

1 Answer 1


This is an interesting development, thanks for bringing it to our (my) attention. Unfortunately, the documentation is lagging the code.

The package is using natural, geometrised units, where $G=c=1$ and I guess you are using Schwarzschild coordinates and the Schwarzschild metric (note that other coordinate systems could be used).

Thus your position is $r, \theta, \phi$, the radial coordinate, polar and azimuthal angles. The radial coordinate will be in multiples of $GM/c^2$ (i.e. in your case, written as $40GM/c^2$ or $40M$ in geometrised units). The angles are expressed in radians. $\theta =\pi/2$ is the "equatorial plane" (has no meaning for a Schwarzschild metric, affects only how it is translated to a Cartesian plot).

The momentum of the body will be expressed per unit mass (for inertial trajectories it doesn't matter what the mass of a test particle is) and will be the Lorentz factor (in your case, $\gamma = 3.83405$ in the $\phi$ direction - an initially tangential motion), where $\gamma = (1 - v^2/c^2)^{-0.5}$. However, it could also be that since $p/m = \gamma v$, that the code is using $\gamma v/c$ as the specific momentum.

You appear to have set $a=1$, so I think rather than a Schwarzschild black hole, this is a maximally spinning Kerr black hole. I have to quibble with the naming convention here; the metric should have been called "Kerr", and the Schwarzschild metric is the Kerr metric with $a=0$.

Delta has me puzzled. Presumably it is a timestep (whether in coordinate time or proper time isn't clear - you could try and make a trajectory cross the event horizon to find out!). The natural time units would be $GM/c^3$, but this seems a bit big to be setting to 1, but maybe it's ok for something starting at $r= 40GM/c^2$.

  • 1
    $\begingroup$ Hi, thanks for the answer, its been a massive help. Out of curiosity though, the units expressed in r, you said is 40M, is this a lightsecond? $\endgroup$
    – Taffy
    May 2, 2022 at 9:46
  • 1
    $\begingroup$ $40M = 40GM/c^2$ @Taffy. Since you haven't told the code what the black hole mass is then none of the calculations can be done in "real units". $\endgroup$
    – ProfRob
    May 2, 2022 at 10:08
  • $\begingroup$ Sorry to be a bother, would you know how to tell the code what the mass of the black hole is? If the hole was 100 solar masses and a star was orbiting it with an average radius of 100 AU, could that be implemented into this code? @ProfRob $\endgroup$
    – Taffy
    May 2, 2022 at 10:27
  • 1
    $\begingroup$ I'm no expert in the code. One of the notebook examples specifies a mass. @Taffy $\endgroup$
    – ProfRob
    May 2, 2022 at 10:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .