Project: Mandelbrot Set
Dr. David KoslickiMath 399Fall 2014
September 29, 2014
1 Introduction
For this project, I used Matlab [1] to create code that would draw Mandelbrotsets.
1.1 Part 1: Code
The Mandelbrot set is defined as the set of complex numbers {z0} such thatthe sequence {zk}k≥0 stays bounded for k = 0, 1, . . . for zk+1 = z2k + z0. Toimplement this, I defined a Matlab function
Mandelbrot(xlim,ylim, maxIterations, gridSize)
that will return a square matrix A with dimensions gridSize where the entryAi,j gives the number of iterations of the recursion zk+1 = z2k + z0 requiredbefore |zk| > 1. The code for this function is copied below in its entirety:
1
1.2 Part 2: Plots
In figure 1 is a plot of the of the function
Mandelbrot([-1.5,.5], [-1,1], 750, 1500).
In figure 2 is a plot of the of the function:
Mandelbrot([-0.748766713922161, -0.748766707771757],...
[0.123640844894862, 0.123640851045266], 750, 1500).
1.3 Part 3: Other Mandelbrot sets
Here, we develop code to implement the following two Mandelbrot-like sets:{z0 ∈ C : ∀k ≥ 0, |zk| < ∞, zk+1 = z3k + z0
}and {
z0 ∈ C : ∀k ≥ 0, |zk| < ∞, zk+1 = sin
(zkz0
)}To implement the first, we used Matlab to develop the function
MandelbrotCubed(xlim,ylim, maxIterations, gridSize).
The complete source code is included below:
To implement the second, we used Matlab to develop the function
MandelbrotSin(xlim,ylim, maxIterations, gridSize).
The complete source code is included below:
2
Real Part
Imag
inar
y P
art
Mandelbrot Set
−1.5 −1 −0.5 0 0.5
−1.5
−1
−0.5
0
0.5
1
1.5
Figure 1: Mandelbrot plot 1.
3
Real Part
Imag
inar
y P
art
Mandelbrot Set
−0.7488 −0.7488 −0.7488 −0.7488 −0.7488 −0.7488
0.1236
0.1236
0.1236
0.1236
0.1236
0.1236
0.1236
Figure 2: Mandelbrot plot 2.
4
In figure 3 we include a plot of the of the function:
MandelbrotCubed([-1, 1],[1, 1], 750, 1500).
In figure 4 we include a plot of the of the function:
MandelbrotSin([-1, 1],[1, 1], 750, 1500).
References
[1] Matlab 2013a, The MathWorks, Inc., Natick, Massachusetts, United States.
5
Real Part
Imag
inar
y P
art
MandelbrotCubed Set
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
−1
−0.8
−0.6
−0.4
−0.2
0
0.2
0.4
0.6
0.8
1
Figure 3: MandelbrotCubed plot.
6
Real Part
Imag
inar
y P
art
MandelbrotSin Set
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
−1
−0.8
−0.6
−0.4
−0.2
0
0.2
0.4
0.6
0.8
1
Figure 4: MandelbrotCubed plot.
7