VectorField - Maple Help

Student[VectorCalculus]

 VectorField
 create a vector field

 Calling Sequence VectorField(v, c, options)

Parameters

 v - list or Vector; components specifying the coefficients of the basis vectors at each point in space c - (optional) name or indexed name; specify the coordinate system options - (optional) equation(s) of the form option=value where option is one of output, fieldoptions, title, or view

Description

 • The VectorField(v) command creates a vector field, one of the four principal Vector data structures of the Student[VectorCalculus] package.  Note that the Student[VectorCalculus] and the VectorCalculus packages share the same Vector data structures.
 • For details on the differences between the four principal Vector data structures, namely, vector fields, position Vectors, rooted Vectors, and free Vectors, see VectorCalculus,Details.
 • A vector field is a Vector that has a vectorfield attribute and a coordinate system attribute. The coordinate system used to define this vector field is determined as follows.
 – If a coordinate system has been set by a call to SetCoordinates, that system is used;
 – Otherwise, if the Vector v has an associated coordinate system (see Vector), that system is used;
 – Otherwise, Maple will choose a default coordinate system, which will be a two- or three-dimensional cartesian system, depending on whether v is two- or three-dimensional.
 • The VectorField(v,c) command creates a vector field using the coordinate system c. If c is an indexed name, the coordinate names given in the index are used. Otherwise, default coordinates names are used.
 • Most commands in the Student[VectorCalculus] package that operate on vector fields also accept a Vector-valued operator; in this case, the output is generally an operator.
 Note: A Vector that is not a vector field is not interpreted as a constant vector field by the Student[VectorCalculus] package commands. Vector Fields and the other Vectors cannot be used interchangeably.
 • By default, Vectors and vector fields created by commands from the Student[VectorCalculus] package are displayed using basis format, that is, as a sum of scalar multiples of basis vectors.  Vector fields are visually distinguished in this format by displaying an overbar above each basis vector. For more information on Vector display formats, see BasisFormat.
 • To evaluate a Vector field at a point, use the evalVF command.
 • The options arguments primarily control plot options.
 arrows=t
 This option specifies the style of arrows used in a field plot. The style (t) can be one of: line, small (or thin), medium (or slim) and large (or thick).
 output = value or plot
 This option controls the return value of the command.
 – output = value returns the Vector field object. Plot options are ignored if output = value.  This is the default value.
 – output = plot returns a field plot of the vector field.
 • fieldoptions = list
 A list of plot options for plotting the field plot. For more information on plotting options, see plot/options. The default value is []. A list of plot options for plotting the Vector field. The field is plotted using a call to plots[fieldplot] or plots[fieldplot3d], so options valid for these commands can be passed in this option.
 • title = string
 Give the plot a title. The default value is the empty string.
 • view = [realcons..realcons, realcons..realcons, realcons..realcons] (3-D) or [realcons..realcons, realcons..realcons] (2-D)
 Specify the plot view. For more information, see plot3d/option or plot/options.
 • caption = anything
 A caption for the plot.
 The default caption is constructed from the parameters and the command options. caption = "" disables the default caption. For more information about specifying a caption, see plot/typesetting.

Examples

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

Note the overbars on the basis vectors.

 > $\mathrm{v1}≔\mathrm{VectorField}\left(⟨{x}^{2},{y}^{2}⟩\right)$
 ${\mathrm{v1}}{≔}\left({{x}}^{{2}}\right){\stackrel{{_}}{{e}}}_{{x}}{+}\left({{y}}^{{2}}\right){\stackrel{{_}}{{e}}}_{{y}}$ (1)
 > $\mathrm{evalVF}\left(\mathrm{v1},⟨2,3⟩\right)$
 $\left[\begin{array}{c}{4}\\ {9}\end{array}\right]$ (2)
 > $\mathrm{SetCoordinates}\left(\mathrm{spherical}\left[r,\mathrm{\phi },\mathrm{\theta }\right]\right)$
 ${{\mathrm{spherical}}}_{{r}{,}{\mathrm{\phi }}{,}{\mathrm{\theta }}}$ (3)
 > $\mathrm{v2}≔\mathrm{VectorField}\left(⟨\frac{1}{{r}^{2}},0,1⟩\right)$
 ${\mathrm{v2}}{≔}\left(\frac{{1}}{{{r}}^{{2}}}\right){\stackrel{{_}}{{e}}}_{{r}}{+}\left({0}\right){\stackrel{{_}}{{e}}}_{{\mathrm{φ}}}{+}\left({1}\right){\stackrel{{_}}{{e}}}_{{\mathrm{θ}}}$ (4)
 > $\mathrm{Flux}\left(\mathrm{v2},\mathrm{Box}\left(-1..1,-1..1,-1..1\right)\right)$
 ${4}{}{\mathrm{\pi }}$ (5)
 > $\mathrm{v3}≔\mathrm{VectorField}\left(⟨r\mathrm{\theta },\mathrm{\theta },{z}^{2}⟩,\mathrm{cylindrical}\left[r,\mathrm{\theta },z\right]\right)$
 ${\mathrm{v3}}{≔}\left({r}{}{\mathrm{\theta }}\right){\stackrel{{_}}{{e}}}_{{r}}{+}\left({\mathrm{\theta }}\right){\stackrel{{_}}{{e}}}_{{\mathrm{θ}}}{+}\left({{z}}^{{2}}\right){\stackrel{{_}}{{e}}}_{{z}}$ (6)
 > $\mathrm{Curl}\left(\mathrm{v3}\right)$
 $\left({0}\right){\stackrel{{_}}{{e}}}_{{r}}{+}\left({0}\right){\stackrel{{_}}{{e}}}_{{\mathrm{θ}}}{+}\left(\frac{{\mathrm{\theta }}{-}{r}}{{r}}\right){\stackrel{{_}}{{e}}}_{{z}}$ (7)
 > $\mathrm{SetCoordinates}\left(\mathrm{cartesian}\left[x,y\right]\right)$
 ${{\mathrm{cartesian}}}_{{x}{,}{y}}$ (8)
 > $\mathrm{VectorField}\left(⟨y,-x⟩,\mathrm{output}=\mathrm{plot},\mathrm{scaling}=\mathrm{constrained}\right)$

The command to create the plot from the Plotting Guide is

 > $\mathrm{VectorField}\left(⟨y,-x⟩,\mathrm{output}=\mathrm{plot},\mathrm{view}=\left[-4..4,-4..4\right],\mathrm{scaling}=\mathrm{constrained},\mathrm{color}="NavyBlue",\mathrm{fieldoptions}=\left[\mathrm{fieldstrength}=\mathrm{fixed},\mathrm{arrows}=\mathrm{SLIM},\mathrm{grid}=\left[10,10\right]\right]\right)$

The flux computation above can be visualized using the following command.

 > $\mathrm{Flux}\left(\mathrm{v2},\mathrm{Box}\left(-1..1,-1..1,-1..1\right),\mathrm{output}=\mathrm{plot},\mathrm{scaling}=\mathrm{constrained}\right)$