Lotka-Volterra fish–shark model

Jacobian and linearized systems’ matrices evaluated about the fixed points, and phase portrait

Clear[diffX,diffY,x,y,α,β,γ,δ];
α=0.6;
β=0.6;
γ=0.8;
δ=0.8;

diffX=α x-β x y;      (*x is fish*)
diffY=γ β x y-δ y;  (*y is SHARK*)
fixedpoints=Quiet[Solve[{diffX==0,diffY==0},{x,y}]];
a={diffX,diffY};
Print[Style["System",18,Blue]]
MatrixForm[a]
Print[Style["Jacobian matrix",18,Blue]]
D[a,{{x,y}}]//MatrixForm (*Jacobian*)
Jfp=D[a,{{x,y}}]/.fixedpoints ; (*lin. systems' matrices about f.p.s*)
Print[Style["Jacobian matric about f.p.s",18,Blue]]
Map[MatrixForm][Jfp]
Print[Style["Determinants",18,Blue]]
Map[Det][Jfp]
Print[Style["Trace",18,Blue]]
Map[Tr][Jfp]
Print[Style["Eigenvalues",18,Blue]]
Map[Eigenvalues][Jfp]
Print[Style["Eigenvektors",18,Blue]]
Map[Eigenvectors][Jfp]
Print[Style["F.p.s coordinates",18,Blue]]
coordinates={x,y}/.fixedpoints

fixedp=Graphics[{PointSize[0.02],Red,Point[coordinates]}];
fixedp0=Graphics[{PointSize[0.04],Red,Point[{0,0}]}];
region=RegionPlot[0<x<5&&0<y<5,{x,-1,6},{y,-1,6},PlotStyle->Opacity[0.25],BoundaryStyle->None];
sp=Show[StreamPlot[{diffX,diffY},{x,-1,5},{y,-1,5},FrameLabel->{"Fish" x[t],"Shark" y[t]},LabelStyle->18,ImageSize->520,AspectRatio->3/4],region,fixedp];
spFP1=Show[StreamPlot[ Jfp[[1]].(({{x}, {y}})),{x,-1,1},{y,-1,1},FrameLabel->{"Fish" u[t],"Shark" v[t]},PlotLabel-> coordinates[[1]],LabelStyle->18,ImageSize->290],fixedp0];
spFP2=Show[StreamPlot[ Jfp[[2]].(({{x}, {y}})),{x,-1,1},{y,-1,1},FrameLabel->{"Fish" u[t],"Shark" v[t]},PlotLabel-> coordinates[[2]],LabelStyle->18,ImageSize->290],fixedp0];
Grid[{{sp,SpanFromLeft},
{spFP1,spFP2}},Frame->All]

Lotka-Volterra fish–shark model, integrated solutions

Clear[diffX,diffY,x,y,α,β,γ,δ]
imagesize=350;maxT=55;
Manipulate[
diffX=α x-β x y;      (*x is fish*)
diffY=γ β x y-δ y;  (*y is SHARK*)
difX=α x[t]-β x[t] y[t];
difY=γ β x[t] y[t]-δ y[t];
splot=StreamPlot[{diffX,diffY},{x,-1,6},{y,-1,6},FrameLabel->{"Fish" x[t],"Shark" 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->Red];
solx=Plot[
Evaluate[x[t]/.integration],
{t,0,T},PlotRange-> All,AxesLabel-> {t,x[t]},PlotLabel->"Fish",ImageSize->imagesize,LabelStyle->16];
soly=Plot[
Evaluate[y[t]/.integration],
{t,0,T},PlotRange-> All,AxesLabel-> {t,y[t]},PlotLabel->"Shark",ImageSize->imagesize,LabelStyle->16,PlotStyle->Red];
region=RegionPlot[0<x<6&&0<y<6,{x,-1,6},{y,-1,6},PlotStyle->Opacity[0.25],BoundaryStyle->None];
Grid[{{Show[splot,region,trajectory,fixedp],soly},{solx,Show[{solx,soly},PlotLabel-> "Fish and sharks",AxesLabel-> {t,"x(t) and y(t)"}]}},Frame->All],
{{T,0.5 maxT,"Integration time, t"},1,maxT,Appearance->"Labeled"},
{{α,0.6,"Shark growth rate, α"},0.05,1,Appearance->"Labeled"},
{{β,0.8,"Predation rate, β"},0,1,Appearance->"Labeled"},
{{γ,0.9,"assimilation efficiency of y, γ"},0,1,Appearance->"Labeled"},
{{δ,0.8,"mortality rate of y, δ"},0.05,1,Appearance->"Labeled"},
{{point,{2,1}},Locator}, SaveDefinitions->True,TrackedSymbols:>{T,α,β,γ,δ,point}]

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