Visualizing Precession in Schwarzschild Spacetime

Importing required modules

[1]:
import numpy as np

from einsteinpy.geodesic import Timelike
from einsteinpy.plotting.geodesic import GeodesicPlotter

Setting up the system

  • Initial position & momentum of the test partcle

  • Spin of the Schwarzschild Black Hole (= 0)

  • Other solver parameters

Note that, we are working in M-Units (\(G = c = M = 1\)). Also, since the Schwarzschild spacetime has spherical symmetry, the values of the angular components do not affect the end result (We can always rotate our coordinate system to bring the geodesic in the equatorial plane). Hence, we set \(\theta = \pi / 2\) (equatorial plane), with initial \(p_\theta = 0\), which implies, that the geodesic should stay in the equatorial plane.

[2]:
position = [40, np.pi / 2, 0.]
momentum = [0., 0., 4.]
a = 0.
end_lambda = 20000.
step_size = 0.5

Calculating the geodesic, using the Julia back-end

[3]:
geod = Timelike(
    position=position,
    momentum=momentum,
    a=a,
    end_lambda=end_lambda,
    step_size=step_size,
    return_cartesian=True,
    julia=True
)

Plotting the geodesic

[4]:
gpl = GeodesicPlotter()
gpl.plot(geod)
gpl.show()