« View all new features in
Mathematica
9
◄
previous
|
next
►
New in
Mathematica
9
›
Parametric Differential Equations
Boundary Value Solutions
In[4]:=
X
Show[Plot[Evaluate@Table[psol[a][t], {a, 0, 2, .05}], {t, 0, 10}, PlotRange -> All, PlotPoints -> 500, PlotStyle -> Lighter[Gray, 0.5]], Plot[Evaluate[psol[s][t] /. val], {t, 0, 10}, PlotStyle -> Thick], ImageSize -> Medium]
Find the solutions of a parametric equation that satisfy a Dirichlet boundary condition.
In[1]:=
X
psol = ParametricNDSolveValue[{y''[t] + Sin[y[t]] == 0, y[0] == 0, y'[0] == s}, y, {t, 0, 10}, {s}];
In[2]:=
X
Plot[Evaluate@Table[psol[s][t], {s, 0, 2, 0.05}], {t, 0, 10}, ImageSize -> Medium]
Out[2]=
A parameter sweep determines the nontrivial solution values of
.
In[3]:=
X
pfun = ParametricNDSolveValue[{y''[t] + Sin[y[t]] == 0, y[0] == 0, y'[0] == s}, y[10], {t, 0, 10}, {s}]; val = Table[FindRoot[pfun[s], {s, s0}], {s0, {0.9, 1.9, 2}}]
Out[3]=
Out[4]=