2017-01-31 21 views
0

方程式y '= cos(y)-1の傾きフィールドを解き、プロットする必要があります。Mathematica VectorPlot *** Hold ***

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

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

私は空のグラフを取得します。どんな助け?

+1

Mathematica関数は ''コス[Y]、常に角括弧を使用するように解曲線でVectorPlotを組み合わせることができます – agentp

答えて

1

コメントに示唆されているように、はCos()ではなく、Mathematicaにあるとします。

あなたはODEを解決し、この

soln[y0_?NumericQ] :[email protected][{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"}]] 

enter image description here