Python Packages to Calculate orbits in Schwarzschild Metric

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
6 replies · 3K views
Arman777
Insights Author
Gold Member
Messages
2,163
Reaction score
191
I am looking for a Python Code/Package to calculate the orbits of the time-like and null-like particles in Schwarzschild metric (in spherical coordinates)

1622055988200.png


1622056010103.png


Does anyone know such package ?

Note: I am mostly looking for packages to calculate the RIGHT side of the given images (i.e the orbits in ##(r, \phi)## plane.

Note 2: If you guys want to share not python but something else that's also okay.
 
Last edited:
Physics news on Phys.org
I did that but did not finding useful. there's Einsteinpy but it does in terms of momentum and initial position instead of energy. I am not sure what values should I put to produce those graphs.

Python:
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 = 0.
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.plot2D(geod, coordinates=(1, 2)) # Plot X & Y
gpl.show()

https://docs.einsteinpy.org/en/stable/examples/Visualizing Precession in Schwarzschild Spacetime.html

This produces something like the 2nd image. But how about 1,3 and 4 ?
 
Ibix said:
Is my code (for Kerr spacetime, but just set ##a=0##) more like what you want? I think I set it up so you can initialise it in various ways.
Well if you think that it can produce the images shown above for a given metric then yes. I can use it
 
Ibix said:
Well I don't think you can get the effective potential out of it, but you should be able to get the orbits.
Thats also good. So what should I type to produce those images ? I mean how can I run the code ?