2007-02-18

Lyapunov Exponent Shader

The Lyapunov exponent is a measure of the stability of a dynamical system. It describes how much a small error of the input will affect the system. The calculation of the graph in the range -1 to 0 for a subset of the complex plane can produce very aesthetic pictuers. The implemantation as a pixel shader 3.0 code is very easy because its just an iteration for every point on the screen. The code for each pixel is as simpe as that:

// Compute single Lyapunov lambda value
float lyapunovExponent (const float2 ab)
{

double r;
double sum = 0;
double x = xStart;
int k;

for(k = 0; k < MaxIter+WarmUp; k++){

r = sequence(k) ? ab.x : ab.y;

x = r * x * ( 1-x );

if (k >= WarmUp) sum += log( r - 2*r*x );

}

return sum/
MaxIter;

}


Where ab is a 2D point in the complex plane, which is related to the pixel position on the screen and sequence(k) is a simple function, which chooses the x or y coordinate for each iteration.
Here is the download and here a picture:

4 Comments:

desaxismundi hat gesagt…

ohohoh...very nice...after the fractal...this one looks amazing too.but cant run PS 3.o on my machine:(

Spunkmeyer hat gesagt…

As you told,
the formula is to decide how stable a system is..

so, why does the picture look like it looks?

Can you explain this a little more?

Or am I totaly blind to it...?

tonfilm hat gesagt…

hi spunkmeyer, the image is the result of two overlaying bifurcations, one of the x value and one of the y value. read something about that here or search the web about bifurcation, there are a lot examples and articles about that...

Elliott hat gesagt…

Hey TonFilm,
My name is Elliott Hedman. I am an electrical computer engineer. We decided that we were going to try to do something similiar to your art for my Senior Capstone project. Can I interview you and pick your brain with some questions?

Thank you,
Elliott Hedman

(mathandstuff_@_hotmail.com) (get rid of the _'s