I have been trying to plot bifurcation diagram for $R$ vs $X$ (or $Y$) for the following problem
tab = Table[{sol, points} =
Reap@NDSolveValue[{Sqrt[-1]*x'[t] ==
B*x[t] - R*x[t]*Abs[x[t]]^2 - A*y[t],
Sqrt[-1]*y'[t] ==
B*y[t] - R*y[t]*Abs[y[t]]^2 - A*x[t] /. {A -> 1, B -> -2},
x[0] == 0, y[0] == 0,
WhenEvent[x'[t] > 0, If[t > 4, Sow[y[t]]]]}, {x, y}, {t, 0.1,
20}]; {R, #} & /@
Union[Flatten[points], SameTest -> (Abs[#1 - #2] < .02 &)], {R, 0,
100, 2}];
ListPlot[Re@Flatten[tab, 1], ImageSize -> Large, AxesLabel -> {R, x}]
I get no error messages but an empty plot. Parameters are flexible so I tried several variations with parameters but didn't succeed in plotting.
Flatten[tab, 1]={}
is empty! $\endgroup$