a look at fractals with maple 13 - vanier...

14
A Look at Fractals with Maple 13 by Minh Khoa Danh Bui Willis Chu presented to Ivan T. Ivanov May, 2012

Upload: others

Post on 04-Sep-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Look at Fractals with Maple 13 - Vanier Collegesun4.vaniercollege.qc.ca/~iti/adlaH13/oldproj/DanhWillis.pdfapplications of fractals that have been applied in art and scientific fields

A Look at Fractals with Maple 13

by

Minh Khoa Danh Bui

Willis Chu

presented to

Ivan T. Ivanov

May, 2012

Page 2: A Look at Fractals with Maple 13 - Vanier Collegesun4.vaniercollege.qc.ca/~iti/adlaH13/oldproj/DanhWillis.pdfapplications of fractals that have been applied in art and scientific fields

1. INTRODUCTION

Fractals have become popular in science due to its usefulness. There are more and more

applications of fractals that have been applied in art and scientific fields such as astronomy,

computer science, fluid mechanics, telecommunications, surface physics and even medicine

because they very often describe better the real world than traditional mathematics and physics.

In astronomy, fractals may revolutionize the way we see the universe. Cosmologists

usually believe that matter is spread uniformly across space. But observations show this notion is

not true. Astronomers agree with that fact on small scales, but most of them think that the

universe is in a large scale and smooth. However, a group of scientists claim that the universe‟s

structure is fractal at all scales. If this new notion is proved to be correct, even the big bang

models should be adapted. But nowadays, cosmologists need more data about the matter of

distribution in the universe to prove whether or not we are living in a fractal universe.

In Fractal Art, the first goal was to portray pure self-similar images of mathematical

objects using the best combinations of colors and the best of visual effects, now many artists tend

to use fractal programs to create abstract images whether they clearly show fractal structures or

not (1)

. More specifically, the present interest in mixing several layers of individual fractals (often

unrelated) to create a single complex image is a manifestation of this tendency. Many artists

combine fractal motifs with photographic images or with other pictures created with advanced

graphics‟ programs. However, the limitation of the graphic effects and the fractal structures in

images may be an interesting challenge to artists.

The reason explains why fractal images are now applied in many fields because they have

many advantages. They can be displayed at high resolution since they are not bound by an

inherent scale. One of the advantages is that fractal images can be encoded at very high

compression ratios (maybe up to 170:1). Besides, fractal images have resolution independence

and they can be decompressed quickly. In addition, fractal images can give high image quality.

However, fractal images do have some disadvantages. The most noticeable fact regard to the

disadvantages of fractal images is that they have slow compression times. Besides, fractal images

haven‟t had the standard image format in web browsers yet. Although fractal images have some

disadvantages, they have more advantages that are very useful in science as well as many fields

related to nature (2)

.

In the field of computer science, the most useful use of fractals is the fractal image

compression. This kind of compression uses the fact that the real world is well described by

fractal geometry. Besides, images are compressed much more than by usual ways for example

JPEG or GIF file formats. Another advantage of fractal compression is that when the picture is

enlarged, there is no pixelation. The picture seems much nicer when its size is increased.

Page 3: A Look at Fractals with Maple 13 - Vanier Collegesun4.vaniercollege.qc.ca/~iti/adlaH13/oldproj/DanhWillis.pdfapplications of fractals that have been applied in art and scientific fields

Besides, one of the applications of fractals in telecommunication is fractal-shaped

antennae that greatly reduces the size and the weight of the antennae(3)

. Fractenna is the

company which sells these antennae. Similarly, the study of turbulence in flows in fluid

mechanics is very adapted to fractals. Turbulent flows are chaotic and very difficult to model

correctly. A fractal representation of them helps engineers and physicists to better understand

complex flows. Flames can also be simulated. Porous media have a very complex geometry and

are well represented by fractal. This is actually used in petroleum science.

In medicine, fractals are applied into biosensor device. A biosensor is an analytical

device for the detection of an analysis that combines a biological component with a

physicochemical detector component. Other applications of biosensors on the increase can be

found in: the protection of civilian structures and infrastructures; protection from possible

biological and chemical threats; health care; energy; food safety; and the environment to name a

few.

Page 4: A Look at Fractals with Maple 13 - Vanier Collegesun4.vaniercollege.qc.ca/~iti/adlaH13/oldproj/DanhWillis.pdfapplications of fractals that have been applied in art and scientific fields

2. DISCUSSION

A fractal is a pattern that is repeated and can that same pattern can be observed through

different scales of the image. The pattern should be obvious whether you are viewing the fractal

up close or from afar. Fractals can appear in mathematics from simple “equations,” but they also

appear everywhere in nature. Some examples of fractals that occur in nature include:

Mollusk Shells, Ferns, Snowflakes

http://fractal.weebly.com/fractals-in-nature.html

Formation of Ice on a Window

In our case, we will be considering fractals that occur in mathematics with the use of affine

transformations. An affine transformation is a linear transformation that is followed by a

translation. (Venit, Bishop, Brown)

( )

W(x) is an affine transformation where:

L is an nxn matrix,

x ϵ Rn

Lx is the linear transformation,

b is the translation

We need to know if the affine transformations are contracting when trying to create our

type of fractal with the use of affine transformations.

Page 5: A Look at Fractals with Maple 13 - Vanier Collegesun4.vaniercollege.qc.ca/~iti/adlaH13/oldproj/DanhWillis.pdfapplications of fractals that have been applied in art and scientific fields

One way of determining if an affine transformation is contracting is by computing LTL

(in our predefined case) and finding its eigenvalues. Then we can consider „s‟ to be the

squareroot of the dominant eigenvalue (also known as the “spectral norm”). If „s‟ is less than 1,

we have a contracting affine transformation. Now we know that the behaviour of the fractal will

mostly be determined by the contracting factor. The contracting factor of an affine

transformation will shrink the “[shrink] the distance between two vectors” (Venit, Bishop,

Brown) by that factor.

There are two ways to create a fractal:

Nondeterministic Algorithm: Start the computation at a random point and then apply this

point to a randomly chosen affine transformation. Due to the random nature of this

method, the resulting image will always be different.

Deterministic Algorithm: A set of rules that is followed to give the same fractal each

time.

We will be considering the case of nondeterministic algorithm to create our fractals. An

advantage to the nondeterministic method is that it is faster and requires less computer memory

than that of the deterministic method.

I have been trying to create a fern fractal for a while now, but most attempts resulted in

chaotic swirls and figures. With the help of some sources on the internet

(http://en.wikipedia.org/wiki/Barnsley_fern) and adjusting the script file that was given, I was successful in

recreating the fern fractal in Maple. The Affine Transformations required for the Barnsley fern

are:

W1(x) = x +

W2(x) = x +

W3(x) = x +

W4(x) = x +

Changes that were made to the given script file:

Page 6: A Look at Fractals with Maple 13 - Vanier Collegesun4.vaniercollege.qc.ca/~iti/adlaH13/oldproj/DanhWillis.pdfapplications of fractals that have been applied in art and scientific fields

A fourth affine transformation was added.

Example of how to check a contracting factor:

[

]

Spectral norm = √ , Therefore W1 is a contraction

Similarly, we can check if the other affine transformations are contracting:

Spectral norm of L2 = √

Spectral norm of L3 ≈ 0.11608453909701616

Spectral norm of L4 ≈ 0.14375606617592038

We can see by observing the spectral norms that these affine transformations are all contracting.

4000 iterations (6.28s to compute) 128000 iterations (1123.48s to compute)

Page 7: A Look at Fractals with Maple 13 - Vanier Collegesun4.vaniercollege.qc.ca/~iti/adlaH13/oldproj/DanhWillis.pdfapplications of fractals that have been applied in art and scientific fields

The results were disappointing and I hoped that using probabilities would generate a more

defined fern fractal. (Script file in 4. APPENDIX) The probability that I mentioned refers to the

chance of selecting a certain affine transformation.

Affine Transformation Probability

W1 1%

W2 85%

W3 7%

W4 7%

4000 iterations (7.31s) 128000 iterations (555.53s)

We can see that just by comparing the 128000 iterations from the “evenly” (≈1/4 each)

distributed affine transformations to the 4000 iterations of the ones with probabilities that we

have a much more defined fern fractal with only 4000 iterations. It seems that W2 will distribute

the points towards the leaves and since it should be chosen around 85% of the time, it is why the

leaves are more defined. I included the time it took to generate the fractals in case if anything

could be observed from it, but there is a huge gap in the 128000 iterations run. This discrepancy

may be caused by different conditions on my computer at the time that could cause it to slow

down.

Page 8: A Look at Fractals with Maple 13 - Vanier Collegesun4.vaniercollege.qc.ca/~iti/adlaH13/oldproj/DanhWillis.pdfapplications of fractals that have been applied in art and scientific fields

Here are some examples of fractals that were generated by using Maple 13:

Where the affine transformation is Dn=Anx+Vn

1.

A1= , V1=

A2= , V2=

A3= , V3=

A4= , V4=

A5= , V5=

A6= , V6=

2.

A1= , V1=

A2= , V2=

A3= , V3=

A4= , V4=

A5= , V5=

A6= , V6=

Page 9: A Look at Fractals with Maple 13 - Vanier Collegesun4.vaniercollege.qc.ca/~iti/adlaH13/oldproj/DanhWillis.pdfapplications of fractals that have been applied in art and scientific fields

3.

A1= , V1=

A2= , V2=

A3= , V3=

4.

A1= , V1=

A2= , V2=

A3= , V3=

5.

A1= , V1=

A2= , V2=

A3= , V3=

Page 10: A Look at Fractals with Maple 13 - Vanier Collegesun4.vaniercollege.qc.ca/~iti/adlaH13/oldproj/DanhWillis.pdfapplications of fractals that have been applied in art and scientific fields

6.

A1= , V1=

A2= , V2=

A3= , V3=

7.

A1= , V1=

A2= , V2=

A3= , V3=

8.

A1= , V1=

A2= , V2=

A3= , V3=

Page 11: A Look at Fractals with Maple 13 - Vanier Collegesun4.vaniercollege.qc.ca/~iti/adlaH13/oldproj/DanhWillis.pdfapplications of fractals that have been applied in art and scientific fields

9.

A1= , V1=

A2= , V2=

A3= , V3=

A4= , V4=

The Banach Contraction Principle (Davidson):

Let X be a closed subset of a complete normed vector space (V,|| . ||). If T is a contraction map

of X into X, then T has a unique fixed point x*. Furthermore, if x is any vector in X, then

and

‖ ‖ ‖ ‖

‖ ‖

where c is the Lipschitz constant for T.

A contraction (T) on Rn (or X) will have a fixed point (x

*). If we pick any arbitrary point in R

n,

xo, and apply it to the contraction map, xo will converge onto x*. “This sequence is Cauchy.”

(Davidson)

Page 12: A Look at Fractals with Maple 13 - Vanier Collegesun4.vaniercollege.qc.ca/~iti/adlaH13/oldproj/DanhWillis.pdfapplications of fractals that have been applied in art and scientific fields

3. REFERENCES

1. FractalArt. Wekipedia. Available at: http://en.wikipedia.org/wiki/Fractal_art

2. Jeff Colvin. Fractal Imgae Technology. Virginia Tech. Technology Education. USA

3. "Fractured Universe", New scientist, 21 August 1999

4. http://fractal.weebly.com/fractals-in-nature.html

5. http://en.wikipedia.org/wiki/Barnsley_fern

6. Elementary Linear Algebra, Venit, Bishop, Brown

7. Real Analysis and Applications: Theory in Practice, Davidson

Page 13: A Look at Fractals with Maple 13 - Vanier Collegesun4.vaniercollege.qc.ca/~iti/adlaH13/oldproj/DanhWillis.pdfapplications of fractals that have been applied in art and scientific fields

4. APPENDIX

8000 iterations 16000 iterations

32000 iterations 64000 iterations

Page 14: A Look at Fractals with Maple 13 - Vanier Collegesun4.vaniercollege.qc.ca/~iti/adlaH13/oldproj/DanhWillis.pdfapplications of fractals that have been applied in art and scientific fields

Maple Script for the fern fractal with distinct probabilities: