Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

SageMath notebooks associated to the Black Hole Lectures (https://luth.obspm.fr/~luthier/gourgoulhon/bh16)

Project: BHLectures
Views: 20113
Kernel: SageMath 9.1.beta8

Timelike and spacelike geodesics

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

%display latex
M = Manifold(4, 'M') X.<t,x,y,z> = M.chart() X
h = var('h') C = M.curve([t, h*t*(1-t), 0, 0], (t,0,1)) C
C.coord_expr()
p = M((0,0,0,0), name='p') q = M((1,0,0,0), name='q')
graph = Graphics() for hval in [-0.75, -0.5, -0.25, 0, 0.25, 0.5, 0.75]: graph += C.plot(ambient_coords=(x,t), parameters={h: hval}, thickness=2) graph += p.plot(ambient_coords=(x,t), size=60, label_offset=0.04, fontsize=24) graph += q.plot(ambient_coords=(x,t), size=60, label_offset=0.04, fontsize=24) show(graph, aspect_ratio=1, xmin=-1/2, xmax=1/2, axes_labels=[r'$x/T$', r'$t/T$'], fontsize=14)
Image in a Jupyter notebook
graph.save('geo_timelike_h.pdf', aspect_ratio=1, xmin=-1/2, xmax=1/2, axes_labels=[r'$x/T$', r'$t/T$'], fontsize=14)
C = M.curve([h*x*(1-x), x, 0, 0], (x,0,1)) C.coord_expr()
q = M((0,1,0,0), name='q') graph = Graphics() for hval in [-0.75, -0.5, -0.25, 0, 0.25, 0.5, 0.75]: graph += C.plot(ambient_coords=(x,t), parameters={h: hval}, thickness=2) graph += p.plot(ambient_coords=(x,t), size=60, label_offset=0.04, fontsize=24) graph += q.plot(ambient_coords=(x,t), size=60, label_offset=0.03, fontsize=24) show(graph, aspect_ratio=1, axes_labels=[r'$x/L$', r'$t/L$'], fontsize=14)
Image in a Jupyter notebook
graph.save('geo_spacelike_h.pdf', aspect_ratio=1, axes_labels=[r'$x/L$', r'$t/L$'], fontsize=14)