Chaos Theory: simulating the motion of a double pendulum system

Lees in het Nederlands 🇳🇱

The study of non-linear dynamical systems, such as human societies, fluid flow, heartbeat irregularities, predictive robotics, epidemiology, biology, weather systems, and climate systems, focuses on apparently(!) random states of disorder. This branch of mathematics is more commonly known as chaos theory.

However, unlike the everyday use of the words chaos and disorder does the mathematical definition not entail randomness; chaotic systems are not unpredictable the way quantum systems are fundamentally unpredictable. Unlike in quantum mechanics, with chaotic systems the underlying mechanism is still entirely deterministic. Contrary to popular belief, the systems mentioned above are all entirely classical in nature, i.e. obeying deterministic laws of nature.

And so, while proven to be computationally difficult to varying degrees in the 1880s, chaos theory has since yielded remarkable tools to analyse and simulate seemingly-random disorder, in no small part owing to the steep rise of computational science, especially surging since the 1960s.

Double pendulum

One of the simplest non-linear dynamical systems is the double pendulum. In this simulation you will not see just one but two systems: i.e. two swinging double pendulums.

The black double pendulum starts at slightly different initial values (i.e. starting angles) than does the blue double pendulum. These differences are purposely invisible to the naked eye. This is why you only see the black set of pendulums down below: the blue set of pendulums is there, but it's hidden behind it. The blue pendulums are starting at only a very slightly different place, simply unnoticeable to our eyes. Have a look at the initial values below.

Starting angles black and blue double pendulum

Upper pendulum:

1.600000000000 rad
1.600000000001 rad
or
91.67324722093°
91.67324722099°

Lower pendulum:

0.800000000000 rad
0.800000000001 rad
or
45.83662361047°
45.83662361052°

Even with this tiny difference of 0.000000000001 radians, you will see two very different simulation outcomes, i.e. predictions, of the states of the black versus the blue system. Non-linear dynamical systems don't need much to behave in a dramatically different way. Compared to the size of the system, the smallest nudge is capable of derailing the whole thing. Give it at least thirty seconds and you'll see what we mean. After a couple of minutes, both systems seem to have converged to a stable (periodic) state.

Note that no energy is added to the system. Both pendulums start with a fixed amount of (potential) energy and that's it. No energy is dissipated. No energy is created. The law of conservation of energy applies.

This simulation was written in the programming language JavaScript. All of the real-time calculations are taking place through the central processing unit of your mobile device, tablet or computer until your battery dies out if necessary :). Imagine what enormous chaotic systems one might be able to predict on a few interlinked supercomputers crunching the numbers for days on end. Enjoy the simulation.

This is just a side project for the author to teach himself some JavaScript programming. Do have a look at our main website for some more maths and physics.

(C) 2020 KJ Runia

Back