MapToBasis - Maple Help

VectorCalculus

 MapToBasis
 convert Vectors and vector fields between different coordinate systems

 Calling Sequence MapToBasis(V,c,p)

Parameters

 V - Vector(algebraic) or Vector valued procedure; specify the free Vector, rooted Vector of vector field to be converted c - (optional) name or name[name, name, ...]; specify the target coordinate system. p - (optional) list or Vector(algebraic); specify the target root point.

Description

 • The MapToBasis(V, c) command converts Vectors and vector fields between different coordinate systems.
 • If V is a Vector valued procedure, it is interpreted as a vector field. Otherwise, a vector field is a Vector created by a call to the VectorField routine.
 • If c is not specified, the current coordinate system is used. If V represents a vector field, the implied coordinates must be indexed with the names of the new coordinates. Otherwise, an error is raised. If V represents a Vector, no coordinate names are required.
 • If a coordinate system attribute is specified on V, V is interpreted in this coordinate system. Otherwise, the object is interpreted as a Vector or vector field in the current coordinate system. If the two are not compatible, an error is raised.
 • If p is specified and v is a free Vector in Cartesian coordinates, the result will be a rooted Vector with a root point p. If p is a list, it will be interpreted as Cartesian coordinates.

Examples

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

MapToBasis with free Vectors

 > $\mathrm{GetCoordinates}\left(\right)$
 ${\mathrm{cartesian}}$ (1)
 > $\mathrm{v1}≔\mathrm{MapToBasis}\left(⟨1,1⟩,\mathrm{polar}\right)$
 ${\mathrm{v1}}{≔}\left(\sqrt{{2}}\right){{e}}_{{r}}{+}\left(\frac{{\mathrm{\pi }}}{{4}}\right){{e}}_{{\mathrm{θ}}}$ (2)
 > $\mathrm{MapToBasis}\left(\mathrm{v1},\mathrm{cartesian}\right)$
 $\left({1}\right){{e}}_{{x}}{+}\left({1}\right){{e}}_{{y}}$ (3)
 > $\mathrm{v2}≔⟨r,\mathrm{\theta }⟩$
 ${\mathrm{v2}}{≔}\left({r}\right){{e}}_{{x}}{+}\left({\mathrm{\theta }}\right){{e}}_{{y}}$ (4)
 > $\mathrm{SetCoordinates}\left(\mathrm{v2},\mathrm{polar}\right)$
 $\left({r}\right){{e}}_{{r}}{+}\left({\mathrm{\theta }}\right){{e}}_{{\mathrm{θ}}}$ (5)
 > $\mathrm{MapToBasis}\left(\mathrm{v2}\right)$
 $\left({r}{}{\mathrm{cos}}{}\left({\mathrm{\theta }}\right)\right){{e}}_{{x}}{+}\left({r}{}{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)\right){{e}}_{{y}}$ (6)

Using MapToBasis with free Vectors to get a rooted Vector

 > $\mathrm{v3}≔\mathrm{MapToBasis}\left(⟨a,b⟩,\mathrm{polar},\left[0,1\right]\right)$
 ${\mathrm{v3}}{≔}\left[\begin{array}{c}{b}\\ {-}{a}\end{array}\right]$ (7)
 > $\mathrm{About}\left(\mathrm{v3}\right)$
 $\left[\begin{array}{cc}{\mathrm{Type:}}& {\mathrm{Rooted Vector}}\\ {\mathrm{Components:}}& \left[{b}{,}{-}{a}\right]\\ {\mathrm{Coordinates:}}& {\mathrm{polar}}\\ {\mathrm{Root Point:}}& \left[{1}{,}\frac{{\mathrm{\pi }}}{{2}}\right]\end{array}\right]$ (8)
 > $\mathrm{SetCoordinates}\left(\mathrm{spherical}\left[r,\mathrm{\phi },\mathrm{\theta }\right]\right)$
 ${{\mathrm{spherical}}}_{{r}{,}{\mathrm{\phi }}{,}{\mathrm{\theta }}}$ (9)

MapToBasis with vector fields

 > $\mathrm{VF}≔\mathrm{VectorField}\left(⟨r,0,0⟩\right)$
 ${\mathrm{VF}}{≔}\left({r}\right){\stackrel{{_}}{{e}}}_{{r}}{+}\left({0}\right){\stackrel{{_}}{{e}}}_{{\mathrm{φ}}}{+}\left({0}\right){\stackrel{{_}}{{e}}}_{{\mathrm{θ}}}$ (10)
 > $\mathrm{MapToBasis}\left(\mathrm{VF},\mathrm{cartesian}\left[x,y,z\right]\right)$
 $\left({x}\right){\stackrel{{_}}{{e}}}_{{x}}{+}\left({y}\right){\stackrel{{_}}{{e}}}_{{y}}{+}\left({z}\right){\stackrel{{_}}{{e}}}_{{z}}$ (11)

MapToBasis with Vector-valued procedures

 > $\mathrm{MapToBasis}\left(\left(r,\mathrm{\phi },\mathrm{\theta }\right)↦⟨\frac{1}{{r}^{2}},0,0⟩,\mathrm{cartesian}\left[x,y,z\right]\right)$
 $\left(\frac{{x}}{{\left({{x}}^{{2}}{+}{{y}}^{{2}}{+}{{z}}^{{2}}\right)}^{{3}}{{2}}}}\right){\stackrel{{_}}{{e}}}_{{x}}{+}\left(\frac{{y}}{{\left({{x}}^{{2}}{+}{{y}}^{{2}}{+}{{z}}^{{2}}\right)}^{{3}}{{2}}}}\right){\stackrel{{_}}{{e}}}_{{y}}{+}\left(\frac{{z}}{{\left({{x}}^{{2}}{+}{{y}}^{{2}}{+}{{z}}^{{2}}\right)}^{{3}}{{2}}}}\right){\stackrel{{_}}{{e}}}_{{z}}$ (12)