experiments with matlab mandelbrot set roger jang ( 張智星 ) csie dept, national taiwan...

12
Experiments with MATLAB Mandelbrot Set Roger Jang ( 張張張 ) CSIE Dept, National Taiwan University [email protected] http://mirlab.org/jang

Upload: brett-roberts

Post on 28-Dec-2015

269 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Experiments with MATLAB Mandelbrot Set Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University jang@mirlab.org

Experiments with MATLABMandelbrot Set

Roger Jang (張智星 )CSIE Dept, National Taiwan University

[email protected]://mirlab.org/jang

Page 2: Experiments with MATLAB Mandelbrot Set Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University jang@mirlab.org

2

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

Page 3: Experiments with MATLAB Mandelbrot Set Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University jang@mirlab.org

3

Convergence for Iterations ofComplex 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: ,...1,0,lim| 210

kzzwithboundediszz kknn

,...1,0,21 kzz kk

Page 4: Experiments with MATLAB Mandelbrot Set Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University jang@mirlab.org

4

Definition of the Mandelbrot set

– Red: Mandelbrot Set– Black: Region of rich

structure

,...1,0,lim| 02

10 kzzzwithboundediszz kkn

n

Page 5: Experiments with MATLAB Mandelbrot Set Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University jang@mirlab.org

5

Examples

• Point inside the set– z0 = .25-.54i generates a

cycle of length four– Verification

z0 = .25-.54i; z = 0;z=z^2+z0

• Point outside the set– z0 = .22-.54i generates

an unbounded trajectory– Manual test

z0 = .22-.54i; z = 0;z=z^2+z0

Page 6: Experiments with MATLAB Mandelbrot Set Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University jang@mirlab.org

6

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.

Page 7: Experiments with MATLAB Mandelbrot Set Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University jang@mirlab.org

7

Implementation Minutes

• Code snippetfunction k = M(z0,

maxCount)z = 0;k = 0;while abs(z)<2 && k<

maxCountz = 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.

Page 8: Experiments with MATLAB Mandelbrot Set Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University jang@mirlab.org

8

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=1full• r=2mini mandelbrot• r=3plaza• r=4seahorses• r=5west wing• r=6dueling dragons• r=7buzzsaw• r=8nebula• r=9vortex1• r=10vortex2• r=11vortex3• r=12geode (deep detail)

• mandelbrot(center,width,grid,depth,cmapindx)

Page 9: Experiments with MATLAB Mandelbrot Set Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University jang@mirlab.org

9

“The Valley of the Seahorses”

• Commands– mandelbrot(4)– mandelbrot(-.7700-.130

0i, 0.1, 1024, 512)

• Fun thing to try– Try “spinmap(5, 1)”!

-0.82 -0.81 -0.8 -0.79 -0.78 -0.77 -0.76 -0.75 -0.74 -0.73 -0.72-0.18

-0.17

-0.16

-0.15

-0.14

-0.13

-0.12

-0.11

-0.1

-0.09

-0.08

Page 10: Experiments with MATLAB Mandelbrot Set Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University jang@mirlab.org

10

“Buzzsaw”

• Commands– mandelbrot(7)– mandelbrot(0.00164372

1971153+0.822467633298876i, 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!

0.001643721971153 + 0.822467633298876i

-2 -1 0 1 2

x 10-11

-2

-1

0

1

2x 10

-11

Page 11: Experiments with MATLAB Mandelbrot Set Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University jang@mirlab.org

11

“Vortex”

• Commands– mandelbrot(9)– mandelbrot(-

1.74975914513036646-0.00000000368513796i, 6.0e-12, 1024, 2048, 2)

• Observations– It’s as small as a the

cross-section of a hair– Try “spinmap(5, 1)”!

-1.7497591451303665 - 0.0000000036851380i

-3 -2 -1 0 1 2 3

x 10-12

-3

-2

-1

0

1

2

3x 10

-12

Page 12: Experiments with MATLAB Mandelbrot Set Roger Jang ( 張智星 ) CSIE Dept, National Taiwan University jang@mirlab.org

12

“Geode”

• Commands– mandelbrot(12)– mandelbrot(0.28692299

709-0.01218247138i, 6.0e-10, 2048, 4096, 1)

• Observations– Try “spinmap(5, 1)”!– Self-similarity!

0.28692299709000 - 0.01218247138000i

-3 -2 -1 0 1 2 3

x 10-10

-3

-2

-1

0

1

2

3x 10

-10