How to solve this ODE : y''+ yy'=0?

Hello

y’‘+ yy’=0 with ic = [1;-1]

I have tried to solve this ODE in several ways without any succes.
In order to go further, I have installed the package sci-sundials.

Where did I go wrong ?
If somebody has the solution, it would be nice.

Remark :

with ic = [1;1] there is no problem and all methodes are working well (there is no singularity).

First way (classical one):

function dy = f(t, y)
 dy(1) = y(2);
 dy(2) = -y(1)*y(2);
endfunction

t = 0:0.01:10*%pi;
t0 = min(t);
y0 = [1; -1];

y = ode(y0, t0, t, f);
plot(t,y(1,:),'LineWidth',2);

Error message in the console : “ode: lsoda exit with state -1.”

Second way : with cvode:

function dy = f(t, y)
 dy(1) = y(2);
 dy(2) = - y(1)*y(2);
endfunction

t = 0:0.01:10;
t0 = min(t);
tf = max(t);
y0 = [1;-1];

[t,y] = cvode(f,[t0 tf],y0)

plot(t,y(1,:),'LineWidth',2)

In this case, there is no error and the plot displays something …which is very strange (due to a singularity at t = 4.7114)

Third way : with arkode

function dy = f(t, y) 
 dy = [y(2);- y(1)*y(2)]
endfunction

t = 0:0.01:4;
t0 = min(t);
tf = max(t);
y0 = [1;-1];

[t,y] = arkode(f,[t0 tf],y0)

This solution works fine only if I avoid the singularity.
The plot from t = 0 to 4:
2024-06-14 20_32_14-y''+ yy'=0 with arkode

This equation solved very easily with MAPLE gives the following plot:

Hello

You cannot compare the symbolic work of maple or Mathematica (btw the ode is easy to solve by hand) with an ode numerical integration scheme. No such scheme can go beyond a singularity. The best that can be done is yielded by cvode here. Just add

gca().data_bounds(3:4)=[-10 1]

to see better the solution graph:

Note that Sundials solvers are part of Scilab since 2024.0.0 version (you don’t need to install any package).

S.

Thank you Stéphane for your accurate answer.
Have a nice weekend

Pascal