Visualizing advancement of perihelion in Schwarzschild space-time¶
[1]:
import numpy as np
import astropy.units as u
from plotly.offline import init_notebook_mode
from einsteinpy.plotting import GeodesicPlotter
from einsteinpy.coordinates import SphericalDifferential
from einsteinpy.bodies import Body
from einsteinpy.geodesic import Geodesic
[2]:
init_notebook_mode(connected=True)
# Essential when using Jupyter Notebook (May skip in Jupyter Lab)
Defining various parameters¶
Mass of the attractor(M)
Initial position and velocity vectors of test partcle
[3]:
Attractor = Body(name="BH", mass=6e24 * u.kg, parent=None)
sph_obj = SphericalDifferential(130*u.m, np.pi/2*u.rad, -np.pi/8*u.rad,
0*u.m/u.s, 0*u.rad/u.s, 1900*u.rad/u.s)
Object = Body(differential=sph_obj, parent=Attractor)
geodesic = Geodesic(body=Object, time=0 * u.s, end_lambda=0.002, step_size=5e-8)
Plotting the trajectory¶
[4]:
obj = GeodesicPlotter()
obj.plot(geodesic)
obj.show()
It can be seen that the orbit advances along the azimuth angle on each revolution of test partcle .