metricGet_Schwarzschild

Description

Create the Schwarzschild spacetime in Cartesian coordinates.

Schwarzschild Metric

The classic Schwarzschild metric given in pseudo-Cartesian coordinates is:

ds2=(1rsr)2dt2+(x21rs/r+y2+z2)dx2r2+(x2+y21rs/r+z2)dy2r2+(x2+y2+z21rs/r)dz2r2+2rsr2(rrs)(xydxdy+xzdxdz+yzdydz),\begin{aligned} d s^2= & -\left(1-\frac{r_s}{r}\right)^2 d t^2+\left(\frac{x^2}{1-r_s / r}+y^2+z^2\right) \frac{d x^2}{r^2}+\left(x^2+\frac{y^2}{1-r_s / r}+z^2\right) \frac{d y^2}{r^2} \\ & +\left(x^2+y^2+\frac{z^2}{1-r_s / r}\right) \frac{d z^2}{r^2}+\frac{2 r_s}{r^2\left(r-r_s\right)}(x y d x d y+x z d x d z+y z d y d z), \end{aligned}

where rsr_s is the Schwarzschild radius.

For more details on the Schwarzschild metric please read the following reference (section 2.2.2) or any standard general relativity textbook:

Method

The metric is constructed using the Schwarzschild radius as a unitless pass-in value in Cartesian coordinates.

Syntax

[metric] = metricGet_Schwarzschild(gridSize,worldCenter,rs, gridScale)

Input Arguments

blue are required inputs.

orange are optional inputs with native default values.

blue are required inputs

InputsFormatTypeDescription

gridSize

1x4 array

integer

The size of the world specified as:

[t,x,y,z][t, x, y, z]

worldCenter

1x4 array

double

The center of the world, which defines the center of rsr_s as a 4-vector, specified as:

[t,x,y,z][t,x,y,z]

rs

1x1 array

double

Schwarzschild radius, in unitless form.

gridScale

1x4 array

double

Unit scaling factor of the grid dimensions defined relative to gridSize. This determines the resolution of the grid along each dimension. Specified as:

[tscale,xscale,yscale,zscale][t_{scale}, x_{scale}, y_{scale}, z_{scale}]

The default value is [1, 1, 1, 1].

Output Arguments

OutputsFormatTypeDescription

metric

struct

object

Schwarzschild solution returned as the metric tensor object.

Last updated