开发者

How to get a vector field that maps the slopes of an equation

Hey so I'm reading this article by Chris Hecker where he has an image of a Parabola surrounded by the a vector field of it's derivative:

How to get a vector field that maps the slopes of an equation

However he never mentions how exactly he got the vector field equation, and never even states it. He does say he overlayed the vector field of the slopes in Figure 1, by drawing the solution to the开发者_如何学运维 slope equation, dy/dx = 2x, as a short vector at each coordinate on the grid.

How do you create a vector field of the slopes of an equation in the vector field syntax of

V = xi + yj


The Figure title would be clearer if it read:

  • The curve y = x^2, and the vector field dy/dx = 2x for the general case y = x^2 + C

There are three equations at work in the graph above:

  1. y = x^2 - The equation for the parabola drawn - This is the one long solid curve
  2. y = x^2 + C -The equation for all parabolas that fit on the vector field - C is a constant. This is the equation for all parabolas that fit on that vector field
  3. dy/dx = 2x The equation for the slope field. - This is the slope or derivative of the both the curve drawn and all the possible curves that can be drawn with y = x^2 + C for all constant Cs.

Note that C is a constant, since the derivative of y = x^2 + C with any C is 2x. So the vector field shows how to draw all the different parabolas with different Cs.


So there are two ways to calculate the vector field:

  1. Iterate over your desired range of x and y and calculate the slope, dy/dx- 2x independent of y in this case - at each point. This is how the author did it.
  2. Draw a bunch of parabolas by slowly varying C in y = x^2 + C over a desired range of - let's say - x calculating y.


For a differential equation dy/dx = f(x,y) (e.g., dy/dx = 2x in this case, with f(x,y) = 2x), the vector field (F) will be F = i + f(x,y)j (so in your case, F = i + 2x j )

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜