Example 2.4: Saddle Focus (Ch 2, page 37)

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

<<VectorFieldPlots`;

System

Parameters

{(Subscript[x, min]),(Subscript[x, max])}={-4,4};
{(Subscript[y, min]),(Subscript[y, max])}={-4,4};
{(Subscript[z, min]),(Subscript[z, max])}={0,8};

f[x_,y_,z_]:=-x + y

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

h[x_,y_,z_]:=-2z

Vector field

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

Fixed Points & Nullclines

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

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

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

Jacobian

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

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

a13=Simplify[D[f[x,y,z],z]]

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

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

a23=Simplify[D[g[x,y,z],z]]

a31=Simplify[D[h[x,y,z],x]]

a32=Simplify[D[h[x,y,z],y]]

a33=Simplify[D[h[x,y,z],z]]

J={{a11,a12,a13},{a21,a22,a23},{a31,a32,a33}}

MatrixForm[J]

Acceleration

γ=J . V

Over-Acceleration (jerk)

Γ=(J . γ +Dt[J] . V)/.{Dt[x]->f[x,y,z],Dt[y]->g[x,y,z],Dt[z]->h[x,y,z],Dt[parameters]->0}

Fixed Points Stability - Eigenvalues

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

Flow Curvature Manifold

ϕ=FullSimplify[Γ  . Cross[V,γ]]

FullSimplify[((x^2)+(y^2))/.{x->2,y->2,z->8}]

flowmanifold=ContourPlot3D[z-((x^2)+(y^2))==0,{x,(Subscript[x, min]),(Subscript[x, max])},{y,(Subscript[y, min]),(Subscript[y, max])},{z,(Subscript[z, min]),(Subscript[z, max])},PlotPoints->{20,20,20},BoxRatios->{1,1,1},Axes->True,AxesLabel->{"x","y","z"},Mesh->None,ContourStyle->Directive[Orange,Opacity[0.3],Specularity[White,30]],AspectRatio->1];

plan=ContourPlot3D[z==0,{x,(Subscript[x, min]),(Subscript[x, max])},{y,(Subscript[y, min]),(Subscript[y, max])},{z,(Subscript[z, min]),(Subscript[z, max])},PlotPoints->{2,2,2},BoxRatios->{1,1,1},Axes->True,AxesLabel->{"x","y","z"},Mesh->None,ContourStyle->Directive[Blue,Opacity[0.2],Specularity[White,30]],AspectRatio->1];

Flow Curvature Invariance

Normal vector

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

Invariance

Ψ=FullSimplify[V . η]

FullSimplify[(Ψ/ϕ)]

Phase Portrait

x=.
y=.
t=.

solution=NDSolve[{x'[t]==f[x[t],y[t],z[t]],x[0]==-2,

y'[t]==g[x[t],y[t],z[t]],y[0]==-2,

z'[t]==h[x[t],y[t],z[t]],z[0]==8},{x,y,z},

{t,0,60},Method->Automatic];phaseplot=ParametricPlot3D[Evaluate[{x[t],y[t],z[t]}/.solution],{t,0,5},PlotStyle->{{Red,Thickness[0.005]}},PlotPoints->2000,PlotRange->All,ImageSize->{400,400},AspectRatio->1,AxesLabel->{"X","Y","Z"}];

solution=NDSolve[{x'[t]==f[x[t],y[t],z[t]],x[0]==-4,

y'[t]==g[x[t],y[t],z[t]],y[0]==4,

z'[t]==h[x[t],y[t],z[t]],z[0]==0},{x,y,z},

{t,0,60},Method->Automatic];phaseplot1=ParametricPlot3D[Evaluate[{x[t],y[t],z[t]}/.solution],{t,0,5},PlotStyle->{{Red,Thickness[0.005]}},PlotPoints->2000,PlotRange->All,ImageSize->{400,400},AspectRatio->1,AxesLabel->{"X","Y","Z"}];

Show[flowmanifold,plan,phaseplot,phaseplot1,fixedpoint1,Boxed->False,Axes->False,BoxRatios->{1,1,1},ImageSize->{600,600}]