1
$\begingroup$

I am trying to solve the non-linear differential equation: $$ \ddot{x}(t) =\frac{3kx(t)}{\gamma^2}\left[kx^4(t)-2 \right] $$

numerically on Mathematica, but I can not find a solution.

My code is:

k = 1;
\[Gamma] = 1;
NDSolve[{-6k x[t] + 3k^2 x[t]^5 - \[Gamma]^2 (x^\[Prime]\[Prime])[t] == 0, x[0] == 1, x'[0] == 1}, x, {t, 0, 5}] 

and running it, I receive the following error:

NDSolve::ndsz:  At  t  ==  0.853147811022917', step size is effectively zero; singularity or stiff system suspected

The equation goes to zero for $x(t) =0 $ and $x(t)= (2/k)^{1/4}$, so I suppose the error may be due to that.

I tried the methods "ExplicitRungeKutta" and "StiffnessSwitching" but they did not help. Moreover, a change in the boundary conditions gave a scalar solution, which is not desired.

Can anyone help me to solve this? I also want to understand why the problem occurs at $t= 0.853147811022917$.

$\endgroup$
3
  • $\begingroup$ Solutions to this ODE are hyperelliptic functions. The issue comes from singularities of solutions which are determined form initial (boundary) conditions and values of constants $k$ and $\gamma$ . You can compare the problem at hand with those which have solutions in terms of elliptic functions e.g. 1, 2 $\endgroup$
    – Artes
    Commented Sep 9 at 0:24
  • $\begingroup$ Perhaps certain solutions are free of singularities (globally regular), otherwise you cannot get rid of singularities and then you can try to understand why they appear, what are conditions for regular or singular solutions. $\endgroup$
    – Artes
    Commented Sep 9 at 0:30
  • 1
    $\begingroup$ If you plot x[t] as far as you can, you will see it blows up there. $\endgroup$
    – Bill Watts
    Commented Sep 9 at 0:30

1 Answer 1

1
$\begingroup$

Numerically, we can Look at the vector field with Manipulate:

With[{vf = 
   Prepend[SolveValues[{-6 k x[t] + 
         3 k^2 x[t]^5 - \[Gamma]^2 (x'')[t] == 0}, x''[t]] /. 
     x[t] -> x, v]},
 With[{cps = 
    Normal@SolveValues[vf == 0 && -2 <= x <= 2, {x, v}, Reals]},
  Manipulate[
   StreamPlot[vf, {x, -2.5, 2.5}, {v, -2.5, 2.5},
    StreamPoints -> {{{{1, 1}, Green}, Automatic}},
    StreamColorFunction -> None,
    Epilog -> {Orange, PointSize@Large, Point[{1, 1}], Green, 
      Point[cps]},
    PlotLabel -> cps],
   {{k, 0.725}, 0.01, 1., Appearance -> "Labeled"},
   {{\[Gamma], 1.}, 0.5, 3.}
   ]
  ]]

enter image description here

As k increases past k == 0.725 or so, the initial condition crosses the boundary between solutions cycling around the origin to those going off to infinity.

To prove they reach infinity in finite time takes more work than I have time for right now. I suspect they do, since on the right, we have x''[t] > constant*x[t]^5.

$\endgroup$
10
  • $\begingroup$ I tried to run your code, but it went wrong, it gives me the message: Coordinate $CellContextSolveValues[False, {$CellContextx, $CellContextv}, Reals] should be a pair of numbers, or a Scaled or Offset form.. Why is that? $\endgroup$
    – Felps
    Commented Sep 9 at 23:56
  • $\begingroup$ @Felps Perhaps x, v, or t has a value. Try Clear[x, v, t, k, \[Gamma]] and re-executing. The False in place of the equation to be solved in the error message shows something was defined already. $\endgroup$
    – Michael E2
    Commented Sep 10 at 0:36
  • $\begingroup$ @MichaelE2 That's an interesting solution. To me it is still unclear why the direct numerical solution aborts. Any idea? Thanks! $\endgroup$ Commented Sep 10 at 7:35
  • $\begingroup$ As Bill Watts commented, the solution heads to infinity if you plot it. NDSolve[] can't integrate past a pole, so at some point, the step size must become smaller than the smallest step supported by the floating-point system. $\endgroup$
    – Michael E2
    Commented Sep 10 at 14:30
  • $\begingroup$ @MichaelE2 Thank you for answer. I tried several initial conditions , NDSolve is able to integrate "over" the poles but stops with the stepsize message. Additionally, knowing the asymptotic behavior from your fine answer, I tried to transform the ode, unfortunately without success $\endgroup$ Commented Sep 12 at 7:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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