Fractals from iterating sines

August 23rd, 2013 | Categories: Fractals, general math, mathematica | Tags:

In a recent blog-post, John Cook, considered when series such as the following converged for a given complex number z

z1 = sin(z)
z2 = sin(sin(z))
z3 = sin(sin(sin(z)))

John’s article discussed a theorem that answered the question for a few special cases and this got me thinking: What would the complete set of solutions look like? Since I was halfway through my commute to work and had nothing better to do, I thought I’d find out.

The following Mathematica code considers points in the square portion of the complex plane where both real and imaginary parts range from -8 to 8. If the sequence converges for a particular point, I colour it black.

LaunchKernels[4]; (*Set up for 4 core parallel compute*)
ParallelEvaluate[SetSystemOptions["CatchMachineUnderflow" -> False]];
convTest[z_, tol_, max_] := Module[{list},
  list = Quiet[
    NestWhileList[Sin[#] &, z, (Abs[#1 - #2] > tol &), 2, max]];
  If[
   Length[list] < max && NumericQ[list[[-1]]]
   , 1, 0]
  ]
step = 0.005;
extent = 8;
AbsoluteTiming[
 data = ParallelMap[convTest[#, 10*10^-4, 1000] &,
    Table[x + I y, {y, -extent, extent, step}, {x, -extent, extent,
      step}]
    , {2}];]
ArrayPlot[data]

 

Sine Fractal

I quickly emailed John to tell him of my discovery but on actually getting to work I discovered that the above fractal is actually very well known. There’s even a colour version on Wolfram’s MathWorld site.  Still, it was a fun discovery while it lasted

Other WalkingRandomly posts like this one:

  1. Martin Cohen
    August 25th, 2013 at 01:58
    Reply | Quote | #1

    How much of this depends on the function being sine and how much of the first n terms of the power series, for n =1, 2, 3, …?

  2. August 26th, 2013 at 07:03
    Reply | Quote | #2

    Very nice image. I discussed the iterated sine on my blog here

    http://observations.rene-grothmann.de/a-chellenge/
    http://observations.rene-grothmann.de/the-iterated-sine/

    It is always amazing, how simple things can lead to mathematical beauty.

  3. April 28th, 2016 at 20:22
    Reply | Quote | #3

1 trackbacks

  1. Iterating sines | The Endeavour Pingback | 2013/08/23