Welcome to Fractal Forums

Fractal Math, Chaos Theory & Research => General Discussion => Topic started by: gaston3d on December 27, 2009, 10:17:56 PM




Title: Period detecting
Post by: gaston3d on December 27, 2009, 10:17:56 PM
hi,
i would like to implement coloring function based on orbit period.
anyone know simple period detecting method in complex/quaternion series?


Title: Re: Period detecting
Post by: lkmitch on December 28, 2009, 12:15:19 AM
hi,
i would like to implement coloring function based on orbit period.
anyone know simple period detecting method in complex/quaternion series?


The simplest of which I'm aware is this:  iterate a bunch of times and save that final z value and its iteration number.  Then, for each subsequent iteration, compare that z with the stored value.  If the difference (typically, magnitude of z - zstored) is less than a threshold value, then the difference in iteration values is the (assumed) period.  Should work for any variable type.


Title: Re: Period detecting
Post by: BradC on December 28, 2009, 01:19:01 AM
Also see http://www.mrob.com/pub/muency/period.html (http://www.mrob.com/pub/muency/period.html).

One way to detect when a cycle has occurred is to iterate two variables at once, with one iterating half as fast as the other. If they ever become equal, then a cycle has occurred. The difference of their iteration counts when this happens will be a multiple of the period.


Title: Re: Period detecting
Post by: David Makin on December 28, 2009, 02:14:32 PM
Also see http://www.mrob.com/pub/muency/period.html (http://www.mrob.com/pub/muency/period.html).

One way to detect when a cycle has occurred is to iterate two variables at once, with one iterating half as fast as the other. If they ever become equal, then a cycle has occurred. The difference of their iteration counts when this happens will be a multiple of the period.

If you store the z[n] values in an array you do not need to iterate twice, you just need 2 index counters :)


Title: Re: Period detecting
Post by: aluminumstudios on April 08, 2010, 07:55:14 AM
If you store the z[n] values in an array you do not need to iterate twice, you just need 2 index counters :)

I know this is an old topic, so this may be irrelevant, but with my recent work on a buddhabrot renderer, I wonder if it might not actually be faster to to iterate twice rather than storing the Z values because a memory access between each iteration might really hold the CPU up resulting in a lot of wasted cycles since CPU arithmetic is SO much faster than memory accesses.

Just a though, I don't know if it's true or not.


Title: Re: Period detecting
Post by: reesej2 on April 08, 2010, 08:32:58 AM
I don't know... I'd think it'd depend on the system you're using. Unless you're using a language with either really amazing support for complex numbers or really lousy memory procedures, I think storing it in an array would be faster. The only exception I can think of is if you're doing a tremendous number of iterations, so big that the array has to be put on the hard drive instead of the cache. THEN it'd be faster to just iterate twice.


Title: Re: Period detecting
Post by: David Makin on April 08, 2010, 12:59:19 PM
For a very simple fractal like z^2+c then iterating twice may be more efficient but on a modern CPU I don't think you need to get much more complicated to get to a point where storing the values would be more efficient (simply due to improvements in memory access generally). Certainly if the calculations involved a divide or any transcendentals then storing would be faster.


Title: Re: Period detecting
Post by: makc on April 08, 2010, 09:11:28 PM
maybe it would be better to use orbit radius, then you only need last 3 z's.


Title: Re: Period detecting
Post by: Timeroot on April 11, 2010, 05:29:33 AM
...why do you say that, makc?

What about period 5?

...or is this some kind of thing with radius of curvature??!?!!


Title: Re: Period detecting
Post by: makc on April 11, 2010, 03:41:23 PM
his original intent was to color the thing using orbit period,and for that he seemingly needed to store lots of z-s. so I said the he could go with radius instead as the radius can be calculated from only 3 points. I am not saying using radius instead of period would make better picture or anything