plots[gradplot]  plot a 2D gradient vector field

Calling Sequence


gradplot(f, r1, r2, options)
gradplot(f, r1, r2,..., options)


Parameters


f



function or set of function to be plotted

r1



range

r2



range

options



options that control the behavior of the gradplot





Description


•

A typical call to the gradplot function is gradplot(f, x=a..b, y=c..d), where f is a Maple expression in x and y, and and specifies the horizontal and vertical ranges of the field. The result is a two dimensional vectorfield with the gradient vector evaluated at (x, y) located at this point.

•

A call to gradplot produces a PLOT data structure, which is then printed. For information on these data structures, see plot/structure.

•

Remaining arguments are interpreted as options which are specified as equations of the form option = value. In particular, following optional arguments are available:

•

The arrows option allows one to specify the style of arrow used to represent a vector. The possibilities are LINE, THIN, SLIM and THICK with THIN being the default.

•

The grid option allows one to set the initial size of the two or three dimensional grid. The default is [20,20].

•

The fieldstrength option allows finer control of how the size of the drawn vectors corresponds to the strength of the field. The following options are available:


average or average(v): The size of the arrow corresponds to the ratio of the field strength at the given point to the average field strength at all points in the grid. The value v (by default is ) multiplies the computed average to determine the maximum arrow size. The drawing of arrows that are larger than the maximum size is controlled through the clipping option (see below). This option is most useful for fields that have large regions with small values, as it allows scaling up to view the field direction for those regions.

•

The clipping boolean option specifies how to draw arrows that have too large a magnitude. If set to true, arrows are drawn without an arrow head. If set to false, arrows are drawn with their magnitude. By default, this option is true. This option is only useful if the fieldstrength option is used to increase the size of the arrows.

•

Use with Coordinate Transforms


Some discussion of the behavior of gradplot when used in combination with the coords options is required.


Under a coordinate transform, both the field and the location of the arrows are adjusted. Options like view and axes labels apply only to the plot after the transform has been applied.


A significant issue arises when scaling the arrows that describe the vector field after the transform has been applied. Specifically, the transform may map many points on the grid to nearly the same area in the transformed region. The gradplot command uses an averaging technique to determine a suitable rescaling of the field vectors after the transform. In some cases, this may not be what is desired, so the fieldstrength and clipping options can be used to adjust the plot.


In addition, arrows that are located at transform singularities are not drawn if they have a component in a direction that becomes undefined at the singularity. As an example, a purely radial field will always have arrows drawn in polar coordinates, but the field will have no arrows drawn at .

•

The remaining options are the same as those available for the plot command. For more information, see plot/options.

•

gradplot may be defined by with(plots) or with(plots,gradplot). It can also be used by the name plots[gradplot] .



Examples


>


>


>


The command to create the plot from the Plotting Guide is
>



