Experiment: Iterated Function Systems

Goal: The goal of this experiment is to see how iterated function systems produce fractal images. You are asked to find the appropriate iterated function systems which produce the given fractals.

Part One: Consider the following four fractals:

Fractal 1

Fractal 2

Fractal 3

Fractal 4

Each of these fractals was generated by using the program below (you can also use Fractalina, available at the Dynamical Systems and Technology home page (math.bu.edu/DYSYS). For each of these fractals

●  Find the coordinates of the points and the compresion ratios that produced the resulting images. You should give the coordinates using "screen coordinates" running from -150 to 150 as in Fractalina. For these systems no rotation is present so the "Rotation" θ should be kept at 0. 

●  Compute the fractal dimension of each of these fractals. 

Part Two: Now consider the fractal in this figure:

Fractal 5

How do you think that this image was produced? This time there was a non-zero rotation involved at each point. Again give both the coordinates and the compresion factors as well as the rotations involved that were used to produce this image.

Part Three: Now consider the images in this figure:

Fractal 6

Fractal 7

How do you think these images were produced? Again, give both the coordinates and the compression fractors that were used to produce these images. In a brief essay explain why certain portions of the images are darker than the other portions.

Part Four: On the web open the "chaos game" Java applet located at math.bu.edu/DYSYS. As discussed in class, find an algorithm to win this game at each level (novice, medium, hard, master). Your algorithm should apply to all targets; not just specific cases. Describe your algorithm in an essay in proper English. Remember that the goal of this game is to move the red starting point into the interior of (not the boundary of) the green triangle using only the moves of the chaos game. 

Part Five: Open the "movie" in the same web site. How do you think this movie was created? Each frame of the film was created using an iterated function system. Using Fractalina, see if you can figure out how each frame was generated. In an essay, describe the number of transformations used, the associated contraction factors, and the rotation angles. Hint: The contraction factors are not all the same.

PS: These last two parts are difficult!

Initialization cell

This cell has general settings. It will be automatically evaluated before the others in this notebook.

Needs["ProgrammingInMathematica`AffineMaps`"];
Needs["ProgrammingInMathematica`IFS`"];
$TextStyle = {FontFamily -> "Times", 
          FontSize -> 14};
p[x_, y_, β_, θ_] := 
        x - x β Cos[θ] + 
          y β Sin[θ];
q[x_, y_, β_, θ_] := 
        y - β (y Cos[θ] + x Sin[θ]);

IFS

In order to plot the Iterated Function Systems shown above we have to specify the number of equations (affine maps) that are used. Each map has a fixed point (x, y), a rotation angle θ (in radians) and a contraction factor β. In order to show how the algorithm works we present the IFS that generates the Sierpinsky triangle. In this case we need three equations, namely, A1, A2 and A3. A1 leaves the point (0, 0)fixed, A2 leaves (1/2, (Sqrt[3])/2) fixed and A3 fixes the point (1, 0). The contraction is given by β = (1/2)and the rotation by θ = 0for the three maps. The variable n defines the number of times the process is iterated. When doing your trials choose n small (5 or 6) and when you are sure about your final plot increase its value. Depending on the number of equations involved, values above n = 9 can take long computation times and in general do not add much detail to the picture. Try a couple of values with the Sierpinsky system to see how it works. 

When trying to find a different fractal you will need to add more equations with their respective fixed points, contraction fractors and rotations. Remember to name the equations A1, A2, ... An with different names and to add these to the last instruction. For example, suppose you want to use 4 functions. Then add another AffineMap to the cell below and call it A4, and also add A4 to Show[Nest[IFS[{A1, A2, A3, A4}]... 

Note: To graph this IFS we are using a random point (seed) to start the process. However, any graphic object can replace this initial point.

x = 0; y = 0; β = 1/2; θ = 0;
A1 = 
        AffineMap[θ, θ, β, β, 
          p[x, y, β, θ], 
          q[x, y, β, θ]];

    
x = 1/2; 
    y = ((Sqrt[3])/2); β = 1/2; θ = 0;
A2 = 
        AffineMap[θ, θ, β, β, 
          p[x, y, β, θ], 
          q[x, y, β, θ]];

    
x = 1; y = 0; β = 1/2; θ = 0;
A3 = 
        AffineMap[θ, θ, β, β, 
          p[x, y, β, θ], 
          q[x, y, β, θ]];

    
n = 9;

    
Show[
        Nest[IFS[{A1, A2, A3}], Graphics[Point[{Random[], Random[]}]], n], 
        AspectRatio -> 1];