MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: direction fields for diff eqns in mathematica 3.0?

Here is a simple differential equation:

y'[x] == y[x]^2

A direction field vector would be given by:

v = {1, y^2}

To plot the direction field I found it easiest to normalize the vector.

{1/Sqrt[1 + y^4], y^2/Sqrt[1 + y^4]}

This plots the direction field.


PlotVectorField[{1, y^2}/Sqrt[1 + y^4], {x, -3, 3}, {y, -7, 7},
   ScaleFunction -> None, HeadLength -> 0, AspectRatio -> 1,
   PlotRange -> {{-4, 4}, {-10, 10}}, Background -> Linen, Frame -> True,
   FrameLabel -> {x, y}, PlotLabel -> Derivative[1][y][x] == y[x]^2,
   ImageSize -> 600];

The plots usually look a little nicer if you make the PlotRange somewhat
larger than the iterator range; otherwise some of the lines may overshoot
the frame.

David Park
djmp at

> -----Original Message-----
> From: Ed [mailto:ejh at]
To: mathgroup at
> Howdy all!
> I cannot find a simple way to do direction field plots for
> differential equations. I mean the plots which show the slope of the
> solutions curves at each point.
> What am I missing? Do I use something fancy with the vector plot
> functions?
> Thanks!
> Ed

  • Prev by Date: Re: MatrixReplace.m
  • Next by Date: Re: HTML Import?
  • Previous by thread: direction fields for diff eqns in mathematica 3.0?
  • Next by thread: Re: direction fields for diff eqns in mathematica 3.0?