如何使用 VectorPlot 在 Mathematica 中绘制微分方程 y'=y-x² 的斜率场?
How to plot the slope field of the differential equation y'=y-x² in Mathematica with VectorPlot?
我是 Wolfram Mathematica 的新手,我对在 Mathematica 中绘制斜坡场感到绝望。
微分方程是 y'=y-x²
,我想在 |x| <= 3, -1 <= y <= 4
区域绘制它的斜率场,将斜率场的长度缩放为 1。
我发现我可以使用 VectorPlot
函数来完成此操作,但我无法自己完成。谁能告诉我怎么做?
编辑:这是否正确:VectorPlot[{1, y[x] - x^2}, {x, -3, 3}, {y[x], -1, 4}]
?
VectorPlot[{1, y - x^2}, {x, -3, 3}, {y, -1, 4},
Frame -> False, Axes -> True, StreamPoints -> 20]
我是 Wolfram Mathematica 的新手,我对在 Mathematica 中绘制斜坡场感到绝望。
微分方程是 y'=y-x²
,我想在 |x| <= 3, -1 <= y <= 4
区域绘制它的斜率场,将斜率场的长度缩放为 1。
我发现我可以使用 VectorPlot
函数来完成此操作,但我无法自己完成。谁能告诉我怎么做?
编辑:这是否正确:VectorPlot[{1, y[x] - x^2}, {x, -3, 3}, {y[x], -1, 4}]
?
VectorPlot[{1, y - x^2}, {x, -3, 3}, {y, -1, 4},
Frame -> False, Axes -> True, StreamPoints -> 20]