VectorCalculus - Maple Programming Help

Home : Support : Online Help : Mathematics : Vector Calculus : VectorCalculus/DotProduct

VectorCalculus

 DotProduct
 computes the dot product of Vectors and differential operators

 Calling Sequence DotProduct(v1, v2) v1 . v2

Parameters

 v1 - Vector(algebraic); Vector, Vector-valued procedure, or differential operator v2 - Vector(algebraic); Vector, Vector-valued procedure, or differential operator

Description

 • The DotProduct(v1, v2) command (scalar product) computes the dot product of v1 and v2, where v1 and v2 can be free Vectors, rooted Vectors, position Vectors, vector fields, Del or Nabla.
 • The function can be accessed through  . or DotProduct exports.
 • If v2 is a VectorField, the divergence of v2 can be computed as DotProduct(Del, v2), or $\nabla .\mathrm{v2}$.
 • If v1 is a VectorField, an operator representing the directional derivative in the direction of v1 is obtained as DotProduct(v1, Del), or $\mathrm{v1}.\nabla$.
 • The behavior of the dot product of two Vectors is described by the following table:

 $\mathrm{v1}$ coord ($\mathrm{v1}$) $\mathrm{v2}$ coord ($\mathrm{v2}$) $\mathrm{v1}·\mathrm{v2}$ 1 free Vector cartesian free Vector cartesian scalar free Vector curved free Vector any error 2 free Vector cartesian rooted Vector (root2) coord2 scalar free Vector curved rooted Vector (root2) coord2 error 3 free Vector cartesian vector field cartesian scalar free Vector cartesian vector field curved error free Vector curved vector field any error 4 free Vector cartesian position Vector cartesian scalar 5 rooted Vector (root1) coord1 rooted Vector (root1) coord1 scalar rooted Vector (root1) coord1 rooted Vector (root2) coord1 error rooted Vector (any) coord1 rooted Vector (any) coord2 error 6 rooted Vector (root1) coord1 vector field coord2 $\mathrm{v1}·\mathrm{v2}\left(\mathrm{root1}\right)$ 7 rooted Vector (root1) cartesian position Vector cartesian scalar 8 vector field coord1 vector field coord1 scalar field vector field coord1 vector field coord2 error 9 vector field coord1 position Vector cartesian error 10 position Vector cartesian position Vector cartesian scalar

Examples

 > $\mathrm{restart}$
 > $\mathrm{with}\left(\mathrm{VectorCalculus}\right):$

Take the dot product of two free Vectors in cartesian coordinates.

 > $⟨1,1,1⟩·⟨-1,-1,1⟩$
 ${-1}$ (1)
 > $\mathrm{v1}≔\mathrm{Vector}\left(\left[1,-1,2\right],\mathrm{coordinates}=\mathrm{cartesian}\left[x,y,z\right]\right)$
 ${\mathrm{v1}}{≔}\left[\begin{array}{c}{1}\\ {-1}\\ {2}\end{array}\right]$ (2)
 > $\mathrm{v2}≔\mathrm{Vector}\left(\left[0,1,1\right],\mathrm{coordinates}=\mathrm{cartesian}\left[x,y,z\right]\right)$
 ${\mathrm{v2}}{≔}\left[\begin{array}{c}{0}\\ {1}\\ {1}\end{array}\right]$ (3)
 > $\mathrm{DotProduct}\left(\mathrm{v1},\mathrm{v2}\right)$
 ${1}$ (4)

Take the dot product of two rooted vectors if they have the same coordinate system and root point.

 > $\mathrm{vs}≔\mathrm{VectorSpace}\left(\left[1,\frac{\mathrm{\pi }}{3},\frac{\mathrm{\pi }}{3}\right],\mathrm{spherical}\left[r,p,t\right]\right)$
 ${\mathrm{vs}}{:=}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{local}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{_origin}}{,}{\mathrm{_coords}}{,}{\mathrm{_coords_dim}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{export}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{GetCoordinates}}{,}{\mathrm{GetRootPoint}}{,}{\mathrm{Vector}}{,}{\mathrm{eval}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (5)
 > $\mathrm{v1}≔\mathrm{RootedVector}\left(\mathrm{root}=\mathrm{vs},\left[1,1,1\right]\right)$
 ${\mathrm{v1}}{≔}\left[\begin{array}{c}{1}\\ {1}\\ {1}\end{array}\right]$ (6)
 > $\mathrm{v2}≔\mathrm{RootedVector}\left(\mathrm{root}=\mathrm{vs},\left[-1,1,0\right]\right)$
 ${\mathrm{v2}}{≔}\left[\begin{array}{c}{-1}\\ {1}\\ {0}\end{array}\right]$ (7)
 > $\mathrm{DotProduct}\left(\mathrm{v1},\mathrm{v2}\right)$
 ${0}$ (8)

The dot product of a cartesian free Vector and a rooted Vector is valid.

 > $\mathrm{v1}≔\mathrm{RootedVector}\left(\mathrm{root}=\left[1,\frac{\mathrm{\pi }}{4},1\right],\left[1,1,1\right],\mathrm{cylindrical}\left[r,p,h\right]\right)$
 ${\mathrm{v1}}{≔}\left[\begin{array}{c}{1}\\ {1}\\ {1}\end{array}\right]$ (9)
 > $\mathrm{v2}≔\mathrm{Vector}\left(\left[0,0,1\right],\mathrm{coordinates}=\mathrm{cartesian}\left[x,y,z\right]\right)$
 ${\mathrm{v2}}{≔}\left[\begin{array}{c}{0}\\ {0}\\ {1}\end{array}\right]$ (10)
 > $\mathrm{v2}·\mathrm{v1}$
 ${1}$ (11)

The dot product of two vector fields is defined if they are in the same coordinate system.

 > $\mathrm{vf1}≔\mathrm{VectorField}\left(⟨r,\mathrm{\phi },\mathrm{\theta }⟩,\mathrm{spherical}\left[r,\mathrm{\phi },\mathrm{\theta }\right]\right)$
 ${\mathrm{vf1}}{≔}\left({r}\right){\stackrel{{_}}{{e}}}_{{r}}{+}\left({\mathrm{\phi }}\right){\stackrel{{_}}{{e}}}_{{\mathrm{φ}}}{+}\left({\mathrm{\theta }}\right){\stackrel{{_}}{{e}}}_{{\mathrm{θ}}}$ (12)
 > $\mathrm{vf2}≔\mathrm{VectorField}\left(⟨{r}^{2},\mathrm{\phi }+\mathrm{\theta },0⟩,\mathrm{spherical}\left[r,\mathrm{\phi },\mathrm{\theta }\right]\right)$
 ${\mathrm{vf2}}{≔}\left({{r}}^{{2}}\right){\stackrel{{_}}{{e}}}_{{r}}{+}\left({\mathrm{\phi }}{+}{\mathrm{\theta }}\right){\stackrel{{_}}{{e}}}_{{\mathrm{φ}}}{+}\left({0}\right){\stackrel{{_}}{{e}}}_{{\mathrm{θ}}}$ (13)
 > $\mathrm{DotProduct}\left(\mathrm{vf1},\mathrm{vf2}\right)$
 ${{r}}^{{3}}{+}{\mathrm{\phi }}{}\left({\mathrm{\phi }}{+}{\mathrm{\theta }}\right)$ (14)

Use differential operators to compute the divergence of a vector field.

 > $\mathrm{vf1}≔\mathrm{VectorField}\left(⟨x,-yz,z⟩,\mathrm{cartesian}\left[x,y,z\right]\right)$
 ${\mathrm{vf1}}{≔}\left({x}\right){\stackrel{{_}}{{e}}}_{{x}}{+}\left({-}{y}{}{z}\right){\stackrel{{_}}{{e}}}_{{y}}{+}\left({z}\right){\stackrel{{_}}{{e}}}_{{z}}$ (15)
 > $\mathrm{Del}·\mathrm{vf1}$
 ${2}{-}{z}$ (16)
 > $\mathrm{vf2}≔\mathrm{VectorField}\left(⟨rt,\mathrm{\phi },t⟩,\mathrm{cylindrical}\left[r,\mathrm{\phi },t\right]\right)$
 ${\mathrm{vf2}}{≔}\left({r}{}{t}\right){\stackrel{{_}}{{e}}}_{{r}}{+}\left({\mathrm{\phi }}\right){\stackrel{{_}}{{e}}}_{{\mathrm{φ}}}{+}\left({t}\right){\stackrel{{_}}{{e}}}_{{t}}$ (17)
 > $\mathrm{Del}·\mathrm{vf2}$
 $\frac{{2}{}{r}{}{t}{+}{r}{+}{1}}{{r}}$ (18)

Construct a directional derivative operator.

 > $V≔\mathrm{VectorField}\left(⟨x,-yz,z⟩,\mathrm{cartesian}\left[x,y,z\right]\right)$
 ${V}{≔}\left({x}\right){\stackrel{{_}}{{e}}}_{{x}}{+}\left({-}{y}{}{z}\right){\stackrel{{_}}{{e}}}_{{y}}{+}\left({z}\right){\stackrel{{_}}{{e}}}_{{z}}$ (19)
 > $W≔\mathrm{VectorField}\left(⟨yz,xz,xy⟩,\mathrm{cartesian}\left[x,y,z\right]\right)$
 ${W}{≔}\left({y}{}{z}\right){\stackrel{{_}}{{e}}}_{{x}}{+}\left({x}{}{z}\right){\stackrel{{_}}{{e}}}_{{y}}{+}\left({x}{}{y}\right){\stackrel{{_}}{{e}}}_{{z}}$ (20)
 > $\left(V·\mathrm{Del}\right)\left(W\right)$
 $\left({-}{y}{}{{z}}^{{2}}{+}{y}{}{z}\right){\stackrel{{_}}{{e}}}_{{x}}{+}\left({2}{}{x}{}{z}\right){\stackrel{{_}}{{e}}}_{{y}}{+}\left({-}{y}{}{z}{}{x}{+}{x}{}{y}\right){\stackrel{{_}}{{e}}}_{{z}}$ (21)

The dot product of two position vectors is defined.

 > $\mathrm{pv1}≔\mathrm{PositionVector}\left(\left[p,p\right],\mathrm{polar}\left[r,t\right]\right)$
 ${\mathrm{pv1}}{≔}\left[\begin{array}{c}{p}{}{\mathrm{cos}}{}\left({p}\right)\\ {p}{}{\mathrm{sin}}{}\left({p}\right)\end{array}\right]$ (22)
 > $\mathrm{pv2}≔\mathrm{PositionVector}\left(\left[1,p\right],\mathrm{parabolic}\left[u,v\right]\right)$
 ${\mathrm{pv2}}{≔}\left[\begin{array}{c}\frac{{1}}{{2}}{-}\frac{{{p}}^{{2}}}{{2}}\\ {p}\end{array}\right]$ (23)
 > $\mathrm{pv1}·\mathrm{pv2}$
 ${p}{}{\mathrm{cos}}{}\left({p}\right){}\left(\frac{{1}}{{2}}{-}\frac{{{p}}^{{2}}}{{2}}\right){+}{{p}}^{{2}}{}{\mathrm{sin}}{}\left({p}\right)$ (24)

The dot product of a cartesian free Vector and a cartesian vector field is defined.

 > $\mathrm{vf3}≔\mathrm{VectorField}\left(⟨yz,xz,xy⟩,\mathrm{cartesian}\left[x,y,z\right]\right)$
 ${\mathrm{vf3}}{≔}\left({y}{}{z}\right){\stackrel{{_}}{{e}}}_{{x}}{+}\left({x}{}{z}\right){\stackrel{{_}}{{e}}}_{{y}}{+}\left({x}{}{y}\right){\stackrel{{_}}{{e}}}_{{z}}$ (25)
 > $\mathrm{v3}≔\mathrm{Vector}\left(\left[1,2,1\right],\mathrm{coordinates}=\mathrm{cartesian}\left[x,y,z\right]\right)$
 ${\mathrm{v3}}{≔}\left[\begin{array}{c}{1}\\ {2}\\ {1}\end{array}\right]$ (26)
 > $\mathrm{vf3}·\mathrm{v3}$
 ${x}{}{y}{+}{2}{}{x}{}{z}{+}{y}{}{z}$ (27)