# Lyapunov fractals

February 03 2013 by
false
Maple 16

11

The following (downsized) images of Lyapunov fractals were each generated in a few seconds, in Maple 16.

I may make an interface for this with embedded components, or submit it in some form on the Application Center. But I thought that I'd share this version here first.

I'm just re-using the techniques in the code behind an earlier Post on Mandelbrot and Julia fractals. But I've only used one simple coloring scheme here, so far. I'll probably try the so-called burning ship escape-time fractal next.

Here below is the contents of the worksheet attached at the end of this Post.

The procedures are defined in the Startup code region of this worksheet.

It should run in Maple 15 and 16, but may not work in earlier versions since it relies on a properly functioning Threads:-Task.

The procedure Lyapunov can be called as

Lyapunov(W, xa, xb, ya, yb, xresolution)

Lyapunov(W, xa, xb, ya, yb, xresolution, numterms=N)

where those parameters are,

- W, a Vector or list whose entries should be only 0 or 1

- xa, the leftmost x-point (a float, usually greater than 2.0)

- xb, the rightmost x-point (a float, usually less than or equal to 4.0)

- ya, the lowest y-point (a float, usually greater than 2.0)

- yb, the highest y-point (a float, usually less than or equal to 4.0)

- xresolution, the width in pixels of the returned image (Array)

- numterms=N, (optional) where positive integer N is the number of terms added for the approx. Lyapunov exponent

The speed of calculation depends on whether the Compiler  is functional and how many cores are detected. On a 4-core Intel i7 under Windows 7 the first example below had approximately the following performce in 64bit Maple 16.

 Compiled evalhf serial (1 core) 20 seconds 240 seconds parallel (4 cores) 5 seconds 60 seconds

 > with(ImageTools):
 > W:=[0,0,1,0,1]: res1:=CodeTools:-Usage( Lyapunov(W, 2.01, 4.0, 2.01, 4.0, 500) ):

memory used=46.36MiB, alloc change=65.73MiB, cpu time=33.87s, real time=5.17s

 > View(res1);
 > W:=[1,1,1,1,1,1,0,0,0,0,0,0]: res2:=CodeTools:-Usage( Lyapunov(W, 2.5, 3.4, 3.4, 4.0, 500) ):

memory used=30.94MiB, alloc change=0 bytes, cpu time=21.32s, real time=3.54s

 > View(res2);
 > W:=[1,0,1,0,1,1,0,1]: res3:=CodeTools:-Usage( Lyapunov(W, 2.1, 3.7, 3.1, 4.0, 500) ):

memory used=26.18MiB, alloc change=15.09MiB, cpu time=18.44s, real time=2.95s

 > View(res3);
 > W:=[0,1]: res4:=CodeTools:-Usage( Lyapunov(W, 2.01, 4.0, 2.01, 4.0, 500) ):

memory used=46.25MiB, alloc change=15.09MiB, cpu time=33.52s, real time=5.18s

 > View(res4);
 >