Experiments with MATLAB Mandelbrot Set Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University
Mandelbrot Set The Fractal Geometry of Nature – By Benoit Mandelbrot, 1982 Mandelbrot Set – Appeared on the cover of Scientific American in 1985, which is about the time that computer graphical displays were first becoming widely available – Has stimulated deep research topics in mathematics and has also been the basis for an uncountable number of graphics projects, hardware demos, and Web pages 2
Convergence for Iterations of Complex Numbers Iteration: Consider the region in the complex plane consisting of the initial values for which the iteration remain bounded as k approaches infinity. Alternatively: 3
Definition of the Mandelbrot set – Red: Mandelbrot Set – Black: Region of rich structure 4
Examples Point inside the set – z0 = i generates a cycle of length four – Verification z0 = i; z = 0; z=z^2+z0 Point outside the set – z0 = i generates an unbounded trajectory – Manual test z0 = i; z = 0; z=z^2+z0 5
Details of the Fringe Criterion for divergence – As soon as z satisfies abs(z)>2, subsequent iterations essentially square the value of abs(z) and diverge. Display – The number of iterations required for z to escape the disc of radius 2 provides the basis for showing the detail in the fringe. – We can then use different colors to represent the above iteration count. 6
Implementation Minutes Code snippet function k = M(z0, maxCount) z = 0; k = 0; while abs(z)<2 && k< maxCount z = z^2+z0; k = k + 1; end Observations – The value returned by this function is between 1 and maxCount. – If the value is maxCount, then z0 is in the set. – We can use the value as an index into a color map of size maxCount-by-3. 7
Demos mandelbrot – thumbnail icons of the twelve regions mandelbrot(r) – r=1~12 starts with r-th interesting regions outside the Mandelbrot set. – Titles of the plots r=1 full r=2 mini mandelbrot r=3 plaza r=4 seahorses r=5 west wing r=6 dueling dragons r=7 buzzsaw r=8 nebula r=9 vortex1 r=10 vortex2 r=11 vortex3 r=12 geode (deep detail) mandelbrot(center,width,grid,depth,c mapindx) 8
“The Valley of the Seahorses” Commands – mandelbrot(4) – mandelbrot( i, 0.1, 1024, 512) Fun thing to try – Try “spinmap(5, 1)”! 9
“Buzzsaw” Commands – mandelbrot(7) – mandelbrot( i, 4.0e-11, 1024, 2048, 2) Observations – It’s as small as a the cross-section of a hair – Try “spinmap(5, 1)”! – Self-similarity! 10
“Vortex” Commands – mandelbrot(9) – mandelbrot( i, 6.0e-12, 1024, 2048, 2) Observations – It’s as small as a the cross-section of a hair – Try “spinmap(5, 1)”! 11
“Geode” Commands – mandelbrot(12) – mandelbrot( i, 6.0e-10, 2048, 4096, 1) Observations – Try “spinmap(5, 1)”! – Self-similarity! 12