# Bifurcation diagram with first-order differential equation

I have code from question 96004, and I made same changes:

s1 = ParametricNDSolveValue[{D[r[t], t,
t] - μ r[t] (r[t] + μ)^2 == 0, D[θ[t], t] == 1,
r == 1, θ == 1}, {r[t] Cos[θ[t]], r[t] Sin[θ[t]]}, {t, 0,
100}, {μ}, MaxSteps -> ∞];
coll = {};
Table[pp =
ParametricPlot[Through[s1[a][t]], {t, 0, 100},
PlotRange -> {{-4, 4}, {-4, 4}}, PerformanceGoal -> "Quality",
MeshFunctions -> (#2 &), Mesh -> {{0.}},
MeshStyle -> {Red, PointSize[0.02]}];
pts = pp[[1, 1]];
AppendTo[
coll, {a, #[]} & /@
pts[[First@Cases[pp[], Point[x__] :> x, -1]]]];, {a, -1, -0.5,
0.005}];
lp = ListPlot[Join @@ coll, Frame -> True, PlotStyle -> Red];
Manipulate[
Column[{ParametricPlot[Through[s1[τ][t]], {t, 0, 100},
PlotRange -> {{-4, 4}, {-4, 4}}, PerformanceGoal -> "Quality",
MeshFunctions -> (#2 &), Mesh -> {{0.}},
MeshStyle -> {Red, PointSize[0.02]}, Frame -> True],
Show[lp,
Graphics[{Gray,
Line[{{τ, -2}, {τ, 2}}]}]]}], {τ, -1, -0.5,
0.01}]


In the original question the differential equation is second order. I found the code doesn't work for first order differential equation. Could someone tell me how to change the above code?

• What changes have you made? What are you trying to achieve? – MarcoB Apr 8 '19 at 14:40
• Before attempting the bifurcation diagram, can you get NDSolve to solve the system for a fixed parameter value? – Chris K Apr 8 '19 at 14:42
• I just change the two order differential equation in the original code to the first order differential equation. And I want to plot the bifurcation diagram as ubpdqn(the third answer) do – 郑新然 Apr 9 '19 at 0:33
• I can get the parametric solve of the system and I can get the phase diagram. In other words, I think the first step (s1) of the code is no problem. – 郑新然 Apr 9 '19 at 0:40