I'm attempting to construct a formula . However there's something amiss ; hence I'm seeking some help on this from the group. This is the formula : comment{ Series Circuit . (c) copyright 2016 sciwise@ihug.co.nz Edward.Q.Montague } DiodeRLC { f = 1/real(p1) z = pixel x = real(z) y = imag(z) p = 0.039757 h = 0.071743 s = -1 R = 1 L =0.001 C = 10^6 C = 1/C K = 10^23 K = (1.3806485279)/K twopi = 6.283185307179586 T = 270 q = 10^19 q = (1.602176620898)/q Id = 10^12 Id = 1/Id a1 = q/(K*T) b1 = (K*T)/(q*C*L) b2 = (K*T)/(Id*q*L) b3 = R/L t1 = 0: v = twopi*t1 v = 100*sin(w) q = s*a1*x q = exp( q ) u = y w = s*a1*y*y + s*b2*q*y + s*b3*y + b2*q*w + b1*q + s*b1 a = x+p*u b = y+p*w q = s*a1*a q = exp( q ) c = x+h*(u+b) d = y + h*(w + s*a1*b*b + s*b2*q*b + s*b3*b + b2*q*v + b1*q + s*b1) x = c y = d t1 = t1 + f z = x+flip(y) |y|
c ??? On 8 January 2016 at 17:00, <sciwise@ihug.co.nz> wrote:
I'm attempting to construct a formula .
However there's something amiss ; hence I'm seeking some
help on this from the group.
This is the formula :
comment{
Series Circuit .
(c) copyright 2016 sciwise@ihug.co.nz
Edward.Q.Montague
} DiodeRLC { f = 1/real(p1) z = pixel x = real(z) y = imag(z) p = 0.039757 h = 0.071743 s = -1 R = 1 L =0.001 C = 10^6 C = 1/C K = 10^23 K = (1.3806485279)/K twopi = 6.283185307179586 T = 270 q = 10^19 q = (1.602176620898)/q Id = 10^12 Id = 1/Id a1 = q/(K*T) b1 = (K*T)/(q*C*L) b2 = (K*T)/(Id*q*L) b3 = R/L t1 = 0: v = twopi*t1 v = 100*sin(w) q = s*a1*x q = exp( q ) u = y w = s*a1*y*y + s*b2*q*y + s*b3*y + b2*q*w + b1*q + s*b1 a = x+p*u b = y+p*w q = s*a1*a q = exp( q ) c = x+h*(u+b) d = y + h*(w + s*a1*b*b + s*b2*q*b + s*b3*b + b2*q*v + b1*q + s*b1) x = c y = d t1 = t1 + f z = x+flip(y) |y| _______________________________________________ Fractint mailing list Fractint@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/fractint
Hi Edward. I gave it a try but I am not sure if this is going to help you. Anyway here is what I found using Fracton to import the formula. It didn't like how a couple of equations were split across two lines so I put them on one line. As John Wilson mentioned c looks suspicious. c exists as an upper case C and later as a lower case c. I don't think FractInt is case sensitive on formulas so those would be the same variable. Fracton converts everything into lower case when importing pars so it makes them the same. I added a parameter section and some colors to see what it would generate. Unfortunately, it gives a black screen. Here is the complete par file that compiles but gives a black screen below: series_circuit { reset=2004 type=formula formulafile=fracton.frm formulaname=DiodeRLC passes=1 float=y center-mag=0/0/2.6666667/1/0/0 params=1/1/0/0/-1/0/1/0/0/0 maxiter=2000 inside=0 periodicity=6 colors=000C10O40ZA0hI0oS0ua0ym0zy0ym0ua0oS0hI0ZA0O\ 40C10000C10O40ZA0hI0oS0ua0ym0zy0ym0ua0oS0hI0ZA0O40\ C10000C10O40ZA0hI0oS0ua0ym0zy0ym0ua0oS0hI0ZA0O40C1\ 0000C10O40ZA0hI0oS0ua0ym0zy0ym0ua0oS0hI0ZA0O40C100\ 00C10O40ZA0hI0oS0ua0ym0zy0ym0ua0oS0hI0ZA0O40C10000\ C10O40ZA0hI0oS0ua0ym0zy0ym0ua0oS0hI0ZA0O40C10000C1\ 0O40ZA0hI0oS0ua0ym0zy0ym0ua0oS0hI0ZA0O40C10000C10O\ 40ZA0hI0oS0ua0ym0zy0ym0ua0oS0hI0ZA0O40C10000C10O40\ ZA0hI0oS0ua0ym0zy0ym0ua0oS0hI0ZA0O40C10000C10O40ZA\ 0hI0oS0ua0ym0zy0ym0ua0oS0hI0ZA0O40C10000C10O40ZA0h\ I0oS0ua0ym0zy0ym0ua0oS0hI0ZA0O40C10000C10O40ZA0hI0\ oS0ua0ym0zy0ym0ua0oS0hI0ZA0O40C10000C10O40ZA0hI0oS\ 0ua0ym0zy0ym0ua0oS0hI0ZA0O40C10000C10O40ZA0hI0oS0u\ a0ym0zy0ym0ua0oS0hI0ZA0O40C10000C10O40ZA0hI0oS0ua0\ ym0zy0ym0ua0oS0hI0ZA0O40C10000C10O40ZA0hI0oS0ua0ym\ 0zy0ym0ua0oS0hI0ZA0O40C10 } frm:DiodeRLC { f=1/real(p1), z=pixel, x=real(z), y=imag(z), p=0.039757, h=0.071743, s=-1, r=1, l=0.001, c=10^6, c=1/c, k=10^23, k=(1.3806485279)/k, twopi=6.283185307179586, t=270, q=10^19, q=(1.602176620898)/q, id=10^12, id=1/id, a1=q/(k*t), b1=(k*t)/(q*c*l), b2=(k*t)/(id*q*l), b3=r/l, t1=0: v=twopi*t1, v=100*sin(w), q=s*a1*x, q=exp(q), u=y, w=s*a1*y*y+s*b2*q*y+s*b3*y+b2*q*w+b1*q+s*b1, a=x+p*u, b=y+p*w, q=s*a1*a, q=exp(q), c=x+h*(u+b), d=y+h*(w+s*a1*b*b+s*b2*q*b+s*b3*b+b2*q*v+b1*q+s*b1), x=c, y=d, t1=t1+f, z=x+flip(y), |y| } -- Mike Frazier www.fracton.org
Hi Mike Difficulties remain , however this is a slightly improved version. For some reason the loop is exited after the first iteration ; I'm starting to think that the exponential function exp(q) might be the cause. comment{ Series Circuit . (c) copyright 2016 sciwise@ihug.co.nz Edward.Q.Montague } DiodeRLC { f = 1/real(p1) z = pixel x = real(z) y = imag(z) p = 0.39757 h = 0.71743 s = -1 R = 1 L =0.001 C1 = 10^6 C1 = 1/C1 K = 10^23 K = (1.3806485279)/K twopi = 6.283185307179586 T = 270 q1 = 10^19 q1 = (1.602176620898)/q1 Id = 10^12 Id = 1/Id a1 = q1/(K*T) b1 = (K*T)/(q1*C1*L) b2 = (K*T)/(Id*q1*L) b3 = R/L t1 = 0: v = twopi*t1 v = 100*sin(v) q = s*a1*x q = exp( q ) u = y w = s*a1*y*y + s*b2*q*y + s*b3*y + b2*q*v + b1*q + s*b1 a = x+p*u b = y+p*w q = s*a1*a q = exp( q ) c = x+h*(u+b) d = y + h*(w + s*a1*b*b + s*b2*q*b + s*b3*b + b2*q*v + b1*q + s*b1) x = c y = d t1 = t1 + f z = x*x + y*y |z| Hi Edward. I gave it a try but I am not sure if this is going to help you.
Anyway here is what I found using Fracton to import the formula. It didn't like how a couple of equations were split across two lines so I put them on one line. As John Wilson mentioned c looks suspicious. c exists as an upper case C and later as a lower case c. I don't think FractInt is case sensitive on formulas so those would be the same variable. Fracton converts everything into lower case when importing pars so it makes them the same. I added a parameter section and some colors to see what it would generate. Unfortunately, it gives a black screen.
Here is the complete par file that compiles but gives a black screen below:
series_circuit { reset=2004 type=formula formulafile=fracton.frm formulaname=DiodeRLC passes=1 float=y center-mag=0/0/2.6666667/1/0/0 params=1/1/0/0/-1/0/1/0/0/0 maxiter=2000 inside=0 periodicity=6
colors=000C10O40ZA0hI0oS0ua0ym0zy0ym0ua0oS0hI0ZA0O
40C10000C10O40ZA0hI0oS0ua0ym0zy0ym0ua0oS0hI0ZA0O40
C10000C10O40ZA0hI0oS0ua0ym0zy0ym0ua0oS0hI0ZA0O40C1
0000C10O40ZA0hI0oS0ua0ym0zy0ym0ua0oS0hI0ZA0O40C100
00C10O40ZA0hI0oS0ua0ym0zy0ym0ua0oS0hI0ZA0O40C10000
C10O40ZA0hI0oS0ua0ym0zy0ym0ua0oS0hI0ZA0O40C10000C1
0O40ZA0hI0oS0ua0ym0zy0ym0ua0oS0hI0ZA0O40C10000C10O
40ZA0hI0oS0ua0ym0zy0ym0ua0oS0hI0ZA0O40C10000C10O40
ZA0hI0oS0ua0ym0zy0ym0ua0oS0hI0ZA0O40C10000C10O40ZA
0hI0oS0ua0ym0zy0ym0ua0oS0hI0ZA0O40C10000C10O40ZA0h
I0oS0ua0ym0zy0ym0ua0oS0hI0ZA0O40C10000C10O40ZA0hI0
oS0ua0ym0zy0ym0ua0oS0hI0ZA0O40C10000C10O40ZA0hI0oS
0ua0ym0zy0ym0ua0oS0hI0ZA0O40C10000C10O40ZA0hI0oS0u
a0ym0zy0ym0ua0oS0hI0ZA0O40C10000C10O40ZA0hI0oS0ua0
ym0zy0ym0ua0oS0hI0ZA0O40C10000C10O40ZA0hI0oS0ua0ym
0zy0ym0ua0oS0hI0ZA0O40C10 }
frm:DiodeRLC { f=1/real(p1),
z=pixel,
x=real(z), y=imag(z), p=0.039757, h=0.071743, s=-1,
r=1,
l=0.001, c=10^6, c=1/c, k=10^23, k=(1.3806485279)/k,
twopi=6.283185307179586,
t=270, q=10^19, q=(1.602176620898)/q,
id=10^12,
id=1/id, a1=q/(k*t), b1=(k*t)/(q*c*l),
b2=(k*t)/(id*q*l),
b3=r/l, t1=0: v=twopi*t1, v=100*sin(w),
q=s*a1*x,
q=exp(q), u=y,
w=s*a1*y*y+s*b2*q*y+s*b3*y+b2*q*w+b1*q+s*b1,
a=x+p*u, b=y+p*w,
q=s*a1*a,
q=exp(q), c=x+h*(u+b),
d=y+h*(w+s*a1*b*b+s*b2*q*b+s*b3*b+b2*q*v+b1*q+s*b1),
x=c, y=d,
t1=t1+f,
z=x+flip(y), |y| }
On Sat, 2016-01-09 at 16:28 +1300, sciwise@ihug.co.nz wrote:
Difficulties remain , however this is a slightly improved version.
For some reason the loop is exited after the first iteration ; I'm starting to think that the exponential function exp(q) might be the cause.
It depends upon what you are trying to iterate during each loop. Take a look at the following. I cleaned up the code a little, but it still doesn't work. DiodeRLC float=y { f = 1/real(p1) z = pixel x = real(z) y = imag(z) p = 0.39757 h = 0.71743 s = -1 R = 1 L =0.001 C1 = 10^(-6) KT = ((1.3806485279) * 10^(-23)) * 270 twopi = 2 * pi q1 = (1.602176620898) * 10^(-19) Id = 10^(-12) a1 = q1/(KT) b1 = (KT)/(q1*C1*L) b2 = (KT)/(Id*q1*L) b3 = R/L t1 = 0 : v = 100*sin(twopi*t1) q = exp( s*a1*x ) u = y w = s*a1*y*y + s*b2*q*y + s*b3*y + b2*q*v + b1*q + s*b1 a = x+p*u b = y+p*w q = exp( s*a1*a ) c = x+h*(u+b) d = y + h*(w + s*a1*b*b + s*b2*q*b + s*b3*b + b2*q*v + b1*q + s*b1) x = c y = d t1 = t1 + f z = x*x + y*y t1 < maxit ; loops until t1 is >= maxit } Jonathan
Your tidy up is good , for some reason I was having difficulty
with negative exponents.
Presently I'm using maxima cas to look at
the values that exp(q)
takes , and indeed it grows quite large after
one or two iterations;
to such an extent that maxima runs out of
digits when printing.
Without going into the details of the
underlying equations , I
encountered a similar difficulty a number of
years ago when I wrote
LnDioGH.frm ; do a web search you should be
able to find the code.
I'm also wondering if the initial x and y are
meant to be 0 and 0 and v = (x,y) .
On 10/01/2016 03:52, Jonathan
Osuch wrote:
> On Sat, 2016-01-09 at 16:28 +1300, sciwise@ihug.co.nz
[1]wrote:
>
>> Difficulties remain , however this is a slightly
improved version. For some reason the loop is exited after the first
iteration ; I'm starting to think that the exponential function exp(q)
might be the cause.
>
> It depends upon what you are trying to iterate
during each loop. Take a
> look at the following. I cleaned up the code
a little, but it still
> doesn't work.
>
> DiodeRLC float=y {
> f =
1/real(p1)
> z = pixel
> x = real(z)
> y = imag(z)
> p = 0.39757
> h =
0.71743
> s = -1
> R = 1
> L =0.001
> C1 = 10^(-6)
> KT =
((1.3806485279) * 10^(-23)) * 270
> twopi = 2 * pi
> q1 =
(1.602176620898) * 10^(-19)
> Id = 10^(-12)
> a1 = q1/(KT)
> b1 =
(KT)/(q1*C1*L)
> b2 = (KT)/(Id*q1*L)
> b3 = R/L
> t1 = 0
> :
> v =
100*sin(twopi*t1)
> q = exp( s*a1*x )
> u = y
> w = s*a1*y*y + s*b2*q*y
+ s*b3*y + b2*q*v + b1*q + s*b1
> a = x+p*u
> b = y+p*w
> q = exp(
s*a1*a )
> c = x+h*(u+b)
> d = y + h*(w + s*a1*b*b + s*b2*q*b + s*b3*b +
b2*q*v + b1*q + s*b1)
> x = c
> y = d
> t1 = t1 + f
> z = x*x + y*y
> t1
< maxit ; loops until t1 is >= maxit
> }
>
> Jonathan
>
>
_______________________________________________
> Fractint mailing
list
> Fractint@mailman.xmission.com [2]
>
https://mailman.xmission.com/cgi-bin/mailman/listinfo/fractint [3]
Links:
------
[1] mailto:sciwise@ihug.co.nz
[2]
mailto:Fractint@mailman.xmission.com
[3]
https://mailman.xmission.com/cgi-bin/mailman/listinfo/fractint
> Your tidy up is good...
Thanks.
> ...I'm using maxima cas...
Very good!
Here are a few more wild and crazy debugging ideas:
> [exp] grows quite large after one or two iterations...
Here's an odd idea. Could you temporarily replace the
exp with a function that doesn't grow so quickly -- just
to get some results to look at? Perhaps a power?
So, instead of:
q = exp( s*a1*x )
you could try something like:
temp = s*a1*x
q = temp * temp
or:
temp = s*a1*x
q = temp * temp * temp * temp
q would then grow (or shrink for "temp" values less
than one,) but not in such a violent way. Using even
numbers of "temp" multiplied together always makes
its sign always be positive -- like the result of an exp().
What does the physics of the RLC circuit say about the
use of the exp() ?
> I'm also wondering if the initial x and y are meant
> to be 0 and 0 and v = (x,y) .
That's certainly easy to try -- but the significance of
doing this ought to be thought about, as well.
Here's an odd observation -- x and y get used for two
different purposes:
z = pixel
x = real(z)
y = imag(z)
and also:
c = x+h*(u+b)
d = y + h*(w + s*a1*b*b + s*b2*q*b + s*b3*b + b2*q*v + b1*q + s*b1)
x = c
y = d
z = x*x + y*y
Might the 2nd place where x and y are used need to
be xtemp and ytemp? It looks like the values of x and y
possibly needing to be constant during the calculation
of a pixel might be getting compromised by their
reuse -- unless that re-usage is intentional,
Also, I note that q is used in two different calculations:
This re-usage may or may not be intentional...
q = exp(s*a1*x )
. . .
q = exp(s*a1*a )
Note that the color map could be useful for debugging
when you get to the stage where you're looking at
resultant images.
Perhaps you could have a map that has big color
changes in adjacent lower values to be able to
better see what is going on in the initial iterations.
Is the image supposed to somehow visually depict
the ringing of a diode-clamped RLC circuit?
- Hal Lane
########################
# hallane@earthlink.net
########################
-----Original Message-----
From: Fractint [mailto:fractint-bounces@mailman.xmission.com] On Behalf Of
sciwise@ihug.co.nz
Sent: Saturday, January 9, 2016 5:50 PM
To: Fractint and General Fractals Discussion <fractint@mailman.xmission.com>
Subject: Re: [Fractint] Tedious formula
Your tidy up is good , for some reason I was having difficulty
with negative exponents.
Presently I'm using maxima cas to look at the values that exp(q)
takes , and indeed it grows quite large after one or two iterations;
to such an extent that maxima runs out of digits when printing.
Without going into the details of the
underlying equations , I
encountered a similar difficulty a number of years ago when I wrote
LnDioGH.frm ; do a web search you should be able to find the code.
I'm also wondering if the initial x and y are meant to be 0 and 0 and v =
(x,y) .
On 10/01/2016 03:52, Jonathan
Osuch wrote:
> On Sat, 2016-01-09 at 16:28 +1300, sciwise@ihug.co.nz
[1]wrote:
>
>> Difficulties remain , however this is a slightly
improved version. For some reason the loop is exited after the first
iteration ; I'm starting to think that the exponential function exp(q) might
be the cause.
>
> It depends upon what you are trying to iterate
during each loop. Take a
> look at the following. I cleaned up the code
a little, but it still
> doesn't work.
>
> DiodeRLC float=y {
> f =
1/real(p1)
> z = pixel
> x = real(z)
> y = imag(z)
> p = 0.39757
> h =
0.71743
> s = -1
> R = 1
> L =0.001
> C1 = 10^(-6)
> KT =
((1.3806485279) * 10^(-23)) * 270
> twopi = 2 * pi
> q1 =
(1.602176620898) * 10^(-19)
> Id = 10^(-12)
> a1 = q1/(KT)
> b1 =
(KT)/(q1*C1*L)
> b2 = (KT)/(Id*q1*L)
> b3 = R/L
> t1 = 0
> :
> v =
100*sin(twopi*t1)
> q = exp( s*a1*x )
> u = y
> w = s*a1*y*y + s*b2*q*y
+ s*b3*y + b2*q*v + b1*q + s*b1
> a = x+p*u
> b = y+p*w
> q = exp(
s*a1*a )
> c = x+h*(u+b)
> d = y + h*(w + s*a1*b*b + s*b2*q*b + s*b3*b +
b2*q*v + b1*q + s*b1)
> x = c
> y = d
> t1 = t1 + f
> z = x*x + y*y
> t1
< maxit ; loops until t1 is >= maxit
> }
>
> Jonathan
>
>
Links:
------
[1] mailto:sciwise@ihug.co.nz
[2]
mailto:Fractint@mailman.xmission.com
[3]
https://mailman.xmission.com/cgi-bin/mailman/listinfo/fractint
_______________________________________________
Fractint mailing list
Fractint@mailman.xmission.com
https://mailman.xmission.com/cgi-bin/mailman/listinfo/fractint
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
Here are a few problems I saw: In this line (and several others) : 100*sin(w) you use "w" before you give "w" a value. In fact, "w" seems to never appear on the left side of an equals sign. x = c y = d needs to be on two lines. You normally need to have a "bailout test" at the end to stop your iterations -- unless you *really* know what you're doing and *really* need to omit it for your specific calculation. An example of a bailout test would be: See the docs re this. |y| < 2 You also have for variable names both an upper case "C" and a lower case "c". I think the Fractint parser may convert them to the same case, but it's not very good programming practice to do this.. - Hal Lane ######################## # hallane@earthlink.net ######################## -----Original Message----- From: Fractint [mailto:fractint-bounces@mailman.xmission.com] On Behalf Of John Wilson Sent: Friday, January 8, 2016 8:16 PM To: Fractint and General Fractals Discussion <fractint@mailman.xmission.com> Subject: Re: [Fractint] Tedious formula c ??? On 8 January 2016 at 17:00, <sciwise@ihug.co.nz> wrote:
I'm attempting to construct a formula .
However there's something amiss ; hence I'm seeking some
help on this from the group.
This is the formula :
comment{
Series Circuit .
(c) copyright 2016 sciwise@ihug.co.nz
Edward.Q.Montague
} DiodeRLC { f = 1/real(p1) z = pixel x = real(z) y = imag(z) p = 0.039757 h = 0.071743 s = -1 R = 1 L =0.001 C = 10^6 C = 1/C K = 10^23 K = (1.3806485279)/K twopi = 6.283185307179586 T = 270 q = 10^19 q = (1.602176620898)/q Id = 10^12 Id = 1/Id a1 = q/(K*T) b1 = (K*T)/(q*C*L) b2 = (K*T)/(Id*q*L) b3 = R/L t1 = 0: v = twopi*t1 v = 100*sin(w) q = s*a1*x q = exp( q ) u = y w = s*a1*y*y + s*b2*q*y + s*b3*y + b2*q*w + b1*q + s*b1 a = x+p*u b = y+p*w q = s*a1*a q = exp( q ) c = x+h*(u+b) d = y + h*(w + s*a1*b*b + s*b2*q*b + s*b3*b + b2*q*v + b1*q + s*b1) x = c y = d t1 = t1 + f z = x+flip(y) |y| _______________________________________________ Fractint mailing list Fractint@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/fractint
_______________________________________________ Fractint mailing list Fractint@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/fractint --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
participants (5)
-
Hal Lane -
John Wilson -
Jonathan Osuch -
Mike Frazier -
sciwise@ihug.co.nz