ランプ強制関数を使って常微分方程式を解く
純粋なランプ応答を計算する.
In[1]:=
![Click for copyable input](assets.ja/solve-an-ode-with-a-ramp-forcing-function/In_156.png)
sol = DSolveValue[{x''[t] + a^2 x[t] == Ramp[t - a], x[0] == 0,
x'[0] == 0}, x[t], t, Assumptions -> a > 0] // FullSimplify
Out[1]=
![](assets.ja/solve-an-ode-with-a-ramp-forcing-function/O_90.png)
パラメータ a のさまざまな値に対する解をプロットする.
In[2]:=
![Click for copyable input](assets.ja/solve-an-ode-with-a-ramp-forcing-function/In_157.png)
Plot[Table[sol, {a, 1, 2, 0.3}] // Evaluate, {t, -1, 15},
Filling -> Axis]
Out[2]=
![](assets.ja/solve-an-ode-with-a-ramp-forcing-function/O_91.png)
ランプと衝撃力を組み合せる.
In[3]:=
![Click for copyable input](assets.ja/solve-an-ode-with-a-ramp-forcing-function/In_158.png)
sol = DSolveValue[{x''[t] + a^2 x[t] ==
Ramp[t - a] + DiracDelta[t - 2 a], x[0] == 0, x'[0] == 0}, x[t],
t, Assumptions -> a > 0] // FullSimplify
Out[3]=
![](assets.ja/solve-an-ode-with-a-ramp-forcing-function/O_92.png)
In[4]:=
![Click for copyable input](assets.ja/solve-an-ode-with-a-ramp-forcing-function/In_159.png)
Plot[Table[sol, {a, 1, 2, 0.3}] // Evaluate, {t, -1, 15},
Filling -> Axis]
Out[4]=
![](assets.ja/solve-an-ode-with-a-ramp-forcing-function/O_93.png)