Thursday, June 26, 2014

World of Fractals - My Previous Work with Fractals


My Previous Work with Fractals

I have had the great opportunity to work on two projects on fractals for my Undergraduate courses. First was in Computational Physics course, where I wrote programs to generate beautiful fractals. I created both kinds of fractals using computer and learned an important concept in programming. Second was in Fourier analysis course, where I mathematically analyzed a special kind of fractals that could be analyzed with Fourier series. 

A collection of fractals that I have created in computational physics class with its significance is below. Programming fractals could be challenging, even impossible, without the use of recursion. Recursion is the process of repeating items in a self-similar way. For example, screen recording inside itself (see the image) or two mirrors in front of each other. In programming, this is done by a function calling itself.

Work from Computational Physics Course

Koch Curve. The following GIF image shows the fractal at each step of the recursion process. The function generating this fractal takes in a straight line as its input and turns it into "_/\_". It also sends each of the four segments of the new line into itself (Look at the image). After infinite steps, we would have the complete Koch Curve. This process keeps happening for some predefined number of times rather than infinitely many, because the time to execute increases very fast (n^n) with number of steps.



Sierpinski's Triangle. Like the Koch Curve, Sierpinski's triangle is also a geometric fractal and follows a simple rule. The animated version is given below.
Barnsley Fern. Statistical fractals also follow a simple rule, but they generate shapes via random numbers. Two of the same fractals won't have exactly same shape because of the inherit randomness. First let me show you the kind of fractals that can be produced using random numbers and simple rules.

Click on the Images to Expand them!
...

These fractals are a collection of points in 2D. We start with the root point $(x_n,y_n) = (0.5,0)$ and generate a new point $(x_{n+1},y_{n+1})$ using random numbers in a particular way. Schemes used to generate new random numbers is given below. It is really as easy as this. It takes a few lines of codes to create above fractals.

Algorithm for the first fern.
Algorithm for the tree.
I recommend that you take a quick look at my presentation for this course. Here are links to different versions: Mathematica CDFPDF.

No comments:

Post a Comment