GeodesicGeometry
GeodesicGeometry is a Mathematica 6.0
package that allows you to visualize certain aspects of
arbitrary spacetimes. It provides the following functions:
- PlotNullSpray plots a spray of null geodesics.
- PlotNullBundle plots a bundle of null geodesics.
- PlotTimelikeSpray plots a spray of timelike geodesics.
- PlotTimelikeBundle plots a bundle of timelike geodesics.
- PlotNullCone plots the surfaces made up of all null vectors in
the tangent space at the position specified.
- PlotPathWithNullCones plots a path interpolating the given
positions along with the corresponding cones at every point.
Download
GeodesicGeometry is available as an archive containing a
Mathematica package:
GeodesicGeometry-0.05.tar.bz2
Examples
Minkowski Spacetime
To visualize the Minkowski spacetime, we first load the package
and then construct a GeodesicGeometry object from the
line element:
Needs["GeodesicGeometry`"]
minkowski = GeodesicGeometry[
{t, x, y, z},
{dt, dx, dy, dz},
dt^2 - dx^2 - dy^2 - dz^2];
We can use this object to plot, say, all null geodesics
emanating from the origin with their initial velocity vector
evenly distributed in the xyt hypersurface:
PlotNullSpray[minkowski, {0, 0, 0, 0},
Table[{Cos[v], Sin[v], 0}, {v, 0, 2 \[Pi], \[Pi]/8}],
ParameterRange -> {0, 10}, PlotCoordinates -> {x, y, t}]
The first parameter of PlotNullSpray is the object
constructed above. The second one is the position in spacetime the
geodesics should start at. The third one is the so called table of initial
velocity templates. When given in the form of a list of three-element
lists like above, it specifies the spatial components of the initial
velocities of the geodesics. The missing temporal component is chosen in
such a way that the length of the whole vector is null. The resulting
bundles of geodesics represent the past- and the future-directed solutions.
We can also plot light cones:
PlotNullCone[minkowski, {0, 0, 0, 0}, PlotCoordinates -> {x, y, t},
SolveCoordinate -> t]
The SolveCoordinate option specifies which variable the
cone equation should be solved for. Often, some choices of solve variables
yield better results than others.
Gödel spacetime
Let's take a look at a more interesting spacetime, Gödel's
universe:
Needs["GeodesicGeometry`"]
Needs["VectorAnalysis`"]
goedelCylindrical = GeodesicGeometry[
{s, r, \[Phi], z},
{ds, dr, d\[Phi], dz},
ds^2 - dr^2 - dz^2 + (Sinh[r]^4 - Sinh[r]^2) d\[Phi]^2 +
2 Sqrt[2] Sinh[r]^2 d\[Phi] ds];
Geodesics emanating from near the origin:
start = {0, 0.00001, 0, 0};
PlotNullSpray[goedelCylindrical, start,
Table[{Cos[v], Sin[v]/start[[2]], 0}, {v, 0, 2 \[Pi], \[Pi]/16}],
ParameterRange -> {0, 4},
PlotCoordinates -> {r, \[Phi], s},
PlotCoordinateTransformation -> (CoordinatesToCartesian[#1, Cylindrical] &)][[2]]
Null and timelike geodesics (blue and red, respectively) emanating from
the same point:
nullSpray =
PlotNullSpray[goedelCylindrical, {0, 0.8, 0, 0},
Table[{Cos[v], Sin[v], 0}, {v, 0, 2 \[Pi], \[Pi]/8}],
ParameterRange -> {0, 3},
PlotCoordinates -> {r, \[Phi], s},
PlotCoordinateTransformation -> (CoordinatesToCartesian[#1, Cylindrical] &)];
timelikeSpay =
PlotTimelikeSpray[goedelCylindrical, {0, 0.8, 0, 0},
Table[{Cos[v], Sin[v], 0}, {v, 0, 2 \[Pi], \[Pi]/8}],
ParameterRange -> {0, 2},
PlotCoordinates -> {r, \[Phi], s},
PlotCoordinateTransformation -> (CoordinatesToCartesian[#1, Cylindrical] &)];
Show[nullSpray[[2]], timelikeSpay[[2]], PlotRange -> Automatic]
Some light cones:
conesCircular =
Table[
PlotNullCone[goedelCylindrical, {0, 1.2, \[Phi]start, 0},
PlotCoordinates -> {r, \[Phi], s},
SolveCoordinate -> s,
PlotRangeOffsets -> 0.2,
PlotCoordinateSystem -> Cylindrical],
{\[Phi]start, -3/4 \[Pi], \[Pi], \[Pi]/ 4}];
conesRadial =
Table[
PlotNullCone[goedelCylindrical, {0, rstart, \[Phi]start, 0},
PlotCoordinates -> {r, \[Phi], s},
SolveCoordinate -> s,
PlotRangeOffsets -> {0.2, 0.2, If[rstart == 0, \[Pi], 0.2], 0.2},
PlotCoordinateSystem -> Cylindrical],
{rstart, 0, 0.6, 0.6}, {\[Phi]start, 0, \[Pi], \[Pi]}];
Show[{conesCircular, conesRadial}, PlotRange -> All]
And finally a famous combination of geodesics and light cones:
spray = PlotNullSpray[goedelCylindrical, start,
Table[{Cos[v], Sin[v]/start[[2]], 0}, {v, 0, 2 \[Pi], \[Pi]/8}],
ParameterRange -> {0, 3.5},
PlotCoordinates -> {r, \[Phi], s},
PlotCoordinateTransformation -> (CoordinatesToCartesian[#1, Cylindrical] &)][[2]];
cones = Table[
PlotNullCone[goedelCylindrical, position,
PlotCoordinates -> {r, \[Phi], s},
SolveCoordinate -> s,
PlotRangeOffsets -> {0.1, 0.1, If[Abs[position[[2]]] < 0.1, \[Pi], 0.1/position[[2]]], 0.1},
PlotCoordinateSystem -> Cylindrical],
{position, {{0, start[[2]], 0, 0}, {1.3, start[[2]], 0, 0},
{0.63, 0.88, 0, 0}, {0.63, 1.32, 0, 0}, {0.63, 0.44, 0, 0},
{0.63, start[[2]], 0, 0}, {0.63, -0.44, 0, 0},
{0.63, -0.88, 0, 0}, {0.63, -1.32, 0, 0},
{0.63, 1.32, 1/2 \[Pi], 0}, {0.63, 1.32, 3/2 \[Pi], 0}}}];
ccc = ParametricPlot3D[
CoordinatesToCartesian[{1.32, \[Phi], 0.63}, Cylindrical],
{\[Phi], 0, 2 \[Pi]}, PlotStyle -> Directive[Red, Thick]];
Show[{spray, cones, ccc}, PlotRange -> All,
ViewPoint -> {1.3, -3.2, 0.8}]
|