The Mandelbrot set and the Fatou and Julia sets

Parameters c corresponding to the stable period-p cycles
Parameter space of a dynamical system

Stable period-p orbits

c1=-1.1-0.1 I;c2=-0.15-0.73 I;c3=0+0 I;c4=0.12+0.22 I;c5=0.2+0 I;
iter=300;
smallsize=270;
c1p=Graphics[{PointSize[0.02],White,Point[{Re[c1],Im[c1]}]}];
c2p=Graphics[{PointSize[0.02],White,Point[{Re[c2],Im[c2]}]}];
c3p=Graphics[{PointSize[0.02],White,Point[{Re[c3],Im[c3]}]}];
c4p=Graphics[{PointSize[0.02],White,Point[{Re[c4],Im[c4]}]}];
c5p=Graphics[{PointSize[0.02],White,Point[{Re[c5],Im[c5]}]}];
Mplot=MandelbrotSetPlot[MaxIterations->iter,ImageResolution->1000,FrameLabel->{"Re(c)","Im(c)"},ImageSize->{2 smallsize,2 smallsize},LabelStyle->20];
Julia1=JuliaSetPlot[c1,MaxIterations->iter,FrameLabel->{"Re(z)","Im(z)"},ImageSize->{smallsize,smallsize},LabelStyle->16];
Julia2=JuliaSetPlot[c2,MaxIterations->iter,FrameLabel->{"Re(z)","Im(z)"},ImageSize->{smallsize,smallsize},LabelStyle->16];
Julia3=JuliaSetPlot[c3,MaxIterations->iter,FrameLabel->{"Re(z)","Im(z)"},ImageSize->{smallsize,smallsize},LabelStyle->16];
Julia4=JuliaSetPlot[c4,MaxIterations->iter,FrameLabel->{"Re(z)","Im(z)"},ImageSize->{smallsize,smallsize},LabelStyle->16];
Julia5=JuliaSetPlot[c5,MaxIterations->iter,FrameLabel->{"Re(z)","Im(z)"},ImageSize->{smallsize,smallsize},LabelStyle->16];
Grid[{{Show[Mplot,c1p,c2p,c3p,c4p,c5p],SpanFromLeft,Julia4},{SpanFromAbove,SpanFromBoth,Julia5},{Julia1,Julia2,Julia3}},Frame->All,Alignment->{{Right,Left},{Bottom,Top}}]

Unstable period-p orbits

c1=-1.5-0.2 I;c2=-0.17-0.9 I;c3=0.3-0.7 I;c4=0.33+0.0 I;c5=0.33+0.8 I;
iter=200;
smallsize=270;
c1p=Graphics[{PointSize[0.02],White,Point[{Re[c1],Im[c1]}]}];
c2p=Graphics[{PointSize[0.02],White,Point[{Re[c2],Im[c2]}]}];
c3p=Graphics[{PointSize[0.02],White,Point[{Re[c3],Im[c3]}]}];
c4p=Graphics[{PointSize[0.02],White,Point[{Re[c4],Im[c4]}]}];
c5p=Graphics[{PointSize[0.02],White,Point[{Re[c5],Im[c5]}]}];
Mplot=MandelbrotSetPlot[MaxIterations->iter,ImageResolution->1000,FrameLabel->{"Re(c)","Im(c)"},ImageSize->{2 smallsize,2 smallsize},LabelStyle->20];
Julia1=JuliaSetPlot[c1,MaxIterations->iter,FrameLabel->{"Re(z)","Im(z)"},ImageSize->{smallsize,smallsize},LabelStyle->16];
Julia2=JuliaSetPlot[c2,MaxIterations->iter,FrameLabel->{"Re(z)","Im(z)"},ImageSize->{smallsize,smallsize},LabelStyle->16];
Julia3=JuliaSetPlot[c3,MaxIterations->iter,FrameLabel->{"Re(z)","Im(z)"},ImageSize->{smallsize,smallsize},LabelStyle->16];
Julia4=JuliaSetPlot[c4,MaxIterations->iter,FrameLabel->{"Re(z)","Im(z)"},ImageSize->{smallsize,smallsize},LabelStyle->16];
Julia5=JuliaSetPlot[c5,MaxIterations->iter,FrameLabel->{"Re(z)","Im(z)"},ImageSize->{smallsize,smallsize},LabelStyle->16];
Grid[{{Show[Mplot,c1p,c2p,c3p,c4p,c5p],SpanFromLeft,Julia5},{SpanFromAbove,SpanFromBoth,Julia4},{Julia1,Julia2,Julia3}},Frame->All,Alignment->{{Right,Left},{Bottom,Top}}]

Zooming into the region of interest, the Mandelbrot set

MandelbrotSetPlot[{-0.65+0.47I,-0.4+0.7I},MaxIterations->800,ImageResolution->1600,FrameLabel->{"Re(c)","Im(c)"},ImageSize->800,LabelStyle->20]

The Mandelbrot set: Iterates (Subscript[z, n]), behaviour of (Subscript[z, n]) = 0 under iteration of Mandelbrot set

Manipulate[
Graphics[{Opacity[0.9],First@background,mandelGraph[1,n2,init]},PlotRange->{{-2,2},{-2,2}},Frame->True,FrameLabel->{"Background Re(c), z iterates Re(z)","Im(c), Im(z)"},ImageSize->{700,700},LabelStyle->20],
{{n2,6,"iterations"},1,20,1,Appearance->"Labeled"},
{{init,{{.25,0.50}}},{-2,-2},{2,2},Locator},
AutorunSequencing->{2},
SynchronousInitialization->False,
Initialization:>(
mandelbrotConv[n_Integer,c_]:=Length@NestWhileList[((#)^2)+c&,0,Abs[#]<2&,1,n];grd=Table[mandelbrotConv[100,x+I y],{y,-2,2,0.01},{x,-2,2,0.01}];background=ArrayPlot[grd,Frame->None,ColorFunction->"LightTemperatureMap",DataRange->{{-2,2},{-2,2}},DataReversed->True];
mandelbrot[n_Integer,c_]:=NestWhileList[((#)^2)+c&,0,Abs[#]<2&,1,n];
colorFun=ColorData["CMYKColors"];
mandelGraph[nVec_Integer,nIt_Integer,init_]:=Module[{tmp1=mandelbrot[nIt,#]&/@{init[[1,1]]+I init[[1,2]]}},MapIndexed[{colorFun[#2[[2]]],Arrowheads[0.011],Arrow[#1]}&,Partition[{Re[#],Im[#]}&/@#,2,1]&/@tmp1,{2}]];)]

Credit: Felipe Dimer de Oliveira

The Fatou set: Iterates (Subscript[z, n]) for c= -0.15 - 0.73i, behaviour of (Subscript[z, n]) under iteration of the Fatou set

c=-0.15-0.73 I;(*fixing the polynomial*)
Manipulate[
Graphics[{Opacity[0.9],First@Jbackground,juliaGraph[1,n2,init]},PlotRange->{{-2,2},{-2,2}},Frame->True,FrameLabel->{"Re(z)","Im(z)"},ImageSize->{700,700},LabelStyle->20],
{{n2,6,"iterations"},1,20,1,Appearance->"Labeled"},
{{init,{{0.5,0.5}}},{-2,-2},{2,2},Locator},
AutorunSequencing->{2},
SynchronousInitialization->False,
Initialization:>(
juliaConv[n_Integer,c_,zinit_]:=Length@NestWhileList[((#)^2)+c&,zinit,Abs[#]<2&,1,n];Jgrd=Table[juliaConv[100,c,x+I y],{y,-2,2,0.01},{x,-2,2,0.01}];Jbackground=ArrayPlot[Jgrd,Frame->None,ColorFunction->"LightTemperatureMap",DataRange->{{-2,2},{-2,2}},DataReversed->True];
julia[n_Integer,c_,zinit_]:=NestWhileList[((#)^2)+c&,zinit,Abs[#]<2&,1,n];
JcolorFun=ColorData["CMYKColors"];
juliaGraph[nVec_Integer,nIt_Integer,init2_]:=Module[{tmp2=julia[nIt,c,#]&/@{init2[[1,1]]+I init2[[1,2]]}},MapIndexed[{JcolorFun[#2[[2]]],Arrowheads[0.011],Arrow[#1]}&,Partition[{Re[#],Im[#]}&/@#,2,1]&/@tmp2,{2}]];)]

The Mandelbrot set for different initial (Subscript[z, 0]) values

Clear[x,y,z0]
iterates=120;
res=0.01;(*resolution, 0.01 fast*)

z0=-0.35+0.1 I;(*make your selection of inital z*)

mandelbrotConv2[n_Integer,c_,zinit_]:=Length@NestWhileList[((#)^2)+c&,zinit,Abs[#]<2&,1,n];
colormatrix=Table[mandelbrotConv2[iterates,x+I y,z0],{y,-2,2,res},{x,-2,2,res}];
ArrayPlot[colormatrix,ColorFunction->"LightTemperatureMap",DataRange->{{-2,2},{-2,2}},DataReversed->False,Frame->True,FrameTicks->Automatic,FrameLabel->{"Im(c)","Re(c)"},LabelStyle->20,ImageSize->600]

The Multibrot sets

Clear[x,y,z0,p]
iterates=230;
res=0.01;(*resolution, 0.01 fast*)

p=4;(*power of polynomial*)
z0=0.0+0.0 I;(*make your selection of inital z*)

mandelbrotConv2[n_Integer,c_,zinit_,p_]:=Length@NestWhileList[((#)^p)+c&,zinit,Abs[#]<2&,1,n];
colormatrix=Table[mandelbrotConv2[iterates,x+I y,z0,p],{y,-2,2,res},{x,-2,2,res}];
ArrayPlot[colormatrix,ColorFunction->"LightTemperatureMap",DataRange->{{-2,2},{-2,2}},DataReversed->False,Frame->True,FrameTicks->All,FrameLabel->{"Im(c)","Re(c)"},LabelStyle->20,ImageSize->500]

Other polynomials and nonlinear functions

Any polynomial or rational function can be studied in a similar manner

Clear[x,y,z0,p]
iterates=300;
res=0.005;(*resolution, 0.01 fast*)

z0=0.0+0.0 I;(*make your selection of inital z, usually 0*)
c=0.225+0.02 I;(*free term *)

iterPoly[n_Integer,c_,zinit_]:=Length@NestWhileList[((#)^3)+0.337 ((#)^2)+#+c&,zinit,Abs[#]<2&,1,n];(*your polynomial here*)
colormatrixP=Table[iterPoly[iterates,x+I y,z0],{y,-2,2,res},{x,-2,2,res}];
PlotP=ArrayPlot[colormatrixP,ColorFunction->"LightTemperatureMap",DataRange->{{-2,2},{-2,2}},DataReversed->False,Frame->True,FrameTicks->All,FrameLabel->{"Im(c)","Re(c)"},LabelStyle->20,ImageSize->400];

iterJulia[n_Integer,c_,zinit_]:=Length@NestWhileList[((#)^3)+0.337 ((#)^2)+#+c&,zinit,Abs[#]<2&,1,n];(*your polynomial here*)
colormatrixJ=Table[iterJulia[iterates,c,x+I y],{y,-2,2,res},{x,-2,2,res}];
PlotJ=ArrayPlot[colormatrixJ,ColorFunction->"LightTemperatureMap",DataRange->{{-2,2},{-2,2}},DataReversed->False,Frame->True,FrameTicks->All,FrameLabel->{"Im(z)","Re(z)"},LabelStyle->20,ImageSize->400];

PointC=Graphics[{PointSize[0.025],Black,Point[{Re[c],Im[c]}]}];
Row[{Show[PlotP,PointC],PlotJ},Graphics[{Arrowheads[Large],Arrow[{{0.0,0.01},{0.1,-0.001}}]}],Frame->True]

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