You are on page 1of 2

Solving nonlinear ODE

In[166]:=

ClearAll["Global`*"]
In[167]:=

ODE = a * D[x[t], {t, 2}] +


b * D[x[t], {t, 2}] +
x[t] +
c * x[t]3 == d * Cos[ω1 * t]
Out[167]=

x[t] + c x[t]3 + a x′′ [t] + b x′′ [t] ⩵ d Cos[t ω1]

In[168]:=

bc1 = {x[0] == 4.5, x '[0] == 13};


bc2 = {x[0] == - 1.55, x '[0] == 0.7};
In[170]:=

parameters = {a, b, c, d, ω1};


In[171]:=

pfun = ParametricNDSolveValue[{ODE, bc1}, x[t], {t, 30, 100}, parameters]


Out[171]=

Expression: x[t]
ParametricFunction 
Parameters: {a, b, c, d, ω1}

In[172]:=

* = 2.56;
+ = 0.32;
, = 0.05;
- = 2.5;
.1 = 1;
In[185]:=

xsol = pfun[*, +, ,, -, .1]


Out[185]=

Domain: {{30., 100.}}


InterpolatingFunction [t]
Output: scalar

Printed by Wolfram Mathematica Student Edition


2 NumeriskFrida.nb

In[189]:=

Plot[xsol, {t, 30., 100.}, PlotTheme -> "Scientific"]


Out[189]=

Printed by Wolfram Mathematica Student Edition

You might also like