I am plotting a bifurcation diagram for my system with A
on x-axis following the code in, How to make a bifurcation diagram of the Lorenz system under a varying parameter value?. But I get an empty output
res = Internal`Bag[];(*a place to store results*)tmax = 10;(*how long \
to run for each A value*){x0, y0} = {0, 1};(*initial ICs*)
\[Omega] = -2.5; \[Tau] = 1; Do[
sol = NDSolve[{Sqrt[-1]*x'[t] == \[Omega]*x[t] -
A*x[t]*Abs[x[t]]^2 - \[Tau]*y[t],
Sqrt[-1]*y'[t] == \[Omega]*y[t] -
A*y[t]*Abs[y[t]]^2 - \[Tau]*x[t], x[0] == x0,
y[0] == y0,(*save extrema of z[t]*)
WhenEvent[x'[t] == 0, Internal`StuffBag[res, {A, x[t]}]]}, {x,
y}, {t, 0, tmax}][[1]];
(*save end value for next ICs*){x0, y0} = {x[tmax], y[tmax]} /.
sol;, {A, 200, 0, -0.1}];
ListPlot[Re@Internal`BagPart[res, All],
PlotStyle -> {Gray, Opacity[0.1], PointSize[0.001]}]
The initial conditions are flexible and can be changed for atleast generating some output, I tried with {x0,y0}={0,1}
and {x0,y0}={1,1}
but to no avail.