The J script user\rv_fct.ijs
NB. Chaotic Attractors with Cyclic Symmetry Revisited
NB. Kevin Jones and Clifford Reiter
NB. This script creates the functions used in that paper
NB. see that comments at the end of this script for 
NB. how to create the images in that paper
NB. June 1999
NB. 

NB. Utilities used for general sums of conjugates

Prods=:\:~@~.@(* >&1e_14@:|)@(,(,/)@:( (+/ . *"2)/~))
sin=:1&o.
cos=:2&o.
rotn=:(cos,-@sin),:(sin,cos)
cd=:Prods^:_@:(rotn@+:@o.@%,:1 0"_,:0:,*)

consum=: 2 : 0
x=.+/ . *
+/@((%.n.)"_ x" 2 1 ])@:(u."1)@(n.&x) f.
)


NB. function 01 is in the style of Field and Golubitsky

Re=:9&o.

FG=: 1 : 0
'L a b c w n '=.m.
(c"_ * (^&(n-1))@+)+] * L"_ + (a"_ * ] * +) + (b"_ * Re@(^&n))+(0j1*w)"_ 
)

p01=:2.40105 _1.49193 _0.0579757 0.00285365 _0.0193793 6

f01=:+.@:(p01 FG)@:(j./)

]f01^:(i.5) 0.1 0.2

NB. function 02 ia a sum of conjugates of polynomials

P=:1 : 0
x=.+/ . *
(1&{ x 0&{ x m."_)@(^/&(i.3))
)

]p02=:3 3 2$  0.111601  _0.327589  0.215598  _0.452505 _0.253271   0.274297  0.113096  _0.198432 _0.0450232   0.295369  0.267113   0.368732  0.275252   0.160737 _0.488431 _0.0672858  0.127573   0.111203

s02=:_5

f02=:(p02 P) consum (cd s02)

]f02^:(i.5) 0.1 0.2

NB. functions 03 and 04 are conjugate sums of trigonometric functions
T=:1 : 0
[: (+/"1^:2) 1 2&(o./)@:(1 2 3&*)"0 * m."_ 
)

p03=:2 2 3$_0.318001 0.152663 0.212579 0.0139679 0.359243 0.201188 _0.234358 0.352427 0.0383502 _0.248544 0.327754 _0.244073
s03=:7
f03=:(p03 T) consum (cd s03)

]f03^:(i.5) 0.1 0.2

p04=:2 2 3$0.341661 _0.100758 0.160408 _0.0308619 _0.295713 0.359693 _0.241457 0.231701 _0.195997 0.281019 _0.11283 _0.326238
s04=:_5
f04=:(p04 T) consum (cd s04)

]f04^:(i.5) 0.1 0.2

NB. NB. function 05 is a conjugate sums of products of trigonometric functions

S=:1 : 0

x=:+/ . *

(1&{ x 0&{ x m."_)@:((cos@(2&*),sin@(1&*),sin@(2&*))"0)

)


p05=:3 3 2$_0.229249 0.0186945 0.198027 0.236974 _0.175746 0.241584 0.30261 _0.0363355 0.308505 0.0354111 0.154188 0.43914 _0.375681 _0.0721911 _0.315159 0.128574 _0.0562258 0.0133984
s05=:_6
f05=:(p05 S) consum (cd s05)

]f05^:(i.5) 0.1 0.2

NB. function 06 is a conjugate sums of products of exponential bump functions

B=:1 : 0
[: (+/"1) ^@-@+:@*:@(-&(2#,:-:i.3)) * m."_
)

p06=:2 3$0.837683 0.942964 0.394768 0.874014 _0.440685 _0.600715
s06=:_3
f06=:(p06 B) consum (cd s06)

]f06^:(i.5) 0.1 0.2

NB. functions 07 and 08 are conjugate sums of complex fractional exponents

F3=:1 : 0
x=:+/ . *
+/@(m.&*)@:+.@(^/)&(1r3 1r5 1r7)@(j./)
)

p07=:3 2$0.159843 0.474288 0.35655 _0.469885 _0.36492 _0.20803
s07=:_3
f07=:(p07 F3) consum (cd s07)

]f07^:(i.5) 0.1 0.2

p08=:3 2$0.486594 0.183674 0.0012491 _0.00630057 0.106356 _0.482176
s08=:_3
f08=:(p08 F3) consum (cd s08)

]f08^:(i.5) 0.1 0.2

NB. functions 09 and 10 are conjugate sums of polynomials mod 1

Q=:1 : 0
x=.+/ . *
1&|@(1&{ x 0&{ x m."_)@(^/&(i.3))
)

p09=:3 3 2$_0.470485 0.55274 _0.0924497 0.198392 0.380427 _0.155494 0.617939 _0.291309 _0.037135 _0.127442 0.077234 0.0726911 _0.280115 0.104806 _0.521677 0.175299 0.249864 _0.538483
s09=:3
f09=:(p09 Q) consum (cd s09)

]f09^:(i.5) 0.1 0.2

p10=:3 3 2$_0.11443 _0.229931 _0.450584 0.0417878 0.327878 _0.349975 _0.0307574 0.0596584 _0.321881 0.147334 0.248735 0.494745 0.183649 _0.40879 0.465903 0.432315 _0.0798881 0.320248
s10=:4
f10=:(p10 Q) consum (cd s10)

]f10^:(i.5) 0.1 0.2

NB. The following lines can be uncommented in order to actaully create an image
NB. The script raster3.ijs run; download from
NB. http://www.lafayette.edu/~reiterc/j
NB. and place in your J directory

NB. imsz=:400                        NB. image size
NB. load 'raster3.ijs'             NB. raster image utilities
NB. d0=:f02^:(1000+i.50000) 0.1 0.2  NB. create figure 02 data
NB. max=:1.05*>./,|d0                NB. scale of data
NB. d0=:<.(max+d0)%2*max%imsz        NB. rescale data to imsz
NB. n=:<"1 ~.d0                      NB. pixels visited
NB. f=:255<. #/.~d0                  NB. frequency of visit
NB. b=:f n}(imsz,imsz)$0             NB. make bitmap array
NB. pal=:0,~255,hue 5r7*(i.%<:)254   NB. make a palette
NB. (pal;b) writebmp8 'temp.bmp'     NB. save the file