DifferentialGeometry[Preferences]
|
Calling Sequence
|
|
Preferences(keyword)
Preferences(keyword, value)
|
|
Parameters
|
|
keyword
|
-
|
a string, the name of the particular preference
|
value
|
-
|
the value to be assigned to the preference
|
|
|
|
|
Description
|
|
•
|
This command allows the user to control various display conventions used by the DifferentialGeometry package; to specify the LaTeX formatting of DifferentialGeometry objects such as vectors, differential forms and tensors; and to specify how commonly used Maple commands are used internally by DifferentialGeometry procedures.
|
•
|
The following are the admissible keywords strings:
|
•
|
The paragraphs below describes the use of each of these keywords.
|
•
|
This command is part of the DifferentialGeometry package, and so can be used in the form Preferences(...) only after executing the command with(DifferentialGeometry). It can always be used in the long form DifferentialGeometry:-Preferences.
|
|
|
Details
|
|
|
"DisplayFrameDefinitions"
|
|
This preference controls what information is displayed when the command DGsetup is executed. When this preference is false, no display is displayed. When this preference is true, the names of the coordinate variables and the labels for the frame vectors and coframe 1-forms are displayed. The default preference is false.
>
|
with(DifferentialGeometry):
|
>
|
Preferences("DisplayFrameDefinitions");
|
| (1) |
>
|
DGsetup([x, y, z], E3);
|
| (2) |
>
|
Preferences("DisplayFrameDefinitions", true);
|
| (3) |
>
|
DGsetup([x, y, z], E3);
|
| (4) |
|
|
"ErrorInfoLevel"
|
|
This preference controls the amount of information provided by an error message from a DifferentialGeometry command. The default for ErrorInfoLevel is 1.
|
|
"ErrorPrintLength"
|
|
For many of the error messages returned by the DifferentialGeometry commands, it is not necessary to display all the component information of the vectors, differential forms, and tensors provided as input. By suppressing the component information, the error messages are generally much easier to read. The ErrorPrintLength preference controls the number of components which will be displayed -- the first k components will be displayed if the sum of their lengths does not exceed the integer specified by the ErrorPrintLength preference. The length of each component is calculated using the Maple length command. The default value for this preference is 0 so that no component information is displayed. To display all component information, set this preference to infinity.
|
|
"HistoryDepth"
|
|
The Tools command CalculationHistory will store the results of certain critical intermediate computations which the user may wish to view. The HistoryDepth preference specifies the number of such computations to store. The default value for this preference is 10.
>
|
with(DifferentialGeometry):
|
To illustrate this preference, we create a small procedure called Test and store some values calculated by this program using the CalculationHistory command.
>
|
Test := proc(n)
local i;
for i to n do
Tools:-CalculationHistory:-Update("Test", [i, i^2])
od; n^2 end:
|
Run the program Test.
| (5) |
Retrieve the calculated values.
>
|
Tools:-CalculationHistory:-Get("Test");
|
| (6) |
Change the HistoryDepth preference to 3.
>
|
Preferences("HistoryDepth", 3);
|
| (7) |
•
|
Rerun the program Test and retrieve the calculated values. This time only 3 values are stored.
|
| (8) |
>
|
Tools:-CalculationHistory:-Get("Test");
|
| (9) |
|
|
"JetNotation"
|
|
In the mathematical literature, there are two standard index notations for representing derivatives of a function. For example, if u = u(x, y) then we have:
JetNotation1: u[1] = u_x, u[2] = u_y, u[1, 1] = u_xx, u[1, 2] = u_xy, u[2, 2] = u_yy, u[1, 1, 1] = u_xxx, u[1, 1, 2] = u_xxy, u[1, 2, 2] = u_xyy, u[2, 2, 2] = u_yyy.
JetNotation2: u[1, 0] = u_x, u[0, 1] = u_y, u[2, 0] = u_xx, u[1, 1] = u_xy, u[0, 2] = u_yy, u[3, 0] = u_xxx, u[2, 1] = u_xxy, u[1, 2] = u_xyy, u[0, 3] = u_yyy.
•
|
The JetNotation preference determines which notation is used by the DifferentialGeometry package (and the JetCalculus subpackage). The default is JetNotation1.
|
>
|
with(DifferentialGeometry):
|
>
|
Preferences("JetNotation");
|
| (10) |
>
|
DGsetup([x,y], [u], Jet, 3, verbose);
|
| (11) |
>
|
Preferences("JetNotation", "JetNotation2");
|
| (12) |
>
|
DGsetup([x, y], [u], Jet, 3, verbose);
|
| (13) |
|
|
"Keywords"
|
|
The option Keywords returns the list of all admissible keywords for the Preferences procedure.
>
|
with(DifferentialGeometry):
|
>
|
Preferences("Keywords");
|
| (14) |
|
|
"PrettyPrint"
|
|
With the PrettyPrint preference set to true, the components of vectors, differential forms and tensors are always displayed on the main text line -- they will not appear as numerators in fractions. This is somewhat easier to read but has the disadvantage that the resulting outline (for vectors and 1-forms) cannot be copied and pasted. The default for the PrettyPrint preference is false.
>
|
with(DifferentialGeometry):
|
| (15) |
>
|
Preferences("PrettyPrint");
|
| (16) |
>
|
X := evalDG(1/(x^2 + y^2)*dx &w dy - dx &w dz);
|
| (17) |
>
|
Preferences("PrettyPrint", true);
|
| (18) |
>
|
X := evalDG(1/(x^2 + y^2)*dx &w dy - dx &w dz);
|
| (19) |
|
|
"PromptLength"
|
|
This preference specifies the maximum number of characters that will be displayed in the frame prompt.
>
|
with(DifferentialGeometry):
|
| (20) |
>
|
Preferences("PromptLength", 4);
|
| (21) |
|
|
"SafeMode"
|
|
With the SafeMode preference set to false, no global assignments are made for the coordinate vectors and 1-forms when the command DGsetup is called. Use this preference when writing programs in which temporary manifolds, Lie algebras, etc... need to be constructed. This will avoid introducing globals into the Maple namespace.
>
|
with(DifferentialGeometry):
|
>
|
Preferences("SafeMode");
|
| (22) |
| (23) |
>
|
assigned(D_x), assigned(dx);
|
| (24) |
Now set the SafeMode preference to true. The names D_y and dy are not assigned nor are they protected.
>
|
Preferences("SafeMode", true);
|
| (25) |
| (26) |
>
|
assigned(D_y), assigned(dy);
|
| (27) |
| (28) |
•
|
Note that the coordinate vectors and forms for the frame R2 can still be accessed using commands from the Tools subpackage. In SafeMode, the internal representations of DifferentialGeometry are displayed as output.
|
| (29) |
>
|
Tools:-DGinfo("FrameBaseForms");
|
| (30) |
>
|
Preferences("SafeMode", false);
|
| (31) |
|
|
"Show"
|
|
The option Show returns the list of all the preference values.
>
|
with(DifferentialGeometry):
|
| (32) |
|
|
"ShowFramePrompt"
|
|
With the ShowFramePrompt set to false, the standard Maple prompt will be used.
>
|
with(DifferentialGeometry):
|
>
|
Preferences("ShowFramePrompt", false);
|
| (33) |
>
|
DGsetup([x, y], Gauss);
|
| (34) |
>
|
LieBracket(D_x, x*D_y);
|
| (35) |
Notice that the prompt has remained the standard Maple prompt '>'.
>
|
Preferences("ShowFramePrompt", true);
|
| (36) |
>
|
DGsetup([x, y], Gauss);
|
| (37) |
Now the prompt contains the name of the current frame.
|
|
"TensorDisplay"
|
|
The preference TensorDisplay controls how the tensor product is displayed in Maple output. If this preference is 0, no symbol is printed; if this preference is 1, then '&t' is printed. The default TensorDisplay preference is 0.
>
|
with(DifferentialGeometry):
|
| (38) |
>
|
alpha := evalDG(2*dx &t dy - dy &t dz);
|
| (39) |
>
|
Preferences("TensorDisplay", 1);
|
| (40) |
| (41) |
>
|
Preferences("TensorDisplay", 0);
|
| (42) |
|
|
"TeXFormList", "TeXVectorList", "TeXBiformList", "TeXPrintOrder", "TeXLineBreak"
|
|
These preferences control how the Maple latex command will TeX the components of a vector, differential form or tensor. These preferences must be set by the user for each frame.
>
|
with(DifferentialGeometry):
|
>
|
DGsetup([x, y, z], M): DGsetup([x, y, z], N):
|
| (43) |
Specify the LaTeX representations for the frame [D_x, D_y, D_z] on M.
>
|
Preferences("TeXVectorList", M, ["\\partial_x", "\\partial_y", "\\partial_z"]);
|
| (44) |
Specify the LaTeX representations for the coframe [dx, dy, dz] on M.
>
|
Preferences("TeXFormList", M, ["dx", "dy", "d,z"]);
|
| (45) |
Specify the LaTeX representations for the frame [D_x, D_y, D_z] on N.
>
|
Preferences("TeXVectorList", N, ["\\frac{\\partial\\hfill}{\\partial_x}", "\\frac{\\partial\\hfill}{\\partial_y}", "\\frac{\\partial\\hfill}{\\partial_y}"]);
|
| (46) |
Specify the LaTeX representations for the coframe [dx, dy, dz] on N.
>
|
Preferences("TeXFormList", N, ["\\alpha", "\\beta", "\\gamma"]);
|
| (47) |
Define a vector X1 and a form alpha1 on M and convert to LaTeX.
| (48) |
>
|
X1 := evalDG(3*D_x - D_y + z*D_z);
|
| (49) |
>
|
alpha1 := evalDG(y*dx - sin(z)*dy + (1/z)*dz);
|
| (50) |
3\, \partial_x-\, \partial_y+z\, \partial_z
| |
y\, dx-\sin \left( z \right) \, dy+{z}^{-1}\, d,z
| |
Now LaTeX the same vector and form, but viewed as objects on N.
| (51) |
>
|
X2 := evalDG(3*D_x - D_y + z*D_z);
|
| (52) |
>
|
alpha2 := evalDG(y*dx - sin(z)*dy + (1/z)*dz);
|
| (53) |
3\, \frac{\partial\hfill}{\partial_x}-\, \frac{\partial\hfill}{\partial_y}+z\, \frac{\partial\hfill}{\partial_y}
| |
y\, \alpha-\sin \left( z \right) \, \beta+{z}^{-1}\, \gamma
| |
The TeXPrintOrder preference allows the user to specify the ordering of components in the TeX representation of a vector, differential form, or tensor.
>
|
Preferences("TeXPrintOrder", [dy, dz, dx]);
|
| (54) |
-\sin \left( z \right) \, dy+{z}^{-1}\, d,z+y\, dx
| |
>
|
TensorOrder := evalDG([dx &t dx, dy &t dy, dz &t dz, dx &t dy, dx &t dz, dy &t dz]);
|
| (55) |
>
|
Preferences("TeXPrintOrder", TensorOrder);
|
| (56) |
>
|
T := evalDG(dx &t dy + dy &t dy);
|
| (57) |
To LaTeX a vector or a form the TeXPrintOrder preference must now be reset. Often, the user may wish to insert the latex output into a LaTeX alignment environment. With the TeXLineBreak preference, a carriage return \' and alignment character & can be automatically placed.after any number of components.
>
|
Preferences("TeXLineBreak", [1]);
|
| (58) |
3\, \partial_x\\&-\, \partial_y+z\, \partial_z
| |
>
|
Preferences("TeXLineBreak", [1, 2]);
|
| (59) |
3\, \partial_x\\&-\, \partial_y\\&+z\, \partial_z
| |
|
|
"WedgeDisplay"
|
|
The preference WedgeDisplay controls how the wedge product of differential forms is displayed in Maple output. If this preference is 0, no symbol is printed; if this preference is 1, a '^' is printed; and if the preference is 2, then '&w' is printed. The default WedgeDisplay preference is 1.
>
|
with(DifferentialGeometry):
|
| (60) |
>
|
alpha := evalDG(2*dx &w dy - dy &w dz);
|
| (61) |
>
|
Preferences("WedgeDisplay", 0);
|
| (62) |
| (63) |
>
|
Preferences("WedgeDisplay", 2);
|
| (64) |
| (65) |
|
|
"dsolve", "nullspace","pdsolve", "rref", "simplification", "solve"
|
|
These preferences allow the user to customize the procedures which will be used with DifferentialGeometry programs for dsolve, LinearAlgebra:-Nullspace, pdsolve, LinearAlgebra:-ReducedRowEchelonForm, simplify, and solve. Here is a simple example.
>
|
with(DifferentialGeometry):
|
| (66) |
>
|
ExteriorDerivative(sqrt(x^2));
|
| (67) |
To obtain the simpler result dx, we can change the simplification command used by the DifferentialGeometry package. Call the new simplification command MySimplify and pass this procedure name to the Preferences. Then rerun the ExteriorDerivative command.
>
|
MySimplify := x -> simplify(x, symbolic);
|
| (68) |
>
|
Preferences("simplification", MySimplify);
|
| (69) |
>
|
ExteriorDerivative(sqrt(x^2));
|
| (70) |
|
|
|