Student[VectorCalculus] - Maple Programming Help

Home : Support : Online Help : Education : Student Package : 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}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}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}[\mathrm{VectorCalculus}]\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}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}F$
 ${2}{}{x}{+}{2}{}{y}{+}{2}{}{z}$ (3)
 > $\mathrm{Nabla}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}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}}{}{\mathrm{VF}}{[}{1}{]}{}\left({x}{,}{y}{,}{z}\right){+}\frac{{\partial }}{{\partial }{y}}{}{\mathrm{VF}}{[}{2}{]}{}\left({x}{,}{y}{,}{z}\right){+}\frac{{\partial }}{{\partial }{z}}{}{\mathrm{VF}}{[}{3}{]}{}\left({x}{,}{y}{,}{z}\right)$ (7)
 > $\mathrm{SetCoordinates}\left({\mathrm{cylindrical}}_{r,\mathrm{θ},z}\right):$
 > $\mathrm{Divergence}\left(\right)$
 $\frac{\frac{{\partial }}{{\partial }{r}}{}\left({r}{}{\mathrm{VF}}{[}{1}{]}{}\left({r}{,}{\mathrm{θ}}{,}{z}\right)\right){+}\frac{{\partial }}{{\partial }{\mathrm{θ}}}{}{\mathrm{VF}}{[}{2}{]}{}\left({r}{,}{\mathrm{θ}}{,}{z}\right){+}\frac{{\partial }}{{\partial }{z}}{}\left({r}{}{\mathrm{VF}}{[}{3}{]}{}\left({r}{,}{\mathrm{θ}}{,}{z}\right)\right)}{{r}}$ (8)
 > $\mathrm{Divergence}\left(\left[s,\mathrm{φ},w\right]\right)$
 $\frac{\frac{{\partial }}{{\partial }{s}}{}\left({s}{}{\mathrm{VF}}{[}{1}{]}{}\left({s}{,}{\mathrm{φ}}{,}{w}\right)\right){+}\frac{{\partial }}{{\partial }{\mathrm{φ}}}{}{\mathrm{VF}}{[}{2}{]}{}\left({s}{,}{\mathrm{φ}}{,}{w}\right){+}\frac{{\partial }}{{\partial }{w}}{}\left({s}{}{\mathrm{VF}}{[}{3}{]}{}\left({s}{,}{\mathrm{φ}}{,}{w}\right)\right)}{{s}}$ (9)
 > $\mathrm{Divergence}\left(\mathrm{spherical}\right)$
 $\frac{\frac{{\partial }}{{\partial }{r}}{}\left({{r}}^{{2}}{}{\mathrm{sin}}{}\left({\mathrm{φ}}\right){}{\mathrm{VF}}{[}{1}{]}{}\left({r}{,}{\mathrm{φ}}{,}{\mathrm{θ}}\right)\right){+}\frac{{\partial }}{{\partial }{\mathrm{φ}}}{}\left({r}{}{\mathrm{sin}}{}\left({\mathrm{φ}}\right){}{\mathrm{VF}}{[}{2}{]}{}\left({r}{,}{\mathrm{φ}}{,}{\mathrm{θ}}\right)\right){+}\frac{{\partial }}{{\partial }{\mathrm{θ}}}{}\left({r}{}{\mathrm{VF}}{[}{3}{]}{}\left({r}{,}{\mathrm{φ}}{,}{\mathrm{θ}}\right)\right)}{{{r}}^{{2}}{}{\mathrm{sin}}{}\left({\mathrm{φ}}\right)}$ (10)
 > $\mathrm{Divergence}\left({\mathrm{spherical}}_{\mathrm{α},\mathrm{ψ},\mathrm{γ}}\right)$
 $\frac{\frac{{\partial }}{{\partial }{\mathrm{α}}}{}\left({{\mathrm{α}}}^{{2}}{}{\mathrm{sin}}{}\left({\mathrm{ψ}}\right){}{\mathrm{VF}}{[}{1}{]}{}\left({\mathrm{α}}{,}{\mathrm{ψ}}{,}{\mathrm{γ}}\right)\right){+}\frac{{\partial }}{{\partial }{\mathrm{ψ}}}{}\left({\mathrm{α}}{}{\mathrm{sin}}{}\left({\mathrm{ψ}}\right){}{\mathrm{VF}}{[}{2}{]}{}\left({\mathrm{α}}{,}{\mathrm{ψ}}{,}{\mathrm{γ}}\right)\right){+}\frac{{\partial }}{{\partial }{\mathrm{γ}}}{}\left({\mathrm{α}}{}{\mathrm{VF}}{[}{3}{]}{}\left({\mathrm{α}}{,}{\mathrm{ψ}}{,}{\mathrm{γ}}\right)\right)}{{{\mathrm{α}}}^{{2}}{}{\mathrm{sin}}{}\left({\mathrm{ψ}}\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}}_{r,\mathrm{θ}}\right)$
 ${{\mathrm{polar}}}_{{r}{,}{\mathrm{θ}}}$ (12)
 > $\mathrm{Divergence}\left(\left(r,\mathrm{θ}\right)→⟨f\left(r,\mathrm{θ}\right),g\left(r,\mathrm{θ}\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)