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

 > $\genfrac{}{}{0}{}{⟨1,t,{t}^{2}⟩}{\phantom{t=1}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{⟨1,t,{t}^{2}⟩}}{t=1}$
 > $\mathrm{v1}≔\mathrm{Vector}\left(⟨x,{y}^{2},{z}^{3}⟩,\mathrm{coords}={\mathrm{cartesian}}_{x,y,z}\right)$
 > $\mathrm{eval}\left(\mathrm{v1},\left[x=1,y=2,z=3\right]\right)$

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}}_{r,t}\right)$
 ${\mathrm{v2}}{≔}\left[\begin{array}{c}{u}\\ {v}\end{array}\right]$ (1)
 > $\genfrac{}{}{0}{}{\mathrm{v2}}{\phantom{u=1,v=2}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{v2}}}{u=1,v=2}$
 $\left[\begin{array}{c}{1}\\ {2}\end{array}\right]$ (2)
 > $\mathrm{GetRootPoint}\left(\mathrm{eval}\left(\mathrm{v2},\left[u=1,v=2\right]\right)\right)$

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}}_{u,v}\right)$
 ${\mathrm{v3}}{≔}\left[\begin{array}{c}{1}\\ {2}\end{array}\right]$ (3)
 > $\genfrac{}{}{0}{}{\mathrm{v3}}{\phantom{s=1,t=\mathrm{Pi}}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{v3}}}{s=1,t=\mathrm{Pi}}$
 $\left[\begin{array}{c}{1}\\ {2}\end{array}\right]$ (4)
 > $\mathrm{GetRootPoint}\left(\mathrm{eval}\left(\mathrm{v3}\right)\right)$

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}}_{r,p,t}\right)$
 ${\mathrm{v4}}{≔}\left[\begin{array}{c}{u}\\ {v}\\ {w}\end{array}\right]$ (5)
 > $\genfrac{}{}{0}{}{\mathrm{v4}}{\phantom{u=1,v=-1,w=1}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{v4}}}{u=1,v=-1,w=1}$
 $\left[\begin{array}{c}{1}\\ {-1}\\ {1}\end{array}\right]$ (6)
 > $\mathrm{GetRootPoint}\left(\mathrm{v4}\right)$

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]$ (7)
 > $\genfrac{}{}{0}{}{\mathrm{pv1}}{\phantom{t=3}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{pv1}}}{t=3}$
 > $\mathrm{pv2}≔\mathrm{PositionVector}\left(\left[t,\frac{v}{\sqrt{1+{t}^{2}}},\frac{vt}{\sqrt{1+{t}^{2}}}\right],{\mathrm{cartesian}}_{x,y,z}\right)$
 ${\mathrm{pv2}}{≔}\left[\begin{array}{c}{t}\\ \frac{{v}}{\sqrt{{{t}}^{{2}}{+}{1}}}\\ \frac{{v}{}{t}}{\sqrt{{{t}}^{{2}}{+}{1}}}\end{array}\right]$ (8)
 > $\genfrac{}{}{0}{}{\mathrm{pv2}}{\phantom{t=3,v=4}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{pv2}}}{t=3,v=4}$

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

 > $\mathrm{vf}≔\mathrm{VectorField}\left(⟨\frac{1}{{r}^{2}},0,0⟩,{\mathrm{spherical}}_{r,p,t}\right)$
 > $\genfrac{}{}{0}{}{\mathrm{vf}}{\phantom{r=1}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{vf}}}{r=1}$
 > $\mathrm{attributes}\left(\genfrac{}{}{0}{}{\mathrm{vf}}{\phantom{r=1}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{vf}}}{r=1}\right)$
 ${\mathrm{vectorfield}}{,}{\mathrm{coords}}{=}{{\mathrm{spherical}}}_{{r}{,}{p}{,}{t}}$ (9)