Python Python Packages to Calculate orbits in Schwarzschild Metric

AI Thread Summary
A user is seeking a Python package to calculate the orbits of time-like and null-like particles in the Schwarzschild metric, specifically in the (r, φ) plane. They mention having difficulty finding suitable resources despite searching online. The discussion references the EinsteinPy library, which allows for geodesic calculations but operates in terms of momentum and initial position rather than energy. A code snippet is provided that uses EinsteinPy to plot geodesics, but the user is uncertain how to adapt it to generate specific images related to their inquiry. They express interest in understanding how to run the code effectively to produce the desired orbital plots. The conversation highlights the need for clarity on initializing parameters to achieve specific visual outputs related to the Schwarzschild metric.
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:
Technology news on Phys.org
Last edited:
  • Haha
Likes romsofia
I did that but did not finding useful. Theres 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 ?
 
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.
 
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
 
Well I don't think you can get the effective potential out of it, but you should be able to get the orbits.
 
  • Like
Likes Arman777
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 ?
 

Similar threads

Back
Top