你需要注意的是,第一個等式一旦與t
區分開來就可以用來代替v[t]
。但是第二個方程變成二階ODE並且需要提供另一個額外的初始條件。我們會給
v[0]==x'[0]==some number
然後解決這個ODE的x
後可以恢復v[t]==x'[t]
我給你一個Manipulate
長期的解決方案,使幾何形勢變得明朗給你。
(* First equation *)
v[t] = x'[t];
(*
Differentiate this equation once and substitute
for v[t] in the second equation
*)
Manipulate[
With[{u = Constant, der = derval},
res = NDSolve[{x''[t] == -x[t] - u*x'[t]^3, x[0.] == 2,x'[0.] == der},
x, {t, 0., 30.}] // First;
Plot[Evaluate[{x[t], v[t]} /. res], {t, 0, 30}, PlotRange -> All,
Frame -> True,Axes -> None, ImageSize -> 600]
],
{{Constant, 0.,[email protected](u)}, 0.,3, .1},
{{derval, -3., [email protected](v[0] == x'[0])}, -3, 3, .1}
]
![enter image description here](https://i.stack.imgur.com/qYRK4.png)
希望這有助於你,但下一次你問之前,你需要先刷了理論,你可以看到你問的擔憂很基本的,初等數學數學不是編程的問題。祝你好運!!
如果您還有其他問題,這裏的大多數專家現在已轉到[Mathematica.se]。 – rcollyer