Python Packages to Calculate orbits in Schwarzschild Metric

In summary: You can run the code by typing:import einsteinpy.geodesic as geodgeod.init("Schwarzschild")In summary, the code produces images that show the orbits of time-like and null-like particles in a Schwarzschild metric.
  • #1
Arman777
Insights Author
Gold Member
2,168
193
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
  • #3
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 ?
 
  • #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.
 
  • #5
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
 
  • #6
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
  • #7
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 ?
 

What is a Python package for calculating orbits in Schwarzschild Metric?

A Python package is a collection of modules and functions that are designed to perform specific tasks. In this case, a Python package for calculating orbits in Schwarzschild Metric would contain functions and algorithms to solve equations of motion in a curved spacetime, specifically the Schwarzschild Metric.

How do I install the Python package for calculating orbits in Schwarzschild Metric?

You can install the package using a Python package manager such as pip or conda. Simply run the command "pip install " or "conda install " in your terminal. Make sure you have the correct dependencies installed before installing the package.

What are the main features of the Python package for calculating orbits in Schwarzschild Metric?

The main features of a Python package for calculating orbits in Schwarzschild Metric would include functions for calculating the trajectory of an object in a curved spacetime, computing the energy and angular momentum of the object, and plotting the orbit. It may also have additional features such as simulation of gravitational lensing effects and black hole dynamics.

Can I use the Python package for calculating orbits in Schwarzschild Metric for research purposes?

Yes, the Python package can be used for research purposes. However, it is important to cite the package and its authors in any publications or presentations that make use of it. It is also recommended to carefully review and understand the underlying equations and assumptions used in the package before using it for research.

Are there any limitations to the accuracy of the Python package for calculating orbits in Schwarzschild Metric?

Like any scientific software, the accuracy of the calculations will depend on the underlying equations and assumptions used in the package. It is important to understand the limitations and uncertainties of the model being used. Additionally, the accuracy may also depend on the precision of the input parameters and the computational resources available.

Similar threads

Replies
6
Views
658
  • Programming and Computer Science
Replies
7
Views
438
  • Programming and Computer Science
Replies
7
Views
2K
  • Special and General Relativity
Replies
9
Views
1K
  • Special and General Relativity
Replies
3
Views
703
  • Special and General Relativity
Replies
13
Views
3K
  • Advanced Physics Homework Help
Replies
10
Views
1K
  • Special and General Relativity
Replies
1
Views
534
Replies
1
Views
1K
  • Special and General Relativity
Replies
11
Views
2K
Back
Top