Linear 2-D and higher order maps

Map representation (stepping method)

Clear[x,y,n,a,b,sol]
Print[Style["Fixed points",19,Blue]]
Solve[{x==a x+y,y==b x},{x,y}](*f.p.s analytically*)
a=0.43;b=0.4;iter=47;

sol=RecurrenceTable[{
x[n+1]==-a x[n]+y[n],
y[n+1]==b x[n],
x[0]==0.7,y[0]==-0.1},{x,y},{n,0,iter}];
fixedpoints=Solve[{x==-a x+y,y==b x},{x,y}];
Print[Style["Fixed points, evaluated",19,Blue]]
coordinates={x,y}/.fixedpoints
fixedp=Graphics[{PointSize[0.02],Red,Point[coordinates]}];
att2=ListPlot[sol,PlotMarkers->{"•",9},PlotStyle->Black,Frame-> True,PlotRange->All,FrameLabel->{x,y},LabelStyle->20,AspectRatio->0.7,ImageSize->400];
Row[{Show[att2,fixedp],
ListLinePlot[{sol[[All,1]],sol[[All,2]]},PlotMarkers->{"•",12},AxesLabel->{n,"(Subscript[x, n]), (Subscript[y, n])"},PlotRange->{{0,iter},All},PlotLegends->{"(Subscript[x, n])","(Subscript[y, n])"},LabelStyle->20,ImageSize->400]},"       "]

Matrix representation: using RecurrenceTable

Clear[X,n,a,b,sol]
a=0.43;b=0.4;iter=47;
Xini=(({{0.7}, {-0.1}})); (*initial condition*)
A=(({{-a, 1}, {b, 0}}));(*system matrix, random*)
sol=RecurrenceTable[{
X[n+1]==A.X[n],
X[0]==Xini},
X,{n,0,iter}];
Row[{ListPlot[sol[[All,All,1]],PlotMarkers->{"•",9},Frame-> True,FrameLabel->{x,y},LabelStyle->20,ImageSize->400,PlotRange->All],
xses=sol[[All,All,1]][[All,1]];yses=sol[[All,All,1]][[All,2]];
ListLinePlot[{xses,yses},PlotMarkers->{"•",12},AxesLabel->{n,"(Subscript[x, n]), (Subscript[y, n])"},PlotRange->All,PlotLegends->{"(Subscript[x, n])","(Subscript[y, n])"},LabelStyle->20,ImageSize->400]},"       "]

Matrix representation: using matrix raised to the power of the iterate

Clear[B,n,a,b,Xini,sol2]
a=0.43;b=0.4;iter=47;
Xini=(({{0.7}, {-0.1}})); (*initial condition*)
B=(({{-a, 1}, {b, 0}}));(*system matrix, random*)
sol2=Table[MatrixPower[B,n].Xini,{n,0,iter}];
Row[{ListPlot[sol2[[All,All,1]],PlotMarkers->{"•",9},Frame-> True,FrameLabel->{x,y},LabelStyle->20,ImageSize->400,PlotRange->All],
xses2=sol2[[All,All,1]][[All,1]];yses2=sol2[[All,All,1]][[All,2]];
ListLinePlot[{xses2,yses2},PlotMarkers->{"•",12},AxesLabel->{n,"(Subscript[x, n]), (Subscript[y, n])"},PlotRange->All,PlotLegends->{"(Subscript[x, n])","(Subscript[y, n])"},LabelStyle->20,ImageSize->400]},"       "]

Nonlinear 2-D and higher order maps

Map representation (stepping method)

Clear[x,y,n,a,b,sol]
Print[Style["Fixed points",19,Blue]]
Solve[{x==a x^2+y,y==b x},{x,y}](*f.p.s analytically*)
a=0.43;b=0.4;iter=20;

sol=RecurrenceTable[{
x[n+1]==-a x[n]^2+y[n],
y[n+1]==b x[n],
x[0]==0.7,y[0]==-0.1},{x,y},{n,0,iter}];
fixedpoints=Quiet[Solve[{x==-a x^2+y,y==b x},{x,y}]];
Print[Style["Fixed points, evaluated",19,Blue]]
coordinates={x,y}/.fixedpoints
fixedp=Graphics[{PointSize[0.02],Red,Point[coordinates]}];
att2=ListPlot[sol,PlotMarkers->{"•",10},PlotStyle->Black,Frame-> True,PlotRange->All,FrameLabel->{x,y},LabelStyle->20,AspectRatio->0.7,ImageSize->400];
Row[{Show[att2,fixedp,PlotRange->All],
ListLinePlot[{sol[[All,1]],sol[[All,2]]},PlotMarkers->{"•",12},AxesLabel->{n,"(Subscript[x, n]), (Subscript[y, n])"},PlotRange->{{0,iter},All},PlotLegends->{"(Subscript[x, n])","(Subscript[y, n])"},LabelStyle->20,ImageSize->400]},"       "]

Matrix representation: using RecurrenceTable

Clear[X,n,a,b,sol]
a=0.43;b=0.4;iter=20;
Xini=(({{0.7}, {-0.1}})); (*initial condition*)
A=(({{-a*X[n][[1,1]], 1}, {b, 0}}));(*system matrix, random x^2 nonlinear*)
sol=RecurrenceTable[{
X[n+1]==A.X[n],
X[0]==Xini},
X,{n,0,iter}];
Row[{ListPlot[sol[[All,All,1]],PlotMarkers->{"•",9},Frame-> True,FrameLabel->{x,y},LabelStyle->20,ImageSize->400,PlotRange->All],
xses=sol[[All,All,1]][[All,1]];yses=sol[[All,All,1]][[All,2]];
ListLinePlot[{xses,yses},PlotMarkers->{"•",12},AxesLabel->{n,"(Subscript[x, n]), (Subscript[y, n])"},PlotRange->All,PlotLegends->{"(Subscript[x, n])","(Subscript[y, n])"},LabelStyle->20,ImageSize->400]},"       "]

Matrix representation: using NestList[]

Clear[a,b,sol]
a=0.43;b=0.4;iter=20;
system[x_]:=(({{-a*x[[1,1]], 1}, {b, 0}})).x;(*system maatrix*)
sol=NestList[system,(({{0.7}, {-0.1}})),iter];(*initial condition here*)
Row[{ListPlot[sol[[All,All,1]],PlotMarkers->{"•",9},Frame-> True,FrameLabel->{x,y},LabelStyle->20,ImageSize->400,PlotRange->All],
xses=sol[[All,All,1]][[All,1]];yses=sol[[All,All,1]][[All,2]];
ListLinePlot[{xses,yses},PlotMarkers->{"•",12},AxesLabel->{n,"(Subscript[x, n]), (Subscript[y, n])"},PlotRange->All,PlotLegends->{"(Subscript[x, n])","(Subscript[y, n])"},LabelStyle->20,ImageSize->400]},"       "]

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