Anyone knows what's the problem with the following code and how can I fix it? I am not sure that I wrote the WhenEvent section correctly. By the way, I want to solve the equations and then plot y vs. y' when x goes to zero (it is obvious that it's an interval :) ).
Thanks
tmax = 300;
{{sol1}, {ps}} = Reap[
NDSolve[
{x'[t] == -(x[t] + 2 x[t] y[t]),
y'[t] == -x[t] x[t] + y[t] (y[t] - 1),
x[0] == 0.1, y[0] == 0.1,
WhenEvent[Limit[x[t], x[t] -> 0], Sow[t]]},
{x, y},
{t, 0, tmax}]]