Title: Complex 2-variable quadratic experiment
Post by: Pauldelbrot on December 31, 2012, 07:43:19 PM
This should replicate my "Julia Foam" and some other recent gallery postings. It should work with the standard "Smooth (Mandelbrot)" coloring, TTBOMK. The images I posted were Julia slices in the "z" plane, which the Julia version here will do. The Mandelbrot version plots in the "seed 1" plane, with the initial value set by the "seed 1" parameter (I don't know if this thing has anything analogous to the critical points of one-complex-variable systems). Adapting these to plot other "axis" planes shouldn't be difficult (though arbitrary slices of the 4D dynamic space and 6D parameter space, or even the 10D "Julibrot" space, would be much hairier to do -- one crude method would be to just add parameters to specify vectors for the unit vectors in the image space to map onto, leaving it up to the user to make them orthonormal or suffer the consequences in distorted images). Because using the Mandelbrot to find good Julias might be difficult, and finding good Mandelbrot slices isn't especially easy either, interesting defaults are supplied. If UF has an "explore" or "mutate" search-feature for quickly exploring varied parameters, it'd probably be a good idea to use that (I've been doing something similar to find interesting parameters myself). e_quad_1 { init: z = #pixel complex w = @seed2 loop: complex ws = sqr(w) w = @seed3*w/z z = sqr(z) + ws + @seed bailout: |z| < @bail default: center = (0,0) maxiter = 10000 title = "Experimental 2var Quadratic 1 Julia" param seed caption = "Seed 1" default = (-0.9064912128,0.1908320307) endparam param seed2 caption = "Seed 2" default = (-0.043575,-0.092319) endparam param seed3 caption = "Seed 3" default = (1,0) endparam param bail caption = "Bailout" default = 100.0 min = 0 endparam }
e_quad_1m { init: z = @seed complex w = @seed2 loop: complex ws = sqr(w) w = @seed3*w/z z = sqr(z) + ws + #pixel bailout: |z| < @bail default: center = (-0.75,0) maxiter = 10000 title = "Experimental 2var Quadratic 1 Mandelbrot" param seed caption = "Seed 1" default = (0.366322,-0.127031) endparam param seed2 caption = "Seed 2" default = (-0.043575,-0.092319) endparam param seed3 caption = "Seed 3" default = (1,0) endparam param bail caption = "Bailout" default = 100.0 min = 0 endparam }
Title: Re: Complex 2-variable quadratic experiment
Post by: fractalchemist on January 01, 2013, 07:38:55 PM
Saved and I am going to explore..:-) (Eveline)
Title: Re: Complex 2-variable quadratic experiment
Post by: Pauldelbrot on January 05, 2013, 03:20:10 AM
Here are versions that use Brent periodicity checking, since UF's inbuilt will screw things up (in case z nearly stands still while w changes, say) and turning it off without supplying your own makes things slooooowww. Use with UF's inbuilt periodicity checking turned off. As a side effect, all points color as "outside". To make inside points black requires using a special coloring plus the fact that these formulas will assign a very specific final value to z if the cycle detection trips. That coloring also works with normal Mandelbrots and gives you Fractint's "logmap=2" ability to logarithmically fit exactly one color gradient repetition between min iters and max iters found in image. It's after the first code block -- use transfer function linear and set "super transfer function" to log (or whatever you want) while ticking "fit gradient to range" and copying the minimum and maximum iterations shown in the General tab of the Statistics palette into the appropriate boxes. I'll eventually also release a version of multiwave that adds the solid-flag check. Or you can modify your copy to wrap the entire innards of the (really looooonnnngg) "final:" section in IF (#z == (501,10)) #solid = true ELSE ... ENDIF. Unfortunately, UF hacking kind of requires some hoop-jumping, gimmicky tricks, and actual hacks, while also being the easiest way to make new fractals and colorings available to other people, at least for the time being. And I tend to have intermittent access to it to test stuff. Let me know by PM or in this thread if either of these gives any problems. e_quad_1j_brent { init: z = #pixel complex w = @seed2 complex oz = z complex ow = w int i = 0 int nexti = 1 float micro = 1/@bail bool periodic = false loop: complex ws = sqr(w) w = @seed3*w/z z = sqr(z) + ws + @seed periodic = ((|oz - z| + |ow - w|) < micro) i = i + 1 IF (periodic) z = (501,10) ELSEIF (i == nexti) nexti = nexti * 2 oz = z ow = w ENDIF bailout: |z| < @bail && !periodic default: center = (-0.75,0) maxiter = 10000 title = "Experimental 2var Quadratic 1 Julia (Brent)" param seed caption = "Seed 1" default = (0.366322,-0.127031) endparam param seed2 caption = "Seed 2" default = (-0.043575,-0.092319) endparam param seed3 caption = "Seed 3" default = (1,0) endparam param bail caption = "Bailout" default = 1000000000000000000000.0 min = 0 endparam }
e_quad_1m_brent { init: z = @seed complex w = @seed2 complex oz = z complex ow = w int i = 0 int nexti = 1 float micro = 1/@bail bool periodic = false loop: complex ws = sqr(w) w = @seed3*w/z z = sqr(z) + ws + #pixel periodic = ((|oz - z| + |ow - w|) < micro) i = i + 1 IF (periodic) z = (501,10) ELSEIF (i == nexti) nexti = nexti * 2 oz = z ow = w ENDIF bailout: |z| < @bail && !periodic default: center = (-0.75,0) maxiter = 10000 title = "Experimental 2var Quadratic 1 Mandelbrot (Brent)" param seed caption = "Seed 1" default = (0.366322,-0.127031) endparam param seed2 caption = "Seed 2" default = (-0.043575,-0.092319) endparam param seed3 caption = "Seed 3" default = (1,0) endparam param bail caption = "Bailout" default = 1000000000000000000000.0 min = 0 endparam }smooth4 { ; ; This coloring method provides smooth iteration ; colors for convergent and divergent fractals and logmap and powermap options. ; ; Variant allows maxit and z_values array to have different size. ; ; Formulas may also be designed to assign some pixels solid color when this coloring is used. ; The formula simply leaves the complex value (501,10) in z when it bails out to do this. ; (There's a vague resemblance between "50110" and "SOlID". :)) init: complex il = 1/log(@power) ; Inverse log (power). float lp = log(log(@bailout)) ; log(log bailout). complex z_values[@zmax] int i = 0 float sum2 = 0.0 complex zold = (0,0) loop: IF(@convergent) z_values[i] = #z i = i + 1 IF (@esm) sum2 = sum2 + exp(-1/cabs(zold-#z)) zold = #z ENDIF ENDIF final: float ix = 0 IF (#z == (501,10)) #solid = true ELSEIF (@esm && @convergent) #index = sum2 ELSE IF (@convergent) IF (@alt) int j = @zmax - 1 IF (i < @zmax) j = i ENDIF i = 0 bool found = false WHILE ((i < j) && !found) IF (|z_values[j] - z_values[i]| < (1/@bailout)) found = true ELSE i = i + 1 ENDIF ENDWHILE int k = i + 1 found = false WHILE ((k < j) && !found) IF (|z_values[j] - z_values[k]| < (1/@bailout)) found = true ELSE k = k + 1 ENDIF ENDWHILE int p = k - i ix = k/p + @perfix*(log(@bailout) + (log(|z_values[i] - z_values[j]|)))/log(|z_values[j] - z_values[i]|/|z_values[j] - z_values[k]|) ELSE int j = @zmax IF (i < @zmax) j = i - 1 ENDIF i = 0 bool found = false WHILE ((i < j) && !found) IF (|z_values[j]-z_values[i]| < (1/@bailout)) found = true ELSE i = i + 1 ENDIF ENDWHILE int k = i + 1 found = false WHILE ((k < j) && !found) IF (|z_values[j]-z_values[k]| < (1/@bailout)) found = true ELSE k = k + 1 ENDIF ENDWHILE int p = k - i float tween = abs((sqrt(1/@bailout) - cabs(z_values[j]-z_values[i])))/(abs(cabs(z_values[j-p]-z_values[i-p]) - cabs(z_values[j]-z_values[i]))) tween = sin(tween*#pi/2) tween = tween^(0.73) IF (tween < 0) tween = 0 ENDIF IF (tween > 1) tween = 1 ENDIF ix = i - tween*p ENDIF ELSE ix = real(#numiter + il*lp - il*log(log(cabs(#z)))) ENDIF ENDIF IF (!@esm) IF (ix < 1) ix = 1 ENDIF float mn = @fitminit float mx = @fitmaxit IF (@transfer == 1) ix = ix^(1/@transpower) mn = mn^(1/@transpower) mx = mx^(1/@transpower) ELSEIF (@transfer == 2) ix = log(ix) mn = log(mn) mx = log(mx) ENDIF IF (@fit) IF (ix < mn) ix = 0 ELSE ix = (ix - mn)/(mx - mn) ENDIF ix = ix * @fittimes ELSE ix = 0.05*ix ENDIF #index = ix ENDIF default: title = "Smooth (Generalized) 2" param convergent caption = "Convergent" default = false hint = "Check this for convergent attractors, uncheck to color divergent points." endparam param esm caption = "Use exp smoothing" default = false hint = "Applies convergent exponential smoothing as the \ standard formula of that name, except that fractals \ can make some areas solid-color." visible = @convergent endparam param alt caption = "Use alternate method" default = false visible = (@convergent && !@esm) endparam param perfix caption = "Period fix factor" default = 1.0 visible = (@convergent && @alt && !@esm) endparam param zmax caption = "Maximum iterations to record" default = 100 hint = "Determines how many iterations to look ahead for a convergent attractor. If \ a convergent attractor is not found, the solid color is used for the pixel. \ Normally you want to use the maximum iterations you selected on the Formula \ panel, but if you're getting 'out of memory' errors you'll need to set this \ lower. There's generally little to gain by making it greater than 1,000,000." visible = @convergent && !@esm endparam param power caption = "Exponent" default = (2,0) hint = "This should be set to match the exponent of the \ formula you are using. For Mandelbrot, this is 2. \ Only needed when coloring divergent points." visible = !@convergent endparam param fit caption = "Fit Gradient to Range" default = true hint = "Check this to spread the gradient out over the range of iteration values." visible = !@esm || !@convergent endparam param fittimes caption = "Number of repetitions" default = 1.0 min = 1.0 hint = "Repeats gradient the specified number of times over the range of iteration values." visible = @fit && (!@esm || !@convergent) endparam param fitminit caption = "Start iteration" default = 1 min = 1 hint = "Gradient begins at this iteration number. It is best if it's approximately the lowest \ actual number of iterations in the image. You can find the exact number by looking at \ Statistics after generating the image once." visible = @fit && (!@esm || !@convergent) endparam param fitmaxit caption = "End iteration" default = 1000 min = 1 hint = "Gradient fitting is based on this range of iterations. Can be profitably made lower than \ maxiter -- try reducing it by factors of 10 until the gradient doesn't fit well, then raise \ it by a factor of 10 once." visible = @fit && (!@esm || !@convergent) endparam param transfer caption = "Super transfer function" enum = "Linear" "Power" "Log" default = 2 hint = "Linear distributes gradient evenly over iterations. \ Power weights gradient towards lower iterations for powers > 1. \ Log weights gradient towards lower iterations." visible = !@esm || !@convergent endparam param transpower caption = "Transfer power" default = 3.0 hint = "Larger values weight gradient more towards low iterations. \ 3.0 with a regular transfer function of Linear and a super transfer \ function of Linear with a regular transfer function of CubeRoot \ produce the same results." visible = (@transfer == 1) && (!@esm || !@convergent) endparam param bailout caption = "Bail-out value" default = 100000.0 hint = "Larger gives smoother coloring for divergent points, and more accurate and smoother for convergent ones." min = 1 visible = !@esm || !@convergent endparam }
Title: Re: Complex 2-variable quadratic experiment
Post by: Alef on January 15, 2013, 09:26:09 AM
IMHO, this is the best new thing in 2D in years. Maybe ultracomplex shapes somewhat don't go with ultracomplex but not very smooth colour methods, but it generates enermous variance of baroquesque /marine shapes. Could I upload it to UF database? Is there any name suggestions? Here I a bitt modified for end users (inside switch, few mutions to play around and turned seed3 into real factor (anyway it's not a seed and less is more pro user.), and seeds put that it gives atractive symmetric ovewall shape. IMHO (1,0) (1,0) 0.5 have better patterns, but then are barely noticable. Maybe I alsou should add few addition modifications, such as tricorn and burning ship. ) Fractal1 { ::70eiSgn2lF1yuxNMMw7Gw/DC6eWL5N2dTL0h2D5QAKQ/DWwYJ7ltySGS0Zj/7L9j0WgeyQcG OzQP9JojA/nLLECCJvzIfefkWKujW6m5ctSczhD3IT9jKhHWcpsRvuRXyZRKbkfNbhxvor0N V1K9ZZZxGtNZ7gJCjBj8bQ3vGSx5gVKiTQHSLGtSVWMCTTYYYntLQuk5B1pmKlYEGCrW1HTj zeYjxI8OuShXV0jeXAG5UTuMdaufUKYBSLG5PgZv19aKSSx01szZNqqtUv/q2oZDmuevnP3Y ywGyveFQfcmWFXpOp24S0ykz8dIYd+V9O04OSd3+A9lZPC80fu+l16cl6Uro/a/co76UMTG0 yBbfVM8mLRcgCxyCMkZo9CIBhcPfahYwVWw54/h8YwBpyihEYRWxN08YMyN1iLLQOlvbUiuo nPqLfS3Wf5yx01/Y7z1t6a9lmmDg61WQcg9YbzT6Dgz/djmWOR7t2/6ZI+HL/oTrbaKL+NAV D5LD }
test.ufm:Pauldebrot { ;Complex 2-variable quadratic system ; by Paul Derbyshire aka Pauldebrot. ; http://www.fractalforums.com/index.php?topic=14541 ::XLXT4in2Fa12OutNQ03Fg+HG48idjXZ7tJ9htRou5iBcR3ggmUkHLolorYXKRFRKLbj8x3ZI puYbtIGYBEnhzcm5MX4KKEmHCDCDSU5lS+RIJeZ/hGNdKMY7GY6aN3YOVyjjn8IrIlL3VpMT m5VKKOwrM8U8cS8qFvoUckLpvXvvuI5fKVaz0EU5H+zP/BS8zfhP++tbCDOHj4xTJwJTuKA+ japg9cYv+/It9Q1du1zQL4nHC+5ewDDAojCgYwGK3HGIVqyHIlNaUq+bVTbmZPinaWc+nmuu ZPLxoqsSP7vz5ZwLJLeJkEGsjJkqaj1Lf/83h3Ar9iCDS57Z1SnuEehhXheY6dLje98lWP+r 5sjCn4VLxfkMjwI5ogJfCtNlbLKUGkxZpii/FJAWpRoKorsRVlXLZwblqknwbxLS7uGAlsKW O4YdA/NwwHJ3CfGVNxpzHqU8tc+qZOhHEaxObw88NLAggaR6SIv/GMJ0A1e4r3C5KPfcrr88 /NObjV84uD53xdWXh5Kn9Wn8bcktmEt0JOXQ3d51em+bsSjtje0CTYQLLZZ0OriRGyAkoJdt O00KvoO/CW37cnb9BSnTbEmksrdNFQONgR17dKFd+32TMGC9tA7ZSN/SIbHpcQ7nK7yGHD47 xaznpLj+55YF6XmN03juKYISjxwPWbY036b4XaHA0tIYQI9JaNBkzKLxbavBJfQ4JSxx0pI4 ZiCT8kN+bAoFSB2+mWXRWSzsWsBBuuVwkCt9YE8ReDupRVhhCzw1UDqd3ERgenNdM9zigvkJ 0QSd1BUcBOdmMH2VjNEZcoUyK4zBEvmMBWE3Xht/MJgGkWxaKmDaFqVeCsJAkfHynkWMVh94 cit2Qdc6I4v4JiSoRV9kGYIiiqEsIY35q5ROyki1+mq29xDo/Jb9ywCs5iOqN/udNtjA/CG8 aWOfEgg/uQKei7pn2aihIBHea4d28qF9LzKk4GkUT+xtLbL2Tt+G+RMuenvz9+7OwqEMqL8b 1sUqomA6TaDH3WcCoVww75V7OpzEVYW8ED6XLHBZGT5DLW000E5LJIZXnrjwJjFCcc6YUZW5 vZUlC8hsX96XtC2agM2BOsTZy6yAM5whPMvanAtyigBb5w1SJYxVDZqGIvGbC08EFaUfczxP dNlaoWj2fzghbHA+ekdW7yXYcxS/bp+llxdLNbrDx9tDtTtXt15ijxdi7mIjHMb6XwH3tony 8u/bC7LJx+3T+fAOn+MW }
Pauldebrot { ;Complex 2-variable quadratic system ; by Paul Derbyshire aka Pauldebrot. ; http://www.fractalforums.com/ultrafractal/complex-2-variable-quadratic-experiment/ init:
complex c=0 complex ws=0
IF (@settype=="Mandelbrot") IF (@inverted) c=1/#pixel c=@func_post(c) ELSE c=#pixel c=@func_post(c) ENDIF z=@seed
ELSEIF (@settype=="Julia") IF (@inverted) c=1/@julia ELSE c=@julia ENDIF z= #pixel z=@func_post(z) ENDIF
complex w = @seed2 loop: ws = sqr(w) w = w/z*(@wfactor) z = sqr(z) + ws
;now adding c and introducing tricorn and burning ship versions IF (@zfunction=="None") z=z+c ELSEIF (@zfunction=="Tricorn") z=conj(z)+c ELSEIF (@zfunction=="Burning Ship") z=abs(z)+c ENDIF
bailout: |z| < @bailout default: center = (-0.5,0) ;maxiter = 10000 title = "Pauldebrot"
heading caption = "Formula Block" endheading param seed caption = "Mbrot Seed" default = (0,1) visible = (@settype=="Mandelbrot") endparam param seed2 caption = "Seed of W" default = (1,0) endparam param wfactor caption = "Factor of W" default = 0.5 endparam param bailout caption = "Bailout" default = 10000.0 min = 0 endparam heading caption = "Julia Block" endheading
param settype caption="Set type" default=0 enum="Mandelbrot" "Julia" endparam
param switchsettype caption = "switch to" default = 1 enum = "Mandelbrot" "Julia" visible = false endparam
complex param julia caption="Julia Seed" default=(0.3, 0.6) visible = (@settype=="Julia") endparam
heading caption = "Mutations" endheading
func func_post caption="Pixel mapping function" default=ident() hint="Function applied during iteration initialisation. New coordinates of pixel = function(coordinates of pixel). This curves not c, but the plane, on which fractal is drawn, so only ident m-set is map for julia sets. Recip works as circle inverse." endfunc
param zfunction caption="Z function" default=0 enum="None" "Tricorn" "Burning Ship" endparam
param inverted caption ="Inverted Set" default = FALSE hint="The same as circle inverse. Unlike pixel mapping this inverts C, so inverted m-set is map of julia sets." endparam
heading caption = "Info" text="Complex 2-variable quadratic system by Paul Derbyshire aka Pauldebrot. http://www.fractalforums.com/ultrafractal/complex-2-variable-quadratic-experiment/ It have both julia seed and mandelbrot seed. Factor of W decides how much second quadratic equation is used." endheading
switch: type="Pauldebrot" julia = #pixel bailout=bailout inverted=inverted settype=switchsettype switchsettype=settype func_post=func_post zfunction=zfunction wfactor=wfactor seed=#pixel seed2=seed2 }
Title: Re: Complex 2-variable quadratic experiment
Post by: Pauldelbrot on January 15, 2013, 02:29:21 PM
Thanks!
Title: Re: Complex 2-variable quadratic experiment
Post by: fractalchemist on January 16, 2013, 04:13:20 PM
:cantor_dance: Thanks!!! For the switch, I already experimented with the M/J separately, and it is very cool!
See my FB album ( it's public)
http://www.facebook.com/media/set/?set=a.10200274158001280.2196453.1373252680&type=1 (http://www.facebook.com/media/set/?set=a.10200274158001280.2196453.1373252680&type=1)
Evie
Title: Re: Complex 2-variable quadratic experiment
Post by: Alef on January 19, 2013, 03:34:22 PM
In UF mailinglist some folks asked to include your smooth4 formula, so I uploaded it as Pauldebrots Smooth. Just added proper credits and a sigmoid function n=3*n/(3+abs(n)) as transfer function.
Title: Re: Complex 2-variable quadratic experiment
Post by: Pauldelbrot on January 19, 2013, 08:42:29 PM
No problem there. Consider anything I post here to be CC-BY. :)
Title: Re: Complex 2-variable quadratic experiment
Post by: Pauldelbrot on January 24, 2013, 09:50:21 PM
The formula contains "minibrots" after a fashion, but they can be hard to find (lacking a critical point as normally defined). Here is how to find some.
First, a normal Mandelbrot image showing some buds and minibrots:
(http://i46.tinypic.com/rldcg7.jpg)
Note how one minibrot is straight out from the bud along the line from its base through the biggest sub-bud that's on roughly the opposite side. The much larger and more prominent one is off to one side.
This suggests how to try to find minibrots in the formula.
Here is a shallow image of this formula, sliced in parameter space.
(http://i45.tinypic.com/24gvfj4.jpg)
There are areas where arcs of buds are discernible. We would prefer one where there's a lot of dense foamy tangles and not just a few stray dendrites about, as a few stray dendrites might all miss the minibrot that lurks in a neighboring dimension, so we zoom into the arc inside the hollow, at the hollow's lower-left, where there's a lot of foam:
(http://i49.tinypic.com/vn30nq.jpg)
The color scheme has been chosen so black contrasts fairly strongly with it.
Note at position 1, a ghostly darkened shape that may be a minibrot. It has approximately the correct shape. Its relationship to the buds nearby is different from what's typical in the plain M-set, though. It may be worth investigating but there are more promising targets.
Position 2 is lined up along the axis through a bud, similar to one of the minibrots in the plain M-set image discussed earlier. There are a few specks that seem darker than the other bluish bits in the same vicinity at this spot. (A high res display may really help spot this sort of thing!)
Position 3 is a slight darkening that's just past another bud, related to it similarly. It's less promising in one respect: it's so faint and small it may be nothing. It's more promising in another: the bud, and the position's relationship to the bud, are much more exactly matching normal M-set buds in form, relative positions, and proportions.
We choose position 2. Zooming at position 2 reveals this:
(http://i45.tinypic.com/9h02h1.jpg)
A field of small black nuggets scattered about near the image center, surrounded by blue and yellow foam. The nuggets are shaped like small filled-in quadratic Julia sets -- this is what happens when the foam occupies the same space as the dimensionally-displaced minibrot, thus making the minibrot visible, after a fashion, and providing interesting shapes to explore.
Turning all escaping points white reveals a distorted minibrot outline:
(http://i47.tinypic.com/24n0hnm.png)
It's got some holes in it but it's definitely a somewhat-warped minibrot.
(I checked, and all 3 positions marked turned out to harbor minibrots, not just #2.)
Title: Re: Complex 2-variable quadratic experiment
Post by: fractalchemist on January 25, 2013, 11:53:51 AM
Thanks for this clear explanation :yes: Show you the results later on! Eveline
Title: Re: Complex 2-variable quadratic experiment
Post by: Pauldelbrot on January 25, 2013, 07:56:13 PM
You're welcome ... and have fun.
(Bah! Someone's monkeying around with something. My images in that post keep disappearing and appearing, and I haven't edited it.)
|