The Complex Quadratic Equation (Subscript[Q, c])(z) = (z^2) + c

This notebook will help you study the complex quadratic equation. You can use it to plot filled Julia sets and the Mandelbrot set with the escape criterion given in Chapter 16 and 17 of the text. You can also plot the Julia set using the Backward Iteration Algorithm as explained in Chapter 16.

Filled Julia sets

The first cell compiles the function and the second one draws the picture. Choose a value of c to plot the corresponding filled Julia set.

Iterates = 100;
\(\(Julia = 
        Compile[{{z, _Complex}, {c, _Complex}}, 
          Length[FixedPointList[#\^2 + c &, z, Iterates, 
              SameTest -> \((Abs[#] > 
                      2.0 &)\)]]];\)\)

c = - .7 - 0.28 I;

    
RealZInf = -1.6;
RealZSup = 1.6;
ImagZInf = -1.2;
ImagZSup = 
        1.2;


$TextStyle = {FontFamily -> "Times", 
          FontSize -> 14};
FilledJuliaSet = 
        DensityPlot[
          Julia[x + I y, c], {x, RealZInf, RealZSup}, {y, ImagZInf, 
            ImagZSup}, Mesh -> False,  Frame -> True, 
          Axes -> False, PlotPoints -> 200, 
          AspectRatio -> Automatic, 
          FrameLabel -> {"Re(z)", "Im(z)"}, 
          RotateLabel -> False, 
          PlotLabel -> "Filled Julia set for c =" <> ToString[c], 
          ColorFunction -> (If[# ≥ 1, RGBColor[0, 0, 0], 
                  Hue[#]] &), 
          ImageSize -> 400];
Clear[c];

Backward iteration algorithm for Julia sets

Change the value of Iterates and DropIterates to add more detail. You can also change the value of AbsolutePointSize when necessary to have a better display of points.

Equation = 
        Function[z, 
          If[Random[] > 
              0.5, (Sqrt[z - c]), -(Sqrt[z - c])]];

    
c = 
        0.45 + 0.07  I;

Iterates = 100000;
DropIterates = 100;
Orbit = 
        Drop[NestList[Equation, Random[], Iterates], 
          DropIterates];
DataPlot = 
        Table[{AbsolutePointSize[1], 
            Point[{Re[Orbit[[i]]], Im[Orbit[[i]]]}]}, {i, 1, 
            Length[Orbit]}];
$TextStyle = {FontFamily -> "Times", 
          FontSize -> 14};
Show[Graphics[DataPlot], Frame -> True, Axes -> False, 
      AspectRatio -> 1, FrameLabel -> {"Re(z)", "Im(z)"}, 
      RotateLabel -> False, 
      PlotLabel -> "Julia set for c =" <> ToString[c], 
      ImageSize -> 400]; Clear[c];

The Mandelbrot set

Choose which portion of the set you want to display by changing the corners of the window. The set is plotted using the escape criterion (see Chapter 16 and 17 of the text). To visualize the whole set use the region (-2.1,-1.2)-(.7,1.2).

Note: You can change the number of Iterates which the program tests for the critical point (0,0) to escape the circle of radius 2 to have more details plotted when zooming in. You can also change the value of PlotPoints to have better definition in the picture. However, depending on the characteristics of your system this could make the computation time too long.

Iterates = 100;
\(\(Mandelbrot = 
        Compile[{{c, _Complex}}, 
          Length[FixedPointList[#\^2 + c &, 0, Iterates, 
              SameTest -> \((Abs[#] > 
                      2.0 &)\)]]];\)\)

CrealInf = -2.1;
CrealSup =  .7;
CimagInf = -1.2;
CimagSup = 1.2;

    
$TextStyle = {FontFamily -> "Times", FontSize -> 14}; 
    MandelbrotSet = 
      DensityPlot[
        Mandelbrot[x + I y], {x, CrealInf, CrealSup}, {y, CimagInf, 
          CimagSup}, Mesh -> False,  Frame -> True, 
        Axes -> False, PlotPoints -> 100, 
        AspectRatio -> Automatic, 
        FrameLabel -> {"Re(c)", "Im(c)"}, 
        PlotLabel -> "The c-plane", RotateLabel -> False, 
        ColorFunction -> (If[# ≥ 1, RGBColor[0, 0, 0], 
                Hue[#]] &), ImageSize -> 400];