FitzHugh-Nagumo model (Ch 14, page 218)

Clear["Global`*"]
Off[General::spell1]

<<VectorFieldPlots`;

System

Parameters

{(Subscript[x, min]),(Subscript[x, max])}={-0.8,1.2};
{(Subscript[y, min]),(Subscript[y, max])}={-0.2,0.4};

ξ=0.01;
a=0.1;
ϵ=0.5;
b=0.01;

f[x_,y_]:=(1/ξ)(x(1-x)(x+a)-y+b)

g[x_,y_]:=x-ϵ y

Vector field

V={f[x,y],g[x,y]}

Fixed Points & Nullclines

(Subscript[x, 1])=.
(Subscript[y, 1])=.

fp=Solve[{f[(Subscript[x, 1]),(Subscript[y, 1])]==0,g[(Subscript[x, 1]),(Subscript[y, 1])]==0},{(Subscript[x, 1]),(Subscript[y, 1])}]

fp1=Sort[fp[[1]]];

{(Subscript[x, 1]),(Subscript[y, 1])}={Extract[fp1,{1}][[2]],Extract[fp1,{2}][[2]]};
fixedpoint1=Show[Graphics[{PointSize[0.025],Hue[0.33],Point[{(Subscript[x, 1]),(Subscript[y, 1])}]},PlotRange->{{(Subscript[x, min]),(Subscript[x, max])},{(Subscript[y, min]),(Subscript[y, max])}}]];

nullclines=ContourPlot[{f[x,y]==0},{x,(Subscript[x, min]),(Subscript[x, max])},{y,(Subscript[y, min]),(Subscript[y, max])},ContourStyle->{{Green,Thickness[0.005]}}];

Show[nullclines,fixedpoint1]

Jacobian

a11=Simplify[D[f[x,y],x]]

a12=Simplify[D[f[x,y],y]]

a21=Simplify[D[g[x,y],x]]

a22=Simplify[D[g[x,y],y]]

J={{a11,a12},{a21,a22}}

MatrixForm[J]

Acceleration

γ=J . V

Fixed Points Stability - Eigenvalues

Eigenvalues[J]/.{x-> (Subscript[x, 1]),y->(Subscript[y, 1])}

Phase Portrait

solution=NDSolve[{x'[t]==f[x[t],y[t]],x[0]==1,

y'[t]==g[x[t],y[t]],y[0]==1},{x,y},

{t,0,100},Method->"ExplicitRungeKutta", MaxSteps->Infinity,StartingStepSize->0.001];phaseplot=ParametricPlot[Evaluate[{x[t],y[t]}/.solution],{t,50,100},PlotPoints->1000,PlotRange->{{(Subscript[x, min]),(Subscript[x, max])},{(Subscript[y, min]),(Subscript[y, max])}},AxesLabel->{"X","Y"},PlotStyle->{{Red,Thickness[0.005]}},AspectRatio->1,Frame->True]

Show[phaseplot,fixedpoint1,nullclines]

plotX=Plot[Evaluate[x[t]/.solution],{t,80,100},PlotRange->{(Subscript[x, min]),(Subscript[x, max])},PlotStyle->{RGBColor[0,0,1]}]

plotY=Plot[Evaluate[y[t]/.solution],{t,80,100},PlotRange->{(Subscript[y, min]),(Subscript[y, max])},PlotStyle->{RGBColor[0,1,0]}]

Show[plotX,plotY]

Flow Curvature Manifold

ϕ=FullSimplify[Det[{V,γ}]]

flowmanifoldG=ContourPlot[{ϕ==0},{x,(Subscript[x, min]),0},{y,(Subscript[y, min]),(Subscript[y, max])},ContourStyle->{{Blue,Thickness[0.005]}},AspectRatio->1,Frame->True]

flowmanifoldD=ContourPlot[{ϕ==0},{x,0.6,(Subscript[x, max])},{y,(Subscript[y, min]),(Subscript[y, max])},ContourStyle->{{Blue,Thickness[0.005]}},AspectRatio->1,Frame->True]

Flow Curvature Invariance

Normal Vector

η={D[ϕ,x],D[ϕ,y]}

Invariance

Ψ=FullSimplify[V . η]

invariantpart=ContourPlot[{Ψ==0},{x,(Subscript[x, min]),(Subscript[x, max])},{y,(Subscript[y, min]),(Subscript[y, max])},PlotPoints->50,ContourStyle->{{Magenta,Thickness[0.005],Dashing[{.025}]}},Frame->True,AspectRatio->1]

Show[phaseplot,fixedpoint1,nullclines,flowmanifoldG,flowmanifoldD,ImageSize->{600,600}]

Show[phaseplot,fixedpoint1,nullclines,flowmanifoldG,flowmanifoldD,invariantpart,ImageSize->{600,600}]

Hessien

Clear["Global`*"]

a11=Simplify[D[ϕ,x,x]]

a12=Simplify[D[ϕ,x,y]]

a21=Simplify[D[ϕ,y,x]]

a22=Simplify[D[ϕ,y,y]]

Matrice hessienne

H={{a11,a12},{a21,a22}}

MatrixForm[H]

Det[H]/.{x-> (Subscript[x, 1]),y->(Subscript[y, 1])}

Hessian is positive. Then I is a focus.