Tag Archives: Complex Paint

Fractals & Chaos Recap for 1/10

We finished proving some of the observations made yesterday, and also discussed an argument that all Julia sets are either completely connected (any two points can be connected by a path along the Julia Set) or completely disconnected (every point is disconnected from every other point). This difference gives us a convenient way to categorize Julia Sets, allowing us to create a catalog view of them, much like we did for the Feigenbaum Plot in the real numbers.

What we need, then, is a convenient way of identifying whether or not a Julia Set is connected without having to actually draw it. Fortunately, iterations of points contained within the Julia Set give us a way to do that: if we can find seeds that do not diverge to infinity, then the Julia Set is connected. More specifically, we have argued that the origin, z = 0, is a convenient starting seed to iterate. If the orbit of z = 0 eventually tends to infinity, we know the Julia Set is disconnected. But how do we know the path of an orbit will actually tend to infinity and never return?

Fortunately, there’s a radius of no return. We further proved in class that if the path of an orbit of the origin exceeds r = 2the orbit will never come back. This means that any value of |c| > 2 results in a Julia Set that is automatically disconnected (since if z_0 = 0, then z_1 = 0^2 + c = c, and we’re already past 2), and for any value of |c| < 2, we just need to iterate until the orbit exceeds 2.

If we imagine the complex plane as a computer image, where every pixel corresponds to a single value of c, then we can colorize those pixels based on whether or not their orbit has “escaped”. As we increase the number of iterations, more and more pixels will become colorized (we can use the same colors for pixels that escape at the same number of iterations). Eventually, we will see a shape form. That shape is the Mandelbrot Set.

Download and investigate the Mandelbrot Set using the program Fractal Zoomer. Make sure you download Fractal Zoomer.exe (unfortunately, this software only functions on Windows-based computers). There are three modes in the basic view screen: Zoom Mode, Julia Mode, and Orbit Mode

  • In Zoom Mode:
    • Left Click = Zoom in
    • Right click = Zoom out
    • Ctrl+F3 = Set new center
  • Press J to activate Julia Mode
    • Left Click anywhere in the Mandelbrot Set to create the Julia Set at that value of C
    • Ctrl+F3 will allow you to spawn a Julia Set of a specific value of C (use this to investigate Julia Sets from the Complex Paint Worksheet)
  • Press O to activate Orbit Mode
    • Left click anywhere in the Mandelbrot Set and it will superimpose the orbit of seeds within the Julia Set that uses that value of C
    • Ctrl+F3 will allow you to specify the orbit of a particular value of C (or if you are in a Julia Set, of a particular seed).

Fractals & Chaos Recap for 1/7

We discussed the results from iterating yesterday’s seeds in the function z², finding that some seeds will attract to zero, some will spiral off to infinity, but others seem trapped in a unit circle around the origin, falling into a cycle or landing on (1,0). This unit circle forms a boundary between seeds that diverge and seeds that do not, and that boundary is called a Julia Set, named after French mathematician Gaston Julia, and developed by Julia and Pierre Fatou (Fatou names the complement of the Julia Set; in the case of C = 0, the Fatou set is the entirety of the rest of the complex plane except for the unit circle).

Not all Julia Sets (in fact pretty much none of them) look as simple as this, and Complex Paint is a great tool to help us see them. Watch this video for instructions on the derivation of Julia Sets, plus instructions on how to use Complex Paint to create and understand this new class of mathematical object. Feel free to explore whatever parameter values you would like, but in particular we will be using the ones found on Complex Paint Worksheet 2. We started this today and will finish it tomorrow. For each, note the type of Julia Set you get (area, string, or dust), any symmetry you observe, and the destination of orbits inside any area Julia Sets.

Fractals & Chaos Recap for 1/6

We started today with a brief recap of the work we’ve done with complex linear functions using the back of the Complex Paint worksheet we’ve been working off of.

From there, we started work with complex quadratic functions. We will be replicating the process we did with real numbers: analyzing a family of quadratics where we only adjust a single parameter value and investigate the behavior of iterations for specific values of the parameter. Eventually, we will find a way to categorize and catalog these behaviors.

The family of functions we will be analyzing is  + C, and the first parameter we will look at is C = 0. We found that squaring a complex number in polar form resulted simply in squaring the value of R and doubling the value of θ, so an initial seed like [2,10°] becomes [4,20°], then [16,40°], then [256,80°] and so on, for larger and larger values of R, suggesting that the seed [2,10°] diverges to infinity under iterations of z².

If you weren’t in class, pick two of the seeds below to iterate. Iterate until you’re convinced what the long-term destination might be (diverging? converging? limit cycle?). Note also that θ should never exceed 360°. If the pattern for [2,10°] from above were continued, we would get 160°, then 320°, then 540°. But 540° is larger than 360°, and is equivalent to 540-360=280°. And that’s the angle we would record.

  • [1,45°]
  • [1/3,60°]
  • [1,30°]
  • [5,180°]
  • [1,7°]
  • [1,120°]
  • [1/2,36°]
  • [2,90°]
  • [1,10°]

Fractals & Chaos Recap for 12/20

We started today with a debrief on the additional two continued fractions you were assigned to create yesterday:

  • 7/38 = [0;5,2,3], creating successive approximations of 1/5, 2/11, and 7/38
  • 71/360 = [0;5,14,5], creating successive approximations of 1/5, 14/71, and 71/360

We continued the conversation by observing that not only does the continued fraction give us rational approximations, it gives us a way of assessing how “good” these approximations are. We’ve already noticed in Complex Paint that the 4 spiral arms of 15/62 last for several steps of R (it’s not until R = 0.99 that we even see the 29 spiral arms), whereas T = 5/17 only shows 3 spiral arms for R = 0.9, and then only barely (we can also somewhat see the 7 spiral arms at this stage). This tells us that 1/4 is a better approximation of 15/62 than 1/3 is of 5/17 (which makes sense, since 15/62 is a lot closer to 0.25 than 5/17 is to 0.3333….).

So, a “good” rational approximation can be illustrated by the following characteristics in Complex Paint:

  • It is easy to see, and not hidden by another pattern
  • It is straight or spoke-like
  • It lasts through several magnifications (R = 0.9->0.95->0.99->0.995->…)

We can see this numerically as well: the third term of the sequence for 15/62 (a_2 = 7) is bigger than the second term (a_1 = 3), suggesting that we’re not adding a lot when we add on the third term of the continued fraction (remember, each term adds on to the denominator). On the other hand, the third term of 5/17 (a_2 = 2) is less than the second term (a_1 = 3), suggesting that we’ve left off a lot by stopping at just two terms.

All of this leads to why we see 7 “spokes” which very slowly turn into spirals for T = pi.The continued fraction sequence for T = pi is [3;7,15,1,292,…]. The very first rational approximation we get for pi is 22/7, which has three digits of accuracy after only one iteration. This is a very good approximation of pi, one you probably used in middle school, which is why the 7 spiral arms we see in Complex Paint are so persistent. You’ll notice that the next term of the sequence, a_2 = 15, is followed immediately by a_3 = 1, the lowest value we could possibly add. This suggests that the second rational approximation, 333/106, is very bad. Even though it gives us 5 digits of accuracy, we don’t even see 106 of anything in Complex Paint. Instead, the third rational approximation, 355/113, produces seven digits of accuracy with a next term of 292, meaning we “lose” very little accuracy by stopping our continued fraction there. The pattern we get in complex paint is 113 spokes.

Finally, this also gives us a way of saying that PHI, the golden ratio, is the most irrational number. Its continued fraction sequence is [1;1,1,1,1,1,…], the worst possible sequence we could get. This is why in Complex Paint we never see spokes, and why we can see multiple spiral patterns within the same value of R. None of the rational approximations we create are “good” approximations.

This fact about Phi is also why the Golden Ratio comes up so much in nature: sprouting leaves or seeds in rotations  around a central stem by a quantity of the golden ratio will guarantee that your seeds or leaves don’t line up. All leaves get some sun exposure, and you’ve maximized the quantity of seeds. See this Math is Fun page for a great explanation of this phenomenon, or Vi Hart’s series of videos on the topic starting here.

Over the break, please complete the back of the Complex Paint worksheet (noted “Linear Lab”). It’s a great way to reflect and summarize all the work we’ve done with complex linear functions.

Fractals & Chaos Recap for 12/19

We’ve been reflecting on the question of why the pattern of attraction for some values of R for the same value of T will produce spiral patterns and why others (specifically slower values of R closer to 1) will produce spokes. A clue was found in discussing T = 0.32, with the note that 0.32 is close to, but not quite equal to, 1/3. So every rotation of 0.32 is close to an exact 1/3 rotation. But since 0.32 < 1/3, every 3rd step is slightly short of a full revolution, so we wind up with a clockwise spiral pattern (T = 0.35 on the other hand would be slightly ahead of 1/3 with every three steps, so it creates a counterclockwise spiral pattern).

But why is it three specifically? 319/1000 is closer to 0.32 than 1/3 is. So is 6/19. Why don’t we see 1000 spiral arms, or 19? The answer to this has to do with a novel way of breaking down real numbers into a sort of skeletal structure: a continued fraction. Each step of a continued fraction produces rational approximations of a real number of progressively improved accuracy. It allows us to claim that some rational numbers are actually “more rational” than others and, even more surprisingly, some irrational numbers are “more irrational” than others. But most immediately, the denominators of these approximations correspond exactly to the numbers of spirals we see.

We confirmed this with r = 15/62 and r = 5/17. The continued fraction sequence for T = 15/62 is [0;4,7,2], producing a first rational approximation of 1/4 and then 7/29. The number 15/62 < 1/4, producing the four CW spirals we see in Complex Paint, and the number 15/62 > 7/29, producing the 29 CCW spirals. The sequence for r = 5/17 = [0;3,2,2], giving approximations of 1/3 (too big -> 3 CW spirals) and 2/7 (too small -> 7 spirals).

Your homework: create the continued fraction sequence (and if possible the corresponding set of rational approximations) for r = 7/38 and r = 71/360

Fractals & Chaos Recap for 12/18

Today, we finished the Complex Paint Worksheet we’ve been working off of. In the left column for Part 2, we saw unambiguous numbers of spokes corresponding to the denominator of the fraction we were using for T in our Polar-Linear Form. Today, with T = 0.32, we saw something else: three clockwise spiral arms. Weird. When we slowed down the attraction from R = .9 to R = .99, we saw 25 spokes, which makes sense given 0.32 = 32/100 = 8/25, but where do those 3 spiral arms come from?

We saw similar results for T = 15/62 and T = 5/17:

  • For T = 15/62, we saw 4 clockwise spiral arms, which turned into 29 counter-clockwise spirals, before we finally saw the 62 spokes we expect.
  • For T = 5/17, we saw 3 clockwise, then 7 counter-clockwise spiral arms before finding the 17 spokes

What’s also odd is that when we used T = π, an obviously irrational quantity, we saw what looked like 7 spokes at R = 0.9. Slower values of R clearly indicated these were spiral arms, but then we saw the attraction pattern line up again with 113 “spokes.” When we used T = φ (the golden ratio), we never saw spokes, as we would expect from another irrational quantity, though we were amused to notice that the numbers of spiral arms we observed exactly matched the Fibonacci sequence.

Where are these spirals coming from in our rational rotation values? And where are these “spokes” coming from in our irrational ones? The answer to this will lead us to a surprising conclusion: Irrationality is not a strict “either/or;” there is a continuity to irrationality where some numbers are more irrational than others. Moreover, what we saw today will form the basis for what I think is a bold claim: Phi, the golden ratio, is the most irrational number.

Stay tuned!

Fractals & Chaos Recap for 12/17

After observing yesterday that the type of fixed point we get depends more on A than on B, we focused our efforts on analyzing the behavior of iterations for different values of A. To do so, we also finally developed a Polar Form for a linear function. Instead of always converting A from polar to rectangular in order to enter it into Complex Paint, we can instead use the form A = Rcos(2πT) + i*Rsin(2πT), where T represents the fraction of a full turn we are attempting to rotate our iterated points by (e.g., if we want a 180° rotation, T = 1/2; if we want a 45° rotation, T = 1/8). This eliminates the need to consider degree vs. radian mode for measuring angles.

We worked on most of the second part of the Complex Paint Worksheet and made a few observations. First, the value of R determines whether the fixed point is attracting or repelling:

  • If R < 1, the fixed point is attracting
  • If R > 1, the fixed point is repelling
  • If R = 1, the fixed point is neutral

This wasn’t overly surprising, as it lines up with what we noticed before about the slope of linear functions as we iterated in the real numbers.

What’s new is that we have a more sophisticated idea of what counts as an “alternating” pattern. If T = 0 (so there is no rotation in our composition of transformations), we could call the pattern “direct.” But let T be anything else and we get either spokes or spirals. The denominator of T appears to govern how many spokes we get, but what else can we find?

Fractals & Chaos Recap for 12/16

Today we had the opportunity to play with our next Very Important Program: Complex Paint. This software was created by former F&C students Devon Loehr and Connor Simpson, and will be invaluable to us going forward. We’ll discuss all the features of the program as they become relevant, but after downloading/unzipping the folder listed in the Google Drive folder linked, read the README file for help on how to use the software. We started our analysis with the top half of a new worksheet, exploring and developing summary ideas of iterations of complex linear functions of the form Az+B.

One of the quickest things we noticed is that the value of A seems to be the major factor in the type of fixed point we get, while B only seems to affect where the fixed point is (this may not come as a significant surprise considering we made a similar observation about the slope and y-intercept of the linear functions we iterated in the real numbers). Furthermore, sometimes, the attracting pattern moved in a straight line (essentially the direct pattern we recall from the reals), and sometimes it looped around the fixed point (echoing the alternating pattern we saw before). But sometimes that alternating pattern produces clear “spokes” like with 4, 5, 6, and 8 from the sheet, and sometimes it produced more ambiguous spiral arms (like 7).

Understanding why this happens is what we’ll look at next.

Fractals & Chaos Recap for 12/12

After reviewing the rectangular/polar coordinate conversions we started yesterday, we revisited the original composition of transformations we looked at on Monday, noting that the Dilation x1/2, Rotation 45°, and Translation up 4 corresponds to an iteration of the function Az+B, where

  • A = [.5, 45°] = √(2)/4 + √(2)/4i
  • B = (0, 4) = 4i

Iterating this function allowed us to find that the coordinates of the attracting fixed point we identified earlier to be roughly positioned at (-2.605, 4.763) (or equivalent to the complex number -2.605+4.763i).

From there, we looked at a few problems from the back of the Complex Transformations Sheet, identifying again the specific geometric transformations that each complex linear function would produce and sketching the new location of a point that underwent that transformation. Your homework is to finish the back of that sheet

With the time we had left, we introduced a new piece of software: Complex Paint, a tool for more easily illustrating the transformations we have been identifying. We will work with this in more detail tomorrow.