title: 'General relativity in R: visual representation of Schwarzschild space using different coordinate systems' authors: - affiliation: 1 name: Robin K. S. Hankin orcid: 0000-0001-5982-0415 date: "November 4th, 2019" output: pdf_document bibliography: ref.bib tags: - Schwarzschild metric - Schwarzschild solution - general relativity - black holes - event horizon - Eddington Finkelstein - Kruskal-Szekeres coordinates - Gullstrand-Painleve coordinates - Penrose diagram - Software infrastructure affiliations: - index: 1 name: Auckland University of Technology nocite: | @schutz2009, @carroll2019, @schwarzschild1916
In general relativity, Schwarzschild coordinates for a black hole have desirable properties such as asymptotic matching with flat-space spherical coordinates; but other coordinate systems can be used which have other advantages such as removing the non-physical coordinate singularity at the event horizon. Following Schwarzschild's original publication in 1916 of his spherically symmetrical solution to the vacuum Einstein field equations, a variety of coordinate transformations have been described that highlight different features of the Schwarzschild metric. These include: Kruskal-Szekeres [@kruskal1960;@szekeres1960], Eddington-Finkelstein [@eddington1924;@finkelstein1958], Gullstrand-Painleve [@painleve1921; @gullstrand1922], Lemaitre [@lemaitre1933], and various Penrose transforms with or without a black hole [@hawking1973]. These are described in many undergraduate GR textbooks such as Schutz (2009) and Carroll (2019).
The schwarzschild
package is a suite of visualization routines for
the coordinate systems mentioned above. It creates a large number of
mathematically accurate diagrams using the R programming language.
In the teaching of numerical subjects such as physics, mathematical
accuracy is an important requirement for informative diagrams.
However, many users of such diagrams will want the ability to
customise or otherwise modify them. In computer terminology, one would
need the source code as well as the final image and such source code
is not currently available. The schwarzschild
R package
[@rcore2019], available under the General Public License, fills this
need.
The package is intended as a resource for lecturers of general relativity and it is envisaged that the diagrams be used as visual teaching aids for understanding the Schwarzschild metric. A number of camera-ready PDF diagrams of black holes using a range of coordinate systems are presented as examples of the software's functionality; the software is extensively configurable to users' requirements.
The software has been used in two general relativity teaching contexts: firstly, as resources for astrophysics lectures at Auckland University of Technology; and secondly to support the Trin Tragula YouTube channel General relativity step by step which, as of October 2020 has over 150000 views and 1200 subscribers.
The schwarzschild
package presents structured R code with extensive
inline documentation as part of an educational resource package. The
package creates mathematically accurate diagrams illustrating
different aspects of physics near a spherically symmetric black hole.
Physical processes such as null geodesics and freely falling objects
near a Schwarzschild black hole are simulated in R and plotted as
usable and accurate PDF images.
\newcommand\latexcode[1]{#1}
The package defines over twenty functions that plot diagrams of
spacetime in the vicinity of a black hole. The principal such
function would be schwarzschild()
, which shows a spacetime diagram
near a non-spinning stationary black hole using Schwarzschild
coordinates but many other coordinate systems are available, including
Kruskal-Szekeres (kruskal()
and variants), \latexcode{Lema\^{\i}tre}
coordinates (lemaitre()
) and others.
The code itself is maintainable, extensible, and makes the connection between physics and plotted diagram explicit. The package is written to behave well in the wider ecology of R software.
Two example images are shown below in low-resolution JPG format. All nineteen vectorized PDF images can be seen in the package vignette or online through Microsoft Sharepoint.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.