# No output for bifurcation diagram

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 = InternalBag[];(*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 == x0,
y == y0,(*save extrema of z[t]*)
WhenEvent[x'[t] == 0, InternalStuffBag[res, {A, x[t]}]]}, {x,
y}, {t, 0, tmax}][];
(*save end value for next ICs*){x0, y0} = {x[tmax], y[tmax]} /.
sol;, {A, 200, 0, -0.1}];

ListPlot[Re@InternalBagPart[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.

In the case of a complex function, we use Re[x'[t]] to select events.

res = InternalBag[];(*a place to store results*)
tmax = 10;(*how long to run for each A value*)
{x0, y0} = {0, 1};(*initial ICs*)
ω = -2.5; τ = 1;
Do[
sol = NDSolve[{I*x'[t] == ω*x[t] -
A*x[t]*Abs[x[t]]^2 - τ*y[t],
Sqrt[-1]*y'[t] == ω*y[t] -
A*y[t]*Abs[y[t]]^2 - τ*x[t], x == x0,
y == y0,(*save extrema of z[t]*)
WhenEvent[Re[x'[t]] == 0,
InternalStuffBag[res, {A, Re[x[t]]}]]}, {x, y}, {t, 0,
tmax}][];
(*save end value for next ICs*){x0, y0} = {x[tmax], y[tmax]} /.
sol;, {A, 200, 0, -0.1}];
Table[ListPlot[InternalBagPart[res, All],
PlotStyle -> {Gray, Opacity[0.1], PointSize[0.001]},
PlotRange -> op], {op, {Automatic, All}}] • Could you add a bit of text saying what the problem was? – Chris K Jul 31 '18 at 15:31
• Secondly, could you please tell how you get the second plot? the one with thin lines on the right? – AtoZ Aug 1 '18 at 1:52
• Lastly, The vertical axis corresponds to x[t] or x'[t]? – AtoZ Aug 1 '18 at 2:39
• I added one line to the code that describes the construction of the figures. The figures show the real part of $x(t)$ - Re[x[t]], depending on the parameter A. – Alex Trounev Aug 1 '18 at 5:25
• I would prolly use the more conventional Sow[]/Reap[] instead of InternalBag[]` for this, since this isn't in a compiled function anyway. – J. M.'s ennui Oct 6 '18 at 2:44