Bifurcations in 2-D systems: Homoclinic bifurcation (Saddle-loop bifurcation)

Case II, C: Linear analysis and static phase portraits, homoclinic bifurcation (Saddle-Loop bifurcation)

μ1=-0.9;
μ2=-0.8645; (*approx. bif point*)
μ3=-0.7;
imagesize=300;xdom=2;ydom=1.1;

diffx=y;
diffy1=μ1 y+x-x^2+x y;
diffy2=μ2 y+x-x^2+x y;
diffy3=μ3 y+x-x^2+x y;

fps1=Quiet[Solve[{diffx==0,diffy1==0},{x,y}]];
fps2=Quiet[Solve[{diffx==0,diffy2==0},{x,y}]];
fps3=Quiet[Solve[{diffx==0,diffy3==0},{x,y}]];
Print[Style["Jacobian matrix, cases: a<0, a=0, a>0",18,Blue]]
matrix1={diffx,diffy1};
matrix2={diffx,diffy2};
matrix3={diffx,diffy3};
D[matrix1,{{x,y}}]//MatrixForm (*Jacobian*)
D[matrix2,{{x,y}}]//MatrixForm 
D[matrix3,{{x,y}}]//MatrixForm 
Jfp1=D[matrix1,{{x,y}}]/.fps1 ; (*lin. systems' matrices about f.p.s*)
Jfp2=D[matrix2,{{x,y}}]/.fps2 ;
Jfp3=D[matrix3,{{x,y}}]/.fps3 ; 
Print[Style["Jacobian matric about f.p.s, cases: a<0, a=0, a>0",18,Blue]]
Map[MatrixForm][Jfp1]
Map[MatrixForm][Jfp2]
Map[MatrixForm][Jfp3]
Print[Style["Determinants, cases: a<0, a=0, a>0",18,Blue]]
Map[Det][Jfp1]
Map[Det][Jfp2]
Map[Det][Jfp3]
Print[Style["Trace, cases: a<0, a=0, a>0",18,Blue]]
Map[Tr][Jfp1]
Map[Tr][Jfp2]
Map[Tr][Jfp3]
Print[Style["Eigenvalues, cases: a<0, a=0, a>0",18,Blue]]
Map[Eigenvalues][Jfp1]
Map[Eigenvalues][Jfp2]
Map[Eigenvalues][Jfp3]
Print[Style["Coordinates of f.p.s, cases: a<0, a=0, a>0",18,Blue]]
coordinates1={x,y}/.fps1
coordinates2={x,y}/.fps2
coordinates3={x,y}/.fps3
Gfps1=Graphics[{PointSize[0.03],Red,Point[coordinates1]}];
Gfps2=Graphics[{PointSize[0.03],Red,Point[coordinates2]}];
Gfps3=Graphics[{PointSize[0.03],Red,Point[coordinates3]}];
sp1=StreamPlot[{diffx,diffy1},{x,-xdom,xdom},{y,-ydom,ydom},FrameLabel->{x[t],y[t]},PlotLabel->Style["Case, μ < μc, stable limit-cycle",Larger],ImageSize->imagesize,LabelStyle->Larger];
sp1t=StreamPlot[{diffx,diffy1},{x,-xdom,xdom},{y,-ydom,ydom},FrameLabel->{x[t],y[t]},PlotLabel->Style["Case, μ < μc, stable limit-cycle",Larger],StreamPoints->{{0.4,0.2}},ImageSize->imagesize,LabelStyle->Larger,StreamColorFunction->None,StreamStyle->{Thick,Blue}];

sp2=StreamPlot[{diffx,diffy2},{x,-xdom,xdom},{y,-ydom,ydom},FrameLabel->{x[t],y[t]},PlotLabel->Style["Case, μ = μc, bif. point",Larger],ImageSize->imagesize,LabelStyle->Larger];
sp2t=StreamPlot[{diffx,diffy2},{x,-xdom,xdom},{y,-ydom,ydom},FrameLabel->{x[t],y[t]},PlotLabel->Style["Case, μ = μc, bif. point",Larger],StreamPoints->{{0.04,0}},ImageSize->imagesize,LabelStyle->Larger,StreamColorFunction->None,StreamStyle->{Thick,Blue}];

sp3=StreamPlot[{diffx,diffy3},{x,-xdom,xdom},{y,-ydom,ydom},FrameLabel->{x[t],y[t]},PlotLabel->Style["Case, μ > μc",Larger],ImageSize->imagesize,LabelStyle->Larger];
sp3t=StreamPlot[{diffx,diffy3},{x,-xdom,xdom},{y,-ydom,ydom},FrameLabel->{x[t],y[t]},PlotLabel->Style["Case, μ > μc",Larger],StreamPoints->{{0.04,-0.1}},ImageSize->imagesize,LabelStyle->Larger,StreamColorFunction->None,StreamStyle->{Thick,Blue}];

Row[{Show[sp1,sp1t,Gfps1],Show[sp2,sp2t,Gfps2],Show[sp3,sp3t,Gfps3]}]

Integrated solution

Clear[diffX,diffY,x,y,μ,parameter]
imagesize=400;domx=2.0;domy=1.2;maxT=33;

Manipulate[
diffX=y;
diffY=μ y+x-x^2+x y;

difX=diffX/.{x->x[t],y->y[t]};difY=diffY/.{x->x[t],y->y[t]};
splot=StreamPlot[{diffX,diffY},{x,-1,domx},{y,-domy,domy},FrameLabel->{x[t],y[t]},ImageSize->imagesize,LabelStyle->16];
fixedpoints=Quiet[Solve[{diffX==0,diffY==0},{x,y}]];
coordinates={x,y}/.fixedpoints;
fixedp=Graphics[{PointSize[0.03],Red,Point[coordinates]}];
integration=NDSolve[{
x'[t]==difX,
y'[t]==difY,
x[0]==point[[1]],y[0]==point[[2]]},
{x,y},{t,0,T}];
trajectory=ParametricPlot[Evaluate[{x[t],y[t]}/.integration],{t,0,T},PlotStyle->Black];
solx=Plot[Evaluate[x[t]/.integration],{t,0,T},PlotRange-> All,AxesLabel-> {t,x[t]},ImageSize->imagesize,LabelStyle->16,PlotStyle->Black];
soly=Plot[Evaluate[y[t]/.integration],{t,0,T},PlotRange-> All,AxesLabel-> {t,y[t]},ImageSize->imagesize,LabelStyle->16,PlotStyle->Black];
Grid[{{Show[splot,trajectory,fixedp],soly},{solx}},Frame->All],
{{T,0.5 maxT,"Integration time, t"},1,maxT,Appearance->"Labeled"},{{μ,-0.8645,"Parameter μ"},-1,-0.6,Appearance->"Labeled"},{{point,{0.1,0.1}},Locator}, SaveDefinitions->True,TrackedSymbols:>{T,μ,point}]

Creation of this notebook was supported by IT Academy program of Information Technology Foundation for Education (HITSA).