CoCalc Public FilesBHLectures / sage / Kerr_princ_null_geod.ipynb
Author: Eric Gourgoulhon
Views : 109
Compute Environment: Ubuntu 18.04 (Deprecated)

# Plot of principal null geodesics in Kerr spacetime

This Jupyter/SageMath worksheet is relative to the lectures Geometry and physics of black holes

Click here to download the worksheet file (ipynb format). To run it, you must start SageMath with the Jupyter notebook, with the command sage -n jupyter

In [1]:
%display latex

In [2]:
a = 0.5
m = 1
rp = m + sqrt(m^2-a^2)
rm = m - sqrt(m^2-a^2)
(rp,rm)

$\left(1.86602540378444, 0.133974596215561\right)$
In [3]:
f_in(r,v) = v - r
f_in

$\left( r, v \right) \ {\mapsto} \ -r + v$
In [4]:
f_out(r,u) = u + r + 2*m/sqrt(m^2-a^2)*(rp*ln(abs((r-rp)/(2*m))) - rm*ln(abs((r-rm)/(2*m))))
f_out

$\left( r, u \right) \ {\mapsto} \ r + u - 0.309401076758503 \, \log\left({\left| \frac{1}{2} \, r - 0.0669872981077807 \right|}\right) + 4.30940107675850 \, \log\left({\left| \frac{1}{2} \, r - 0.933012701892219 \right|}\right)$
In [5]:
rmin = -8; rmax = 8
graph = Graphics()
for u0 in range(-20, 20, 2):
graph += plot(f_out(r, u0), (r, rmin, rmax), color='green', ticks=2)

In [6]:
for v0 in range(-20, 20, 2):
graph += plot(f_in(r, v0), (r, rmin, rmax), color='green', linestyle='--')

In [7]:
H = line(((rp, -8), (rp, 8)), color='black', thickness=2) + \
text(r'$\mathscr{H}$', (rp+0.5, 4.7), color='black', fontsize=20)
Hin = line(((rm, -8), (rm, 8)), color='brown', thickness=2) + \
text(r'$\mathscr{H}_{\rm in}$', (rm+0.6, 4), color='brown', fontsize=20)
graph += H + Hin
show(graph, axes_labels=[r"$r/m$", r"$\tilde{t}/m$"], aspect_ratio=1, ymin=-5, ymax=5)

In [8]:
graph.save("ker_princ_null_geod.pdf", axes_labels=[r"$r/m$", r"$\tilde{t}/m$"],
aspect_ratio=1, ymin=-5, ymax=5)

In [ ]: