Help with plotting vector fields

  • Thread starter smithnya
  • Start date
41
0

Main Question or Discussion Point

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?
 

Answers and Replies

1,786
53
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?
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}]
 

Related Threads for: Help with plotting vector fields

Replies
2
Views
4K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
0
Views
2K
  • Last Post
Replies
4
Views
1K
Replies
0
Views
10K
  • Last Post
Replies
1
Views
2K
Replies
10
Views
1K
Top