fieldplot3d - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Graphics : 3-D : fieldplot3d

plots

  

fieldplot3d

  

plot a 3-D vector field

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

fieldplot3d(f, x=r1, y=r2, z=r3, options)

fieldplot3d(f, r1, r2, r3, options)

Parameters

f

-

Vector field to be plotted

x

-

first coordinate

r1

-

range of first coordinate

y

-

second coordinate

r2

-

range of second coordinate

z

-

third coordinate

r3

-

range of third coordinate

options

-

options that control the behavior of fieldplot3d

Description

• 

A typical call to the fieldplot3d function is fieldplot3d(f, x=a..b, y=c..d, z=p..q), where f is a list of three maple expressions in x, y and z, and a..b, c..d, and p..q specifies the three axes ranges of the field. The result is a three-dimensional vector field with the vector evaluated at (x, y, z) located at this point.

• 

It is possible to input procedures, rather than expressions, as the components of a vector field. A typical call in this case is fieldplot3d(f, a..b, c..d, p..q), where f is a list of three maple procedures in three variables.

• 

It is also possible to input a three-dimensional VectorField from the VectorCalculus package to be plotted, which works with either calling sequence as the coordinates are given as part of the field vector.

• 

A call to fieldplot3d produces a PLOT3D data structure, which is then printed.  For information on these data structures, see plot3d/structure.

  

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

• 

arrows=value

  

The arrows option allows you to specify the style of arrow used to represent a vector. The possible values are line, small (or thin), medium (or slim), large (or thick) and solid, with thin being the default.

• 

grid=[value1,value2,value3]

  

The grid option allows you to set the initial size of the three-dimensional grid. The default is [8,8,8].

• 

fieldstrength=value

  

The fieldstrength option allows finer control of how the size of the drawn vectors corresponds to the strength of the field. value can be any of the following:

  

maximal or maximal(v): The size of the arrow corresponds to the ratio of the field strength at the given point to the maximal field strength at all points in the grid. The value v (by default 1) is a scaling factor used to adjust the ratio. Values smaller than 1 reduce the size of all arrows, while values larger than 1 increase the size of all arrows. Note: In cases where 1<v, the drawing of arrows that are larger than the maximum size is controlled through the clipping option (see below).

  

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 2) 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.

  

fixed or fixed(v): The size of all arrows is fixed to v (by default 0.9) times the maximum arrow size for the grid. The value v must be a positive value no larger than 1. Use of this option results in a direction plot for the field. Note: In cases where a coordinate transform is applied, the size of the arrows depends on the transform.

  

log or log[v]: The size of the arrows is rescaled according to the formula size = exp(ln(strength/max)/(1+v)) where strength is the strength of the field at the point, and max is the maximum strength of the field on the grid. The value v (by default 2) must be larger than −1. Values of v larger than zero have the effect of reducing the variation of the arrow length throughout the field, while values smaller than zero increase the variation. Using the value v=0 produces an identical plot to the default maximal plot. This option is most useful for fields that have either very large or very small variations, for example, an inverse square law.

  

scaleto(v): The size of the arrows is scaled so that the maximum fieldstrength is assumed to be v (which must be a positive numeric value). This option is most useful when constructing an animation of fieldplots where the maximal field strength is not consistent between frames of the animation, but the relative field strength between the frames is relevant.

• 

clipping=true or false

  

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 false if a coordinate transform is applied (via the coords argument), and true otherwise. This option is only useful if the fieldstrength option is used to increase the size of the arrows, or the field has been transformed. These are the only cases in which arrows may exceed the desired length.

• 

Use with Coordinate Transforms

  

Some discussion of the behavior of fieldplot3d 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 volume in the transformed region. The fieldplot3d 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 spherical coordinates, but the field 0&comma;1&comma;0 will have no arrows drawn at r=0.

• 

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

• 

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

Examples

withplots&colon;

fieldplot3d2x&comma;2y&comma;1&comma;x=1..1&comma;y=1..1&comma;z=1..1&comma;grid=5&comma;5&comma;5

fieldplot3dx&comma;y&comma;z2x&comma;x&comma;y&comma;z2y&comma;x&comma;y&comma;z1&comma;1..1&comma;1..1&comma;1..1

Use with VectorCalculus

withVectorCalculus&colon;

SetCoordinatescartesianx,y,z&colon;

fldVectorFieldz&comma;y&comma;x

fieldplot3dfld&comma;0..1&comma;0..1&comma;0..1

A radial plot in spherical coordinates

fieldplot3d1&comma;0&comma;0&comma;r=0..1&comma;t=0..π2&comma;p=0..π2&comma;coords=spherical

Note that the plots package uses a convention for the order of spherical coordinates that is different from e.g. the VectorCalculus package. In particular, the polar angle comes after the azimuthal angle in the plots package. We construct plots showing both of these vector fields and display them together using the display command.

azimuthfieldplot3d0&comma;1&comma;0&comma;0.6..1&comma;0..2π&comma;0.1π..0.9π&comma;coords=spherical&comma;grid=2&comma;6&comma;6&comma;color=red&colon;

polefieldplot3d0&comma;0&comma;1&comma;0.6..1&comma;0..2π&comma;0.1π..0.9π&comma;coords=spherical&comma;grid=2&comma;6&comma;6&comma;color=blue&colon;

displayazimuth&comma;pole

Use of `3-D` arrows

rsqrtx2+y2+z2&colon;

fldxr&comma;yr&comma;zr&colon;

fieldplot3dfld&comma;x=0..1&comma;y=0..1&comma;z=0..1&comma;arrows=`3-D`&comma;grid=4&comma;4&comma;4

Smaller arrows. This is the command to create the plot from the Plotting Guide.

fieldplot3dfld&comma;x=0..1&comma;y=0..1&comma;z=0..1&comma;arrows=`3-D`&comma;fieldstrength=maximal0.5&comma;grid=3&comma;3&comma;3

See Also

plot3d

plot3d/colorfunction

plot3d/option

plot3d/structure

VectorCalculus[VectorField]