• February 25, 2021, 05:49:21 PM

Login with username, password and session length

Author Topic: (Question) Weird Perturbation Theory thingy  (Read 223 times)

0 Members and 1 Guest are viewing this topic.

Offline Mr Rebooted

  • Fractal Phenom
  • ****
  • Posts: 47
(Question) Weird Perturbation Theory thingy
« on: November 11, 2020, 08:48:08 PM »
Can anyone explain why this looks like a Mandelbrot Set with a starting value that's not 0+0i with Perturbation Theory on?

Linkback: https://fractalforums.org/programming/11/weird-perturbation-theory-thingy/3856/

Offline claude

  • 3f
  • ******
  • Posts: 1781
    • mathr.co.uk
Re: Weird Perturbation Theory thingy
« Reply #1 on: November 11, 2020, 09:26:06 PM »
Possibly an "off by one" error?  Make sure your reference iterations line up with your pixel iterations.  At iteration 1, ref Z = ref C and delta z = delta c.  Other than that, show code if you want people to debug it :)

Offline Mr Rebooted

  • Fractal Phenom
  • ****
  • Posts: 47
Re: Weird Perturbation Theory thingy
« Reply #2 on: November 11, 2020, 09:44:49 PM »
Just checked, and I think it has to do with the Precision. BTW, here's the code to my perturbation theory function:
Code: [Select]
double mandelbrotPerturbation(dvec2 c, dvec2 dc) {
    dvec2 z = dvec2(Start.x, Start.y);
    dvec2 dz = dvec2(Start.x, Start.y);
    dvec2 glitchedC = dvec2(0.0, 0.0);
    for (int i = 0; i < itr; i++) {
        dvec2 dznew;
        dvec2 znew;
        if (FRACTAL_TYPE == 0) {
            dz = c_times(2.0*z+dz,dz) + dc;
            //dz = c_times(dvec2(2.0, 0.0), c_times(z, dn)) + c_powi(dn, 2) + dc;
            z = c_times(z, z) + c;
            if (glitchedPixel) {
                dz = c_times(2.0*z+dz, dz) + glitchedC;
                z = c_times(z, z) + c;
            }
        } else if (FRACTAL_TYPE == 1) {
            dznew.x = 2.0*z.x*dz.x+(dz.x*dz.x)-(dz.y*dz.y)-2.0*dz.y*z.y + dc.x;
            dznew.y = dc.y - 2.0*(z.x*dz.y+dz.x*z.y+dz.x*dz.y);
            znew.x = z.x*z.x - z.y*z.y + c.x;
            znew.y = c.y - (2.0*z.x*z.y);
            dz = dznew;
            z = znew;
        } else if (FRACTAL_TYPE == 2) {
            dznew.x = 2.0*z.x*dz.x+(dz.x*dz.x)-(dz.y*dz.y)-2.0*dz.y*z.y + dc.x;
            dznew.y = dc.y - 2.0*abs(z.x*dz.y+dz.x*z.y+dz.x*dz.y);
            znew.x = z.x*z.x - z.y*z.y + c.x;
            znew.y = -2.0*abs(z.x*z.y)+c.y;
            dz = dznew;
            z = znew;
        }
        //dz = dznew;
        //z = znew;
        if (dot(z+dz, z+dz) > threshold) {
            escaped = true;
            break;
        }
        if (dot(z+dz, z+dz)/dot(z, z) < 1e-6) {
            glitchedPixel = true;
            glitchedC = z + dz;
            break;
        }
        n++;
    }
    return n/float(itr);
}

Offline claude

  • 3f
  • ******
  • Posts: 1781
    • mathr.co.uk
Re: Weird Perturbation Theory thingy
« Reply #3 on: November 11, 2020, 10:06:46 PM »
Oh yes, at zoom e18 you need more than double precision for the reference orbit - looks like GLSL, you'll need to calculate a higher precision reference orbit (probably on CPU) and transfer it in texture or similar.

Offline Mr Rebooted

  • Fractal Phenom
  • ****
  • Posts: 47
Re: Weird Perturbation Theory thingy
« Reply #4 on: November 11, 2020, 10:25:17 PM »
ooh, so THAT's why it looks like a seeded mandelbrot, thanks!


xx
"Time Span"

Started by cricke49 on Fractal Image Gallery

0 Replies
802 Views
Last post August 02, 2018, 07:05:21 AM
by cricke49
xx
Perturbation theory

Started by gerrit on Fractal Mathematics And New Theories

213 Replies
12401 Views
Last post August 12, 2020, 07:38:03 AM
by gerrit
clip
How to get second reference when using Perturbation Theory?

Started by Mr Rebooted on Programming

11 Replies
406 Views
Last post November 10, 2020, 02:03:44 PM
by Mr Rebooted
xx
Looking for someone to help me implement Perturbation Theory some more

Started by Mr Rebooted on Collaborations & Jobs

2 Replies
247 Views
Last post November 27, 2020, 04:45:29 AM
by Mr Rebooted
clip
Perturbation Theory works! However...

Started by Mr Rebooted on Programming

4 Replies
176 Views
Last post November 10, 2020, 04:12:18 AM
by 3DickUlus