# "step size is effectively zero;" error when solving with NDSolve

I have the following question, I have the following system (set of differential equations) in Mathematica

h[x_, y_] = x;

s[x_, y_] = 2 x^2 + 2 y^2  - 2;


with h = x' and s= y' ;

I am trying to draw a phase diagram of the system, but when I use NDSolve,

diferenci[x0_, y0_] :=
NDSolve[{x'[t] == h[x[t], y[t]], y'[t] == s[x[t], y[t]], x[0] == x0,
y[0] == y0}, {x[t], y[t]}, {t, 0, 10}, MaxSteps -> Infinity];


I get the error

step size is effectively zero; singularity or stiff system suspected

, now I know that it's not a singularity problem, becuase the system is inestable and the solution is going away from the singularity, yet at some point this error occurs.

Any help?

• There are multiple singularities between t=[0,10] . You can check this by solving it arithmeticly with DSolve. Sep 30, 2016 at 10:55

The system seems to be simple enough for DSolve to handle it, so let's give it a try:

diferenci[x0_, y0_] :=
DSolve[{x'[t] == h[x[t], y[t]], y'[t] == s[x[t], y[t]], x[0] == x0,
y[0] == y0}, {x[t], y[t]}, {t, 0, 10}];

sol = y[t] /. diferenci[1/10, 1/10][[1]]


That's a complicated denominator; it may cause you trouble:

The plot is quite wild, with a number of singularities:

But analytical solution appears to be easy to obtain in this case, so maybe just use DSolve instead.