- #1
member 428835
Hi PF
The following ODE
$$\ddot x + x - x^3 = 0\\
x(0)=0,\,\,\,\dot x(0) = \frac {1}{ \sqrt 2}$$
is solve exactly with ##\tanh (t/\sqrt 2)##. However, when I try to solve this with MATLAB ode45 (ode23t looks identical) or Mathematica NDSolve I get an oscillatory numerical solution (see attached).
Any idea what's going wrong?
The following ODE
$$\ddot x + x - x^3 = 0\\
x(0)=0,\,\,\,\dot x(0) = \frac {1}{ \sqrt 2}$$
is solve exactly with ##\tanh (t/\sqrt 2)##. However, when I try to solve this with MATLAB ode45 (ode23t looks identical) or Mathematica NDSolve I get an oscillatory numerical solution (see attached).
Any idea what's going wrong?