Detection of Hopf bifurcations

Supercritical Hopf bifurcation

f1[x_,y_,mu_]:=x (mu-x^2- y^2)-y(1+x^2+y^2);
g1[x_,y_,mu_]:=y(mu-x^2- y^2)+x(1+x^2+y^2);

Manipulate[sol1=NDSolve[{x'[t]==f1[x[t],y[t],mu],y'[t]==g1[x[t],y[t],mu],x[0]==x0,y[0]==x0},{x[t],y[t]},{t,0,T}];
Show[ParametricPlot[{x[t],y[t]}/.sol1,{t,0,T}],Graphics[Disk[{x0,x0},.04]],PlotRange->{{-1,1},{-1,1}}],{x0,0.01,1},{mu,-.4,.4},{T,1,20}]

Subcritical Hopf bifurcation

f2[x_,y_,mu_]:=mu x-y+x y^2;
g2[x_,y_,mu_]:=x+mu y+y^3;

Manipulate[sol2=NDSolve[{x'[t]==f2[x[t],y[t],mu],y'[t]==g2[x[t],y[t],mu],x[0]==x0,y[0]==x0},{x[t],y[t]},{t,0,T}];
Show[ParametricPlot[{x[t],y[t]}/.sol2,{t,0,T}],Graphics[Disk[{x0,x0},.04]],PlotRange->{{-1,1},{-1,1}}],{x0,0.01,1},{mu,-.1,.1},{T,1,20}]