Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Help with plotting vector fields

  1. Oct 8, 2011 #1
    I'm having difficulty plotting a vector field of a first-order system. I understand that I am supposed to select various points, "plug" them into the equations, and then plot the vector from the resulting point. But how do I know in which way the vector is pointing? Once I get the point from which the vector will originate, how do I decide in which direction to point that vector? Also, what do I do if I get a system such as dx/dt = x, dy/dt = 1? How would I plot dy/dt being that it is a constant?
     
  2. jcsd
  3. Oct 9, 2011 #2
    The "vectors" are slopes. You can draw a small line with a particular slope right? For example, take:

    [tex]\frac{dy}{dt}=2y+1[/tex]

    At the point (1,2), the slope is 5. So at that point in the plot, draw a small arrow with slope five. The slope at the point (-3,-1) would be -1. So draw a small line with a slope of -1. Same dif everywhere else. Since this one doesn't depend on t, the slope field is symmetrical with respect to the t-axis right?

    In the case of a system:

    [tex]dx/dt=x[/tex]
    [tex]dy/dt=1[/tex]

    the slope field is now in the x-y coordinate system so at the point x=1, y=2, the slope would be 1. Draw a line with slope 1 there. At the point x=5, y=3, the slope is five. Do the same there.

    To check your work, use Mathematica's StreamPlot function. In the case of the single DE above, then dt/dt=1 and dy/dt=2y+1 so that in the t-y coordinate system, we can code:

    StreamPlot[{x, 1}, {x, -5, 5}, {y, -5, 5}]

    and for systems like the one above:

    StreamPlot[{x,1},{x,-5,5},{y,-5,5}]
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Help with plotting vector fields
  1. Flow of a vector field (Replies: 2)

  2. Curl and vector fields (Replies: 4)

Loading...