Code Sketches

Click the titles to go to each of the sketches

String art

Put a bunch of nails labeled 1 thru N in a circle, and stretch strings between each peg $i$ and its double $2i$. the density of strings is highest wherever the strings cross, which happens on a cardoid curve. Use really tiny strings, and we can see the pure cardiod, like in the left picture below. These high-density curves are called caustics. This sketch explores how the caustics look with different maps, or deformed boundaries like the picture in the right.

More mathematically, every map from the circle to itself gives a piece of string art. What do the caustics in that art tell us about the dynamics of the map? For example, the left picture below shows the caustics of a (doubled) mobius transform, while the right shows a family of perlin noise maps.

Dynamics of random maps

An illustration of dynamics of a random map from the plane to itself. It plots the trajectories of a few random points, showing where and how they accumulate. The map is periodically modulating perlin noise. As the map changes, you can see all sorts of bifurcations and dynamic effects. Here are some more examples, and a little more context


Just some fun blobs. I suggest looking thru the presets.

Gif of blobs

Toric geometry and harmonic oscillators

I explained the mathematical context pretty extensivly in this post, which also holds several other sketches. For the cliff notes, try my thread on twitter. Some outputs:

KAM Tori

A failed attempt to find some KAM tori. When a system has lots of conserved quantities, its dynamics becomes very regular. The level sets of the conserved quantities are tori, and everything circles around the tori at a constant rate. Perturbing the system breaks these symmetries, so we lose our pretty tori. KAM theorem tells us how: A torus with a rational ratio of frequencies collapses into several smaller tori with regular dynamics, interspersed with areas of hyperbolic dynamics. This process repeats and repeats, forming a fractal of tori surrounded by chaos. The picture below shows a cross-section of some KAM tori, taken from Abraham-Marsden Foundation of Mechanics:


Incidentally, the tori with sufficiently irrational frequency ratios remain, separating the chaotic regions.

This sketch is my attempt to see the invariant torus decomposition in the flesh. I start with the simplest integrable system, rotation by a radius-dependent angle, and perturb it. Unfortunately, I couldn’t see much recognizable in the orbits of this system. But, at some point I goofed up and forgot to update the rotation angle for each point, so every point was running under its own dynamical system. This made some pretty mesmerizing dances when perturbed, as each particle spirals in or blossoms out.