I drew a double pendulum today, using some math pointed out by the Coding Train "Coding Challenge #93: Double Pendulum" video: https://www.youtube.com/watch?v=uWzPe_S-RVE
I recall at some point when I was in high school, knowing a little bit about the Mandelbrot Set and a little bit about chaos, thinking that a double pendulum graph would be cool to explore.
It's kind of cool to see how the red bob ("bob 1") is jerked around by the blue bob ("bob 2"), yielding non periodic motion, but it's surprising to me to see how smooth bob 2's motion looks; the path looks like a sine wave to my eye. It's probably a little sharper, but hard to tell.
Interesting direction to go with this: instead of just a single plot of x versus time, what if we had multiple configurations in parallel, and compress the pendulum x value into a color? So, maybe time would extend to the right in the image, and the image x would represent some continuously varying set of initial conditions.
Tools Used: drawSVG Python Library
Languages Used: Python
Development Time: ~1 hours
Drawing Time: ~2 minutes
What's Generative Here: the mass and length m1 and L1 are chosen to be 1.0 each, but the mass and length m2 and L2 are chosen randomly. Similarly the initial pose of the double pendulum is randomly generated.
No comments:
Post a Comment