Student[VectorCalculus] - Maple Programming Help

Home : Support : Online Help : Education : Student Packages : Vector Calculus : Computation Commands : Student/VectorCalculus/Gradient

Student[VectorCalculus]

 compute the gradient of a function
 Del
 Vector differential operator
 Nabla
 Vector differential operator

Parameters

 f - (optional) algebraic expression c - (optional) specify the coordinate system

Description

 • The Gradient(f) calling sequence computes the gradient of the expression f in the current coordinate system.  If no coordinate system has been explicitly specified, the command will assume a cartesian system with coordinates the variables which appear in the expression f.
 • The Gradient(f,c) calling sequence computes the gradient of the expression f in the coordinate system specified by the parameter c, which can be given as:
 * an indexed name, e.g., ${\mathrm{spherical}}_{r,\mathrm{\phi },\mathrm{\theta }}$
 * a name, e.g., spherical; default coordinate names will be used
 * a list of names, e.g., $\left[r,\mathrm{\phi },\mathrm{\theta }\right]$; the current coordinate system will be used, with these as the coordinate names
 The Gradient(c) calling sequence returns the differential form of the gradient operator in the coordinate system specified by the parameter c.
 The Gradient() calling sequence returns the differential form of the gradient operator in the current coordinate system.  If no coordinate system has been set (by a call to SetCoordinates), cartesian coordinates are assumed.
 • In all cases, the result is a vector field.
 • Nabla and Del are both synonyms for Gradient.
 • However, you can also use the Del or Nabla commands (as the Vector differential operator) with . (DotProduct) and &x (CrossProduct) as synonyms for the Curl, Divergence, and Laplacian commands.

 Command Equivalent Command using Del Equivalent Command Using Nabla Curl Del &x Nabla &x Divergence Del . Nabla . Laplacian Del . Del Nabla . Nabla

Examples

 > $\mathrm{with}\left(\mathrm{Student}\left[\mathrm{VectorCalculus}\right]\right):$

 > $\mathrm{Gradient}\left({x}^{2}+{y}^{2}\right)$
 $\left({2}{}{x}\right){\stackrel{{_}}{{e}}}_{{x}}{+}\left({2}{}{y}\right){\stackrel{{_}}{{e}}}_{{y}}$ (1)
 > $\mathrm{Del}\left({u}^{2}+a{v}^{2},\left[u,v\right]\right)$
 $\left({2}{}{u}\right){\stackrel{{_}}{{e}}}_{{u}}{+}\left({2}{}{a}{}{v}\right){\stackrel{{_}}{{e}}}_{{v}}$ (2)
 > $\nabla \left({x}^{2}+{y}^{2}\right)$
 $\left({2}{}{x}\right){\stackrel{{_}}{{e}}}_{{x}}{+}\left({2}{}{y}\right){\stackrel{{_}}{{e}}}_{{y}}$ (3)
 > $\mathrm{Gradient}\left({r}^{2}\mathrm{\phi },\mathrm{spherical}\left[r,\mathrm{\phi },\mathrm{\theta }\right]\right)$
 $\left({2}{}{r}{}{\mathrm{\phi }}\right){\stackrel{{_}}{{e}}}_{{r}}{+}\left({r}\right){\stackrel{{_}}{{e}}}_{{\mathrm{φ}}}{+}\left({0}\right){\stackrel{{_}}{{e}}}_{{\mathrm{θ}}}$ (4)
 > $\mathrm{SetCoordinates}\left(\mathrm{spherical}\left[r,\mathrm{\phi },\mathrm{\theta }\right]\right)$
 ${{\mathrm{spherical}}}_{{r}{,}{\mathrm{\phi }}{,}{\mathrm{\theta }}}$ (5)
 > $\mathrm{Del}\left({r}^{2}\mathrm{\phi }\right)$
 $\left({2}{}{r}{}{\mathrm{\phi }}\right){\stackrel{{_}}{{e}}}_{{r}}{+}\left({r}\right){\stackrel{{_}}{{e}}}_{{\mathrm{φ}}}{+}\left({0}\right){\stackrel{{_}}{{e}}}_{{\mathrm{θ}}}$ (6)

 > $\mathrm{Gradient}\left(\right)$
 $\left(\frac{{\partial }}{{\partial }{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\mathrm{SF}}{}\left({r}{,}{\mathrm{\phi }}{,}{\mathrm{\theta }}\right)\right){\stackrel{{_}}{{e}}}_{{r}}{+}\left(\frac{\frac{{\partial }}{{\partial }{\mathrm{\phi }}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\mathrm{SF}}{}\left({r}{,}{\mathrm{\phi }}{,}{\mathrm{\theta }}\right)}{{r}}\right){\stackrel{{_}}{{e}}}_{{\mathrm{φ}}}{+}\left(\frac{\frac{{\partial }}{{\partial }{\mathrm{\theta }}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\mathrm{SF}}{}\left({r}{,}{\mathrm{\phi }}{,}{\mathrm{\theta }}\right)}{{r}{}{\mathrm{sin}}{}\left({\mathrm{\phi }}\right)}\right){\stackrel{{_}}{{e}}}_{{\mathrm{θ}}}$ (7)
 > $\mathrm{Gradient}\left(\mathrm{polar}\left[r,\mathrm{\theta }\right]\right)$
 $\left(\frac{{\partial }}{{\partial }{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\mathrm{SF}}{}\left({r}{,}{\mathrm{\theta }}\right)\right){\stackrel{{_}}{{e}}}_{{r}}{+}\left(\frac{\frac{{\partial }}{{\partial }{\mathrm{\theta }}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\mathrm{SF}}{}\left({r}{,}{\mathrm{\theta }}\right)}{{r}}\right){\stackrel{{_}}{{e}}}_{{\mathrm{θ}}}$ (8)

You can compute the divergence, curl, and gradient using the corresponding commands, or the Del or Nabla command and the . or &x operator.

 > $\mathrm{SetCoordinates}\left(\mathrm{cartesian}\left[x,y,z\right]\right)$
 ${{\mathrm{cartesian}}}_{{x}{,}{y}{,}{z}}$ (9)
 > $\mathrm{Divergence}\left(\mathrm{VectorField}\left(⟨y,-x,0⟩\right)\right)$
 ${0}$ (10)
 > $\mathrm{Del}·\mathrm{VectorField}\left(⟨y,-x,0⟩\right)$
 ${0}$ (11)
 > $\mathrm{Curl}\left(\mathrm{VectorField}\left(⟨y,-x,0⟩\right)\right)$
 $\left({0}\right){\stackrel{{_}}{{e}}}_{{x}}{+}\left({0}\right){\stackrel{{_}}{{e}}}_{{y}}{+}\left({-2}\right){\stackrel{{_}}{{e}}}_{{z}}$ (12)
 > $\nabla \phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&x\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{VectorField}\left(⟨y,-x,0⟩\right)$
 $\left({0}\right){\stackrel{{_}}{{e}}}_{{x}}{+}\left({0}\right){\stackrel{{_}}{{e}}}_{{y}}{+}\left({-2}\right){\stackrel{{_}}{{e}}}_{{z}}$ (13)
 > $\mathrm{SetCoordinates}\left(\mathrm{spherical}\left[r,\mathrm{\phi },\mathrm{\theta }\right]\right)$
 ${{\mathrm{spherical}}}_{{r}{,}{\mathrm{\phi }}{,}{\mathrm{\theta }}}$ (14)
 > $\mathrm{Laplacian}\left(r\mathrm{sin}\left(\mathrm{\theta }\right)\right)$
 $\frac{{2}{}{r}{}{\mathrm{sin}}{}\left({\mathrm{\phi }}\right){}{\mathrm{sin}}{}\left({\mathrm{\theta }}\right){-}\frac{{r}{}{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}{{\mathrm{sin}}{}\left({\mathrm{\phi }}\right)}}{{{r}}^{{2}}{}{\mathrm{sin}}{}\left({\mathrm{\phi }}\right)}$ (15)
 > $\mathrm{Del}·\mathrm{Del}\left(r\mathrm{sin}\left(\mathrm{\theta }\right)\right)$
 $\frac{{2}{}{r}{}{\mathrm{sin}}{}\left({\mathrm{\phi }}\right){}{\mathrm{sin}}{}\left({\mathrm{\theta }}\right){-}\frac{{r}{}{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}{{\mathrm{sin}}{}\left({\mathrm{\phi }}\right)}}{{{r}}^{{2}}{}{\mathrm{sin}}{}\left({\mathrm{\phi }}\right)}$ (16)