Python Python Packages to Calculate orbits in Schwarzschild Metric

Click For Summary
SUMMARY

The discussion centers on finding a Python package to calculate orbits of time-like and null-like particles in the Schwarzschild metric, specifically in the (r, φ) plane. The user mentions the EinsteinPy library, which allows for geodesic calculations but requires input in terms of momentum and initial position rather than energy. A sample code snippet using EinsteinPy's Timelike geodesic and GeodesicPlotter is provided, demonstrating how to visualize orbits in Schwarzschild spacetime. The conversation highlights the need for clarity on how to produce specific graphical outputs using the provided code.

PREREQUISITES
  • Familiarity with Python programming
  • Understanding of general relativity concepts, particularly the Schwarzschild metric
  • Knowledge of the EinsteinPy library and its functionalities
  • Basic skills in data visualization using Python libraries
NEXT STEPS
  • Explore the EinsteinPy documentation for advanced geodesic calculations
  • Learn about the effective potential in general relativity
  • Investigate alternative Python packages for simulating orbits in different metrics
  • Study the mathematical foundations of orbits in Schwarzschild spacetime
USEFUL FOR

Researchers, physicists, and developers interested in computational physics, particularly those working with general relativity and orbit simulations in Python.

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

Replies
6
Views
3K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
952
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 13 ·
Replies
13
Views
5K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 17 ·
Replies
17
Views
3K