Welcome to Fractal Forums

Fractal Art => Images Showcase (Rate My Fractal) => Topic started by: gds-entropy on January 25, 2017, 11:30:04 PM




Title: Meta-Mandelbrot [Mandeljulia?]
Post by: gds-entropy on January 25, 2017, 11:30:04 PM
A technique which is my favorite, and I am not aware of its popularity, is the use of meta-formulae.

These are fractal formulae that follow the convention of an original but at a much higher level.

One such is below [and attached, and I copy the text of the Flickr description below as well]:
https://www.flickr.com/photos/gds-entropy/31665738024/in/dateposted-public/ (https://www.flickr.com/photos/gds-entropy/31665738024/in/dateposted-public/)

I always share all of my formulae unless I have lost them and would need to reconstruct them from Fractal Explorer *.frs files.
I'm both too busy and too lazy to do this, but will freely share the *.frs files; I would appreciate a link back to my Flickr if you use them and please share any derivative formulae with the world in return.

<ot>
For any of the cellular automata and PDE simulations on my Flickr, I cannot post code on that platform, they mangle it beyond imagination. I am always open to collaborations though, such as the one I undertook with Softology/Jason Rampe which resulted in us largely cracking the McCabe "Very Cellular Automata"...that was fun. Link.. https://softologyblog.wordpress.com/2016/11/17/more-experiments-with-coupled-cellular-automata/ (https://softologyblog.wordpress.com/2016/11/17/more-experiments-with-coupled-cellular-automata/)
</ot>

The Level 3 Meta-Mandel formula looks almost like a Mandeljulia, for certain values of Real.

While this IS a Julia rendered formula colored according to Newton and Log(|Z|), it follows the rough pattern of the Mandelbrot fractal.
This makes sense, even though it does so for only ONE particular value of real [-0.1], because the formula is itself a meta-Mandelbrot.

Look at it.

I simply followed the convention of z*z+c to three levels...so thing A times itself plus thing B. Thing B is simply an inverted thing A which follows the same convention.

Level 0 is:
z*z+c

Level 1 is:
((z*z+c)*(z*z+c)+(c*c+z))

Level 2 is:
(((z*z+c)*(z*z+c)+(c*c+z)) * ((z*z+c)*(z*z+c)+(c*c+z)) + ((c*c+z)*(c*c+z)+(z*z+c)))

Level 3 is:
((((z*z+c)*(z*z+c)+(c*c+z))*((z*z+c)*(z*z+c)+(c*c+z))+((c*c+z)*(c*c+z)+(z*z+c)))*(((z*z+c)*(z*z+c)+(c*c+z))*((z*z+c)*(z*z+c)+(c*c+z))+((c*c+z)*(c*c+z)+(z*z+c)))+(((c*c+z)*(c*c+z)+(z*z+c))*((c*c+z)*(c*c+z)+(z*z+c))+((z*z+c)*(z*z+c)+(c*c+z))))

Try this technique yourself with other models, you will get interesting results!

Ian


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: PieMan597 on January 26, 2017, 12:18:03 AM
This is very cool!


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: kram1032 on January 26, 2017, 01:15:49 AM
There was a thread about this technique a while a go. Pretty neat indeed. I believe it was called Meta-brot at the time.
I wonder if there is some limit estimate one could do to this, so you get a "short" formula that approximates the limit and then works more like the original iteration formula.
Although the c²+z might be new? I don't know what the other thread had as a pattern.


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: kram1032 on January 26, 2017, 01:32:21 AM
found it: http://www.fractalforums.com/new-theories-and-research/metabrot/


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: gds-entropy on January 26, 2017, 05:00:15 AM
found it: http://www.fractalforums.com/new-theories-and-research/metabrot/

Very interesting, and certainly some similarity in the output. If the formula I posted is rendered as a Mandelbrot, it produces a rather boring star shape though; the most interesting manifestations seem to be when treated as Julia.

Ian


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: Dinkydau on January 26, 2017, 09:36:31 AM
This is amazing.


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: SamTiba on January 26, 2017, 10:18:05 AM
expanded Formula for the pattern level 3 with c = -0.1:

z^16 + -0.8*z^14 + 4*z^13 + 0.32*z^12 + -2.4*z^11 + 9.92*z^10 + 0.76*z^9 + -4.1862*z^8 + 11.856*z^7 + 0.95832*z^6 + -2.782*z^5 + 13.888144*z^4 + 0.51864*z^3 + -1.191008*z^2 + 0.984064*z^1 + 0.03988026

I computed it not using the diverging method and it looks rather like a normal Julia-set with nothing special.


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: kram1032 on January 26, 2017, 12:48:33 PM
It's beautiful though.
I still wonder what my own works would eventually actually look like. I need to make an iterative density plot version of it somehow. - In my old mathematica code I just evaluated all the points without ever actually plotting the result mid-calculation to see how it progresses. If anybody has a take on it, that would be nice.
Also, is there a similar, what appears to be a closed form, for this variant of the Metabrot compared to the other?
Just to reiterate, here is the Mathematica code that recursively builds all points in the set given a specific value for c and up to a specific recursion depth n:

Code:
z[0, _, _] := 0
z[n_, c_, -1] := {1/2 (1 - Sqrt[1 - 4 z[n - 1, c, -1]]) + c,
                  1/2 (1 + Sqrt[1 - 4 z[n - 1, c, -1]]) + c}
z[n_, c_,  1] := {1/2 (1 - Sqrt[1 - 4 z[n - 1, c,  1]]) + c,
                  1/2 (1 + Sqrt[1 - 4 z[n - 1, c,  1]]) + c}
z[n_, c_] := {z[n, c, -1], z[n, c, 1]}

Yesterday I coded up what should be the equivalent function in Python:
Code:
import collections
from cmath import sqrt


def flatten(l):
    for el in l:
        if isinstance(el, collections.Iterable) and not isinstance(el, (str, bytes)):
            yield from flatten(el)
        else:
            yield el


def z(n, c, b=None):
    if n == 0:
        yield 0
    elif b == -1:
        for _z in flatten(z(n-1, c, -1)):
            yield .5 * (1 - sqrt(1 - 4 * _z)) + c
            yield .5 * (1 + sqrt(1 - 4 * _z)) + c
    elif b == 1:
        for _z in flatten(z(n - 1, c, 1)):
            yield .5 * (1 - sqrt(1 - 4 * _z)) + c
            yield .5 * (1 + sqrt(1 - 4 * _z)) + c
    elif b is None:
        yield flatten(z(n, c, -1))
        yield flatten(z(n, c, 1))

So what has to be done with this code is to evaluate it with all possible values for c: That would then be the actual Meta-Mandelbrot Set. For any specific value of c, it's the Meta-Julia-set.

To find my potential closed form expression, I simply kept expanding larger and larger meta-iterations of the M-set as given at the start of the other thread, and I observed that the first few polynomial coefficients remained constant; the polynomial family converged to a limit which appears to be the expansion of z\to\frac{1}{2} \left(1-sqrt{1-4z}\right) which is one of two inverses of z \leftarrow z - z^2, the other one being z \to \frac{1}{2} \left(1+\sqrt{1-4z}\right). These two formulae are what the above functions iterate over.
It was relatively easy due to c not being involved in the iteration though. This new take also involves powers of c and thus it will be quite a bit tougher, I assume.
Though perhaps it's just as simple to do. Gotta expand a bunch of terms and see if any pattern emerges.


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: Chillheimer on January 26, 2017, 04:34:11 PM
uhhh fascinating!! :) thanks for sharing.


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: SamTiba on January 27, 2017, 12:58:18 AM
I am somehow worrying about the small dots where the number of iterations get higher not beeing on the spiral-sequence.
Can you zoom in there, gds-entropy?
Or can someone confirm them or could it also be a bug?

I thought of finding nice known patterns for formulas aswell, already tried some things like for example the legendre polynoms.
They have special behaviours but nothing extraordinary yet. There are also some nice continous fractions I would like to try out, hopefully the result is stunning.
If anyone has ideas feel free to share!


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: gds-entropy on January 27, 2017, 08:55:04 PM
I am somehow worrying about the small dots where the number of iterations get higher not beeing on the spiral-sequence.
Can you zoom in there, gds-entropy?
Or can someone confirm them or could it also be a bug?

Without having the source of Fractal Explorer I cannot really say if it is a bug or not. They no longer respond to their old e-mail at the Ukrainian government...anyone know how to contact them? I am trying to track them both down with LinkedIn and using academic routes. I wish I had bought a license to it when I had the chance in 2005.

In FE I am using 8192 iterations, N-Set Method, View As Julia, Log Counting |Z|-area, and Linear(Ident) within color control.

The [inside and outside] dots remain regardless of the settings I choose, with only a few exceptions that look like pure chaos so I couldn't tell the difference. They remain if I select Inverted too, albeit in a different place.
It may be a Fractal Explorer thing, maybe not; it does not manifest in UF when just calculating the raw fractal, it is just black inside. However the image generated by SamTiba has [outside] dots, though I cannot say their relation to the ones in my image, as I have no context.

The outside dots are tiny, complete copies of the fractal as a whole, rotated. I'll render one and upload it.

I'm not sure how useful that information is.

rsidwell from the UF forum was kind enough to make a UFM for me, in order to assist in migrating my formulae from FE to UF...those programs are so different... Honestly I much prefer FE for ease of use and all of the built in options...but alas, that infernal 16bit Formula Compiler fails to function without a 16 bit subsystem being in the newer windows...[I will try both XP Mode in win7 and a VM...]. With UF I'm essentially going to have to reverse engineer all of the modes that FE had...ugh...that is a lot of reimplementation work for what is essentially a solved problem.

Here is the UFM:

Code:
Ian1-M {
;
; Ian McDonald custom formula from the forum (Mandelbrot mode)
;
init:
  z = (0,0)
  c = #pixel
loop:
  z = ((((z*z+c)*(z*z+c)+(c*c+z))*((z*z+c)*(z*z+c)+(c*c+z))+((c*c+z)*(c*c+z)+(z*z+c)))*(((z*z+c)*(z*z+c)+(c*c+z))*((z*z+c)*(z*z+c)+(c*c+z))+((c*c+z)*(c*c+z)+(z*z+c)))+(((c*c+z)*(c*c+z)+(z*z+c))*((c*c+z)*(c*c+z)+(z*z+c))+((z*z+c)*(z*z+c)+(c*c+z))))
bailout:
  |z| <= @bailout
default:
  title = "Ian1 Mandelbrot"
  float param bailout
    caption = "Bailout value"
    default = 4.0
  endparam
switch:
  type = "Ian1-J"
  seed = #pixel
  bailout = bailout
}

Ian1-J {
;
; Ian McDonald custom formula from the forum (Julia mode)
;
init:
  z = #pixel
  c = @seed
loop:
  z = ((((z*z+c)*(z*z+c)+(c*c+z))*((z*z+c)*(z*z+c)+(c*c+z))+((c*c+z)*(c*c+z)+(z*z+c)))*(((z*z+c)*(z*z+c)+(c*c+z))*((z*z+c)*(z*z+c)+(c*c+z))+((c*c+z)*(c*c+z)+(z*z+c)))+(((c*c+z)*(c*c+z)+(z*z+c))*((c*c+z)*(c*c+z)+(z*z+c))+((z*z+c)*(z*z+c)+(c*c+z))))
bailout:
  |z| <= @bailout
default:
  title = "Ian1 Julia"
  param seed
    caption = "Seed"
    default = (-0.1, 0)
  endparam
  float param bailout
    caption = "Bailout value"
    default = 4.0
  endparam
switch:
  type = "Ian1-M"
  bailout = bailout
}


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: 3dickulus on January 28, 2017, 06:29:24 AM
this looks really interesting and a bit familiar, like something I found while investigating BioMorphs using Fragmentarium,
I tried your level 3 with the standard Mandelbrot.frag using this to calculate z... (i think I got it right?)
and in the spirit of the OP I thought I would share what I have too :)
Code:
for (i = 0; i < Iterations; i++) {
 z = (
   cMul(
(
    cMul((cMul((cMul(z,z)+c),(cMul(z,z)+c))+(cMul(c,c)+z)),
(cMul((cMul(z,z)+c),(cMul(z,z)+c))+(cMul(c,c)+z)))+
(cMul((cMul(c,c)+z),(cMul(c,c)+z))+(cMul(z,z)+c))
),
(
    cMul((cMul((cMul(z,z)+c),(cMul(z,z)+c))+(cMul(c,c)+z)),
(cMul((cMul(z,z)+c),(cMul(z,z)+c))+(cMul(c,c)+z)))+
(cMul((cMul(c,c)+z),(cMul(c,c)+z))+(cMul(z,z)+c))
)
)+
(
    cMul((cMul((cMul(c,c)+z),(cMul(c,c)+z))+(cMul(z,z)+c)),
(cMul((cMul(c,c)+z),(cMul(c,c)+z))+(cMul(z,z)+c)))+
(cMul((cMul(z,z)+c),(cMul(z,z)+c))+(cMul(c,c)+z))
)
    );
if (dot(z,z)> 100.0) break;
}
...c.x = -0.1077844 c.y = 0.0000000 image meta1.png


 which looks similar to the biomorph plot of  z=z+z²+c
Code:
Power = 4;

vec2 Plot(vec2 a) {
  vec2 b;
  b.x = sqrt (a.x * a.x + a.y * a.y);
  b.y = atan (a.y / a.x);
  if ( a.x < 0.) b.y += 3.141592;
  b.x = pow(b.x,float(Power));
  b.y *= float(Power);
  a.x = cos(b.y) * b.x;
  a.y = sin(b.y) * b.x;
  return a;
}

...
      for (i = 0; i < Iterations; i++) {
        z += Plot(z) + c;
        if (dot(z,z)> 100.0) break;
      }
...
...c.x=0.0416913 c.y=0.0000000 meta2.png

both of these images are at about 40 iterations


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: gds-entropy on January 31, 2017, 12:49:34 AM
I am somehow worrying about the small dots where the number of iterations get higher not beeing on the spiral-sequence.
Can you zoom in there, gds-entropy?

Here is the fractal found at: [which is one of the dots in the halo]
x: -0.589605376476377944
y:  0.162209338090551179

This is just to the upper left of the leftmost set of spirals.

https://www.flickr.com/photos/gds-entropy/31769659574/in/dateposted-public/ (https://www.flickr.com/photos/gds-entropy/31769659574/in/dateposted-public/)


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: gds-entropy on January 31, 2017, 12:56:34 AM
this looks really interesting and a bit familiar, like something I found while investigating BioMorphs using Fragmentarium,
I tried your level 3 with the standard Mandelbrot.frag using this to calculate z... (i think I got it right?)
and in the spirit of the OP I thought I would share what I have too :)

Thank you for sharing. :)

The first image is the closest I have seen yet, it is structurally identical from what I can tell.
Other interesting forms are at Real -0.2 and -0.1.

Here is the one for R-0.2:
https://www.flickr.com/photos/gds-entropy/32052371270/in/dateposted-public/ (https://www.flickr.com/photos/gds-entropy/32052371270/in/dateposted-public/)


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: DarkBeam on January 31, 2017, 08:58:01 AM
It reminds me the Spider fractint formula. Also I wonder what happens when you expand the massive product :)


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: SamTiba on January 31, 2017, 09:11:09 AM
I already did, darkbeam
For c = -0.1 I posted the formula earlier

For variable c it is:
26*c^8 + 80*c^7*z^2 + 144*c^6*z^4 + 64*c^6*z + 168*c^5*z^6 + 136*c^5*z^3 + 12*c^5 + 138*c^4*z^8 + 180*c^4*z^5 + 90*c^4*z^2 + 80*c^3*z^10 + 144*c^3*z^7 + 112*c^3*z^4 + 16*c^3*z + 32*c^2*z^12 + 76*c^2*z^9 + 96*c^2*z^6 + 52*c^2*z^3 + 4*c^2 + 8*c*z^14 + 24*c*z^11 + 42*c*z^8 + 28*c*z^5 + 12*c*z^2 + z^16 + 4*z^13 + 10*z^10 + 12*z^7 + 14*z^4 + z

(dumb MatLab sorted it for c)


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: DarkBeam on January 31, 2017, 09:16:05 AM
oh interesting  :alien: ;D tx


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: kram1032 on January 31, 2017, 07:05:24 PM
Nice stuff!
Meanwhile, I am working on the other Metabrot idea: I already managed to make the Mathematica code a lot faster and also really cut down on the memory costs. Though I want to push it even further: To get really large point-sets out of Mathematica I had to transform the previous recursive call into a corecursive one and, to go even further, I'll also have to make the whole process lazy somehow.

If somebody could convert the equivalent thing to a different, perhaps faster programming language that'd probably help too. - It's not like I need anything mathematica-specific. I just like its pretty easy graphing abilities.
Here's a question for the mods though:
Since this thread is about a different Metabrot than the one in the old thread, should I rather revive the old one or semi-hijack this one? I mean I think the idea is similar enough and thus I don't think it'd be off-topic here, but I'm not quite sure.


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: gds-entropy on February 01, 2017, 11:54:49 AM
Nice stuff!
Meanwhile, I am working on the other Metabrot idea: I already managed to make the Mathematica code a lot faster and also really cut down on the memory costs. Though I want to push it even further: To get really large point-sets out of Mathematica I had to transform the previous recursive call into a corecursive one and, to go even further, I'll also have to make the whole process lazy somehow.

If somebody could convert the equivalent thing to a different, perhaps faster programming language that'd probably help too. - It's not like I need anything mathematica-specific. I just like its pretty easy graphing abilities.

Hmm...I have Mathematica, but have held off using it pending my acquisition of Wolfram MathCode.

Otherwise if I am just making a "thing" [usually continuous domain n-D CA, PDE solvers, or what not] I'll hack out a version in Java via Processing, written so as to use no language features and thus be easily copypasta-able into pretty much anything else. Then I will migrate to C# through VS 2015 Enterprise if I really want to make it perform well in a short amount of time.

Delphi performs excellently, but the language is weird. Embarcadero "seems" to have done something with their compiler that automatically takes advantage of 100% of your resources, as Jason Rampe a.k.a. Softology did nothing special with regards to language or compilation to make Visions of Chaos perform as such, but it does, and he didn't even explicitly parallelize his algorithms either... Java and C# will not do this without a bit of prodding.

You may be interested in a new [very new, like, a few days ago] modification to Cilk via LLVM, which really upped the performance [as in 10 to 25% better parallel perf]:
http://news.mit.edu/2017/optimizing-code-compiler-parallel-programs-0130 (http://news.mit.edu/2017/optimizing-code-compiler-parallel-programs-0130)

Otherwise I say go for a GPU language like GLSL, OpenCL or CUDA. Personally, I utterly deplore the way those languages "taste" to my mind, and I find their use cumbersome at best.
They are not clean, and are very ugly IMO. Some of what I am doing will not be able to proceed to larger resolution and more scales until I give in and throw it at a Tesla...but I'm holding out until I have no choice left..

Maybe the program Ready has enough of what you will need in place already to make the transition easy [it is C++ and OpenCL], plus there is a fork for Houdini. You can likely do what you wish quite easily with that...meaning easier than rolling your own mature code base which can harness OpenCL and so forth.
https://github.com/GollyGang/ready (https://github.com/GollyGang/ready)

Rhino and Grasshopper support C#, and Lightwave supports SciPy and NumPy...though these are of low potential relevance to your goal, they are also loads of fun.

Here's a question for the mods though:
Since this thread is about a different Metabrot than the one in the old thread, should I rather revive the old one or semi-hijack this one? I mean I think the idea is similar enough and thus I don't think it'd be off-topic here, but I'm not quite sure.

Since no mods have spoken up, and given both the fact that I started this thread and I really cannot possibly care any less about "the proper thing", I say go for it man; hijack or do otherwise as you please. And honestly other than keeping OT and not trolling, who has time to care about the esoteric vagaries surrounding some internet forum, really? :tease:

As a side note, I have been working on some ways to implement fractal cellular automata and reaction-diffusion PDEs with varying levels of success depending on the method. As they are not "true" fractals, I've not bothered posting them here [nor will I], but there will be some images and movies on my Flickr for two new algorithms, and there are already many previous examples of similar concepts on there, in case anyone cares. I'll probably roll in a decent FFT blur I made based on some work by some person named Nayuki as well at some point, though I'm still working some fiddly bits out with usability.

Ian


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: kram1032 on February 06, 2017, 04:19:32 PM
Still working on polishing that Mathematica code of mine. However, in the mean time, I found this:
http://blog.sigfpe.com/2017/02/logarithms-and-exponentials-of-functions.html
I'm not entirely sure yet but I think this basic idea could also be implemented for the M-Set. It's a little abstract but if somebody can translate it to some simple iterations and the result converges this should give "the definitive" Meta-MSet.
I will try to do that soon but I don't have time immediately so if anybody else wants to have a go, please go right ahead!


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: gds-entropy on February 09, 2017, 09:21:53 PM
Still working on polishing that Mathematica code of mine. However, in the mean time, I found this:
http://blog.sigfpe.com/2017/02/logarithms-and-exponentials-of-functions.html
I'm not entirely sure yet but I think this basic idea could also be implemented for the M-Set. It's a little abstract but if somebody can translate it to some simple iterations and the result converges this should give "the definitive" Meta-MSet.
I will try to do that soon but I don't have time immediately so if anybody else wants to have a go, please go right ahead!

Very cool; any new developments?

I looked into hacking Mandelbulber to render a meta, but as I said previously, I HATE shader languages  :angry:, so I scrapped that idea pretty quickly once I had a look at the guts of the app; I simply have no financial incentive to learn shading languages at this point and modding that app would take too much time for me. Maybe someone else who already knows GL will do it at some point.

Ian


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: kram1032 on February 09, 2017, 09:51:50 PM
Told you, I don't have time immediately right now. So nope, not yet. Not by me anyway. Perhaps anybody else looked into that?


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: kram1032 on February 11, 2017, 08:15:09 PM
I switched over to Python. Here is code that, provided you have all the dependencies, will indefinitely render out (and overwrite/update) a supposed limit-metabrot (as found in the other thread) Buddhabrot-style and save it into a png next to wherever your python script is stored.

Code:
import random as rnd
import sys as sys
import threading as thrd
from cmath import sqrt
from math import floor
from PIL import Image
import numpy as np


class Tree:
    def __init__(self, v0, fl, fr):
        self.v = v0
        self.fl = fl
        self.fr = fr

    def left(self):
        return Tree(self.fl(self.v), self.fl, self.fr)

    def right(self):
        return Tree(self.fr(self.v), self.fl, self.fr)


def empty():  # generator without elements.
    return    # looks like a dirty hack.
    yield     # as far as I know the only way.


def chain(*its):
    for it in its:
        for i_ in it:
            yield i_


def bf(t):  # traverses infinite tree breadth first such that it gets to all the nodes and gives all the values eventually. For n iterations, need 2**(n+1)-1 points.
    ts = (t for t in [t])  # generator with one element
    while ts:
        nts = empty()
        for t in ts:
            if t is not None:
                yield t.v
                nts = chain(nts, [t.left()], [t.right()])
        ts = nts


  # I decided to sample from a circular region. Could go with rectangular region or with something more carefully chosen to get more detail in the busy central area

def rangle():  # generate random numbers evenly distributed on a circle in the complex plane
    while True:
        z = complex(rnd.uniform(-1, 1), rnd.uniform(-1, 1))
        yield z*z/(z*z.conjugate())


def rcircle(c0, r0): # generate random numbers evenly distributed in a circle in the complex plane
    a = rangle()
    while True:
        r = sqrt(rnd.uniform(0, r0*r0))
        yield r * next(a) - c0


def mtree(c_, z0_):  # corecursively generates all the points to be plotted
    return Tree(z0_, lambda z: .5*(1-sqrt(1-4*z))+c_, lambda z: .5*(1+sqrt(1-4*z))+c_)


def mbrot(iterations, resolution, filename='MBrot'):

    filename += '.png'

    # triple code for the three colors

    histr = np.array([[0. for _ in range(resolution)] for _ in range(resolution)], dtype=np.float32)
    histg = np.array([[0. for _ in range(resolution)] for _ in range(resolution)], dtype=np.float32)
    histb = np.array([[0. for _ in range(resolution)] for _ in range(resolution)], dtype=np.float32)
    img = Image.fromarray(np.uint8(histr)*255)
    img.save(filename)

    cs = rcircle(.0+.0j, 2.)

    itr = 2**(iterations + 1) - 1  # perhaps this shouldn't be hard-coded. As is, green will have half the number of points as red and blue will have half that
    itg = 2**iterations - 1
    itb = 2**(iterations - 1) - 1

    try:
        while True:
            tree = mtree(next(cs), next(cs))  # I decided to go Buddhagram-style, also giving a random initial z0. Could fix. Perhaps at the critical point z = .25+0i.
            points = bf(tree)

            for z, it_ in zip(points, range(itr)):
                r = (z.real + 3.)/6.  # the +3/6 determines what point is in the middle of the image (as is the 0,0 point) and how large the overall area is. Perhaps rewrite in terms of center point and zoom level and don't hard-code.
                x = floor((1. - 1.e-10) * resolution * r)  # the  1.e-10 is to avoid being right on the edge of a pixel
                if 0 <= x < resolution:
                    im = (z.imag + 3.)/6.
                    y = floor((1. - 1.e-10) * resolution * im)
                    if 0 <= y < resolution:
                        histr[x, y] += 1
                        if it_ <= itg:
                            histg[x, y] += 1
                            if it_ <= itb:
                                histb[x, y] += 1

                        im = (3. - z.imag)/6
                    y = floor((1.-1.e-10) * resolution * im)  # double code for enforced mirror-symmetry
                    if 0 <= y < resolution:
                        histr[x, y] += 1
                        if it_ <= itg:
                            histg[x, y] += 1
                            if it_ <= itb:
                                histb[x, y] += 1
            imhistr, binsr = np.histogram(histr.flatten(), 2 ** 16, normed=True)  # I'm not even sure if the 2 ** 16 even makes a difference
            imhistg, binsg = np.histogram(histr.flatten(), 2 ** 16, normed=True) # perhaps 2 ** 8 = 256 suffices.
            imhistb, binsb = np.histogram(histr.flatten(), 2 ** 16, normed=True) # It's how finely the histogram should be divided for equalization.
            cdfr = imhistr.cumsum()
            cdfr = cdfr / cdfr[-1]
            imeqr = np.interp(histr.flatten(), binsr[:-1], cdfr)
            mineqr = np.min(imeqr)
            maxeqr = np.max(imeqr)
            if mineqr != maxeqr:
                imeqr -= mineqr
                imeqr *= 255/(maxeqr-mineqr)
            cdfg = imhistg.cumsum()
            cdfg = cdfg / cdfg[-1]
            imeqg = np.interp(histg.flatten(), binsg[:-1], cdfg)
            mineqg = np.min(imeqg)
            maxeqg = np.max(imeqg)
            if mineqg != maxeqg:
                imeqg -= mineqg
                imeqg *= 255/(maxeqg-mineqg)
            cdfb = imhistb.cumsum()
            cdfb = cdfb / cdfb[-1]
            imeqb = np.interp(histb.flatten(), binsb[:-1], cdfb)
            mineqb = np.min(imeqb)
            maxeqb = np.max(imeqb)
            if mineqb != maxeqb:
                imeqb -= mineqb
                imeqb *= 255/(maxeqb-mineqb)
            imgr = Image.fromarray(imeqr.reshape(histr.shape)).convert('L')  # perhaps these four lines could be made into a single step
            imgg = Image.fromarray(imeqg.reshape(histg.shape)).convert('L')
            imgb = Image.fromarray(imeqb.reshape(histb.shape)).convert('L')
            img = Image.merge('RGB', [imgr, imgg, imgb])
            try:  # if I don't do this, it crashes when something else accesses the file.
                img.save(filename)
            except IOError:
                pass
    except KeyboardInterrupt:  # break loop when pressing Ctrl+C
        img.save(filename)  # save a final time

def runbrot():  # need a parameter-less wrapper function to allow for deeper nesting -> higher iterations
    it = int(input("Please enter an iteration depth.
"
                   "(Note: If this is too large, it will crash. Try something in the very low double-digits.
"
                   "It will also be exponentially slower."))
    res = int(input("Please Enter a resolution."))
    fn = input("How would you like to call your file? (Without file ending)")
    print("To end, press Ctrl+C")
    mbrot(it, res, fn)

sys.setrecursionlimit(2 ** 28)  # lift Python-interpreter-imposed nesting limit
thrd.stack_size(2**28-1)  # lift OS-imposed nesting limit - will crash when out of memory!
thread = thrd.Thread(target=runbrot)
thread.start()

I'm not sure but it could probably be made faster somehow.
In some ways it looks like the usual Buddhabrot but in others it's quite different.


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: gds-entropy on February 11, 2017, 10:51:17 PM
I switched over to Python. Here is code that, provided you have all the dependencies, will indefinitely render out (and overwrite/update) a supposed limit-metabrot (as found in the other thread) Buddhabrot-style and save it into a png next to wherever your python script is stored.

Pretty cool man, thanks for sharing. Depending on what I find when I look up the parts of python you used in terms of complexity to implement in another language, I just convert it to C# or C++. I'll shoot this over to Jason Rampe too, he may or may not be interested in doing something with it too...we'll see.

Ian


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: kram1032 on February 12, 2017, 02:10:12 AM
I had a couple mistakes in the code and I switched over to histogram-equalized rendering. The code below has been updated accordingly. It looks much nicer now with those changes. (Though it's, of course, slightly slower than with the naive linear rendering I had before)
I think I'll let one render overnight.

EDIT 2: I added a bunch of comments to the code to make it easier to recognize what's going on and also to see what my design decisions were and what could be modified. Should also help for porting.

EDIT: I updated the code with color and made higher iteration counts possible.
Also, here is a link to a super early image (like three updates worth). It looks like it might be more interesting to look at early takes than at finished (or more developed at any rate) results.
(http://i.imgur.com/UfJ051D.png)
It's 2896²px, so right-click and open to get the full resolution.
Iteration depth: 15 for red, 13 for green, 11 for blue.
It looks like the structures that appear early on look much more interesting than the final result which tends to end up being way too bright.


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: kram1032 on February 12, 2017, 07:30:37 PM
Here is the same thing with a couple of hours worth of rendering time. I think the problem with these is that they actually are too detailed. They become much less interesting once they are almost entirely filled in.
However I can only assume that that's nothing higher iteration levels couldn't fix. But as is, I'm running out of memory if I try that.
(http://i.imgur.com/RdlfKPU.png)
Again, right click and open in new tab to get the full resolution.


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: youhn on February 13, 2017, 06:53:28 PM
Rendered in 5840px
Scaled back to 640px
Took a series of 10 snapshots, every 60 seconds
Took some more series of 10, but with some pause in between (lazy scripting, sloppy human intervention)
Converted all images to an animated GIF:

(http://www.rijckaert.org/jeroen/metabrot-test02.gif)

I'll post some closeups from the end result later on.


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: kram1032 on February 13, 2017, 11:15:10 PM
Nice! What's the iteration depth you picked? I didn't manage that kind of resolution due to memory limitations. Did you fiddle with it at all or did you just take it directly as is? (Looks like as-is to me)
It's pretty neat watching it grow, eh?
The coloring helped a lot actually: I'm still rendering the one I posted there. With just a single color channel, basically all the detail got washed out and foggy. With three channels, things stay distinguishable. I think I'll give mine another night to fill in the blanks but then I'll finish and post it. Looking at it in full resolution is actually kind of important: Once it's this (mostly) filled-in, we are talking about single-pixel details making things interesting.
After that, if nobody else wants to give it a go (it really should be simple enough), I'll add in new capabilities like zooming in on specific points, per-channel iteration level control, and perhaps picking a rendering area. (Right now it will always render around a fixed circle. Presumably, a rectangular area would be faster to since even finding the circular area involves four random numbers and a square root. It means the fringes look differently though.)


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: youhn on February 14, 2017, 03:45:23 PM
Iteration depth was 14, I think.

Some close ups from the last frame:

(http://www.rijckaert.org/jeroen/fractal/metabrot-closeup-01.png)

(http://www.rijckaert.org/jeroen/fractal/metabrot-closeup-03.png)

(http://www.rijckaert.org/jeroen/fractal/metabrot-closeup-04.png)

(http://www.rijckaert.org/jeroen/fractal/metabrot-closeup-05.png)

(http://www.rijckaert.org/jeroen/fractal/metabrot-closeup-06.png)

(http://www.rijckaert.org/jeroen/fractal/metabrot-closeup-07.png)

(http://www.rijckaert.org/jeroen/fractal/metabrot-closeup-08.png)

(http://www.rijckaert.org/jeroen/fractal/metabrot-edit.png)

The last one is edited with the Gimp (some layering, color levels, blurring, sharpening, etc)


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: kram1032 on February 15, 2017, 11:23:29 AM
Ok, it's still changing quite a bit over time, filling in more and more holes, but by now, at least in the central areas, it has become pretty darn solid. This is direct output without image trickery, 15 (red), 13 (green) and 11 (blue) iterations. Please make sure to look at it in full resolution. (Right-click, open) The fine details, imo, are really what's selling this one. The shape at large is comparatively boring. What, do you think, would be a good place to explore?
(http://i.imgur.com/fNsaJ3P.jpg)


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: Softology on February 15, 2017, 09:07:12 PM
Here is a sample Meta-Mandelbrot movie at 4K resolution.  First part is 1000 frames changing the real part of C from 0 to -0.2.  Then 3 zooms (-01,0.0) (-0.14,0.0) and (-0.2,0.0).  Uses CPM smooth shading.

https://www.youtube.com/watch?v=8Hci_vNr6sI&feature=youtu.be

Here is the full shader code if anyone wants to take a look.

Code:
#version 400

uniform vec2 resolution;
uniform vec3 palette[256];
uniform double xmin;
uniform double xmax;
uniform double ymin;
uniform double ymax;
uniform double bailout;
uniform int maxiters;
uniform int samplepixels;

double sqrsamplepixels=double(samplepixels*samplepixels);
double bailout_squared=double(bailout*bailout);
double magnitude,r1,r2,g1,g2,b1,b2,tweenval,x,y;
double realiters;
vec4 finalcol,col;
int superx,supery;
double stepx=(xmax-xmin)/resolution.x/double(samplepixels);
double stepy=(ymax-ymin)/resolution.y/double(samplepixels);
int colval,colval2;
dvec2 z,c,lastz,lastz2,s1,s2,n,d,a,d2,temp,temp2,temp3;

dvec2 cmul( dvec2 a, dvec2 b )  { return dvec2( a.x*b.x - a.y*b.y, a.x*b.y + a.y*b.x ); }
dvec2 csqr( dvec2 a ) { return dvec2(a.x*a.x-a.y*a.y, 2.0*a.x*a.y ); }

void main(void)
{
finalcol=vec4(0,0,0,0);

//C is constant
c.x = -0.1;
c.y = 0.0;

for (supery=0;supery<samplepixels;supery++)
{
for (superx=0;superx<samplepixels;superx++)
{
//z from current pixel
z.x = xmin+gl_FragCoord.x/resolution.x*(xmax-xmin)+(stepx*double(superx));
z.y = ymin+gl_FragCoord.y/resolution.y*(ymax-ymin)+(stepy*double(supery));
int i;

for(i=0; i<maxiters; i++)
{
// http://www.fractalforums.com/images-showcase-(rate-my-fractal)/meta-mandelbrot-(mandeljulia)/?PHPSESSID=b5fd43c3acfd4c3472a92524915f0100
dvec2 ztmp=cmul((cmul((csqr((csqr(z)+c))+(csqr(c)+z)),(csqr((csqr(z)+c))+(csqr(c)+z)))+(csqr((csqr(c)+z))+(csqr(z)+c))),(cmul((csqr((csqr(z)+c))+(csqr(c)+z)),(csqr((csqr(z)+c))+(csqr(c)+z)))+(csqr((csqr(c)+z))+(csqr(z)+c))))+(cmul((csqr((csqr(c)+z))+(csqr(z)+c)),(csqr((csqr(c)+z))+(csqr(z)+c)))+(csqr((csqr(z)+c))+(csqr(c)+z)));

magnitude=(ztmp.x*ztmp.x+ztmp.y*ztmp.y);
if (magnitude>bailout_squared) break;
z=ztmp;
}

if (i==maxiters) {
col=vec4(0.0,0.0,0.0,1.0);
} else {
//CPM smooth colors
//note that double precision does not support log so it needs to be cast as float
realiters=float(i+1-((log(log(sqrt(float(magnitude))))/log(16)))); //normally log is the power factor, needs to be raised here to smooth colors
colval=int(mod(realiters,255));
colval2=int(mod(colval+1,255));
tweenval=realiters-int(realiters);
r1=palette[colval].r;
g1=palette[colval].g;
b1=palette[colval].b;
r2=palette[colval2].r;
g2=palette[colval2].g;
b2=palette[colval2].b;
col=vec4(r1+((r2-r1)*tweenval),g1+((g2-g1)*tweenval),b1+((b2-b1)*tweenval),1.0);
}

finalcol+=col;
}
}
gl_FragColor = vec4(finalcol/double(sqrsamplepixels));
}

These formulas and scripts are now included with Visions of Chaos http://softology.com.au/voc.htm (http://softology.com.au/voc.htm).


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: gds-entropy on February 15, 2017, 11:13:22 PM
Here is a sample Meta-Mandelbrot movie at 4K resolution.  First part is 1000 frames changing the real part of C from 0 to -0.2.  Then 3 zooms (-01,0.0) (-0.14,0.0) and (-0.2,0.0).  Uses CPM smooth shading.

I will be including these formulas and scripts with the next released version of Visions of Chaos http://softology.com.au/voc.htm (http://softology.com.au/voc.htm).

Very cool!  ;D ;D

The settings I used in Fractal Explorer to get good internal coloring I are "N-set method" and "Log counting |Z|"; I am not sure what that really translates to in code due to not having the source for FE, but those two settings are what enables the full internal coloring method.

Ian


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: gds-entropy on February 18, 2017, 09:26:21 PM
However I can only assume that that's nothing higher iteration levels couldn't fix. But as is, I'm running out of memory if I try that.

How much memory does it currently use? I have machines with 24, 32 and 64gb of ram, so if you are hitting a wall below those I might be able to lend a hand if you wish.

Ian


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: claude on February 18, 2017, 11:22:14 PM
...
Here is the full shader code if anyone wants to take a look.

Code:
...
dvec2 ztmp=cmul((cmul((csqr((csqr(z)+c))+(csqr(c)+z)),(csqr((csqr(z)+c))+(csqr(c)+z)))+(csqr((csqr(c)+z))+(csqr(z)+c))),(cmul((csqr((csqr(z)+c))+(csqr(c)+z)),(csqr((csqr(z)+c))+(csqr(c)+z)))+(csqr((csqr(c)+z))+(csqr(z)+c))))+(cmul((csqr((csqr(c)+z))+(csqr(z)+c)),(csqr((csqr(c)+z))+(csqr(z)+c)))+(csqr((csqr(z)+c))+(csqr(c)+z)));
...

That's frightening, and I don't know why there are cmul() in there, as far as I can tell csqr() is all that is needed.  Maybe a use case for the pre-processor (or ideally recursive functions, but GLSL doesn't support that):

Code:
#define LEVEL0(a,b) (a)
#define LEVEL1(a,b) csqr(LEVEL0(a,b))+LEVEL0(b,a)
#define LEVEL2(a,b) csqr(LEVEL1(a,b))+LEVEL1(b,a)
#define LEVEL3(a,b) csqr(LEVEL2(a,b))+LEVEL2(b,a)
#define LEVEL4(a,b) csqr(LEVEL3(a,b))+LEVEL3(b,a)
dvec2 ztmp = LEVEL4(z,c);


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: 3dickulus on February 18, 2017, 11:26:29 PM
c.x=-0.2 c.y=0.0

     z = csqr( csqr(z)+c ) + csqr(c)+z;



Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: claude on February 18, 2017, 11:56:36 PM
Fragmentarium version with distance estimation colouring via complex dual numbers for automatic differentiation, c = -0.125 + 0.25 i, zoomed in somewhat.  Uses the #define trick from my previous post.


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: kram1032 on February 19, 2017, 04:26:28 PM
gds-entropy it really depends on both how deep you go into the tree and what resolution you build your images with. It should also be noted that, when I was trying 4K, I was running Chrome in the background, which is quite a Memory-hog. I think if I shut down everything else I should be able to get to something around 5K, 15 iteration depth.
If you have the time for it, I'd love to see a deeper iteration depth and/or higher resolution.
It's currently not multi-threaded (beyond what ever Python may or may not already do under the hood which, I think, is nothing?) so multiple cores won't help. But as is, on the laptop I ran it on, it takes about 80s to update the image once at iteration depth 15, and times should roughly double with the depth (so if you tried iteration depth 20 it'll probably take like 45min to even just update the image once), and you'll need quite a lot of updates to get a nicely filled-in pic.
Things could probably rearranged to take advantage of threading - both to sample multiple points at the same time and to, perhaps, save an image independently in an extra thread. But I have never done any multithreading and find the provided packages a bit confusing.

I have since somewhat updated the code (it has basic navigation features: you can, in principle, zoom into an arbitrary point and specify non-square dimensions, but there is no runtime control over what area to sample - it'd be easy enough to change by hand in the script though, since it's pretty short right now) So you can try that if you want.

I think it might also be possible to use heuristics to terminate a particular sample early if it doesn't appear to add much to the area of interest, but I'm not quite sure yet what those heuristics would have to be. If I (or somebody else) found good ones for this, I expect it to be much faster. Something like "if none of the points up to iteration depth 5 (or something almost-instant like that) land in a specified area (say the bounding box of the actual Mbrot-ish-shaped region in the center or, in a zoom, the zoom boundaries), don't evaluate any further".


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: gds-entropy on February 19, 2017, 08:22:12 PM
gds-entropy it really depends on both how deep you go into the tree and what resolution you build your images with. It should also be noted that, when I was trying 4K, I was running Chrome in the background, which is quite a Memory-hog. I think if I shut down everything else I should be able to get to something around 5K, 15 iteration depth.
If you have the time for it, I'd love to see a deeper iteration depth and/or higher resolution.
It's currently not multi-threaded (beyond what ever Python may or may not already do under the hood which, I think, is nothing?) so multiple cores won't help. But as is, on the laptop I ran it on, it takes about 80s to update the image once at iteration depth 15, and times should roughly double with the depth (so if you tried iteration depth 20 it'll probably take like 45min to even just update the image once), and you'll need quite a lot of updates to get a nicely filled-in pic.
Things could probably rearranged to take advantage of threading - both to sample multiple points at the same time and to, perhaps, save an image independently in an extra thread. But I have never done any multithreading and find the provided packages a bit confusing.

I have since somewhat updated the code (it has basic navigation features: you can, in principle, zoom into an arbitrary point and specify non-square dimensions, but there is no runtime control over what area to sample - it'd be easy enough to change by hand in the script though, since it's pretty short right now) So you can try that if you want.

I think it might also be possible to use heuristics to terminate a particular sample early if it doesn't appear to add much to the area of interest, but I'm not quite sure yet what those heuristics would have to be. If I (or somebody else) found good ones for this, I expect it to be much faster. Something like "if none of the points up to iteration depth 5 (or something almost-instant like that) land in a specified area (say the bounding box of the actual Mbrot-ish-shaped region in the center or, in a zoom, the zoom boundaries), don't evaluate any further".

I presently have a 65536 iteration 8192x8192 image rendering for R -0.141 I 0.0 in Fractal Explorer, hosted in Virtual PC and XP Mode on a win7 box, so we will see what that gives us for now.

In a different set, I also tried modifying the base formula as such, where all base instances are replaced with:
(z^P1) + ((z^P3) + c)
and
(c^P2) + ((c^P4) + z)

giving:
Code:
(((((z^P1)+(z^P3+c))*((z^P1)+(z^P3+c))+((c^P2)+(c^P4+z)))*(((z^P1)+(z^P3+c))*((z^P1)+(z^P3+c))+((c^P2)+(c^P4+z)))+(((c^P2)+(c^P4+z))*((c^P2)+(c^P4+z))+((z^P1)+(z^P3+c))))*((((z^P1)+(z^P3+c))*((z^P1)+(z^P3+c))+((c^P2)+(c^P4+z)))*(((z^P1)+(z^P3+c))*((z^P1)+(z^P3+c))+((c^P2)+(c^P4+z)))+(((c^P2)+(c^P4+z))*((c^P2)+(c^P4+z))+((z^P1)+(z^P3+c))))+((((c^P2)+(c^P4+z))*((c^P2)+(c^P4+z))+((z^P1)+(z^P3+c)))*(((c^P2)+(c^P4+z))*((c^P2)+(c^P4+z))+((z^P1)+(z^P3+c)))+(((z^P1)+(z^P3+c))*((z^P1)+(z^P3+c))+((c^P2)+(c^P4+z))))) 

This successfully merges the behavior with another fractal I have on Flickr, and produces interesting behavior for 50, 2, 50, 2, and other values, such as making one of the 50s negative. This modification also displays an interesting bilongitudinal asymmetry of coloration, while retaining the symmetry of shape with only minor distortion due to the negative real I use with this formula. Once I render those in a larger version I'll post them as well, with the *.frs files and formulae for them.

One interesting effect is that the center shape becomes surrounded with a perfect circle of smaller, differently shaped sets which are oriented in curious ways.

I will reply to this and attach the initial experiment images, which will be rendered much larger later...I'm having some issues getting the forum software to accept them presently.

EDIT:

Here are the Fractal Explorer *.frs files for the second formula I mentioned, which is different than the original Level 3 version in 7z format.
Regrettably the board does not allow file size sufficient to include the preview images, nor, oddly, does it allow files in 7z format, so I had to rename it to be *.rar.

The file is not rar, it is 7z.

I did not see rar as a compression option in 7z and didn't feel like looking for it, but 7z can extract this without being renamed, but if you are using another archive manager this may not be the case.

Ian


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: gds-entropy on February 19, 2017, 08:23:46 PM
Images referenced above..


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: kram1032 on February 19, 2017, 09:03:30 PM
65536 iteration
of my Python-code? - At that kind of iteration-depth I doubt it'll work out... Or did you modify something?
I mean my laptop isn't the fastest or anything, but I doubt your CPU will be so many times faster that that kind of iteration-count becomes feasible, even remotely. It'll just never produce any image. We're talking about 265537-1 points to evaluate here. For a single update.

The iteration-depth is more time-limited (although there also is a memory-component to it). The bigger memory-hog probably is the image-resolution. - It keeps three entire res²-images in memory at all times (basically constant memory usage at that point), and then briefly peaks as it calculates the equalized image and saves it as png. That's where most of the memory limitation happens.
As said, on my laptop, 15 iterations take 80s per update. 16 iterations should take about 160s. If you went to 65536, I'm pretty sure we're talking about longer-than-the-heat-death-of-the-universe


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: gds-entropy on February 19, 2017, 10:11:40 PM
of my Python-code? - At that kind of iteration-depth I doubt it'll work out... Or did you modify something?
I mean my laptop isn't the fastest or anything, but I doubt your CPU will be so many times faster that that kind of iteration-count becomes feasible, even remotely. It'll just never produce any image. We're talking about 265537-1 points to evaluate here. For a single update.

The iteration-depth is more time-limited (although there also is a memory-component to it). The bigger memory-hog probably is the image-resolution. - It keeps three entire res²-images in memory at all times (basically constant memory usage at that point), and then briefly peaks as it calculates the equalized image and saves it as png. That's where most of the memory limitation happens.
As said, on my laptop, 15 iterations take 80s per update. 16 iterations should take about 160s. If you went to 65536, I'm pretty sure we're talking about longer-than-the-heat-death-of-the-universe

My apologies for not being clear; the 65536 iteration image I am rendering at the moment is of the base level 3 formula, which looks like it may take the better part of a week. I'm pretty patient, and will wait months for calculations to complete if needed, which has happened with some very deep PDE simulations. I suppose this patience comes from running raytracers on double digit MHz processors in the early 90's, though I still seem to produce scenes that render at 1 pixel per minute sometimes.  :tease: I think that the time to render any random scene is nearly constant regardless of technological improvements, due to new, more power hungry features being added to the engine...but I digress...

I intend to examine the python code for possible translation to a different language, where I can handle parallelism more comfortably, as python isn't really my bag; I'm a C#/Java/C++ guy. If that proves too unwieldy, I will simply run the code outright on a machine which I will allocate entirely to the task, and then just let it render for a few weeks. I have a xeon hexacore which would be perfect for it if parallelism proves trivial in a different language, otherwise I'll just run it on a box with large RAM capacity.

I will probably make a rudimentary first pass translation to C#, then run the profiling tools in VS2015 Enterprise on it to see where I can best leverage parallelism. I'm also working on building an adaptive CUDA laplacian/kernel based sampling library at the moment too, so as I become more comfortable with CUDA I might find I can leverage that too; we will see, as I just started learning CUDA a few days ago, but I am a quick study. So far, of the GPU languages, CUDA is the least offensive to me, and I have a pretty good box with a few SLI connected cards obtained specifically for running CUDA accelerated simulation code...so we will see where this leads me.

Do not expect a rapid turn-around though, as I have a fair number of personal projects going on right now on top of a full-time software architecture/etc.. job, which obviously takes priority, but I will put a good amount of effort into this, likely when I am suffering from insomnia at its worst, which is when I tend to get most interesting things accomplished.

I was blessed/cursed with one of those jerk brains that takes stuff I'm into, processes it in the background, then refuses to let me sleep until I have implemented whatever thing it comes up with, which of course it just loves bringing to my attention right smack in the middle of the blasted night. It is a pretty good troll. The jerk.  :angry:

Ian


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: 3dickulus on February 19, 2017, 10:30:55 PM
@gds-entropy http://www.fractalforums.com/programming/omp-vs-par4all/msg77348/#msg77348  :dink:


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: kram1032 on February 19, 2017, 11:24:22 PM
gds-entropy ok that makes more sense  :)


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: gds-entropy on February 19, 2017, 11:59:56 PM
@gds-entropy http://www.fractalforums.com/programming/omp-vs-par4all/msg77348/#msg77348  :dink:

Ok I will check that p4all out as well. OpenACC was another which someone on the NVIDIA forums mentioned to me as being fairly user friendly, with Thrust being lower level and with greater optimization potential.

Right now my design goal is a minimum of fuss, with greatest performance boost through offload to GPU, and not micro optimization or those requiring substantial algorithmic alterations; best bang for the buck one might say.

The primary use case is production of a foss c++ library for interop as extern with C#, either through use of ManagedCuda or direct use of the 8.0 tooling sans MC, but NVIDIA lies about vs2015 support I have discovered, as while the IDE is supported, the vs160 cpp compiler toolset is NOT and thus compatibility with .net 4.6+ fails, and setting the CUDA project to use the 2013 compiler ALSO does not seem to work. Im not very happy about ANY of that. It looks like I have to install 2013 ultimate on another box, as that is the most recent cpp toolset they support.

Their website is intentionally deceptive about this though, and you only find this out when the <<>> for globals fails and you hit SO and dive into the nvidia analogue of MSDN, which the MS version of itself has decayed in quality of late.

I am only including this information for others who may encounter this issue with regards to the Meta effort, and if folks need the info I will add links to StackOverflow and the relevant setup and config pages for the tooling stack I mentioned, otherwise I will not mention CUDA and related items further here, to prevent deviation from the overarching topic.

Ian



Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: gds-entropy on February 20, 2017, 05:32:21 AM
UPDATE: I was informed my server was not properly serving 7z files, and I have modified the web.comfig to add that mimetype, so it will work for you now if you browse the directly.

The archive is in 7z format, not rar; I had to do this to permit the posting of the archive.

You may or may not need to alter the file extension, archive manager dependent.

Here are the *.frs files for the original Meta, levels 2 and 3, with some palette variations, inverse and obverse variants for level 3 are likewise included.

Here is a version of the archive with preview images:
http://gds-entropy.com/filedrop/fractals/01-13-2017%20Meta%20Levels%202%20and%203.7z (http://gds-entropy.com/filedrop/fractals/01-13-2017%20Meta%20Levels%202%20and%203.7z)

Below are links to the output of some of them, for reference.

Folder location: Level 32017-01-13_0 Obverse JuliaAlternates:
https://www.flickr.com/photos/gds-entropy/31769659574/in/dateposted-public/ (https://www.flickr.com/photos/gds-entropy/31769659574/in/dateposted-public/) File: 2017-01-19_r[-0_1]i[0]_1Dot
https://www.flickr.com/photos/gds-entropy/31665738024/in/dateposted-public/ (https://www.flickr.com/photos/gds-entropy/31665738024/in/dateposted-public/) File: 2017-01-19_r[-0_1]i[0]_0
https://www.flickr.com/photos/gds-entropy/32336993282/in/dateposted-public/ (https://www.flickr.com/photos/gds-entropy/32336993282/in/dateposted-public/) File: 2017-01-19_r[-0_1]i[0]_1
https://www.flickr.com/photos/gds-entropy/32309431531/in/dateposted-public/ (https://www.flickr.com/photos/gds-entropy/32309431531/in/dateposted-public/) File: 2017-01-19_r[-0_3]i[0]_0
https://www.flickr.com/photos/gds-entropy/32052371270/in/dateposted-public/ (https://www.flickr.com/photos/gds-entropy/32052371270/in/dateposted-public/) File: 2017-01-19_r[-0_2]i[0]_0
https://www.flickr.com/photos/gds-entropy/32430271875/in/dateposted-public/ (https://www.flickr.com/photos/gds-entropy/32430271875/in/dateposted-public/) File: 2017-01-19_r[0_2]i[0]_0
https://www.flickr.com/photos/gds-entropy/32309428241/in/dateposted-public/ (https://www.flickr.com/photos/gds-entropy/32309428241/in/dateposted-public/) File: 2017-01-19_r[0_1]i[0]_0

Folder location: Level 2:
https://www.flickr.com/photos/gds-entropy/31674508593/in/dateposted-public/ (https://www.flickr.com/photos/gds-entropy/31674508593/in/dateposted-public/) File: 2017-01-13_5
https://www.flickr.com/photos/gds-entropy/32279143522/in/dateposted-public/ (https://www.flickr.com/photos/gds-entropy/32279143522/in/dateposted-public/) File: 2017-01-13_4
https://www.flickr.com/photos/gds-entropy/31601052373/in/dateposted-public/ (https://www.flickr.com/photos/gds-entropy/31601052373/in/dateposted-public/) File: 2017-01-13_3
https://www.flickr.com/photos/gds-entropy/32401167115/in/dateposted-public/ (https://www.flickr.com/photos/gds-entropy/32401167115/in/dateposted-public/) File: 2017-01-13_1
https://www.flickr.com/photos/gds-entropy/32243302432/in/dateposted-public/ (https://www.flickr.com/photos/gds-entropy/32243302432/in/dateposted-public/) File: 2017-01-13_6

Ian


Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: 3dickulus on March 04, 2017, 06:44:59 AM
couldn't help but go back to my biomorph experiments to see if this works with the plotting routine... yes it does :D very nicely

power 2,3,4



Title: Re: Meta-Mandelbrot [Mandeljulia?]
Post by: gds-entropy on March 05, 2017, 03:21:06 AM
couldn't help but go back to my biomorph experiments to see if this works with the plotting routine... yes it does :D very nicely

power 2,3,4

Very cool! Thanks for sharing as well.  :)

Ian