<p>This is an interesting development, thanks for bringing it to our (my) attention. Unfortunately, the documentation is lagging the code.</p>
<p>The package is using natural, geometrised units, where <span class="math-container">$G=c=1$</span> and I guess you are using Schwarzschild coordinates and the Schwarzschild metric (note that other coordinate systems could be used).</p>
<p>Thus your position is <span class="math-container">$r, \theta, \phi$</span>, the radial coordinate, polar and azimuthal angles. The radial coordinate will be in multiples of <span class="math-container">$GM/c^2$</span> (i.e. in your case, written as <span class="math-container">$40GM/c^2$</span> or <span class="math-container">$40M$</span> in geometrised units). The angles are expressed in radians. <span class="math-container">$\theta =\pi/2$</span> is the &quot;equatorial plane&quot; (has no meaning for a Schwarzschild metric, affects only how it is translated to a Cartesian plot).</p>
<p>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, <span class="math-container">$\gamma = 3.83405$</span> in the <span class="math-container">$\phi$</span> direction - an initially tangential motion), where <span class="math-container">$\gamma = (1 - v^2/c^2)^{-0.5}$</span>. However, it could also be that since <span class="math-container">$p/m = \gamma v$</span>, that the code is using <span class="math-container">$\gamma v/c$</span> as the specific momentum.</p>
<p>You appear to have set <span class="math-container">$a=1$</span>, 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 &quot;Kerr&quot;, and the Schwarzschild metric is the Kerr metric with <span class="math-container">$a=0$</span>.</p>
<p>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 <span class="math-container">$GM/c^3$</span>, but this seems a bit big to be setting to 1, but maybe it's ok for something starting at <span class="math-container">$r= 40GM/c^2$</span>.</p>

CC BY-SA 4.0
2022-05-02T09:46:05.973Z
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?
Taffy
CC BY-SA 4.0
2022-05-02T10:08:04.397Z
$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".
ProfRob
CC BY-SA 4.0
2022-05-02T10:27:42.907Z
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
Taffy
CC BY-SA 4.0
2022-05-02T10:31:31.440Z
I'm no expert in the code. One of the notebook examples specifies a mass. @Taffy
ProfRob
CC BY-SA 4.0
2022-05-02T07:39:08.110Z
2022-05-02T10:33:49.093Z
2022-05-02T10:33:49.093Z
ProfRob
<p>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</p>
<p><a href="https://einsteinpy.org" rel="nofollow noreferrer">https://einsteinpy.org</a></p>
<pre><code>    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(
    metric=&quot;Schwarzschild&quot;,
    metric_params=(a,),
    position=position,
    momentum=momentum,
    steps=steps,
    delta=delta,
    return_cartesian=True
)


gpl = GeodesicPlotter()
gpl.plot(geod)
gpl.show()
</code></pre>

<black-hole><astrophysics><python><precession>
Using Einsteinpy to plot the precession of a star orbiting a black hole?
Taffy
# Using Einsteinpy to plot the precession of a star orbiting a black hole?

(Asked by: username_0 on 2022-05-02)

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
https://einsteinpy.org
    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(
    metric="Schwarzschild",
    metric_params=(a,),
    position=position,
    momentum=momentum,
    steps=steps,
    delta=delta,
    return_cartesian=True
)


gpl = GeodesicPlotter()
gpl.plot(geod)
gpl.show()

**Tags:** black-hole, astrophysics, python, precession

---

## 1 answers

### Answer by username_1 on 2022-05-02. Score: 5

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$.

> **Comments:**
> **username_0**: 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?  
> **username_1**: $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".  
> **username_0**: 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  
> **username_1**: I'm no expert in the code. One of the notebook examples specifies a mass. @Taffy  

---

