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

爱⌒轻易说出口 提交于 2019-12-08 04:00:09

问题


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:

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


回答1:


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.




回答2:


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 )



来源:https://stackoverflow.com/questions/7761685/how-to-get-a-vector-field-that-maps-the-slopes-of-an-equation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!