Double Pendulum
This is a simulation of 2 bobs, connected by massless, perfectly rigid rods to a central pivot under the force of uniform gravity. In addition to being the motivating example for chaotic systems (in addition to the Lorenz system, its fluid mechanics counterpart), the double pendulum represents some interesting challenges.
Draw circle bounds
Draw cherry tracer
Draw connections
Pause
Simulation parameters:
Angle 1
Angle 2
Radial Velocity 1
Radial Velocity 2
Length 1
Length 2
Mass 1
Mass 2
Advanced options:
Gravity
Frames per second
Steps per frame
Simulation parameters:
Angle 1
Angle 2
Radial Velocity 1
Radial Velocity 2
Length 1
Length 2
Mass 1
Mass 2
Advanced options:
Gravity
Frames per second
Steps per frame
One challenge is that when end mass is much larger than central mass, the problem becomes stiff, and consequently the step-size must decrease quite a bit. Thus a RK8 numerical integrator called [Verner's Method](http://www.mymathlib.com/diffeq/runge-kutta/runge_kutta_verner.html) is used, which was manually ported from C to Javascript.
The system is modeled directly from the equations of motion, which were derived using Mathematica (via the Euler-Lagrange formula).