【问题标题】:Mathematica VectorPlot ***Hold***Mathematica VectorPlot ***保持***
【发布时间】:2017-01-31 02:25:00
【问题描述】:

我需要求解并绘制方程 y'=cos(y)-1 的斜率场。

DSolve[{y'[x] == -1 + Cos[y[x]]}, y[x], x]

VectorPlot[{1, (-1 + Cos (y))}, {x, -3, 3}, {y, -3, 3}]

我得到一个空图表。有什么帮助吗?

【问题讨论】:

  • mathematica 函数总是使用方括号,Cos[y]

标签: math wolfram-mathematica wolframalpha


【解决方案1】:

按照评论中的建议,您应该在 Mathematica 中使用 Cos[] 而不是 Cos()

您可以求解 ode 并将 VectorPlot 与这样的求解曲线结合起来

soln[y0_?NumericQ] :=First@DSolve[{y'[x] == -1 + Cos[y[x]], y[0] == y0}, {y}, {x, 0,10}];
vp = VectorPlot[{1, (-1 + Cos[y])}, {x, -3, 3}, {y, -3, 3}];
Show[vp, Plot[
  Evaluate[{y[x]} /. soln[#] & /@ Range[-20, 20, 0.3]], {x, -3, 3}, 
  PlotRange -> All, MaxRecursion -> 8, AxesLabel -> {"x", "y"}]]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-15
    • 2011-01-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多