-1
$\begingroup$

Suppose we have the following non-linear differential equation

$$\displaystyle{\ddot{x}+\omega^2(t) x-\frac1{x^3}}=0,$$

where $x(t)$ is a function of time $t$ a and where we choose $\omega^2(t)$ to be some (positive) periodic function, to be more specific, let us say

$$\omega_1(1+\sin^2(\omega_2 t)),$$

with $\omega_1$ and $\omega_2$ being positive constants.

Let us choose $\omega_1=1$ and $\omega_2=2$, and the initial conditions e.g. $x(0)=1$, $x'(0)=1$.

How to approach the solution in Mathematica?

See also https://math.stackexchange.com/questions/2219030/how-to-solve-ddotx-omega2t-x-frac1x3-0-for-a-particular-form-of-o

$\endgroup$
4
  • 1
    $\begingroup$ When I searched the documentation for "differential equation" the first hit was this guide to differential equations that points out both symbolic and numerical solvers. What happened when you searched? $\endgroup$
    – Michael E2
    Apr 29 '17 at 18:41
  • $\begingroup$ @wondering Did you saw my answer? $\endgroup$
    – zhk
    May 3 '17 at 6:49
  • $\begingroup$ @zhk Yes, thank you, this answers my question. Btw., you must be from India, right? --> "Did you SEE my answer?" :-) $\endgroup$
    – wondering
    May 5 '17 at 10:21
  • $\begingroup$ @wondering Close! I am grandson of Taliban supreme leader Mullah Umar. Thx for the correction. $\endgroup$
    – zhk
    May 5 '17 at 10:54
3
$\begingroup$

For numerical solution to ODE's/PDE's you can use NDSolve. For more details visit here.

1.$\omega(t)$ as a triangle function

w[t_] = UnitTriangle[t]

ODE = x''[t] + w[t]^2*x[t] - 1/x[t]^3 == 0;

sol = NDSolve[{ODE, x[0] == 1, x'[0] == 1}, x[t], {t, -10, 10}]

Plot[x[t] /. sol, {t, -10, 10}]

enter image description here

2.$\omega^2(t)=\omega_1(1+\sin^2(\omega_2 t))$

w[t_] = w1*(1 + Sin[w2*t]^2);

w1 = 1; w2 = 2;

ODE = x''[t] + w[t]*x[t] - 1/x[t]^3 == 0;

sol = NDSolve[{ODE, x[0] == 1, x'[0] == 1}, x[t], {t, -10, 10}];

Plot[x[t] /. sol, {t, -10, 10}]

enter image description here

$\endgroup$
0

Not the answer you're looking for? Browse other questions tagged or ask your own question.