eval - Maple Help

VectorCalculus

 eval
 evaluation for Vectors

 Calling Sequence eval(v, t=a) eval(v, eqns)

Parameters

 v - Vector(algebraic); Vector or algebraic expression t - name; usually a name but may be a general expression a - expression eqns - list or set; list or set of equations

Description

 • The eval(v, eqns) command is an extension of the top-level eval command which correctly evaluates free Vectors , rooted Vectors, position Vectors, and VectorFields for the VectorCalculus package.  If v is not a Vector, the arguments are passed to the top level eval command.
 • If v is a rooted Vector then both the root point or origin and the components, corresponding to the coefficients of the basis vectors, are evaluated.
 • If v is a VectorField, then the components are evaluated and a VectorField is returned. To properly evaluate a VectorField at a point use evalVF.
 • If v is a free Vector or a position Vector, then the components are evaluated. The type of the Vector does not change.

Examples

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

Evaluating free Vectors

 > $\mathrm{eval}\left(⟨1,t,{t}^{2}⟩,t=1\right)$
 $\left({1}\right){{e}}_{{x}}{+}\left({1}\right){{e}}_{{y}}{+}\left({1}\right){{e}}_{{z}}$ (1)
 > $\mathrm{v1}≔\mathrm{Vector}\left(⟨x,{y}^{2},{z}^{3}⟩,\mathrm{coords}=\mathrm{cartesian}\left[x,y,z\right]\right)$
 ${\mathrm{v1}}{≔}\left({x}\right){{e}}_{{x}}{+}\left({{y}}^{{2}}\right){{e}}_{{y}}{+}\left({{z}}^{{3}}\right){{e}}_{{z}}$ (2)
 > $\mathrm{eval}\left(\mathrm{v1},\left[x=1,y=2,z=3\right]\right)$
 $\left({1}\right){{e}}_{{x}}{+}\left({4}\right){{e}}_{{y}}{+}\left({27}\right){{e}}_{{z}}$ (3)

Evaluating rooted Vectors: both the root point and the components are evaluated.

 > $\mathrm{v2}≔\mathrm{RootedVector}\left(\mathrm{point}=\left[u,\mathrm{\pi }\right],\left[u,v\right],\mathrm{polar}\left[r,t\right]\right)$
 ${\mathrm{v2}}{≔}\left[\begin{array}{c}{u}\\ {v}\end{array}\right]$ (4)
 > $\mathrm{eval}\left(\mathrm{v2},\left\{u=1,v=2\right\}\right)$
 $\left[\begin{array}{c}{1}\\ {2}\end{array}\right]$ (5)
 > $\mathrm{GetRootPoint}\left(\mathrm{eval}\left(\mathrm{v2},\left[u=1,v=2\right]\right)\right)$
 $\left({1}\right){{e}}_{{r}}{+}\left({\mathrm{\pi }}\right){{e}}_{{t}}$ (6)

If the components have no variables then the root point is evaluated.

 > $\mathrm{v3}≔\mathrm{RootedVector}\left(\mathrm{point}=\left[s,t\right],\left[1,2\right],\mathrm{parabolic}\left[u,v\right]\right)$
 ${\mathrm{v3}}{≔}\left[\begin{array}{c}{1}\\ {2}\end{array}\right]$ (7)
 > $\mathrm{eval}\left(\mathrm{v3},\left\{s=1,t=\mathrm{\pi }\right\}\right)$
 $\left[\begin{array}{c}{1}\\ {2}\end{array}\right]$ (8)
 > $\mathrm{GetRootPoint}\left(\mathrm{eval}\left(\mathrm{v3}\right)\right)$
 $\left({s}\right){{e}}_{{u}}{+}\left({t}\right){{e}}_{{v}}$ (9)

If the root point has no variables then the components are evaluated.

 > $\mathrm{v4}≔\mathrm{RootedVector}\left(\mathrm{point}=\left[1,\frac{\mathrm{\pi }}{4},\frac{\mathrm{\pi }}{4}\right],\left[u,v,w\right],\mathrm{spherical}\left[r,p,t\right]\right)$
 ${\mathrm{v4}}{≔}\left[\begin{array}{c}{u}\\ {v}\\ {w}\end{array}\right]$ (10)
 > $\mathrm{eval}\left(\mathrm{v4},\left\{u=1,v=-1,w=1\right\}\right)$
 $\left[\begin{array}{c}{1}\\ {-1}\\ {1}\end{array}\right]$ (11)
 > $\mathrm{GetRootPoint}\left(\mathrm{v4}\right)$
 $\left({1}\right){{e}}_{{r}}{+}\left(\frac{{\mathrm{\pi }}}{{4}}\right){{e}}_{{p}}{+}\left(\frac{{\mathrm{\pi }}}{{4}}\right){{e}}_{{t}}$ (12)

Evaluating position Vectors

 > $\mathrm{pv1}≔\mathrm{PositionVector}\left(\left[t,t\right],\mathrm{polar}\right)$
 ${\mathrm{pv1}}{≔}\left[\begin{array}{c}{t}{}{\mathrm{cos}}{}\left({t}\right)\\ {t}{}{\mathrm{sin}}{}\left({t}\right)\end{array}\right]$ (13)
 > $\mathrm{eval}\left(\mathrm{pv1},t=3\right)$
 $\left[\begin{array}{c}{3}{}{\mathrm{cos}}{}\left({3}\right)\\ {3}{}{\mathrm{sin}}{}\left({3}\right)\end{array}\right]$ (14)
 > $\mathrm{pv2}≔\mathrm{PositionVector}\left(\left[t,\frac{v}{\mathrm{sqrt}\left(1+{t}^{2}\right)},\frac{vt}{\mathrm{sqrt}\left(1+{t}^{2}\right)}\right],\mathrm{cartesian}\left[x,y,z\right]\right)$
 ${\mathrm{pv2}}{≔}\left[\begin{array}{c}{t}\\ \frac{{v}}{\sqrt{{{t}}^{{2}}{+}{1}}}\\ \frac{{v}{}{t}}{\sqrt{{{t}}^{{2}}{+}{1}}}\end{array}\right]$ (15)
 > $\mathrm{eval}\left(\mathrm{pv2},\left\{t=3,v=4\right\}\right)$
 $\left[\begin{array}{c}{3}\\ \frac{{2}{}\sqrt{{10}}}{{5}}\\ \frac{{6}{}\sqrt{{10}}}{{5}}\end{array}\right]$ (16)

Evaluating VectorFields: eval evaluates the components and returns a VectorField.

 > $\mathrm{vf}≔\mathrm{VectorField}\left(⟨\frac{1}{{r}^{2}},0,0⟩,\mathrm{spherical}\left[r,p,t\right]\right)$
 ${\mathrm{vf}}{≔}\left(\frac{{1}}{{{r}}^{{2}}}\right){\stackrel{{_}}{{e}}}_{{r}}{+}\left({0}\right){\stackrel{{_}}{{e}}}_{{p}}{+}\left({0}\right){\stackrel{{_}}{{e}}}_{{t}}$ (17)
 > $\mathrm{eval}\left(\mathrm{vf},r=1\right)$
 $\left({1}\right){\stackrel{{_}}{{e}}}_{{r}}{+}\left({0}\right){\stackrel{{_}}{{e}}}_{{p}}{+}\left({0}\right){\stackrel{{_}}{{e}}}_{{t}}$ (18)
 > $\mathrm{attributes}\left(\mathrm{eval}\left(\mathrm{vf},r=1\right)\right)$
 ${\mathrm{vectorfield}}{,}{\mathrm{coords}}{=}{{\mathrm{spherical}}}_{{r}{,}{p}{,}{t}}$ (19)