Student/VectorCalculus/DirectionalDiff - Maple Help

Student[VectorCalculus]

 DirectionalDiff
 computes the directional derivative of a scalar field in the direction given by a vector

 Calling Sequence DirectionalDiff(F,v,c) DirectionalDiff(F,p,d,c)

Parameters

 F - algebraic; the scalar or vector field to differentiate v - Vector(algebraic); the direction Vector or vector field c - (optional) name or name[name, name,...]; list of names or name of the coordinate system, possibly indexed by the coordinate names p - point=list(algebraic) or point=Vector(algebraic); point where the derivative will be evaluated d - list(algebraic) or Vector(algebraic); components specifying the direction of the directional derivative in a specified coordinate system.

Description

 • The DirectionalDiff(F,v,c) command computes the directional derivative of an expression F at the location and direction specified by v.  The expression F is interpreted in the coordinate system specified by c, if provided, and otherwise in the current coordinate system.

The argument v can be a free Vector in Cartesian coordinates, a position Vector, a vector field or a rooted Vector.  If v is one of the first three, the result will be a scalar field of all directional derivatives in ${R}^{n}$ in the directions specified by v; this scalar field will be given in the same coordinate system as is used to interpret expression F.  If v is a rooted Vector, the result is the value of the directional derivative of F in the direction of v taken at the root point of v.

 • The DirectionalDiff(F,p,d,c) command computes the directional derivative of F at the point p in the direction d, where F is interpreted in the coordinate system specified by c, if provided, and otherwise in the current coordinate system.  The point p can be a list, a free Vector in Cartesian coordinates or a position Vector. The direction d can be a free Vector in Cartesian coordinates, a position Vector or a vector field.  The result is the value of DirectionalDiff(F,d,c) evaluated at the point p.
 – If c is a list of names, the directional derivative of F is taken with respect to these names in the current coordinate system.
 – If c is an indexed coordinate system, F is interpreted in the combination of that coordinate system and coordinate names.
 – If c is not specified, F is interpreted in the current coordinate system, whose coordinate name indices define the function's variables.
 – If c is not specified, and the current coordinate name is not indexed by any coordinate variable names, then the first n indeterminates of F, sorted alphabetically, will define the function's variables, where n is determined by the dimension of the current coordinate system. If this fails because there are not enough indeterminates in F, then the standard coordinate names will define the function's variables. For example, r and theta will be used for polar coordinates.

Note that c has no influence on the interpretation of the direction vector v.

Examples

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

Introductory examples where a coordinate system is specified

 > $\mathrm{SetCoordinates}\left(\mathrm{cartesian}\left[x,y\right]\right)$
 ${{\mathrm{cartesian}}}_{{x}{,}{y}}$ (1)
 > $\mathrm{v1}≔⟨1,2⟩:$
 > $\mathrm{DirectionalDiff}\left({r}^{2},\mathrm{v1},\mathrm{polar}\left[r,t\right]\right)$
 $\frac{{2}{}{r}{}{\mathrm{cos}}{}\left({t}\right){}\sqrt{{5}}}{{5}}{+}\frac{{4}{}{r}{}{\mathrm{sin}}{}\left({t}\right){}\sqrt{{5}}}{{5}}$ (2)
 > $W≔\mathrm{VectorField}\left(⟨u+v,v⟩,\mathrm{cartesian}\left[u,v\right]\right)$
 ${W}{≔}\left({u}{+}{v}\right){\stackrel{{_}}{{e}}}_{{u}}{+}\left({v}\right){\stackrel{{_}}{{e}}}_{{v}}$ (3)
 > $\mathrm{DirectionalDiff}\left({r}^{2},\mathrm{point}=\left[1,\mathrm{\pi }\right],W,\mathrm{polar}\left[r,t\right]\right)$
 ${2}$ (4)
 > $\mathrm{dd}≔\mathrm{DirectionalDiff}\left({r}^{2},W,\mathrm{polar}\left[r,t\right]\right):$
 > $\mathrm{simplify}\left(\mathrm{eval}\left(\mathrm{dd},\left[r=1,t=\mathrm{\pi }\right]\right)\right)$
 ${2}$ (5)

Examples where a list of variable names is provided

 > $\mathrm{DirectionalDiff}\left(pq,⟨1,2⟩,\left[p,q\right]\right)$
 $\frac{{q}{}\sqrt{{5}}}{{5}}{+}\frac{{2}{}{p}{}\sqrt{{5}}}{{5}}$ (6)
 > $\mathrm{v2}≔⟨1,0⟩:$
 > $\mathrm{SetCoordinates}\left(\mathrm{polar}\right)$
 ${{\mathrm{polar}}}_{{r}{,}{\mathrm{\theta }}}$ (7)
 > $\mathrm{dd}≔\mathrm{DirectionalDiff}\left(r\mathrm{cos}\left(\mathrm{\theta }\right),\mathrm{v2},\left[r,\mathrm{\theta }\right]\right):$
 > $\mathrm{simplify}\left(\mathrm{dd}\right)$
 ${1}$ (8)

Examples where the information is given in the form of a Rooted Vector

 > $\mathrm{SetCoordinates}\left(\mathrm{polar}\left[r,t\right]\right)$
 ${{\mathrm{polar}}}_{{r}{,}{t}}$ (9)
 > $\mathrm{vs}≔\mathrm{VectorSpace}\left(\left[1,\frac{\mathrm{\pi }}{2}\right],\mathrm{polar}\left[r,t\right]\right):$
 > $\mathrm{v3}≔\mathrm{vs}:-\mathrm{Vector}\left(\left[1,1\right]\right)$
 ${\mathrm{v3}}{≔}\left[\begin{array}{c}{1}\\ {1}\end{array}\right]$ (10)
 > $\mathrm{v4}≔\mathrm{vs}:-\mathrm{Vector}\left(\left[0,1\right]\right)$
 ${\mathrm{v4}}{≔}\left[\begin{array}{c}{0}\\ {1}\end{array}\right]$ (11)
 > $\mathrm{DirectionalDiff}\left({r}^{2},\mathrm{v3}\right)$
 $\sqrt{{2}}$ (12)
 > $\mathrm{DirectionalDiff}\left({r}^{2},\mathrm{v4}\right)$
 ${0}$ (13)
 > $\mathrm{SetCoordinates}\left(\mathrm{cartesian}\left[x,y\right]\right)$
 ${{\mathrm{cartesian}}}_{{x}{,}{y}}$ (14)
 > $\mathrm{DirectionalDiff}\left({y}^{2}{x}^{2},\mathrm{point}=\left[1,2\right],⟨0,1⟩,\mathrm{cartesian}\left[x,y\right]\right)$
 ${4}$ (15)
 > $\mathrm{DirectionalDiff}\left({y}^{2}{x}^{2},\mathrm{RootedVector}\left(\mathrm{root}=\left[1,2\right],\left[0,1\right]\right),\mathrm{cartesian}\left[x,y\right]\right)$
 ${4}$ (16)
 > $\mathrm{DirectionalDiff}\left({y}^{2}{x}^{2},\mathrm{RootedVector}\left(\mathrm{root}=\left[1,\frac{\mathrm{\pi }}{2}\right],\left[1,1\right],\mathrm{polar}\left[r,t\right]\right),\mathrm{cartesian}\left[x,y\right]\right)$
 ${0}$ (17)

Examples using the dot operator to construct a directional derivative operator

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