Lemniscates  

Robert P. Munafo, 2009 Oct 30.



In classical mathematics a 'lemniscate' is a curve defined by a parametric relation. For examples, see the Wikipedia page, which lists several different types. Of those mentioned, the closest to the lemniscates discussed here is the polynomial lemniscate.

In relation to the Mandelbrot Set we use a specific definition. It originates with Dr. Mandelbrot in his book Fractal Geometry of Nature, where (on page 183) he uses "lemniscates" to refer to:

"... algebraic curves [...] defined by |fn*(0)|=R for some large R ..."

In the notation used here in Mu-ency, each lemniscate LN is defined as the set of all points C for which

|Zn| = ER

where ER is the escape radius (Mandelbrot's R), and Zn is the nth iteration of a function (Mandelbrot's "fn*()"), that defines the iterates:

Z0 = 0
Zi+1 = Zi2 + C

The boundary of the Mandelbrot Set is the limit of the Nth lemniscate as N goes to infinity.

Coefficients of Zi

The first few values of Zi are:

Z0 = 0
Z1 = C
Z2 = C2 + C
        = C (C + 1)
Z3 = C4 + 2 C3 + C2 + C
        = C (C3 + 2 C2 + C + 1)
Z4 = C8 + 4 C7 + 6 C6 + 6 C5 + 5 C4 + 2 C3 + C2 + C
        = C (C + 1) (C6 + 3 C5 + 3 C4 + 3 C3 + 2 C2 + 1)
etc...

The coefficients (0, 1, 0, 1, 1, 0, 1, 2, 1, 1, 0, 1, 4, 6, 6, 5, 2, 1, 1, 0, ...) are given by Sloane's sequence A137560 (or in an alternate order by A052154). The sum of the coefficients in each polynomial is Sloane's A003095, in which each term is produced by squaring the previous term and adding 1.

Relation to Divisions of a Line Segment, and to Binary Trees

The coefficients have additional interpretations that pertain to partitions (by successive bisections) of a line segment, or to binary trees of limited height; both of these interpretations are described and illustrated here: Sequences A052154 and A137560.

Lemniscates as Equations in C

The first few lemniscates are:

L0: Undefined
L1: |C| = ER
L2: |C2 + C| = ER
L3: |C4 + 2 C3 + C2 + C| = ER
etc...

The absolute value is taken by adding the squares of the real and imaginary components then taking the square root, for example:

L1: sqrt(real{C}2 + imag{C}2) = ER

Since ER is a constant we can simplify by squaring both sides:

L0: Undefined
L1: real{C}2 + imag{C}2 = ER2
L2: real{C2 + C}2 + imag{C2 + C}2 = ER2
etc...

Lemniscates as Equations in x and y

To make this a bit less abstract we'll pretend that the complex plane is an X-Y plane, and substitute x+yi for C; the resulting definitions of the lemniscates in terms of x and y are:

L0: Undefined
L1: x2 + y2 = ER2
L2: x4 + 2 y2 x2 + y4 + 2 x3 + 2 y2 x + x2 + y2 = ER2
L3: x8 + 4 y2 x6 + 6 y4 x4 + 4 y6 x2 + 4 x7 + 12 y2 x5 + 12 y4 x3 + 4 y6 x + 6 x6 + 14 y2 x4 + 10 y4 x2 + 6 x5 + 4 y2 x3 - 2 y4 x + 5 x4 + 2 y2 x2 + 2 x3 + 2 y2 x + x2 + y8 + 2 y6 - 3 y4 + y2 = ER2
etc...

Plotting the Lemniscates

As you can see, L1 is a simple circle x2+y2 = K, but L2 and higher are much more complex.

To plot them, you need to use numerical methods. Start with a single point somewhere on the curve, then follow the curve in one direction or the other using the derivative to track where and how fast to move, and a correction algorithm like Newton's method to stay on course.

To find a starting point, constrain C to be positive real. The equation then becomes Xn=K, with Xn a simple real number with the above definition, i.e. X1=C, X2=C2+C, X3=C4+2C3+C2+C, etc. The solution will always lie between 1/4 and K, and can be found with something as simple as a binary search.

The derivative Z'n is derived in the direct way, as one would learn in 1st year calculus:

Z'0(C) = d/dC Z0 = d/dC 0 = 0

Z'1(C) = d/dC Z1 = d/dC C = 1

Z'n(C) = d/dC Zn = d/dC ( Zn-12 + C ) = ( 2 Zn-1 d/dC Zn-1 ) + d/dC C = 2 Zn-1 Z'n-1+1

so the derivative is an iterated function Z'n, and you need to also iterate the values of Zn. This is the same calculation used in the distance estimator method.

Once you have calculated the derivative Z'n for a certain value of C, look at its phase angle to see which way the curve goes. For example, when C is on the positive real axis (your starting point) the phase angle will be 0. That means moving to the right will increase Zn in the positive real direction; moving up will change Zn in the positive imaginary direction, and so on. In general, let's call the phase of the derivative θ(Z'(C)). θ, the Greek letter theta, means "angle".

In general, if you alter the value of C by adding a small "delta C" ΔC, the change in value of Zn will be:

Zn(C+ΔC) - Zn(C) = ΔZn(C) ≅ ΔC Z'n(C)

and therefore the angles are related as follows:

θ(ΔZn(C)) ≅ θ(ΔC) + θ(Z'n(C))

You want to keep Zn on a circle of radius K (another way of saying |Zn=K| ). That means, Zn needs to move at a right angle to its current phase angle. So, we want

θ(ΔZn(C)) = θ(Zn(C)) ± π/2

So, the way to follow the lemniscate is: At each value of C, measure θ(Zn), the phase angle of Zn. (Use arctan(a/b), where a is the imaginary component and b is the real, and to add pi whenever b is negative). Then, choose ΔC such that:

θ(ΔC) = θ(Zn(C)) - θ(Z'n(C)) ± π/2

For "± π/2", use either π/2 or -π/2. One will move clockwise around the lemniscate, the other counterclockwise.

Choosing θ(ΔC) is only part of the choice, you also need to choose a magnitude. You need to move more slowly when the curve is bending sharply. Use the magnitude of the second derivative to measure this, and set the magnitude of C inversely proportional to it. You also need to have a way to discover that you have completed the loop.

Finally, at each step you need to correct for drift. Typically this involves taking your actual value of Zn, subtracting from it the nearest point with magnitude K, divide by the derivative, and subtract the result from C, then recompute Zn, and repeat if necessary until the desired precision is reached. That essentially amounts to Newton's method.

To plot lemniscates within a restricted view, such as a highly zoomed-in rectangle showing a very small part of the Mandelbrot Set, you need to efficiently find the parts of the curve that are visible in the view, without computing the entire lemniscate, most of which will be far out of view. To locate the parts of the curve you need, you can do a raster scan, noting pixels that fall near the desired lemniscate (that is, pixels whose level set lies just inside or just outside the desired lemniscate curve). Then, your starting C values will be near these pixels, and Newton's method can be used to zero in on starting values for the curve tracing algorithm.

See Also

See also contours, dwell bands, level sets.


[1] The lemniscates were generated and factored in Maxima by the following commands: z:0; for i:1 thru 6 do ( z:z^2+c, print(expand(z)), print(factor(z)) );

Z0 through Z4 are given above. Here are a couple more:

Z5 = C16 + 8 C15 + 28 C14 + 60 C13 + 94 C12 + 116 C11 + 114 C10 + 94 C9 + 69 C8 + 44 C7 + 26 C6 + 14 C5 + 5 C4 + 2 C3 + C2 + C
        = C (C15 + 8 C14 + 28 C13 + 60 C12 + 94 C11 + 116 C10 + 114 C9 + 94 C8 + 69 C7 + 44 C6 + 26 C5 + 14 C4 + 5 C3 + 2 C2 + C + 1)

Z6 = C32 + 16 C31 + 120 C30 + 568 C29 + 1932 C28 + 5096 C27 + 10948 C26 + 19788 C25 + 30782 C24 + 41944 C23 + 50788 C22 + 55308 C21 + 54746 C20 + 49700 C19 + 41658 C18 + 32398 C17 + 23461 C16 + 15864 C15 + 10068 C14 + 6036 C13 + 3434 C12 + 1860 C11 + 958 C10 + 470 C9 + 221 C8 + 100 C7 + 42 C6 + 14 C5 + 5 C4 + 2 C3 + C2 + C
        = C (C + 1) (C3 + 2 C2 + C + 1) (C27 + 13 C26 + 78 C25 + 293 C24 + 792 C23 + 1672 C22 + 2892 C21 + 4219 C20 + 5313 C19 + 5892 C18 + 5843 C17 + 5258 C16 + 4346 C15 + 3310 C14 + 2331 C13 + 1525 C12 + 927 C11 + 536 C10 + 298 C9 + 155 C8 + 76 C7 + 35 C6 + 17 C5 + 7 C4 + 3 C3 + C2 - C + 1)

The following PARI/GP code (from Gerald McGarvey) gives the coefficients in the same order as given by A137560 (which starts with the constant term, followed by the C term, then the C2 term and so on):

j=7; p = vector(j); p[1] = x; for(n=2, j, p[n] = p[n-1]^2 + x); print1("1"); for(n=1, j, for(m=0, poldegree(p[n]), print1(", ", polcoeff(p[n], m))))




From the Mandelbrot Set Glossary and Encyclopedia, by Robert Munafo, (c) 1987-2014.     Mu-ency index


Robert Munafo's home pages on HostMDS   © 1996-2014 Robert P. Munafo.   about   contact    mrob    mrob27    @mrob_27
This work is licensed under a Creative Commons Attribution-NonCommercial 2.5 License. Details here.

This page was last updated on 2014 Nov 21. s.11