VectorCalculus - Maple Programming Help

VectorCalculus

 compute the gradient of a function from R^n to R
 Del
 Vector differential operator
 Nabla
 Vector differential operator

Parameters

 f - algebraic expression c - (optional) list(name) or name[name, name, ...]; specify the list of variable names or coordinate system indexed by coordinate names

Description

 • The Gradient(f, c) command computes the gradient of the expression f.  The result is a vector field.
 • If c is a list of names, the gradient is taken in the current default coordinate system by using the names in c as the coordinate names.  If the number of given names is not compatible with this coordinate system, an error is raised.
 If c is a name indexed by other names, the gradient is computed in this coordinate system by using the indices as the coordinate names.  If the number of names is not compatible with the coordinate system, an error is raised.
 If c is not specified, the current default coordinates are used. The default coordinates must be indexed by coordinate names, otherwise an error is raised.
 • The command Del(f, c) is just a synonym for Gradient(f, c). However, Del is also recognized as the Vector differential operator that is used with DotProduct and CrossProduct as shortcuts for Curl, Divergence, Gradient, and Laplacian.
 Nabla is a synonym for Del.

Examples

 > $\mathrm{with}\left(\mathrm{VectorCalculus}\right):$
 > $\mathrm{g1}≔\mathrm{Gradient}\left({x}^{2}+{y}^{2},\left[x,y\right]\right)$
 ${\mathrm{g1}}{≔}{2}{}{x}{\stackrel{{_}}{{e}}}_{{x}}{+}{2}{}{y}{\stackrel{{_}}{{e}}}_{{y}}$ (1)
 > $\mathrm{attributes}\left(\mathrm{g1}\right)$
 ${\mathrm{vectorfield}}{,}{\mathrm{coords}}{=}{{\mathrm{cartesian}}}_{{x}{,}{y}}$ (2)
 > $\mathrm{g2}≔\mathrm{Gradient}\left({r}^{2},{'\mathrm{polar}'}_{r,\mathrm{θ}}\right)$
 ${\mathrm{g2}}{≔}{2}{}{r}{\stackrel{{_}}{{e}}}_{{r}}$ (3)
 > $\mathrm{attributes}\left(\mathrm{g2}\right)$
 ${\mathrm{vectorfield}}{,}{\mathrm{coords}}{=}{{\mathrm{polar}}}_{{r}{,}{\mathrm{θ}}}$ (4)
 > $\mathrm{SetCoordinates}\left({'\mathrm{spherical}'}_{r,\mathrm{φ},\mathrm{θ}}\right)$
 ${{\mathrm{spherical}}}_{{r}{,}{\mathrm{φ}}{,}{\mathrm{θ}}}$ (5)
 > $\mathrm{g3}≔\mathrm{Gradient}\left({r}^{2}\mathrm{φ}\right)$
 ${\mathrm{g3}}{≔}{2}{}{r}{}{\mathrm{φ}}{\stackrel{{_}}{{e}}}_{{r}}{+}\left({r}\right){\stackrel{{_}}{{e}}}_{{\mathrm{φ}}}$ (6)
 > $\mathrm{attributes}\left(\mathrm{g3}\right)$
 ${\mathrm{vectorfield}}{,}{\mathrm{coords}}{=}{{\mathrm{spherical}}}_{{r}{,}{\mathrm{φ}}{,}{\mathrm{θ}}}$ (7)
 > $\mathrm{Del}\left({r}^{2}\mathrm{φ}\right)$
 ${2}{}{r}{}{\mathrm{φ}}{\stackrel{{_}}{{e}}}_{{r}}{+}\left({r}\right){\stackrel{{_}}{{e}}}_{{\mathrm{φ}}}$ (8)
 > $\mathrm{Gradient}\left(\right)$
 $\left(\frac{{\partial }}{{\partial }{r}}{}{\mathrm{SF}}{}\left({r}{,}{\mathrm{φ}}{,}{\mathrm{θ}}\right)\right){\stackrel{{_}}{{e}}}_{{r}}{+}\left(\frac{\frac{{\partial }}{{\partial }{\mathrm{φ}}}{}{\mathrm{SF}}{}\left({r}{,}{\mathrm{φ}}{,}{\mathrm{θ}}\right)}{{r}}\right){\stackrel{{_}}{{e}}}_{{\mathrm{φ}}}{+}\left(\frac{\frac{{\partial }}{{\partial }{\mathrm{θ}}}{}{\mathrm{SF}}{}\left({r}{,}{\mathrm{φ}}{,}{\mathrm{θ}}\right)}{{r}{}{\mathrm{sin}}{}\left({\mathrm{φ}}\right)}\right){\stackrel{{_}}{{e}}}_{{\mathrm{θ}}}$ (9)
 > $\mathrm{SetCoordinates}\left({'\mathrm{cartesian}'}_{x,y,z}\right)$
 ${{\mathrm{cartesian}}}_{{x}{,}{y}{,}{z}}$ (10)
 > $\mathrm{Del}\left({x}^{2}+{y}^{2}+{z}^{2}\right)$
 ${2}{}{x}{\stackrel{{_}}{{e}}}_{{x}}{+}{2}{}{y}{\stackrel{{_}}{{e}}}_{{y}}{+}{2}{}{z}{\stackrel{{_}}{{e}}}_{{z}}$ (11)
 > $\mathrm{n1}≔\mathrm{Nabla}\left({x}^{2}+{y}^{2}+{z}^{2}\right)$
 ${\mathrm{n1}}{≔}{2}{}{x}{\stackrel{{_}}{{e}}}_{{x}}{+}{2}{}{y}{\stackrel{{_}}{{e}}}_{{y}}{+}{2}{}{z}{\stackrel{{_}}{{e}}}_{{z}}$ (12)
 > $\mathrm{Del}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{n1}$
 ${6}$ (13)
 > $\mathrm{Del}&x\left(\mathrm{VectorField}\left(⟨y,-x,0⟩\right)\right)$
 ${-}{2}{\stackrel{{_}}{{e}}}_{{z}}$ (14)
 > $L≔\left(\mathrm{VectorField}\left(⟨x,y,z⟩\right)\right)&x\mathrm{Del}$
 ${L}{≔}{e}{→}{\mathrm{VectorCalculus:-&x}}{}\left({\mathrm{Vector\left(3, \left\{\left(1\right) = x, \left(2\right) = y, \left(3\right) = z\right\}, attributes = \left[vectorfield, coords = cartesian\left[x, y, z\right]\right]\right)}}{,}{\mathrm{VectorCalculus:-Gradient}}{}\left({e}\right)\right)$ (15)
 > $L\left(\mathrm{sin}\left(xyz\right)\right)$
 $\left({{y}}^{{2}}{}{x}{}{\mathrm{cos}}{}\left({x}{}{y}{}{z}\right){-}{{z}}^{{2}}{}{x}{}{\mathrm{cos}}{}\left({x}{}{y}{}{z}\right)\right){\stackrel{{_}}{{e}}}_{{x}}{+}\left({-}{{x}}^{{2}}{}{y}{}{\mathrm{cos}}{}\left({x}{}{y}{}{z}\right){+}{{z}}^{{2}}{}{y}{}{\mathrm{cos}}{}\left({x}{}{y}{}{z}\right)\right){\stackrel{{_}}{{e}}}_{{y}}{+}\left({{x}}^{{2}}{}{z}{}{\mathrm{cos}}{}\left({x}{}{y}{}{z}\right){-}{{y}}^{{2}}{}{z}{}{\mathrm{cos}}{}\left({x}{}{y}{}{z}\right)\right){\stackrel{{_}}{{e}}}_{{z}}$ (16)
 > $L≔\mathrm{Del}&x\mathrm{Del}$
 ${L}{≔}{\mathrm{VectorCalculus:-Curl}}{@}{\mathrm{VectorCalculus:-Gradient}}$ (17)
 > $L\left(f\left(x,y,z\right)\right)$
 ${0}{\stackrel{{_}}{{e}}}_{{x}}$ (18)