DifferentialGeometry Lessons - Maple Programming Help

Home : Support : Online Help : Mathematics : DifferentialGeometry : Lessons and Tutorials : DifferentialGeometry : DifferentialGeometry/LessonsAndTutorials/DifferentialGeometry/GettingStarted

DifferentialGeometry Lessons

Lesson 1: Getting Started

Overview

In this lesson, you will learn to do the following:

 – Create coordinate systems.
 – Change coordinates.
 – List existing coordinate systems.
 – Remove coordinate systems from the Maple session.
 – Obtain various attributes of a defined coordinate system.
 – Control simplification of the output from DifferentialGeometry commands.

DGsetup

All DifferentialGeometry sessions begin by executing the DGsetup command.  This command is used to setup the computation environment by creating coordinate systems, frames, Lie algebras, and so on.  The DGsetup command can be used many times within a given Maple session.

 > with(DifferentialGeometry):

We first use DGsetup to create a coordinate system for a 2-dimensional manifold.  We declare [x, y] to be the names of the coordinates and we name the manifold (or, more precisely, the coordinate patch for the manifold) E2.

 > DGsetup([x, y], E2, verbose);
 ${\mathrm{The following coordinates have been protected:}}$ $\left[{x}{,}{y}\right]$ ${\mathrm{The following vector fields have been defined and protected:}}$ $\left[{\mathrm{D_x}}{,}{\mathrm{D_y}}\right]$ ${\mathrm{The following differential 1-forms have been defined and protected:}}$ $\left[{\mathrm{dx}}{,}{\mathrm{dy}}\right]$ ${\mathrm{frame name: E2}}$ (2.1)

At this point, the coordinate names have been protected and cannot be assigned values.  The vectors D_x, D_y are assigned and protected; they define the coordinate basis for the tangent space of E2 at each point [x, y].  The differential 1-forms dx and dy are assigned and protected; they define the coordinate basis for the cotangent space of E2 at each point [x, y].

We will cover the basis operations involving vectors, forms and tensors in the next lesson.

Before proceeding, we remark that all the various geometric objects which arise in differential geometry have an internal representation within Maple which describes various attributes of the object as well as all the component values of the geometric object.  A detailed understanding of this internal representation is not required to use any of the DifferentialGeometry commands -- here we simply wish to make the user aware of its existence.  To display the internal representation of the vector field D_x and the 1-form dy, use the Maple lprint command.

 E2 > lprint(D_x);
 _DG([["vector", J2, []], [[[1], 1]]])
 J2 > lprint(dy);
 _DG([["form", J2, 1], [[[2], 1]]])

Notice that the internal representation of D_x clearly marks D_x as a geometric object of type "vector" attached to the manifold E2, while the internal representation of dy shows that dy is a "form" attached to the manifold E2 and has degree 1.

To create a rank 2 fiber bundle F over a 3 dimensional base manifold with base coordinates [x, y, z] and fiber coordinates [u, v], use the DGsetup command as follows:

 J2 > DGsetup([x, y, z], [u, v], F, verbose);
 ${\mathrm{The following coordinates have been protected:}}$ $\left[{x}{,}{y}{,}{z}{,}{u}{,}{v}\right]$ ${\mathrm{The following vector fields have been defined and protected:}}$ $\left[{\mathrm{D_x}}{,}{\mathrm{D_y}}{,}{\mathrm{D_z}}{,}{\mathrm{D_u}}{,}{\mathrm{D_v}}\right]$ ${\mathrm{The following differential 1-forms have been defined and protected:}}$ $\left[{\mathrm{dx}}{,}{\mathrm{dy}}{,}{\mathrm{dz}}{,}{\mathrm{du}}{,}{\mathrm{dv}}\right]$ ${\mathrm{frame name: F}}$ (2.2)

 F >

Note that the Maple prompt has changed to F.  Within the DifferentialGeometry environment, the Maple prompt changes to the name of the current or active coordinate system.  The name of the prompt always reflects the name of the coordinate system or manifold of the last computed object.

For example, as we shall see in Lesson 6, if F : M -> N is a transformation from a manifold M to a manifold N and a differential form alpha is defined on N, then the prompt is

N  >

If the command beta := Pullback(F, alpha) is executed, then the result, beta, is a differential form on M and the prompt changes to

M  >

To create the second-order jet space J^2(R^2, R) with independent variables [x, y] and dependent variable [u], use the DGsetup command with the following syntax:

 F > DGsetup([x, y], [u], J2, 2, verbose);
 ${\mathrm{The following coordinates have been protected:}}$ $\left[{x}{,}{y}{,}{{u}}_{{[}{]}}{,}{{u}}_{{1}}{,}{{u}}_{{2}}{,}{{u}}_{{1}{,}{1}}{,}{{u}}_{{1}{,}{2}}{,}{{u}}_{{2}{,}{2}}\right]$ ${\mathrm{The following vector fields have been defined and protected:}}$ $\left[{\mathrm{D_x}}{,}{\mathrm{D_y}}{,}{{\mathrm{D_u}}}_{{[}{]}}{,}{{\mathrm{D_u}}}_{{1}}{,}{{\mathrm{D_u}}}_{{2}}{,}{{\mathrm{D_u}}}_{{1}{,}{1}}{,}{{\mathrm{D_u}}}_{{1}{,}{2}}{,}{{\mathrm{D_u}}}_{{2}{,}{2}}\right]$ ${\mathrm{The following differential 1-forms have been defined and protected:}}$ $\left[{\mathrm{dx}}{,}{\mathrm{dy}}{,}{{\mathrm{du}}}_{{[}{]}}{,}{{\mathrm{du}}}_{{1}}{,}{{\mathrm{du}}}_{{2}}{,}{{\mathrm{du}}}_{{1}{,}{1}}{,}{{\mathrm{du}}}_{{1}{,}{2}}{,}{{\mathrm{du}}}_{{2}{,}{2}}\right]$ ${\mathrm{The following type \left[1,0\right] biforms have been defined and protected::}}$ $\left[{\mathrm{Dx}}{,}{\mathrm{Dy}}\right]$ ${\mathrm{The following type \left[0,1\right] biforms \left(contact 1-forms\right) have been defined and protected::}}$ $\left[{{\mathrm{Cu}}}_{{[}{]}}{,}{{\mathrm{Cu}}}_{{1}}{,}{{\mathrm{Cu}}}_{{2}}{,}{{\mathrm{Cu}}}_{{1}{,}{1}}{,}{{\mathrm{Cu}}}_{{1}{,}{2}}{,}{{\mathrm{Cu}}}_{{2}{,}{2}}\right]$ ${\mathrm{frame name: J2}}$ (2.3)

In this context, the dependent variable u is now referred to as u[ ], the derivative of u with respect to x is u[1], the derivative of u with respect to y is u[2], the second derivative of u with respect to x is u[1,1] and so on.

To suppress the display of the protected variables, vector fields, and differential 1-forms, run DGsetup with the quiet option.

 J2 > DGsetup([x, y, z], E3, quiet);
 ${\mathrm{frame name: E3}}$ (2.4)

This option, together with options for controlling the format of the Maple prompt, can be set using the Preferences command.

DGinfo

The DGinfo command is located in the Tools package of DifferentialGeometry.  This utility program can be used to retrieve information about any object created by the DifferentialGeometry package.  Here are a few examples.

List all the coordinate systems defined in the current Maple session.

 E3 > Tools:-DGinfo("FrameNames");
 $\left[{\mathrm{E2}}{,}{\mathrm{E3}}{,}{F}{,}{\mathrm{J2}}\right]$ (3.1)

Obtain the name of the active frame/coordinate system.

 E3 > Tools:-DGinfo("CurrentFrame");
 ${\mathrm{E3}}$ (3.2)

Obtain the dimensions of the base manifold and of the fiber space of the fiber bundle.

 E3 > Tools:-DGinfo(F, "FrameBaseDimension");
 ${3}$ (3.3)
 E3 > Tools:-DGinfo(F, "FrameFiberDimension");
 ${2}$ (3.4)

Obtain the coordinate basis for the tangent space of the manifold E3.

 E3 > Tools:-DGinfo(E3, "FrameBaseVectors");
 $\left[{\mathrm{D_x}}{,}{\mathrm{D_y}}{,}{\mathrm{D_z}}\right]$ (3.5)

ChangeFrame and RemoveFrame

The command ChangeFrame is used to change the active frame.

 E3 > Tools:-DGinfo("CurrentFrame");
 ${\mathrm{E3}}$ (4.1)

 E3 > ChangeFrame(J2);
 ${\mathrm{E3}}$ (4.2)
 J2 > Tools:-DGinfo("CurrentFrame");
 ${\mathrm{J2}}$ (4.3)

The command RemoveFrame removes a frame from Maple memory (the number of remaining frames is returned) and unassigns and unprotects the names associated to that frame.

 J2 > Tools:-DGinfo("FrameNames");
 $\left[{\mathrm{E2}}{,}{\mathrm{E3}}{,}{F}{,}{\mathrm{J2}}\right]$ (4.4)
 J2 > RemoveFrame(F);
 ${3}$ (4.5)
 E2 > Tools:-DGinfo("FrameNames");
 $\left[{\mathrm{E2}}{,}{\mathrm{E3}}{,}{\mathrm{J2}}\right]$ (4.6)

Simplification

Prior to displaying the result of a computation, most DifferentialGeometry commands simplify the result using the Maple simplify command.  The user may control this simplification using the Preferences command.

 E2 > a := (x^2)^(1/2);
 ${a}{≔}\sqrt{{{x}}^{{2}}}$ (5.1)
 E2 > simplify(a);
 ${\mathrm{csgn}}{}\left({x}\right){}{x}$ (5.2)

Let us multiply the vector field D_x by the scalar a.  We see that the result has been simplified using the Maple command simplify.

 E2 > a &mult D_x;
 ${\mathrm{csgn}}{}\left({x}\right){}{x}{}{\mathrm{D_x}}$ (5.3)

Let us define a new simplify procedure, NewSimplify, and use the Preferences command to dictate that NewSimplify is to be used to simplify the output of all DifferentialGeometry commands.

 E2 > NewSimplify := proc(x) simplify(x, symbolic) end:
 E2 > Preferences("simplification", NewSimplify);
 ${\mathbf{proc}}\left({s}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}$ (5.4)

Let us multiply the vector field D_x by the scalar a again.  We see that the result has been simplified using the user defined command NewSimplify.

 E2 > a &mult D_x;
 ${x}{}{\mathrm{D_x}}$ (5.5)

Here is another example.

 E2 > b := sin(2*x);
 ${b}{≔}{\mathrm{sin}}{}\left({2}{}{x}\right)$ (5.6)
 E2 > b &mult D_x;
 ${\mathrm{sin}}{}\left({2}{}{x}\right){}{\mathrm{D_x}}$ (5.7)
 E2 > NewSimplify2 := proc(x) expand(x) end:
 E2 > Preferences("simplification", NewSimplify2);
 ${\mathbf{proc}}\left({x}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{simplify}}{}\left({x}{,}{\mathrm{symbolic}}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}$ (5.8)
 E2 > b &mult D_x;
 ${2}{}{\mathrm{sin}}{}\left({x}\right){}{\mathrm{cos}}{}\left({x}\right){}{\mathrm{D_x}}$ (5.9)

The user can similarly control how DifferentialGeometry invokes dsolve, pdsolve and a number of LinearAlgebra procedures.  Before continuing, we reset the simplification to its default procedure.

 E2 > Preferences("simplification",simplify):

Exercises

Exercise 1

Create a coordinate system called M4 with coordinates x, y, z, t.

 E2 > with(DifferentialGeometry):

Solution

 E2 > DGsetup([x, y, z, t], M4);
 ${\mathrm{frame name: M4}}$ (6.1.1.1)

Exercise 2

Create a coordinate system that you would need to study first order variational problems for curves in the plane.

 M4 > with(DifferentialGeometry):

Solution

There are two possibilities here depending on whether the curve is to be described as a graph of a function y = f(x) or parametrically as [x(t), y(t)].

 M4 > DGsetup([x], [y], E2, 1, verbose);
 ${\mathrm{The following coordinates have been protected:}}$ $\left[{x}{,}{{y}}_{{[}{]}}{,}{{y}}_{{1}}\right]$ ${\mathrm{The following vector fields have been defined and protected:}}$ $\left[{\mathrm{D_x}}{,}{{\mathrm{D_y}}}_{{[}{]}}{,}{{\mathrm{D_y}}}_{{1}}\right]$ ${\mathrm{The following differential 1-forms have been defined and protected:}}$ $\left[{\mathrm{dx}}{,}{{\mathrm{dy}}}_{{[}{]}}{,}{{\mathrm{dy}}}_{{1}}\right]$ ${\mathrm{The following type \left[1,0\right] biforms have been defined and protected::}}$ $\left[{\mathrm{Dx}}\right]$ ${\mathrm{The following type \left[0,1\right] biforms \left(contact 1-forms\right) have been defined and protected::}}$ $\left[{{\mathrm{Cy}}}_{{[}{]}}{,}{{\mathrm{Cy}}}_{{1}}\right]$ ${\mathrm{frame name: E2}}$ (6.2.1.1)
 E2 > DGsetup([t], [x, y], P, 1, verbose);
 ${\mathrm{The following coordinates have been protected:}}$ $\left[{t}{,}{{x}}_{{[}{]}}{,}{{y}}_{{[}{]}}{,}{{x}}_{{1}}{,}{{y}}_{{1}}\right]$ ${\mathrm{The following vector fields have been defined and protected:}}$ $\left[{\mathrm{D_t}}{,}{{\mathrm{D_x}}}_{{[}{]}}{,}{{\mathrm{D_y}}}_{{[}{]}}{,}{{\mathrm{D_x}}}_{{1}}{,}{{\mathrm{D_y}}}_{{1}}\right]$ ${\mathrm{The following differential 1-forms have been defined and protected:}}$ $\left[{\mathrm{dt}}{,}{{\mathrm{dx}}}_{{[}{]}}{,}{{\mathrm{dy}}}_{{[}{]}}{,}{{\mathrm{dx}}}_{{1}}{,}{{\mathrm{dy}}}_{{1}}\right]$ ${\mathrm{The following type \left[1,0\right] biforms have been defined and protected::}}$ $\left[{\mathrm{Dt}}\right]$ ${\mathrm{The following type \left[0,1\right] biforms \left(contact 1-forms\right) have been defined and protected::}}$ $\left[{{\mathrm{Cx}}}_{{[}{]}}{,}{{\mathrm{Cy}}}_{{[}{]}}{,}{{\mathrm{Cx}}}_{{1}}{,}{{\mathrm{Cy}}}_{{1}}\right]$ ${\mathrm{frame name: P}}$ (6.2.1.2)

Exercise 3

Create a coordinate system that you would need in order to calculate the point symmetries of the heat equation u_t = u_xx.

Solution

 P > DGsetup([t, x], [u], Heat, 2, verbose);
 ${\mathrm{The following coordinates have been protected:}}$ $\left[{t}{,}{x}{,}{{u}}_{{[}{]}}{,}{{u}}_{{1}}{,}{{u}}_{{2}}{,}{{u}}_{{1}{,}{1}}{,}{{u}}_{{1}{,}{2}}{,}{{u}}_{{2}{,}{2}}\right]$ ${\mathrm{The following vector fields have been defined and protected:}}$ $\left[{\mathrm{D_t}}{,}{\mathrm{D_x}}{,}{{\mathrm{D_u}}}_{{[}{]}}{,}{{\mathrm{D_u}}}_{{1}}{,}{{\mathrm{D_u}}}_{{2}}{,}{{\mathrm{D_u}}}_{{1}{,}{1}}{,}{{\mathrm{D_u}}}_{{1}{,}{2}}{,}{{\mathrm{D_u}}}_{{2}{,}{2}}\right]$ ${\mathrm{The following differential 1-forms have been defined and protected:}}$ $\left[{\mathrm{dt}}{,}{\mathrm{dx}}{,}{{\mathrm{du}}}_{{[}{]}}{,}{{\mathrm{du}}}_{{1}}{,}{{\mathrm{du}}}_{{2}}{,}{{\mathrm{du}}}_{{1}{,}{1}}{,}{{\mathrm{du}}}_{{1}{,}{2}}{,}{{\mathrm{du}}}_{{2}{,}{2}}\right]$ ${\mathrm{The following type \left[1,0\right] biforms have been defined and protected::}}$ $\left[{\mathrm{Dt}}{,}{\mathrm{Dx}}\right]$ ${\mathrm{The following type \left[0,1\right] biforms \left(contact 1-forms\right) have been defined and protected::}}$ $\left[{{\mathrm{Cu}}}_{{[}{]}}{,}{{\mathrm{Cu}}}_{{1}}{,}{{\mathrm{Cu}}}_{{2}}{,}{{\mathrm{Cu}}}_{{1}{,}{1}}{,}{{\mathrm{Cu}}}_{{1}{,}{2}}{,}{{\mathrm{Cu}}}_{{2}{,}{2}}\right]$ ${\mathrm{frame name: Heat}}$ (6.3.1.1)

Exercise 4

Use DGinfo to obtain the coordinate basis for the cotangent bundle for the manifold M4 defined in Exercise 1.

Solution

 Heat > Tools:-DGinfo(M4, "FrameBaseForms");
 $\left[{\mathrm{dx}}{,}{\mathrm{dy}}{,}{\mathrm{dz}}{,}{\mathrm{dt}}\right]$ (6.4.1.1)

Exercise 5

Write a program, test, which will return true if the input is the name of a defined coordinate system and false otherwise.

Hint: ?member

Solution

 M4 > test := proc(N)
 M4 > local Frame;
 M4 > Frame := Tools:-DGinfo("FrameNames");
 M4 > member(N, Frame);
 M4 > end:
 M4 >
 M4 > test(M4);
 ${\mathrm{true}}$ (6.5.1.1)
 M4 > test(M5);
 ${\mathrm{false}}$ (6.5.1.2)

Exercise 6

Change the DifferentialGeometry simplification procedure so that no simplification whatsoever occurs prior to output.  Use the following calculation as a check.

 M4 > ((1/x) &mult D_x) &plus ((1/x^2) &mult D_x);
 $\frac{\left({1}{+}{x}\right){}{\mathrm{D_x}}}{{{x}}^{{2}}}$ (6.6.1)

Solution

 M4 > NoSimplify := x ->x ;
 ${\mathrm{NoSimplify}}{≔}{x}{→}{x}$ (6.6.1.1)
 M4 > Preferences("simplification", NoSimplify);
 ${\mathbf{proc}}\left({s}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}$ (6.6.1.2)
 M4 > ((1/x) &mult D_x) &plus ((1/x^2) &mult D_x);
 $\left(\frac{{1}}{{{x}}^{{2}}}{+}\frac{{1}}{{x}}\right){}{\mathrm{D_x}}$ (6.6.1.3)
 M4 >