Geodesics generalize the idea of straight lines in a plane to curved surfaces. They are the paths taken by objects that move freely, without acceleration. They are determined by the geodesic equation
where s is the invariant interval measured along the geodesics and repeated indices are summed. The Christoffel symbols in the equation are defined in terms of a metric tensor by
As a step towards meaningful visualizations of geodesics for general relativistic metrics, this presentation will consider geodesics for two-dimensional surfaces embedded in our three-dimensional space. This means that given a parametrization of a surface in terms of two independent variables
the expression for the square of the invariant interval formed by summing squared differentials of the parametrized dependent variables reduces to two dimensions:
This expression in general has three terms with coefficient functions depending on both independent variables. The two-dimensional metric tensor and its inverse are
In the general case there are six independent Christoffel symbols, where derivatives with respect to the two variables are denoted by numerical indices:
One can now easily construct the two geodesic equations using these symbols, remembering to include a factor of two due to symmetry whenever symbols with differing lower indices occur.
Since many people consider evaluating Christoffel symbols to be tedious, it is worth pointing out that there is an alternative method for deriving geodesic equations. Define a Lagrangian for the metric as
where the dot is differentiation with respect to invariant interval, and evaluate the Lagrange equations
This process is entirely equivalent to the one requiring explicit statement of Christoffel symbols and perhaps a bit less error prone. The explicit Lagrange equations are
Expanding the left-hand sides and rearranging
so that the second derivatives of the independent variables are
One can easily verify that the quantities on the right-hand side are the negatives of the Christoffel symbols previously calculated, allowing for the extra factor of two mentioned above for those with differing lower indices.
For the purposes of visualization, there is no need to simplify any further: all the functions involved can be written in code and evaluated as is. Since the set of resulting equations is nonlinear for nontrivial metrics, numerical integration is in any case generally necessary for a solution.
A good starting point is a spherical surface of radius a that can be parametrized with
The corresponding two-dimensional metric is
Not only is the off-diagonal component zero, but the first metric coefficient is constant and the other depends on only one independent variable. The geodesic equations are relatively simple:
Note that these equations are independent of the radius. That parameter is here merely an overall scaling factor for the transformation to three dimensions, but will be included for consistency with later surfaces.
Numerical integration for an arbitrary starting point and a spray of geodesics around it:
The geodesics visibly trace out a spherical surface from any starting point. All of these geodesics are closed great circles on the sphere. Closed geodesics do not occur in general on arbitrary surfaces, which will become evident with more complicated cases.
One curiosity of the code for this graphic is how the initial velocities are assigned in the two-dimensional angular space. Since the differential of v is multiplied by
Further, the regions around u = 0 and u = π are avoided due to the singularity in the second geodesic equation. The same applies to the initial velocities, where a small offset is used to avoid passing through these poles. This will no longer be necessary when adaptive Runge-Kutta integration is added to Math.
The embedding of this surface in three-dimensional space is easily shown by parametrizing an arbitrary point in three-dimensional space as
and evaluating the corresponding metric:
This is the metric of a flat three-dimensional space expressed in spherical coordinates. The metric of the spherical surface by contrast has only the two dimensions parametrized by angles. The restriction of the radius to a constant value is what produces the curvature of the surface in its ambient three-dimensional space.
A generalization of the simple spherical surface is an ellipsoid of revolution parametrized with
with an independent scaling factor in the z direction. The metric formed by summing squared differentials is
This metric is diagonal like the last but with functional dependence for the first metric function. The geodesic equations are a bit more complicated:
Simplification is possible for the first equation, but it will be left in this form to avoid introducing additional singularities. It reduces to the first equation for the spherical surface when as expected.
Numerical integration for an arbitrary starting point and a spray of geodesics around it:
The geodesics now visibly trace out an ellipsoid of rotation from any starting point. One major difference from the spherical surface is that these geodesics do not in general close upon themselves, but cover the surface densely as the maximum interval is increased. The initial velocities are again divided by their factors in the metric to reduce artifacts from the coordinate system.
A further generalization of the spherical surface is an ellipsoid parametrized with
where there are now three independent constants scaling each axial direction. The metric formed by summing squared differentials is
All metric functions here are nonzero and dependent on both variables of parametrization. The corresponding geodesic equations are so complicated that there is not much point in writing them out in full, apart from in the code itself.
Numerical integration for an arbitrary starting point and a spray of geodesics around it:
The geodesics now trace out a general ellipsoid from any starting point. Simplifications with double-angle identities are used in the code to reduce function calls, but this beast still can take some time to evaluate. The equations are mathematically less stable under numerical integration than the previous two examples, so input parameter ranges have been restricted.
This last example indicates how one can visualize geodesics for any complicated two-dimensional surface. The underlying code already has the full geodesic equations for the general case. All that would need to change for other surfaces is the set of metric function definitions and their partial derivatives in the code.
The remainder of this presentation will visualize a couple less complicated compact surfaces for which the geodesic equations are easily expressed. While one can visualize noncompact surfaces similarly, the results are less striking than for compact surfaces because geodesics mostly run off to infinity.
The surface of a torus can be parametrized with
where and the first angular variable runs from the top of the torus around the circumference of the tube. The metric formed by summing squared differentials is
The metric is diagonal and depends on only one angular variable. The geodesic equations are
and do not have singularities in the first angular variable, unlike the surfaces of the sphere and ellipsoid of revolution, as long as a is nonzero.
Numerical integration for an arbitrary starting point and a spray of geodesics around it:
Like the sphere, a toroidal surface can have closed geodesics, but they are special cases. One is visible with the default settings: experiment a bit to find others.
A surface similar to an ellipsoid can be generated by revolution of the ovals of Cassini. Like ellipses these ovals are defined with respect to two centers or foci. For an ellipse the sum of distances to the foci is constant, but for the ovals of Cassini it is the product of the distances. If the foci lie on the x-axis equal distances from the origin, the ovals have the implicit equation
A parametrization of the curves is found by setting
and solving for the introduced radial variable as a function of angle:
The domain of the angular variable u and signs of radicals are chosen to keep the expression real, and that depends on the relative values of the two parameters. When
the entire angular domain
to keep the inner radical real, and all four combinations of signs are necessary to draw the entire curve, except for the the special case where only the inner positive sign can be used. Here is how the curve looks as the parameters are varied:
The ovals becomes circles in the limit for fixed a, as well as for nonzero b.
A surface of revolution can be formed by rotation about either the z-axis as for the ellipsoid above or about the x-axis. In the interest of possible future application, the latter will be chosen, with the parametrization
with the restriction for simplicity. The metric formed by summing squared differentials is
Like the ellipsoid of rotation and the torus, the metric is diagonal and depends on only one angular variable. As an aside, for revolution about the z-axis the sine here would be replaced by a cosine.
The geodesic equations for the chosen axis of revolution are
The second equation has singularities in the first angular variable like the surfaces of the sphere and ellipsoid of revolution. Differentiating the defining equation for gives
from which one can find
The geodesic equations then can be written fairly compactly as
with the ratio defined above. As a check, since for either or , these equations become those for the spherical surface in both limits as expected.
Numerical integration for an arbitrary starting point and a spray of geodesics around it:
The geodesics for will be left as a possible future addition.
Uploaded 2018.04.03 — Updated 2019.11.24 analyticphysics.com