Demo for Affine.m
Andrew D. Lewis
Department of Mathematics and Statistics
Queen's University
Kingston ON K7L 3N6
Canada

andrew@mast.queensu.ca

This is a set of Mathematica commands for performing basic operations in affine differential geometry.  This is an initial implementation, and will hopefully be improved upon as time goes by.

Reference: Geometric Control of Mechanical Systems.  Modeling, Analysis, and Design for Simple Mechanical Control Systems
                      Francesco Bullo and Andrew D. Lewis
                       http://penelope.mast.queensu.ca/smcs/
       January 2003

<< Affine.m

Note that the package \package{Tensors.m} is loaded.  Please see the documentation for that package to use its features.  To get help, type ?command

?AlongCurve

Riemannian geometry specifics

The metric can be used to convert vector fields to covector fields, and vice versa, in the usual manner.  The rule is ``Sharp raises the index (i.e., converts a covector field to a vector field) and flat lowers the index (i.e., converts a vector field to a covector field).''

g  =  {{1, 0}, {0, r^2}}

{{1, 0}, {0, (r^2)}}

alpha  =  {0, 1}

X  =  RiemannSharp[alpha, g]

RiemannFlat[X, g]

A special instance of the flat map is the gradient, and there is a special purpose function for it.

f  =  r Cos[theta]

q  =  {r, theta}

Grad[f, g, q]

The Levi-Civita Christoffel symbols can be computed using a set of coordinates and the components of the Riemannian metric.

conn  =  LeviCivita[g, q]

Affine differential geometry basics

The standard covariant derivative of vector fields is computed as follows.

X  =  {Cos[theta], r^2}

Y  =  {Sin[theta], 1/r}

Then one computes the covariant derivative of $Y$ with respect to $X$, using the Christoffel symbols for the connection.

CovariantDerivative[X, Y, conn, q]

The symmetric product is a useful operation for dealing with simple mechanical control systems, and its function works much like the covariant derivative.

SymmetricProduct[X, Y, conn, q]

The covariant derivative of a general tensor can also be computed.  See the documentation for \package{Tensors.m} to see how tensors can be defined, and how they are stored by our packages.  One should specify the tensor one is covariantly differentiating, the Christoffel symbols of the connection, the coordinates, and the type of the tensor.

nablag  =  CovariantDifferential[g, conn, q, {0, 2}]

Note that, if the tensor is of type $(r,s)$, then what comes out is a tensor of type $(r,s+1)$.  To produce the covariant derivative of the tensor with respect to a vector field (i.e., a tensor field of type $(r,s)$), one can use the EvaluateTensor function that is part of the \package{Tensors.m} package.

EvaluateTensor[nablag, {X}, {1, 2}, {{}, {1, 2}}]

In like manner one can compute the covariant derivative of a tensor field along a curve.  This requires specifying the coordinate functions of time that define the curve.  The variable parameterizing time is an argument, so can be whatever is desired.

gamma  =  {r[t], theta[t]}

Upsilon  =  D[gamma, t]

AlongCurve[Upsilon, conn, gamma, t, {1, 0}]

Note that the result in this case has been contrived to be the components of the geodesic equations in second-order form.

The geodesic spray can be computed by using velocity coordinates.

v  =  D[gamma, t]

Z  =  Spray[conn, gamma, v]

Note that what is returned are the components of a vector field on the tangent bundle in natural coordinates.

Torsion and curvature

These commands are all pretty basic.  Some of them reflect mathematical constructions not defined in the text.  We refer the reader to \cite{SK/KN:63ab} for discussions of undefined terms.

TorsionTensor[conn, q]

CurvatureTensor[conn, q]

RicciCurvature[conn, q]

Scalar and sectional curvature are defined only for Levi-Civita connections.

ScalarCurvature[g, q]

The sectional curvature requires the specification of two orthonormal tangent vectors to prescribe a two-dimensional subspace.

e1  =  {1, 0}

e2  =  {0, 1/r}

SectionalCurvature[e1, e2, g, q]