Daniel Staudigel

dstaudigel at gmail dot com

Projects : Double Pendulum


Source code: doublependulum

Hit R to reset motion of both pendulums.
Hit T to start/stop tracing.

This is a double pendulum, a differential equation solved in real time by the fourth-order runge-kutta method. Basically, this is a pendulum attached to the weight of another pendulum. It is a simple system that displays chaotic behavior, i.e. small changes in the start condition cause completely different results.

This is demonstrated by the duplicate pendulums. One pendulum (red border) is guided by the runga-kutta method. The other (white border) is guided by a spring-mass system. They are extremely close, but because of floating-point divergence, they completely separate.

To explain, the red pendulum is a mathematically perfect model of a completely rigid system. This does not necessarily mean it is a perfect model of the way pendulums work in the real world. The white pendulum is a simulation of a "springy" system, i.e. the lines stretch a little bit. To make it similar to the static system, the springs have been made extremely stiff. This results in an extremely similar motion. However, since they are both being calculated by different means, mathematical floating point divergence (inaccuracies in the math) happen differently. In the upper-right corner, there are two numbers. One is the spring constant (how stiff the springs is) and the other is how far apart the two pendulums are. Once the two systems are slightly off, since they're chaotic, they will never be together again.

Built with Processing

Back