Iterates of linear 2-D maps and their phase portraits

Clear[x,y,t,iter,n,a,b,c,d,sol,f,g,x0,y0]
Manipulate[
f=a x[n]+b y[n];g=c x[n]+d y[n];
A={{a,b},{c,d}};
dtext1=Text@Style[StringForm["Eigenvalues (Subscript[λ, 1]) and (Subscript[λ, 2]) are ``, minus forces the iterates to jump around the corresponding manifold.",Eigenvalues[A]] ,12];
dtext2=Text@Style[StringForm["Determinant Δ is ``, absolute value is proportional to the change in area.",Det[A]]  ,12];
dtext3=Text@Style[StringForm["Matrix trace τ is ``",Tr[A]]   ,12];
sol=RecurrenceTable[{
x[n+1]==f,
y[n+1]==g,
x[0]==point[[1]],y[0]==point[[2]]},{x,y},{n,0,iter}];
fixedp=Graphics[{PointSize[0.021],Red,Point[{0,0}]}];
evec=Graphics[{Red,Arrow[{{0,0},#}]&/@Eigenvectors[A]}];
att2=If[Element[Eigenvalues[A],Reals],
Show[ListPlot[sol,PlotMarkers->{"•",10},PlotStyle->Black,Frame-> True,PlotRange->{{-xmax,xmax},{-ymax,ymax}},Joined->True,FrameLabel->{x,y},LabelStyle->20,AspectRatio->1.0,ImageSize->420],evec],
ListPlot[sol,PlotMarkers->{"•",10},PlotStyle->Black,Frame-> True,PlotRange->{{-xmax,xmax},{-ymax,ymax}},Joined->True,FrameLabel->{x,y},LabelStyle->20,AspectRatio->1.0,ImageSize->420]];
ip=ListLinePlot[{sol[[All,1]],sol[[All,2]]},Frame->True,PlotRange->{All,{-xmax,xmax}},AspectRatio->1.0,PlotMarkers->{"•",12},FrameLabel->{n,"(Subscript[x, n]), (Subscript[y, n])"},PlotRange->{{0,iter},All},PlotLegends->{"(Subscript[x, n])","(Subscript[y, n])"},LabelStyle->20,ImageSize->410];
xp=ListLinePlot[sol[[All,1]],Frame->True,PlotRange->{All,{-xmax,xmax}},AspectRatio->1.0,PlotMarkers->{"•",12},FrameLabel->{n,"(Subscript[x, n])"},PlotRange->{{0,iter},All},LabelStyle->20,ImageSize->410,PlotStyle->Black];
yp=ListLinePlot[sol[[All,2]],Frame->True,PlotRange->{All,{-ymax,ymax}},AspectRatio->1.0,PlotMarkers->{"•",12},FrameLabel->{n,"(Subscript[y, n])"},PlotRange->{{0,iter},All},LabelStyle->20,ImageSize->410,PlotStyle->Black];
Grid[{{Show[att2,fixedp],yp},{xp,ip},{Column[{dtext1,dtext2,dtext3}],SpanFromLeft}},Frame->All],
{{point,{1.0,2.0},"Initial condition"},Locator},
Row[{Column[{Style["System matrix coefficients:",12],
Control@{{a,0.37,"a"},-1,1,Appearance->"Labeled",ImageSize->Small},
Control@{{b,0.1,"b"},-1,1,Appearance->"Labeled",ImageSize->Small},
Control@{{c,0.3,"c"},-1,1,Appearance->"Labeled",ImageSize->Small},
Control@{{d,0.5,"d"},-1,1,Appearance->"Labeled",ImageSize->Small}}],
Column[{
Control@{{xmax,2,"Range of |(Subscript[x, max])|"},1,6,Appearance->"Labeled"},
Control@{{ymax,2,"Range of |(Subscript[y, max])|"},1,6,Appearance->"Labeled"},
Control@{{iter,15,"Number of iterations n"},0,50,1,Appearance->"Labeled"}}]}],
SaveDefinitions->True,TrackedSymbols:>{a,b,c,d,iter,point,xmax,ymax}]

Phase portrait, robust

Clear[map,a,b,c,d]
imsize=550;
Manipulate[
xlim=2;ylim=2;
icoord=Flatten[Table[{i,j},{i,-xlim,xlim,0.5},{j,-ylim,ylim,0.5}],1];
points=Length[icoord];
A={{a,b},{c,d}};
dtxt1=Text@Style[StringForm["Eigenvalues (Subscript[λ, 1]) and (Subscript[λ, 2]) are ``, minus forces the iterates to jump around the corresponding manifold.",Eigenvalues[A]] ,12];
dtxt2=Text@Style[StringForm["Determinant Δ is ``, absolute value is proportional to the change in area.",Det[A]]  ,12];
dtxt3=Text@Style[StringForm["Matrix trace τ is ``",Tr[A]]   ,12];
map[ic_,i_]:={a ic[[i,1]]+b ic[[i,2]],c ic[[i,1]]+d ic[[i,2]]};
sol=NestList[Table[map[#,i],{i,1,points,1}]&,icoord,frame];
rsol=ArrayReshape[Transpose[sol],{points,frame+1,2}];(*reshapng the array*)
fp0=Graphics[{PointSize[0.02],Red,Point[{0,0}]}];
lppp=Show[ListPlot[rsol,PlotRange->{{-xlim,xlim},{-ylim,ylim}},Frame-> True,PlotStyle->Black,PlotMarkers->{"•",8},FrameLabel->{x,y},AspectRatio->0.9,LabelStyle->20,ImageSize->imsize,Joined->True],fp0];
Column[{lppp,dtxt1,dtxt2,dtxt3}],
Style["System matrix coefficients:",12],
{{a,0.37,"a"},-1,1,Appearance->"Labeled",ImageSize->Small},
{{b,0.1,"b"},-1,1,Appearance->"Labeled",ImageSize->Small},
{{c,0.3,"c"},-1,1,Appearance->"Labeled",ImageSize->Small},
{{d,0.5,"d"},-1,1,Appearance->"Labeled",ImageSize->Small},
Delimiter,
{{frame,6,"Number of iterations n"},1,40,1,Appearance->"Labeled"},
SaveDefinitions->True,TrackedSymbols:>{a,b,c,d,frame}]

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