Overview of the Physics[Vectors] Subpackage - Maple Programming Help

Online Help

All Products    Maple    MapleSim

Home : Support : Online Help : Physics : Vectors : Physics/Vectors

Overview of the Physics[Vectors] Subpackage



The Physics[Vectors] subpackage introduces an algebraic (not matricial) representation for abstract vectors, that is, vectors or vector functions not projected onto any particular vector basis, as well as for cartesian, cylindrical and spherical curvilinear unit vectors, so that it is possible to do algebraic and differential calculus with both nonprojected and projected vector functions. For examples of the use of the subpackage in applications see Physics, examples (this page opens only in the Standard Graphical User Interface).


The vectors represented in the Vectors subpackage are the standard mathematical objects used in Physics that have magnitude and direction and are defined up to parallel translation, sometimes referred to as free vectors. These vectors can also represent 3D-vectorial noncommutative quantum operators - see for instance the Quantum Mechanics section, of Physics, examples.


Regarding projected vectors, the Vectors subpackage is designed to work only with cartesian, cylindrical and spherical orthonormal basis and the related systems of coordinates (see Identify), according to



cartesian unit vectors,



cylindrical unit vectors,



spherical unit vectors






cartesian coordinates,



cylindrical coordinates,



spherical coordinates


where θ is the angle down from the z-axis, ranging from 0 to π, and φ is the angle around the z-axis ranging from 0 to 2π.


Regarding non-projected vectors and vector functions, the key idea is to identify them by a postfix in the name, as a computer mimicry of "the arrow on top" you use to represent them when working with paper and pencil. This postfix identifier is by default the underscore _ but can be set to be any valid sequence of characters (see Physics[Setup]).


Mathematical vector notation: When Physics[Vectors] is loaded in the Standard Graphical User Interface, by entering Physics[Setup](mathematicalnotation = true), non-projected vectors and unit vectors are respectively displayed with an arrow and a hat on top, and the differential operators (Nabla, Laplacian, etc.) with an upside down triangle as in textbooks. You can also set this notation from the Options Dialog: go to Tools > Options, select the Display tab, and set the Typesetting level to Extended.


NOTE: these variables x, y, z, ρ, φ, r and θ, as well as _i, _j, _k, _ρ, _φ, _r and _θ, respectively used to represent the coordinates and the unit vectors, are automatically protected when the Physics[Vectors] subpackage is loaded.


Some examples illustrating the use of the Physics[Vectors] subpackage in Mechanics and Electrodynamics are found in examples/Physics.

List of Physics[Vectors] Subpackage Commands


The following is a list of available commands.























Inert forms of these commands, representing the operations, including their mathematical properties under differentiation, expansion etc., but holding the computations, consist of the same command's names prefixed by the % character. The inert computations constructed with these commands can be activated when desired using the value command.

Brief description of each command


+, -, . and &x performs the addition, subtraction, dot product and cross product of vector functions, respectively.


ChangeBasis changes the projection basis of a given vector function.


Component evaluates the component of a vector function.


DirectionalDiff evaluates the directional derivative of a (vectorial) expression.


Gradient, Divergence, Curl, and Laplacian, as well as the corresponding inert forms (starting with a Capital letter) respectively compute (or represent) the gradient, divergence, curl and Laplacian of a given (vector) function. As a handy mnemonics rule, these differential commands as well as the main one, Nabla (for nabla), are entered using just the first three letters.


Nabla is a command representation for the nabla differential operator. Thus, Nabla alone can also be used to calculate the gradient, divergence, curl or Laplacian of a function.


Norm evaluates the norm of a vector functions (note that Maple has also a command called norm not related to Vectors).


diff is a differentiation command which takes into account the relation between geometrical cartesian, cylindrical and spherical coordinates (and curvilinear unit vectors) when evaluating derivatives. It uses the same syntax (calling sequence) and display as the standard diff command, (diff and diff derivatives evaluated over one function at the same time are displayed separately).


Setup this is actually the Physics[Setup] command, there is only one, used to set abbreviations for some Vectors subpackage commands, and, in the Standard Maple GUI, used to turn ON/OFF the mathematical notation for the vectorial differential operators as well as the vector display with an arrow on top (default), etc.

See Also

Physics, Physics conventions, Physics examples, Student/VectorCalculus, VectorCalculus



Cheb-Terrab, E.S. and Nisembaum, M. "Vector Analysis and Symbolic Computation in Physics Education." Workshop: Computers in Education, EDAI - UERJ. Rio de Janeiro, Brazil, 1995.