I attempted to implement a perturbation method for this fractal:

w <-- w/z
z <-- z^2+w^2+c

but it does not give the right result. Suggestions anyone?

``````MandelFoamPT {
init:
#z = sqrt(-1/2)
loop:
#z = #z^2 + #pixel
bailout:
|#z| <= @bailout
perturbinit:
#dz = 0
w = sqrt(1/2)
perturbloop:
wo = w
w = w/#z;
#dz = 2*#z*#dz + sqr(#dz) + wo^2 + #dpixel
default:
title = "MandelFoamPT"
center = (0, 0)
float param bailout
caption = "Bailout value"
default = 1e16
endparam
}
``````
I attempted to implement a perturbation method for this fractal: w &lt;-- w/z z &lt;-- z^2+w^2+c but it does not give the right result. Suggestions anyone? ```` MandelFoamPT { init: #z = sqrt(-1/2) loop: #z = #z^2 + #pixel bailout: |#z| &lt;= @bailout perturbinit: #dz = 0 w = sqrt(1/2) perturbloop: wo = w w = w/#z; #dz = 2*#z*#dz + sqr(#dz) + wo^2 + #dpixel default: title = &quot;MandelFoamPT&quot; center = (0, 0) float param bailout caption = &quot;Bailout value&quot; default = 1e16 endparam } ````

0

Your "loop" is the standard Mandelbrot formula loop with no reference to w, but your "perturbloop" is for a different formula involving w.

If you weren't doing a perturbation method, what should your "loop" formula be?

Your &quot;loop&quot; is the standard Mandelbrot formula loop with no reference to w, but your &quot;perturbloop&quot; is for a different formula involving w. If you weren&#039;t doing a perturbation method, what should your &quot;loop&quot; formula be?

0

Your "loop" is the standard Mandelbrot formula loop with no reference to w, but your "perturbloop" is for a different formula involving w.

If you weren't doing a perturbation method, what should your "loop" formula be?

``````loop:
wo = w
w = w/z
z = z^2 + wo^2 + #pixel
``````
&gt;Your &quot;loop&quot; is the standard Mandelbrot formula loop with no reference to w, but your &quot;perturbloop&quot; is for a different formula involving w. &gt;If you weren&#039;t doing a perturbation method, what should your &quot;loop&quot; formula be? ```` loop: wo = w w = w/z z = z^2 + wo^2 + #pixel ````

0

Here is a formula like the one you were doing.

``````MandelFoamPT {
init:
z = sqrt(-1/2)
complex w = sqrt(1/2)
loop:
complex wo = w
w = w/z
z = z^2 + wo^2 + #pixel
bailout:
|z| <= @bailout
perturbinit:
#dz = 0
w = sqrt(1/2)
perturbloop:
wo = w
w = w/#z;
#dz = 2*#z*#dz + sqr(#dz) + sqr(wo) + #dpixel
default:
title = "MandelFoamPT"
center = (0, 0)
float param bailout
caption = "Bailout value"
default = 1e16
endparam
}
``````

This runs but the perturbation doesn't ever apply. This is because the term sqr(wo) in the perturb loop is large. Refer to the help file under "Perturbation equations" where it says

In short, if your formula can be reduced so all terms are small (in the order of dz or dc), it will work with perturbation calculations.

You would have to be able to rewrite the perturbloop changing the sqr(wo) term somehow so that it is small, perhaps using a "dw" that is small. It doesn't look to me as if this is possible, as w changes a lot from iteration to iteration, but maybe there is a way.

Some formulas just don't work with perturbation.
_

Here is a formula like the one you were doing. ```` MandelFoamPT { init: z = sqrt(-1/2) complex w = sqrt(1/2) loop: complex wo = w w = w/z z = z^2 + wo^2 + #pixel bailout: |z| &lt;= @bailout perturbinit: #dz = 0 w = sqrt(1/2) perturbloop: wo = w w = w/#z; #dz = 2*#z*#dz + sqr(#dz) + sqr(wo) + #dpixel default: title = &quot;MandelFoamPT&quot; center = (0, 0) float param bailout caption = &quot;Bailout value&quot; default = 1e16 endparam } ```` This runs but the perturbation doesn&#039;t ever apply. This is because the term sqr(wo) in the perturb loop is large. Refer to the help file under &quot;Perturbation equations&quot; where it says &gt; In short, if your formula can be reduced so all terms are small (in the order of dz or dc), it will work with perturbation calculations. You would have to be able to rewrite the perturbloop changing the sqr(wo) term somehow so that it is small, perhaps using a &quot;dw&quot; that is small. It doesn&#039;t look to me as if this is possible, as w changes a lot from iteration to iteration, but maybe there is a way. Some formulas just don&#039;t work with perturbation. _

0

Thanks for the response.

Not sure if I totally get that. All that is required is that the PT loop is computable in normal precision, not that all terms are small. So if sqr(w0) is big, the other terms just drop out, but that should be ok. For most of the PT iterations #z*#dz is also "big" compared to sqr(#dz) which drops out of the normal precision formula with no bad effects (provided you have a glitch detector).

Anyways, even if it produced the right results no speedup would be obtained it seems as there seems no way to enforce w also to be normal floating point, and you can't have more than one perturbed variable. And of course w/(#z+#dz) has no finite Taylor expansion in #dz.

I'll try to code the algorithm myself, see if it's UF limitation or really wrong (as you say, you may be right).

Thanks for the response. Not sure if I totally get that. All that is required is that the PT loop is computable in normal precision, not that all terms are small. So if sqr(w0) is big, the other terms just drop out, but that should be ok. For most of the PT iterations #z*#dz is also &quot;big&quot; compared to sqr(#dz) which drops out of the normal precision formula with no bad effects (provided you have a glitch detector). Anyways, even if it produced the right results no speedup would be obtained it seems as there seems no way to enforce w also to be normal floating point, and you can&#039;t have more than one perturbed variable. And of course w/(#z+#dz) has no finite Taylor expansion in #dz. I&#039;ll try to code the algorithm myself, see if it&#039;s UF limitation or really wrong (as you say, you may be right).

0

Good luck. I'd like to know your final conclusion, if you come to one.

I tried doing a perturbation for Phoenix (Mandelbrot) for the standard case of Exponent#1=2, Exponent#2=0 but didn't make it work. It's somewhat similar to your case in that it uses the previous value of z.

Good luck. I&#039;d like to know your final conclusion, if you come to one. I tried doing a perturbation for Phoenix (Mandelbrot) for the standard case of Exponent#1=2, Exponent#2=0 but didn&#039;t make it work. It&#039;s somewhat similar to your case in that it uses the previous value of z.

0

This does work:

``````init:
z = sqrt(-1/2)
dz = 0
w = sqrt(1/2)
dpixel = #pixel - #center
loop:
wo = w
w = w/(z+dz)
dz = 2*z*dz + dz^2 + wo^2 + dpixel
z = z^2 + #center
bailout:
|z+dz| <= @bailout
``````

But how to code this in UF language so that z is updated only once for the center pixel at high precision and the other loop variables in normal precision? Documentation does not say much about what is really going on.

This does work: ```` init: z = sqrt(-1/2) dz = 0 w = sqrt(1/2) dpixel = #pixel - #center loop: wo = w w = w/(z+dz) dz = 2*z*dz + dz^2 + wo^2 + dpixel z = z^2 + #center bailout: |z+dz| &lt;= @bailout ```` But how to code this in UF language so that z is updated only once for the center pixel at high precision and the other loop variables in normal precision? Documentation does not say much about what is really going on.

0

You cannot express that in the perturbloop section. Furthermore it doesn't look like it's going to work because both w and z are large so the w=w/(z+dz) calculation needs high precision during the loop. Perturbation calculations only work when all the terms are small.

You cannot express that in the perturbloop section. Furthermore it doesn&#039;t look like it&#039;s going to work because both w and z are large so the w=w/(z+dz) calculation needs high precision during the loop. Perturbation calculations only work when all the terms are small.

Ultra Fractal author

0

I tried in MATLAB and found out you're right.
It is possible to also perturb w and that works, but not implementable in UF.

I tried in MATLAB and found out you&#039;re right. It is possible to also perturb w and that works, but not implementable in UF.

0
230
views
8
replies
3
followers
live preview
Enter at least 10 characters.
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified Saving...
Saved
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing