1
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ There are multiple singularities between t=[0,10] . You can check this by solving it arithmeticly with DSolve. $\endgroup$ – Julien Kluge Sep 30 '16 at 10:55
1
$\begingroup$

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]]

enter image description here

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

enter image description here

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

enter image description here

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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