Student[VectorCalculus] - Maple Programming Help

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

Student[VectorCalculus]

 Divergence
 compute the divergence of a vector field

 Calling Sequence Divergence(F) Divergence(c)

Parameters

 F - (optional) vector field or Vector-valued procedure; specify the components of the vector field c - (optional) specify the coordinate system

Description

 • The Divergence(F) calling sequence computes the divergence of the vector field $F$.  This calling sequence is equivalent to $\mathrm{Del}·F$ and DotProduct(Del, F).
 • If $F$ is a Vector-valued procedure, the default coordinate system is used. The default coordinate system must be indexed by the coordinate names.
 Otherwise, $F$ must be a Vector with the vectorfield attribute set, and it must have a coordinate system attribute that is indexed by the coordinate names.
 • If $F$ is a procedure, the returned object is a procedure. Otherwise, the returned object is an expression.
 • The Divergence(c) calling sequence returns the differential form of the divergence operator in the coordinate system specified by $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 Divergence() calling sequence returns the differential form of the divergence operator in the current coordinate system.  For more information, see SetCoordinates.

Examples

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

To create a vector field, use the Student[VectorCalculus][VectorField] command.

 > $F≔\mathrm{VectorField}\left(⟨{x}^{2},{y}^{2},{z}^{2}⟩\right)$
 ${F}{≔}\left({{x}}^{{2}}\right){\stackrel{{_}}{{e}}}_{{x}}{+}\left({{y}}^{{2}}\right){\stackrel{{_}}{{e}}}_{{y}}{+}\left({{z}}^{{2}}\right){\stackrel{{_}}{{e}}}_{{z}}$ (1)
 > $\mathrm{Divergence}\left(F\right)$
 ${2}{}{x}{+}{2}{}{y}{+}{2}{}{z}$ (2)
 > $\mathrm{Del}·F$
 ${2}{}{x}{+}{2}{}{y}{+}{2}{}{z}$ (3)
 > $\nabla ·F$
 ${2}{}{x}{+}{2}{}{y}{+}{2}{}{z}$ (4)
 > $\mathrm{DotProduct}\left(\mathrm{Del},F\right)$
 ${2}{}{x}{+}{2}{}{y}{+}{2}{}{z}$ (5)
 > $\mathrm{Divergence}\left(\left(x,y,z\right)↦⟨\mathrm{sin}\left(x\right),\mathrm{cos}\left(y\right),\mathrm{tan}\left(z\right)⟩\right)$
 $\left({x}{,}{y}{,}{z}\right){↦}{\mathrm{cos}}{}\left({x}\right){-}{\mathrm{sin}}{}\left({y}\right){+}{1}{+}{{\mathrm{tan}}{}\left({z}\right)}^{{2}}$ (6)

To display the differential form of the divergence operator:

 > $\mathrm{Divergence}\left(\right)$
 $\frac{{\partial }}{{\partial }{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{{\mathrm{VF}}}_{{1}}{}\left({x}{,}{y}{,}{z}\right){+}\frac{{\partial }}{{\partial }{y}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{{\mathrm{VF}}}_{{2}}{}\left({x}{,}{y}{,}{z}\right){+}\frac{{\partial }}{{\partial }{z}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{{\mathrm{VF}}}_{{3}}{}\left({x}{,}{y}{,}{z}\right)$ (7)
 > $\mathrm{SetCoordinates}\left(\mathrm{cylindrical}\left[r,\mathrm{\theta },z\right]\right):$
 > $\mathrm{Divergence}\left(\right)$
 $\frac{\frac{{\partial }}{{\partial }{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}\left({r}{}{{\mathrm{VF}}}_{{1}}{}\left({r}{,}{\mathrm{\theta }}{,}{z}\right)\right){+}\frac{{\partial }}{{\partial }{\mathrm{\theta }}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{{\mathrm{VF}}}_{{2}}{}\left({r}{,}{\mathrm{\theta }}{,}{z}\right){+}\frac{{\partial }}{{\partial }{z}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}\left({r}{}{{\mathrm{VF}}}_{{3}}{}\left({r}{,}{\mathrm{\theta }}{,}{z}\right)\right)}{{r}}$ (8)
 > $\mathrm{Divergence}\left(\left[s,\mathrm{\phi },w\right]\right)$
 $\frac{\frac{{\partial }}{{\partial }{s}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}\left({s}{}{{\mathrm{VF}}}_{{1}}{}\left({s}{,}{\mathrm{\phi }}{,}{w}\right)\right){+}\frac{{\partial }}{{\partial }{\mathrm{\phi }}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{{\mathrm{VF}}}_{{2}}{}\left({s}{,}{\mathrm{\phi }}{,}{w}\right){+}\frac{{\partial }}{{\partial }{w}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}\left({s}{}{{\mathrm{VF}}}_{{3}}{}\left({s}{,}{\mathrm{\phi }}{,}{w}\right)\right)}{{s}}$ (9)
 > $\mathrm{Divergence}\left(\mathrm{spherical}\right)$
 $\frac{\frac{{\partial }}{{\partial }{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}\left({{r}}^{{2}}{}{\mathrm{sin}}{}\left({\mathrm{\phi }}\right){}{{\mathrm{VF}}}_{{1}}{}\left({r}{,}{\mathrm{\phi }}{,}{\mathrm{\theta }}\right)\right){+}\frac{{\partial }}{{\partial }{\mathrm{\phi }}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}\left({r}{}{\mathrm{sin}}{}\left({\mathrm{\phi }}\right){}{{\mathrm{VF}}}_{{2}}{}\left({r}{,}{\mathrm{\phi }}{,}{\mathrm{\theta }}\right)\right){+}\frac{{\partial }}{{\partial }{\mathrm{\theta }}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}\left({r}{}{{\mathrm{VF}}}_{{3}}{}\left({r}{,}{\mathrm{\phi }}{,}{\mathrm{\theta }}\right)\right)}{{{r}}^{{2}}{}{\mathrm{sin}}{}\left({\mathrm{\phi }}\right)}$ (10)
 > $\mathrm{Divergence}\left(\mathrm{spherical}\left[\mathrm{\alpha },\mathrm{\psi },\mathrm{\gamma }\right]\right)$
 $\frac{\frac{{\partial }}{{\partial }{\mathrm{\alpha }}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}\left({{\mathrm{\alpha }}}^{{2}}{}{\mathrm{sin}}{}\left({\mathrm{\psi }}\right){}{{\mathrm{VF}}}_{{1}}{}\left({\mathrm{\alpha }}{,}{\mathrm{\psi }}{,}{\mathrm{\gamma }}\right)\right){+}\frac{{\partial }}{{\partial }{\mathrm{\psi }}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}\left({\mathrm{\alpha }}{}{\mathrm{sin}}{}\left({\mathrm{\psi }}\right){}{{\mathrm{VF}}}_{{2}}{}\left({\mathrm{\alpha }}{,}{\mathrm{\psi }}{,}{\mathrm{\gamma }}\right)\right){+}\frac{{\partial }}{{\partial }{\mathrm{\gamma }}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}\left({\mathrm{\alpha }}{}{{\mathrm{VF}}}_{{3}}{}\left({\mathrm{\alpha }}{,}{\mathrm{\psi }}{,}{\mathrm{\gamma }}\right)\right)}{{{\mathrm{\alpha }}}^{{2}}{}{\mathrm{sin}}{}\left({\mathrm{\psi }}\right)}$ (11)

To display the divergence of an arbitrary vector-valued function (r,theta) -> <f(r,theta),g(r,theta)> in the polar coordinate system:

 > $\mathrm{SetCoordinates}\left(\mathrm{polar}\left[r,\mathrm{\theta }\right]\right)$
 ${{\mathrm{polar}}}_{{r}{,}{\mathrm{\theta }}}$ (12)
 > $\mathrm{Divergence}\left(\left(r,\mathrm{\theta }\right)↦⟨f\left(r,\mathrm{\theta }\right),g\left(r,\mathrm{\theta }\right)⟩\right)$
 $\left({r}{,}{\mathrm{θ}}\right){→}\frac{{f}{}\left({r}{,}{\mathrm{θ}}\right){+}{r}{}\left(\frac{{\partial }}{{\partial }{r}}{}{f}{}\left({r}{,}{\mathrm{θ}}\right)\right){+}\frac{{\partial }}{{\partial }{\mathrm{θ}}}{}{g}{}\left({r}{,}{\mathrm{θ}}\right)}{{r}}$ (13)