(Question) Actual Implementation of Perturbation Theory for the Mandelbrot Set

  • 5 Replies
  • 518 Views

0 Members and 1 Guest are viewing this topic.

Offline LionHeart

  • *
  • Uploader
  • *
  • Posts: 143
    • ManpWIN Fractal Generator
« on: February 18, 2019, 06:31:38 AM »
Hi Friends,

This is my first post on the new forum. I am trying to implement perturbation theory from SUPERFRACTALTHING MATHS by K.I. MARTIN. I couldn't really understand it but then found Shirom Makkad's MandelbrotPerturbation program on GitHub.

https://github.com/ShiromMakkad/MandelbrotPerturbation

When I ran it, it certainly gave the sort of speed enhancement I get from Kalles Fraktaler, but seems to be plagued by glitches.



Does anyone have any experience with this program?

I suspect the precision is lost in the step:

      xZoomPoint = atof(xZoomPointin);
      yZoomPoint = atof(yZoomPointin);

where these variables are long doubles (64bits in Microsoft VC++). But I don't really understand perturbation theory very well.

Actually, what I really want is a library source that is platform independent that looks like:

int  MandelbrotPerturbation(int ScreenWidth, int ScreenHeight, long MaxIterations, char *xZoomPt, char *yZoomPt, double ZoomWidth, long*PixelArray)

where:
image size is given by ScreenWidth and ScreenHeight
Maximum number of iterations tested = MaxIterations
xZoomPt, yZoomPt are strings containing the full number of digits for the centre (or corner) of the complex plane
ZoomWidth is the vertical size of the area is the complex plane
PixelArray is an array of all pixels and their iteration count

Any help here would be greatly appreciated
Thanks.



Linkback: https://fractalforums.org/fractal-mathematics-and-new-theories/28/actual-implementation-of-perturbation-theory-for-the-mandelbrot-set/2631/
Paul the LionHeart

Offline quaz0r

  • *
  • Fractal Friar
  • *
  • Posts: 119
« Reply #1 on: February 19, 2019, 10:56:43 AM »
I've never heard of that program nor seen it mentioned anywhere on the forum here.  Unless someone is an active participant in the discussions here and/or has pored over the years' worth of discussions here they probably will come up with a very basic, unoptimized, inaccurate, janky, buggy, unreliable implementation at best, as evidenced by your description of it and your example image of what should be the easiest sort of location to get right.

most people don't have the time nor want to spend the time it would really take to totally get all the ins and outs of making these things work properly and efficiently.  many a nerd has fancied themselves clever by writing a z^2+c "program" in a couple days or a day or 5 minutes or whatever, but this other stuff is not at all a linear increase in difficulty or complexity.

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1655
    • Digilantism
« Reply #2 on: February 19, 2019, 03:34:20 PM »
http://www.superfractalthing.co.nf/sft_maths.pdf
http://sourceforge.net/projects/suprfractalthng/
http://www.fractalforums.com/announcements-and-news/superfractalthing-arbitrary-precision-mandelbrot-set-rendering-in-java/

immediate 10x speed increase = port from java to C

deep deep zooms = kalles fraktaler

there are a number of "actual" implementations but the trick is fixing the glitches generated by shortfalls... good luck :D

Offline claude

  • *
  • 3f
  • ******
  • Posts: 1453
    • mathr.co.uk
« Reply #3 on: February 19, 2019, 03:58:23 PM »
that glitch looks something like what happens if you have the reference orbit out of position relative to the pixels positions in a glitch correction pass (for example, by initializing pixel deltas relative to image center instead of relative to reference C).

http://www.fractalforums.com/announcements-and-news/pertubation-theory-glitches-improvement/ is the key post about glitch detection

I was working on such a library at one point but KF is more powerful and I didn't manage to fix my own code's glitch correction satisfactorily yet (EDIT: code actually does work with minor changes, was just left in an experimental non-working state last time I touched it several years ago).  KF does some image-space processing to find the center of glitches, I'm not entirely sure how it works.  Then KF adds a new reference at the center of the largest glitch and rerenders glitched pixels, until remaining glitches are insignificant.

https://code.mathr.co.uk/mandelbrot-perturbator/blob/eecab5441ecae8a6179b19164cf504672c924e23:/c/include/mandelbrot-perturbator.h is the API of my library, it does calculations in separate threads for ease of writing GUIs without blocking everything.
« Last Edit: February 19, 2019, 05:14:05 PM by claude, Reason: it works »

Offline claude

  • *
  • 3f
  • ******
  • Posts: 1453
    • mathr.co.uk
« Reply #4 on: February 19, 2019, 05:19:37 PM »
I suspect the precision is lost in the step:

      xZoomPoint = atof(xZoomPointin);
      yZoomPoint = atof(yZoomPointin);

where these variables are long doubles (64bits in Microsoft VC++). But I don't really understand perturbation theory very well.

Yes, that loses precision.  The README says that arbitrary precision is missing, which means you'll only be able to zoom as deep as double allows (pixel spacing around 1e-16).

Offline LionHeart

  • *
  • Uploader
  • *
  • Posts: 143
    • ManpWIN Fractal Generator
« Reply #5 on: February 20, 2019, 07:52:36 AM »
Thank you to quazor, 3DickUlus and Claude for replying.

Claude, I think you hit the nail on the head. I suspected as much. Actually my program ManpWIN http://www.deleeuw.com.au/download/SetupManpWIN64bit.exe uses MPFR/MPIR arbitrary precision libraries and maybe if I use bignum:

replace
      xZoomPoint = atof(xZoomPointin);
      yZoomPoint = atof(yZoomPointin);
with
     mpfr_t xZoomPoint, yZoomPoint ;

     mpfr_set_str(xZoomPoint , xZoomPointin, 100, MPFR_RNDN);
     mpfr_set_str(yZoomPoint , yZoomPointin, 100, MPFR_RNDN);

and use these in the MandelbrotPerturbation program I might make some progress.

I'll need some thought.

Thanks so much for your help  ;)



xx
"Time Span"

Started by cricke49 on Fractal Image Gallery

0 Replies
510 Views
Last post August 02, 2018, 07:05:21 AM
by cricke49
xx
Coloring the Mandelbrot set with a perturbation implementation

Started by glorifiedelbow on Fractal Mathematics And New Theories

5 Replies
540 Views
Last post April 02, 2018, 09:49:59 PM
by skychurch
xx
Perturbation theory

Started by gerrit on Fractal Mathematics And New Theories

212 Replies
10409 Views
Last post January 05, 2020, 04:03:10 PM
by claude
xx
Resource for Learning Perturbation Theory

Started by Byte11 on Programming

0 Replies
362 Views
Last post September 10, 2018, 06:49:35 PM
by Byte11
xx
Are the mandelbrot sets generated different in appearance to the "actual" set?

Started by abbaddon1001 on Fractal Mathematics And New Theories

17 Replies
813 Views
Last post August 05, 2018, 08:45:17 PM
by Fraktalist