Revisiting the 3D Newton

  • 26 Replies
  • 1382 Views

0 Members and 1 Guest are viewing this topic.

Offline gforce

  • *
  • Fractal Friend
  • **
  • Posts: 11
« Reply #15 on: July 25, 2018, 03:31:06 AM »
I have tried another 4D variant (using a 2x2 matrix of real numbers), but the result was too weird.

I would be interested in this variation, I'd be even more interested in that variant with the all the bells and whistles you've added to JIT_gnj_RealPowNewton_04. It might not look good with simple transformations like rotation but i think it will have potential for hybrid formulas :)

Offline FractalDave

  • *
  • Fractal Fruit Salad
  • *****
  • Posts: 63
    • Makin Magic Fractals
« Reply #16 on: August 09, 2018, 01:03:16 PM »
To produce something really generic one could simply allow the user to define f(h) and g(h) (for 3D h=a+bi+cj) where the "Newton" is performed as:
Code: [Select]
init:
  h = 0 or value from coord for julia
  oldh = 0
  a = value from coord for mandy or constant for julia
loop:
  oldh = h
  h = (f(h) - a) / (g(h) + user const)
Obviously for proper Newtons g(h) should be the derivative of f(h), in particular it should be 1 degree less - but then again why stick to either ?
In this case allowing the option of either divergent or convergent bailout or indeed both might be useful.
The meaning and purpose of life is to give life purpose and meaning.

Offline Sabine62

  • *
  • Fractal Furball
  • ***
  • Posts: 218
    • sabine62.deviantart.com
« Reply #17 on: August 13, 2018, 09:26:01 AM »
Have tried to port this to Fragmentarium. Has been so long that I have done anything with fractals and still completely lacking any understanding of math, I am so happy that the thing shows anything at all. Have stolen the DE from Mandelbulb, and no optimization at all as will have to read up on that AGAIN after all this time  :fp: :fp: :fp: :embarrass: :embarrass: :embarrass: Neither have any idea what should go into the loop and what not etc etc, it's all just throwing gannjondals newton blindly at fragm, but here it is for your enjoyment (or dispair  :)) )Julia does blow up the whole thing, but added rotations which give really nice results. Also quite some fuzz, so lots  and lots of room for improvement. Oh well...Hope I get some more time to look at it.


Complete .frag in zip below
« Last Edit: August 25, 2018, 04:12:27 PM by Sabine62 »
It's just a jump to the left...

Offline mclarekin

  • *
  • Fractal Furball
  • ***
  • Posts: 299
« Reply #18 on: August 13, 2018, 09:59:15 AM »
looks good.

Thanks for the frag. As usual I have learnt a new thing or two about coding and formulas from looking at it O0

Offline Sabine62

  • *
  • Fractal Furball
  • ***
  • Posts: 218
    • sabine62.deviantart.com
« Reply #19 on: August 13, 2018, 10:19:39 AM »
Thanks, mclarekin, does look newtonesque, doesn't it ;) Did some minor optimization and updated the frag. Not sure if it will make a big difference though speedwise.

Offline gforce

  • *
  • Fractal Friend
  • **
  • Posts: 11
« Reply #20 on: August 23, 2018, 05:47:10 AM »
A little tip for making hybrids with the amazing box with these formulae, set first iteration to the number of iterations of the amazing box.(generally even 3 seems to work) (otherwise it tends to be solid renders:yes: I'm an idiot just read the description better.
« Last Edit: August 23, 2018, 06:00:47 AM by gforce »

Offline kosalos

  • *
  • Fractal Friend
  • **
  • Posts: 14
« Reply #21 on: August 23, 2018, 06:47:46 PM »
I am trying to understand the equations well enough to write renditions for the iPad using their metal shading language.
But I am missing something.
For example, in JIT_gnj_RealPowNewton_01.m3f, I don't see the definition of "TPIteration3D",
and I don't understand what "PIteration3D^.J1" could mean.
In other shaders I have seen the '^' operator used on floating point values.

Can you point me to a link where I can learn background info on what these shaders are based on, and
how to better understand their environment?
And just in general, any links to places where I can learn shader "best standard operations, and tricks"

Thanks for helping a beginner like me.

Offline Sabine62

  • *
  • Fractal Furball
  • ***
  • Posts: 218
    • sabine62.deviantart.com
« Reply #22 on: August 23, 2018, 07:42:27 PM »
Great that you posted these questions, kosalos, I've been playing with gannjondal's code as well, and it's ALMOST clear to me as I have no clue really about the maths, so lots of things I still need to dig in to :D This is what I think might help you a little bit further:

TPIteration3D: Haven't spotted a TPIteration3D, either, maybe some leftover of something tested earlier? comes standard within the Mandelbulb3d JIT coding environment.


PIteration3D: I am not quite sure about the correct format of JIT, but basically PIteration3D works as a vec3 user input, loaded into vec3 c:

cx := PIteration3D^.J1;
cy := PIteration3D^.J2;
cz := PIteration3D^.J3;

which is used as a kind of scalar for r_pow further down:

x := fac_eff*x - cx*cos(phi_pow)*cos(theta_pow)*r_pow/Power_ ;
y := fac_eff*y - cy*cos(phi_pow)*sin(theta_pow)*r_pow/Power_ ;
z := fac_eff*z + cz*sin(phi_pow)*r_pow/Power_ ;

The ^.J1-3 seem to me the x,y,z-coordinates of PIteration3D, so if you'd declare both c and PIteration3D as vec3, the whole thing up here would look like:

vec3 PIteration3D (user input);
vec3 c;

c=PIteration3D;

z.x = fac_eff*z.x - c.x*cos(phi_pow)*cos(theta_pow)*r_pow/Power_ ;
z.y = fac_eff*z.y - c.y*cos(phi_pow)*sin(theta_pow)*r_pow/Power_ ;
z.z = fac_eff*z.z + c.z*sin(phi_pow)*r_pow/Power_ ;


Shaders: Can't help you there ::)
« Last Edit: August 25, 2018, 04:02:12 PM by Sabine62 »

Offline gannjondal

  • *
  • Fractal Friend
  • **
  • Posts: 14
« Reply #23 on: August 26, 2018, 06:44:19 PM »
Oh-oh. So many updates!  I should really come back more often. 
But honestly, this long summer made me too lazy in mind  :confused:
I want to answer at least some of your comments and questions....

Have tried to port this to Fragmentarium. Has been so long that I have done anything with fractals and still completely lacking any understanding of math, I am so happy that the thing shows anything at all. Have stolen the DE from Mandelbulb, and no optimization at all as will have to read up on that AGAIN after all this time Neither have any idea what should go into the loop and what not etc etc, it's all just throwing gannjondals newton blindly at fragm, but here it is for your enjoyment (or dispair )Julia does blow up the whole thing, but added rotations which give really nice results....

Great to hear some sign of life from you, Sabine!  It has really been a while  ;)
Your new version of the pictures look really interesting! 
The pictures are very different to mine in MB3D, but absolutely valid as an own formula with some unique structure. 
 
To understand the differences I have tried to analyze an older version of your .frag, and tried to get it running in Fragmentarium. 
The result ...   
Well I was happy to get the frag compiled with my AMD card (it seams that some functions that are part of the GLSL standard are not understood by AMD's GLSL).   
As of now I get something like a better point cloud (ok, I'm an absolute Fragmentarium beginner).   
 
Nevertheless I have attached my current version. I have re-ordered some lines, and added a ton of comments.   
Maybe it helps you a bit to understand even more, or to get a version that is equivalent to mine ( if you should want to do that  ;) ).

I am trying to understand the equations well enough to write renditions for the iPad using their metal shading language.
But I am missing something.
For example, in JIT_gnj_RealPowNewton_01.m3f, I don't see the definition of "TPIteration3D",
and I don't understand what "PIteration3D^.J1" could mean ....
 
Please have a look Sabine's explanations. I just want to add the point of view of an MB3D JIT formula author: 
 
TPIteration3D is pure MB3D.
It is a big (Delphi style) structure, defined within the MB3D code, and the one-and-only structure that is exposed to JIT formula authors. 
It contains almost everything you can touch when writing JIT formulas.   
Don't heat up your brain with the details if you don't want to write JIT formulas for MB3D - it's too weird! 

And yes, TPIteration3D^.J1/2/3 are just the built-in Julia parameters if Julia=true, and the position values in case of Julia=false. Hence it's simply the c in z=z▓+c.

To produce something really generic one could simply allow the user to define f(h) and g(h) (for 3D h=a+bi+cj) where the "Newton" is performed as:
Code: [Select]
init:
  h = 0 or value from coord for julia
  oldh = 0
  a = value from coord for mandy or constant for julia
loop:
  oldh = h
  h = (f(h) - a) / (g(h) + user const)
 
Obviously for proper Newtons g(h) should be the derivative of f(h), in particular it should be 1 degree less - but then again why stick to either ?
In this case allowing the option of either divergent or convergent bailout or indeed both might be useful.
 
You are right, that would simplify much! 
But right now you will need to write one formula for each f().   
This is true for every fractal program on the market unfortunately, even for such elaborated programms like Fragmentarium, or Ultra Fractal. 
To allow it to program in a way as you have suggested you would need to marry a program that allows symbolic calculation (like Octave) with Fragmentarium & Co. 
Feel free to write such a software! (but don't forget the automatic DE code optimizer)  :P   
But seriously, it may be a not too weird idea to build something like a formula generator in Octave or so, that can calculate derivations etc, so that you can just copy the result into Fragmentarium, JIT, UF, or whatever.

I have this Bookmarked, and will make a note at GitHub
it looks so good. The maths talk is above me, but the JITs i should be able to follow.  Oh man!! it is just finding the time.!!

BTW. Adding formulas and compliling a standalone Mandelbulber in QT , has never been easier
....
 
Thank you for your kind words, mclarekin! 
On the other hand, I must it admit. I am one of those Windows users who never would use a word like 'easy' if it comes to compile a huge and complex software project (especially such with an UI). 
I am not completely agnostic to programming (otherwise I would not write those JIT formulas), but I think, if you really want so see the Newton variants in Mandelbulber then it would be probably faster if you would start (feel however free to ask if really needed)...

I would be interested in this variation, I'd be even more interested in that variant with the all the bells and whistles you've added to JIT_gnj_RealPowNewton_04. It might not look good with simple transformations like rotation but i think it will have potential for hybrid formulas
 
The variant you have been pointing to is mathematically useless in the form I have tried; it is even not good for transformations I'm afraid (it destroys too much on information). 
I have enogh other ideas, and maybe I will publish one or two other formulas if I should find something useful - But EVERYONE would stop to have even a look if I would offer something like the several hundred of Newton variants that I have in UF  ;)   



Offline Sabine62

  • *
  • Fractal Furball
  • ***
  • Posts: 218
    • sabine62.deviantart.com
« Reply #24 on: August 27, 2018, 12:06:22 AM »
HeyHey and Moin, gannjondal!  ;)
Not much time but looked quickly at the .frag
Here's some pwitty picshers for ya and attached the .frag  :D
Hopefully will have time to study your code soon!





Offline FractalDave

  • *
  • Fractal Fruit Salad
  • *****
  • Posts: 63
    • Makin Magic Fractals
« Reply #25 on: September 13, 2018, 01:41:34 PM »
"But seriously, it may be a not too weird idea to build something like a formula generator in Octave or so, that can calculate derivations etc, so that you can just copy the result into Fragmentarium, JIT, UF, or whatever."

In UF I just paired some operations with their derivatives so the user could then select which are used in the iterated formula, if I remember correctly even including some functions of functions....with plain complex it's very simple but generic 2D or 3D+ except quaternions/bicomplex gets complicated due to non-standard derivatives so I didn't get that far, though another formula of mine for UF does allow generic manipulations of general 2D numbers i.e. so with x,y real new(x,y)=f(x,y),g(x,y) where f() and g() can be defined by the user - this is something else I'm intending to add as 3D+ either to UF or possibly other software ;)

Edit: Ooops, sorry my mistake, I did do the Multivariable Newton formula in mmf3.ufm !!

Offline FractalDave

  • *
  • Fractal Fruit Salad
  • *****
  • Posts: 63
    • Makin Magic Fractals
« Reply #26 on: October 01, 2018, 10:24:43 PM »
Just remembered that for general 2D (or higher) formulas such as new (x,y) = (f(x,y),g(x,y)) you need to use the Jacobi for the correct derivatives, I'd've mentioned that in my last post but couldn't remember the name (am getting old).


xx
Newton (gannjondal)

Started by Sabine62 on Fractal Image Gallery

0 Replies
36 Views
Last post August 15, 2018, 04:28:09 PM
by Sabine62
xx
Newton's Garden

Started by gannjondal on Fractal Image Gallery

4 Replies
184 Views
Last post April 17, 2018, 11:22:45 PM
by spain2points
xx
Newton-Raphson zooming

Started by gerrit on Fractal Mathematics And New Theories

57 Replies
1916 Views
Last post December 12, 2017, 05:42:52 AM
by gerrit
xx
Newton Folded - Towards Dragonflies

Started by gannjondal on Fractal Image Gallery

0 Replies
59 Views
Last post April 02, 2018, 06:30:55 PM
by gannjondal
clip
Neat variation of Newton's method

Started by Ebanflo on Share a fractal

1 Replies
195 Views
Last post April 17, 2018, 04:34:13 PM
by mrrudewords