Re: PlotVectorField Package (easy question?)
- To: mathgroup at smc.vnet.net
- Subject: [mg15904] Re: [mg15838] PlotVectorField Package (easy question?)
- From: BobHanlon at aol.com
- Date: Wed, 17 Feb 1999 23:33:46 -0500
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 2/12/99 8:44:54 PM, ami at teleport.com writes:
>I am running Mathematica 3.0 on a G3, and having trouble using
><<Graphics`PlotVectorField`
>
>******************************
>In[55]:=
>
><<Graphics`PlotField`
>
>In[56]:=
> (PlotGradientField[{2 x^2 + y, 3 x - y}, {x,-10,10 }, {y,-10,10}]
>
>Out[56]=
>
> "Graphics`PlotField`PlotVectorField[
> {{4 x, 3}, {1, -1} , {x, -10, 10}, {y, -10, 10},
> {A long list of all the options}]
>
>
>******************
>??PlotGradientField gives the help information from the package, but it
>still won't plot. ??PlotVectorField returns: Global['PlotVectorField']
>
>I have tried clearing everything, running from inside PlotField.m, and
>even evaluating the example pages from the help manual.
>PlotVectorField just won't run. What am I doing wrong?
>
Adam,
Needs["Graphics`PlotField`"];
PlotGradientField[{2 x^2 + y, 3 x - y}, {x,-10,10 }, {y,-10,10}]
PlotVectorField[{{4*x, 3}, {1, -1}}, {x, -10, 10},
{y, -10, 10}, {ScaleFactor -> Automatic,
ScaleFunction -> None, MaxArrowLength -> None,
ColorFunction -> None, AspectRatio -> Automatic,
HeadScaling -> Automatic, HeadLength -> 0.02,
HeadCenter -> 1, HeadWidth -> 0.5,
HeadShape -> Automatic, ZeroShape -> Automatic,
AspectRatio -> GoldenRatio^(-1), Axes -> False,
AxesLabel -> None, AxesOrigin -> Automatic,
AxesStyle -> Automatic, Background -> Automatic,
ColorOutput -> Automatic, DefaultColor -> Automatic,
Epilog -> {}, Frame -> False, FrameLabel -> None,
FrameStyle -> Automatic, FrameTicks -> Automatic,
GridLines -> None, ImageSize -> Automatic,
PlotLabel -> None, PlotRange -> All,
PlotRegion -> Automatic, Prolog -> {},
RotateLabel -> True, Ticks -> Automatic,
DefaultFont :> $DefaultFont,
DisplayFunction :> $DisplayFunction,
FormatType :> $FormatType, TextStyle :> $TextStyle,
PlotPoints -> Automatic}]
The output from your call to PlotGradientField shows that Mathematica
took the gradient of your input (i.e., a vector) and called PlotVectorField
with the resulting matrix. However, since PlotVectorField was expecting
a vector function as input rather than a matrix it was unable to evaluate.
?PlotVectorField
PlotVectorField[f, {x, x0, x1, (xu)}, {y, y0, y1, (yu)},
(options)] produces a vector field plot of the
two-dimensional vector function f.
That is, PlotGradientField is expecting an input of a scalar function rather
than the vector function which you provided.
?PlotGradientField
PlotGradientField[f, {x, x0, x1, (xu)}, {y, y0, y1, (yu)},
(options)] produces a vector field plot of the gradient
vector field of the scalar function f by calculating its
derivatives analytically.
Perhaps you were intending to use PlotVectorField on your vector input
PlotVectorField[{2 x^2 + y, 3 x - y},
{x,-10,10 }, {y,-10,10}];
Bob Hanlon