Monday, January 30, 2006

attractor fractals anyone?

(Update: got some decent detail on this one. n=10, f(x)=4x(1-x) read below for more info...)

Ok, so we were learning about a new sort of fractal in class today, and I used my computer to display some data for some of the functions that we were looking at.

These are all fractals of the sort where we have a function f and we calculate a point xn by plugging in a value x0 into the recursive definition xn+1=f(xn) n number of times.

The graph that you can see is made up of a series of xi values on the vertical axis (from x0-xn, for example x0-x20 or so), where the horizontal axis is the value of the starting input x0, ranging over the unit interval (0.0, 1.0). I made low-detail renderings by limiting n to 5, and I made high-detail renderings by letting n go up to 20. That means on the high-detail graphs, we have 20 plotted values for x at each x0.

The first one that was mentioned was f(x)=3/2*x for x between 0 and 1/2 and f(x)=-3/2*(x-1) for x between 1/2 and 1. Here is a low-detail rendering (n=5).
(****Note: for a larger view of these pictures, left click on them. My blogger displays shrunken "thumbs" instead of full resolution. On some of these renderings, getting the larger view is critical. -Ed)

Here is a high-detail rendering (n=20). See the other equations below for better results.


The second function that was mentioned was f(x)=2*x for x between 0 and 1/2 and f(x)=-2*(x-1) for x between 1/2 and 1. This is a low-detail rendering of the above equation (n=5).here is the most highly detailed rendering (n=20). I think this is a really awesome illustration of the infinite detail contained in such simple math.

This is another new shot. I decreased the line width and increased the increment in order to show more detail. I still am unclear about two aspects of these fractals: I don't understand exactly what an "orbit" is for one of these attractors and how it causes the detail. Also, and this is related to the first question, why is it called an attractor in the first place? if you know the answer to either of these questions, then by all means post a comment!
In the closup here, you can really see the layers upon layers of lines that seem to reflect off the "walls" of the graph over and over again.

The third one is f(x)=4x*(1-x). Here is a low detail shot of the fractal (by low detail, once again I mean that each x0-xn series is only 5 terms long, as in n=5)



This one is a slightly more detailed rendering (n=7), If you look closely at the two renderings, you can see exactly what the value n controls. If you look at any point on the horizontal axis, there are 6 curves that are crossing that spot (x0 is not drawn). If you refer to the previous shot, you can clearly see the 4 individual curves. As you increase n, you get more curves and thus more detail!


here we can see the most highly detailed rendering (n=20). I am still trying to figure out a way to zoom properly or display it so that the infinity is clear to the eye, but I think that this shot hints at the infinite detail of the fractal.


This final image is a rendering of an attractor-like equation that I discovered myself after playing around with the math for awhile.
This one is an n=10 rendering of the function f(x)= - (x-0.5)^3 for x less than 0.5 and f(x)=x^3 for x greater than 0.5.

here is a listing of the source code
that renders these images. For this code to work, you need to have your opengl window set up already.

(note: code was removed, as blogger thought that less-than signs were html tags...
once i figure out how to post code, I will add the source here. -Ed)

8 Comments:

Anonymous Anonymous said...

I don't know if it would help for adding the code, but the html < p r e > but with no spaces allows you to type whatever in, and then you just say < / p r e > at the end.
But, it wouldn't let me use pre in my comment, so I don't know if it will refuse it in the rest of the blog.

10:19 AM  
Blogger Max Rebuschatis said...

thanks christa!!! I will give that a try so others can participate in the fractal fun!

11:15 AM  
Blogger Thy Queen said...

Math and I don't speak the same language. However, I just dropped in to compliment you on your "You are entering a world where logic knows no bounds. A world where the 4 familiar dimensions of time and space are echewed for mind bending alternatives. A world where the ring that your coffee left on the veneer of your desk might be another universe or something. Welcome to the world of max's brain!"

Made me laugh. :)

5:15 PM  
Blogger Max Rebuschatis said...

well, ok then...

Thanks queen anabella! I appreciate any input to this blog, including that which does not relate to the discussions at hand.

Way to be a trailblazer for others!

-Max

5:23 PM  
Blogger Max Rebuschatis said...

also, that introduction was inspired by (but not quoted from -Ed) a Futurama spinoff of the Twilight Zone called The Scary Door. Let me see if I can get an exact quote for you.

-Max

7:41 PM  
Blogger Max Rebuschatis said...

"You are entering the vicinity of an area adjacent to a location. The kind of place where there might be a monster or some kind of weird mirror. These are just examples. It could also be something much better. Prepare to enter... The Scary Door."

-Futurama Season 2, Episode 7: "A Head in the Polls"

if you have never seen this show, then you are missing out.

-Max

7:46 PM  
Anonymous Anonymous said...

Ahh, 1-D maps. I love those things. I think I like them better than 2-D maps.

Though the way you plotted them is a level of indirection down from how they are usually studied. I'm sure you're familiar with the logistic map (which was included as one of your examples (4*x*(1-x))), and it's famous bifurcation diagram http://upload.wikimedia.org/wikipedia/commons/7/7d/LogisticMap_BifurcationDiagram.png

Take a look at your logistic plot for a second. It looks like you're plotting f(x), f(f(x)), f(f(f(x))) etc over each other. Try plotting just x along with it; the interaction of maps with the line y=x can be very enlightening. Anyway, look at where f(x) intersects f(f(x)); call it x0. That's a period-two orbit, i.e. f(f(x)) = x. You can also look at other intersections to find other orbits; a period-three orbit satisfies f(f(f(x))) = x.

One of the famous results of chaos theory is called "period three implies chaos" (though "chaos" in this layman's definition is rather different from what we consider to be chaos today). That is, if there is a period-three orbit, then there are orbits of all periods. Formally: if f is a continuous function from some interval I to itself, where there exists an x such that f(f(f(x))) = x, then for every n there exists a y where f^n(y) (f repeated n times) = y.

The proof is all about the intermediate value theorem. Over and over and over it is applied, and suddenly you have the result.

5:40 AM  
Blogger Max Rebuschatis said...

wow!

cool stuff luke!
I think I understand the idea of orbits better now.

One thing that you mentioned that was also mentioned by Tom Taylor (my fractal class professor) is that my renderings of those equations are not the standard renderings, but rather a plot of the paths that x0s take towards the attractor set S.

He suggested that I plot only fn(x) where n>100 or so, but I have tried this and many different variations, all with the same result: a uniform scattering array of points across the unit interval.

So maybe you can explain this to me... How do you recommend getting renderings of these fractals in the usual fashion? am I crazy or am I just doing something wrong?

-Max

9:16 AM  

Post a Comment

<< Home