Qurak

Solve delay differential equations

操作指南 共 7 個步驟,在同一個工作階段中依序執行。每一步都在引擎上實際執行過,下方的輸出就是它產生的結果。

步驟 1
sol1 = NDSolve[{x'[t] == x[t - 1](1 - x[t]), x[t /; t ≤ 0] == t ^ 2}, x, {t, -2, 2}]
輸出
NDSolve[{Derivative[1][x][t] == x[-1 + t]*(1 - x[t]), x[t /; t <= 0] == t^2}, x, {t, -2, 2}]
步驟 2
Plot[Evaluate[{x[t], x'[t]} /. First[sol1]], {t, -1, 5}, PlotRange -> All, PlotLegends -> {Style[x[t], 14], Style[ x'[t], 14]}]
輸出
-Graphics-
步驟 3
Manipulate[
	Module[{sol = NDSolve[{x'[t] == x[t - 1](1 - x[t]), x[t /; t ≤ 0] == ϕ}, x, {t, -2, 2}]},
	Plot[Evaluate[x[t] /. First[sol]], {t, -2, 2}]], {ϕ, {0.1, t ^ 2, Exp[t], Cos[t], Sin[t]}}]
輸出
Manipulate[Module[{sol = NDSolve[{Derivative[1][x][t] == x[t - 1]*(1 - x[t]), x[t /; t <= 0] == ϕ}, x, {t, -2, 2}]}, Plot[Evaluate[x[t] /. First[sol]], {t, -2, 2}]], {ϕ, {0.1, t^2, E^t, Cos[t], Sin[t]}}]
步驟 4
sol2 = NDSolve[{x'[t] == x[t] (x[t - π] - x'[t - 1]), x[t /; t ≤ 0] == Cos[t]}, x, {t, 0, 8}]
輸出
NDSolve[{Derivative[1][x][t] == (x[-Pi + t] - Derivative[1][x][-1 + t])*x[t], x[t /; t <= 0] == Cos[t]}, x, {t, 0, 8}]
步驟 5
Plot[Evaluate[{x[t], x'[t]} /. First[sol2]], {t, 0, 8}, PlotRange -> All, PlotLegends -> {Style[x[t], 14], Style[ x'[t], 14]}]
輸出
-Graphics-
步驟 6
sol3 = NDSolve[{x''[t] + x[t - 1] == 0, x[t /; t ≤ 0] == t ^ 2}, x, {t, -1, 5}]
輸出
NDSolve[{x[-1 + t] + Derivative[2][x][t] == 0, x[t /; t <= 0] == t^2}, x, {t, -1, 5}]
步驟 7
Plot[Evaluate[{x[t], x'[t], x''[t]} /. First[sol3]], {t, -1, 5}, PlotRange -> All, PlotLegends -> {Style[x[t], 14], Style[ x'[t], 14], Style[x''[t], 14]}]
輸出
-Graphics-

使用到的函式

相關的操作範例

所有操作範例 · 函式參考 · 從 MCP 用戶端使用這個