Python Packages to Calculate orbits in Schwarzschild Metric

Click For Summary

Discussion Overview

The discussion revolves around finding Python packages or code to calculate the orbits of time-like and null-like particles in the Schwarzschild metric, specifically in spherical coordinates. Participants are exploring options for visualizing these orbits in the (r, φ) plane and are open to suggestions beyond Python.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested

Main Points Raised

  • One participant is seeking a Python package to calculate orbits in the Schwarzschild metric, expressing a preference for visualizing results in the (r, φ) plane.
  • Another participant suggests searching online, indicating a lack of immediate solutions.
  • A participant mentions having tried Einsteinpy but finds it focuses on momentum and initial position rather than energy, expressing uncertainty about the required values for generating the desired graphs.
  • Code is shared that utilizes Einsteinpy to plot geodesics, but the participant questions how to produce specific images related to the orbits.
  • One participant offers a code snippet for Kerr spacetime, suggesting it can be adapted for Schwarzschild by setting a=0, and expresses willingness to assist further.
  • Another participant doubts the ability to extract effective potential from the code but believes it can still generate the orbits.
  • There is a request for guidance on how to run the code to produce the desired images.

Areas of Agreement / Disagreement

Participants express differing views on the capabilities of the code and packages discussed. There is no consensus on a specific solution or method to achieve the desired visualizations.

Contextual Notes

Participants have not reached a resolution on the specific values or parameters needed for the calculations, and there are uncertainties regarding the effective potential and how to run the provided code.

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   Reactions: 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   Reactions: 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
5K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 3 ·
Replies
3
Views
982
  • · 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