Fractals/Iterations in the complex plane/Mandelbrot set

< Fractals < Iterations in the complex plane

This book shows how to code different algorithms for drawing parameter plane [1] ( Mandelbrot set [2] ) for complex quadratic polynomial [3].

One can find different types of points / sets on parameter plane [4]


Exterior of Mandelbrot set

Extrerior

Boundary of Mandelbrot set

description

Interior of Mandelbrot set - hyperbolic components

The Lyapunov Exponent

Lyapunov exponents of mini the Mandelbrot set
Lyapunov exponent of real quadratic map

Math equation :[5]

where :

means first derivative of f with respect to z


See also :

Interior distance estimation

Interior distance estimation

Description of method

absolute value of the orbit

# Hypercomputing the Mandelbrot Set? by Petrus H. Potgieter February 1, 2008
n=1000; # For an nxn grid
m=50; # Number of iterations
c=meshgrid(linspace(-2,2,n))\ # Set up grid
+i*meshgrid(linspace(2,-2,n));
x=zeros(n,n); # Initial value on grid
for i=1:m
x=x.^2+c; # Iterate the mapping
endfor
imagesc(min(abs(x),2.1)) # Plot monochrome, absolute
# value of 2.1 is escape


internal level sets

Color of point  :


bof60

Image of bof60 in on page 60 in the book "the Beauty Of Fractals".Description of the method described on page 63 of bof. It is used only for interior points of the Mandelbrot set.

Color of point is proportional to :

Level sets of distance are sets of points with the same distance[12]

if (Iteration==IterationMax)
 /* interior of Mandelbrot set = color is proportional to modulus of last iteration */
 else { /* exterior of Mandelbrot set = black */
  color[0]=0;
  color[1]=0;
  color[2]=0;                           
 }
bof60 {
 init:
       float mag_of_closest_point = 1e100
 loop:
       float zmag = |z|
       if zmag < mag_of_closest_point
               mag_of_closest_point = zmag
       endif
 final:
       #index = sqrt(mag_of_closest_point) * 75.0/256.0
}

bof61

Names and description

Period of hyperbolic components

period of hyperbolic components

Period of hyperbolic component of Mandelbrot set is a period of limit set of critical orbit.


Algorithms for computing period:

Multiplier map

definition

Fractint

Fractint : Color Parameters : INSIDE=ATAN

colors by determining the angle in degrees the last iterated value has with respect to the real axis, and using the absolute value. This feature should be used with periodicity=0[18]

Internal angle

Method by Renato Fonseca : [19] "a point c in the set is given a hue equal to argument

(scaled appropriatly so that we end up with a number in the range 0 - 255). The number z_nmax is the last one calculated in the z's sequence. "

Internal rays

Internal and external rays

When varies and is constant then goes along internal ray. It is used as a path inside Mandelbrot set

/* find c in component of Mandelbrot set 
 uses complex type so #include <complex.h> and -lm 
 uses code by Wolf Jung from program Mandel
 see function mndlbrot::bifurcate from mandelbrot.cpp
 http://www.mndynamics.com/indexp.html

  */
double complex GiveC(double InternalAngleInTurns, double InternalRadius, unsigned int period)
{
  //0 <= InternalRay<= 1
  //0 <= InternalAngleInTurns <=1
  double t = InternalAngleInTurns *2*M_PI; // from turns to radians
  double R2 = InternalRadius * InternalRadius;
  double Cx, Cy; /* C = Cx+Cy*i */
  switch ( period ) {
    case 1: // main cardioid
      Cx = (cos(t)*InternalRadius)/2-(cos(2*t)*R2)/4; 
      Cy = (sin(t)*InternalRadius)/2-(sin(2*t)*R2)/4; 
      break;
   case 2: // only one component 
      Cx = InternalRadius * 0.25*cos(t) - 1.0;
      Cy = InternalRadius * 0.25*sin(t); 
      break;
  // for each period  there are 2^(period-1) roots. 
  default: // safe values
      Cx = 0.0;
      Cy = 0.0; 
    break; }

  return Cx+ Cy*I;
}

// draws points to memmory array data
int DrawInternalRay(double InternalAngleInTurns , unsigned int period, int iMax, unsigned char data[])
{

   complex double c;
   double InternalRadius;
   double RadiusStep; // between radius of points 
   int i; // number of point to draw
      
  RadiusStep = 1.0/iMax;
   
  for(i=0;i<=iMax;++i){ 
   InternalRadius = i * RadiusStep;
   c = GiveC(InternalAngleInTurns, InternalRadius, period);
   DrawPoint(c,data);
  }

return 0;
}

Example : internal ray of angle =1/6 of main cardioid.

Internal angle :

radius of ray :

Point of internal radius of unit circle :

Map point to parameter plane :

For this is equation for main cardioid.

Internal curve

When is constant varies and varies then goes along internal curve.

/* find c in component of Mandelbrot set 
 uses complex type so #include <complex.h> and -lm 
 uses code by Wolf Jung from program Mandel
 see function mndlbrot::bifurcate from mandelbrot.cpp
 http://www.mndynamics.com/indexp.html

  */
double complex GiveC(double InternalAngleInTurns, double InternalRadius, unsigned int period)
{
  //0 <= InternalRay<= 1
  //0 <= InternalAngleInTurns <=1
  double t = InternalAngleInTurns *2*M_PI; // from turns to radians
  double R2 = InternalRadius * InternalRadius;
  double Cx, Cy; /* C = Cx+Cy*i */
  switch ( period ) {
    case 1: // main cardioid
      Cx = (cos(t)*InternalRadius)/2-(cos(2*t)*R2)/4; 
      Cy = (sin(t)*InternalRadius)/2-(sin(2*t)*R2)/4; 
      break;
   case 2: // only one component 
      Cx = InternalRadius * 0.25*cos(t) - 1.0;
      Cy = InternalRadius * 0.25*sin(t); 
      break;
  // for each period  there are 2^(period-1) roots. 
  default: // safe values
      Cx = 0.0;
      Cy = 0.0; 
    break; }

  return Cx+ Cy*I;
}


// draws points to memmory array data
int DrawInternalCurve(double InternalRadius , unsigned int period,  int iMax, unsigned char data[])
{

   complex double c;
   double InternalAngle; // in turns = from 0.0 to 1.0
   double AngleStep;
   int i;
   // int iMax =100;
   
  AngleStep = 1.0/iMax;
   
  for(i=0;i<=iMax;++i){ 
   InternalAngle = i * AngleStep;
   c = GiveC(InternalAngle, InternalRadius, period);
   DrawPoint(c,data);
  }

return 0;
}

Boundaries of hyperbolic components

description

Centers of components

Video

see 3D

Speed improvements - optimisation

Symmetry

The Mandelbrot set is symmetric with respect to the x-axis in the plane :

colour(x,y) = colour(x,-y)

its intersection with the x-axis ( real slice of Mandelbrot set ) is an interval :

<-2 ; 1/4>

It can be used to speed up computations ( up to 2-times )[20]

Bailout test

Instead of checking :

compute ER2 once and check :

It gives the same result and is faster.

Period detection

"When rendering a Mandelbrot or Julia set, the most time-consuming parts of the image are the “black areas”. In these areas, the iterations never escape to infinity, so every pixel must be iterated to the maximum limit. Therefore, much time can be saved by using an algorithm to detect these areas in advance, so that they can be immediately coloured black, rather than rendering them in the normal way, pixel by pixel. FractalNet uses a recursive algorithm to split the image up into blocks, and tests each block to see whether it lies inside a “black area”. In this way, large areas of the image can be quickly coloured black, often saving a lot of rendering time. ... (some) blocks were detected as “black areas” and coloured black immediately, without having to be rendered. (Other) blocks were rendered in the normal way, pixel by pixel." Michael Hogg [21]

 // cpp code by Geek3 
// http://commons.wikimedia.org/wiki/File:Mandelbrot_set_rainbow_colors.png
bool outcircle(double center_x, double center_y, double r, double x, double y)
{ // checks if (x,y) is outside the circle around (center_x,center_y) with radius r
        x -= center_x;
        y -= center_y;
        if (x * x + y * y > r * r)
                return(true);
        return(false);

 // skip values we know they are inside
                        if ((outcircle(-0.11, 0.0, 0.63, x0, y0) || x0 > 0.1)
                                && outcircle(-1.0, 0.0, 0.25, x0, y0)
                                && outcircle(-0.125, 0.744, 0.092, x0, y0)
                                && outcircle(-1.308, 0.0, 0.058, x0, y0)
                                && outcircle(0.0, 0.25, 0.35, x0, y0))
                        {
                          // code for iteration
                         }

Cardioid and period-2 checking

One way to improve calculations is to find out beforehand whether the given point lies within the cardioid or in the period-2 bulb. Before passing the complex value through the escape time algorithm, first check if:

to determine if the point lies within the period-2 bulb and

to determine if the point lies inside the main cardioid.

Periodicity checking

Most points inside the Mandelbrot set oscillate within a fixed orbit. There could be anything from ten to tens of thousands of points in between, but if an orbit ever reaches a point where it has been before then it will continually follow this path, will never tend towards infinity and hence is in the Mandelbrot set. This Mandelbrot processor includes periodicity checking (and p-2 bulb/cardioid checking) for a great speed up during deep zoom animations with a high maximum iteration value.


Perturbation theory


Description

Very highly magnified images require more than the standard 64-128 or so bits of precision most hardware floating-point units provide, requiring renderers use slow "bignum" or "arbitrary precision"[22] math libraries to calculate. However, this can be sped up by the exploitation of perturbation theory[23]. Given

as the iteration, and a small epsilon, it is the case that

or

so if one defines

one can calculate a single point (e.g. the center of an image) using normal, high-precision arithmetic (z), giving a reference orbit, and then compute many points around it in terms of various initial offsets epsilon-zero plus the above iteration for epsilon. For most iterations, epsilon does not need more than 16 significant figures, and consequently hardware floating-point may be used to get a mostly accurate image.[24] There will often be some areas where the orbits of points diverge enough from the reference orbit that extra precision is needed on those points, or else additional local high-precision-calculated reference orbits are needed. This rendering method, and particularly the automated detection of the need for additional reference orbits and automated optimal selection of same, is an area of ongoing, active research. Renderers implementing the technique are publicly available and offer speedups for highly magnified images in the multiple orders of magnitude range.[25] [26] [27]

Newton-Raphson zooming

One can "use newton's method to find and progressively refine the precision of the location of the minibrot at the center of a pattern. This allows them to arbitrarily select a magnification between the location they started at and the final minibrot they calculate to be at the center of that location."[28][29]

Glitches

Glitches[30]

history


Programs

More tutorials and code

References

  1. parameter plane in wikipedia
  2. Mandelbrot set in wikipedia
  3. complex quadratic polynomial in wikipedia
  4. reenigne blog : mandelbrot-set-taxonomy
  5. The logistic equation by Didier Gonze October 4, 2013
  6. Ljapunov Exponent and mandelbrot set by janthor
  7. Image by Anders Sandberg
  8. Fractint : Misc. Options and algorithms
  9. Java™ Number Cruncher: The Java Programmer's Guide to Numerical Computing By Ronald Mak
  10. Firefly Application Help by Terry W. Gintz
  11. Mandelbrot Oscillations by Brian Gawalt
  12. Fractint doc by Noel Giffin
  13. gnofract4d
  14. Rigorous Investigations Of Periodic Orbits In An Electronic Circuit By Means Of Interval Methods by Zbigniew Galias
  15. Mandelbrot set drawing by Milan
  16. interior_coordinates_in_the_mandelbrot_set by Claude Heiland-Allen
  17. practical interior_distance rendering by Claude Heiland-Allen
  18. fractint color params
  19. The Mandelbrot set by Renato Fonseca
  20. How to use symetry of set
  21. FractalNet by Michael Hogg
  22. arbitrary precision at wikipedia
  23. perturbation theory in wikipedia
  24. "Superfractalthing - Arbitrary Precision Mandelbrot Set Rendering in Java by K.I. Martin 2013-05-18". http://www.fractalforums.com/announcements-and-news/superfractalthing-arbitrary-precision-mandelbrot-set-rendering-in-java/.
  25. "Kalles Fraktaler 2". http://www.chillheimer.de/kallesfraktaler/.
  26. Fast Mandelbrot set with infinite resolution, ver. 2 by Sergey Khashin, July 9, 2011
  27. Perturbation techniques applied to the Mandelbrot set by Claude Heiland-Allen October 21, 2013
  28. newton-raphson-zooming by quaz0r
  29. Newton-Raphson zooming and Evolution zoom method by Dinkydau
  30. pertubation-theory-glitches-improvement - fractal forum
  31. Fast Mandelbrot set with infinite resolution, ver. 2
  32. fractalforums : superfractalthing-arbitrary-precision-mandelbrot-set-rendering-in-java
  33. Perturbation glitches by Claude Heiland-Allen
  34. superfractalthing By K.I. Martin
  35. mightymandel by Claude Heiland-Allen
  36. ASCII graphic

Notes

  1. ^ It is conjectured that the polynomials (for the centers) are irreducible, but this has not been proved yet - Wolf Jung
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.