Double Pendulum
31 Dec 2019
A double pendulum is a pendulum with another pendulum attached to its end, and is a simple physical system that exhibits rich dynamic behavior with a strong sensitivity to initial conditions. The motion of a double pendulum is governed by a set of differential equations and is chaotic.
Sorry, your browser does not support Canvas.
VariableValue RangeValue
Gravity 1 - 20
Damping 0.900 - 1.000
Trace

Look I am going to be honest here. I don't really understand the mathematics behind the equations. So I'll just link you to the original site I took the equations from. https://www.myphysicslab.com/pendulum/double-pendulum-en.html. The equations that make this work are
θ1'' =   g (2 m1 + m2) sin θ1m2 g sin(θ1 − 2 θ2) − 2 sin(θ1θ2) m2 (θ2'2 L2 + θ1'2 L1 cos(θ1θ2))
L1 (2 m1 + m2m2 cos(2 θ1 − 2 θ2))
θ2'' =   2 sin(θ1θ2) (θ1'2 L1 (m1 + m2) + g(m1 + m2) cos θ1 + θ2'2 L2 m2 cos(θ1θ2))
L2 (2 m1 + m2m2 cos(2 θ1 − 2 θ2))
where
θ1'' read as theta-prime-prime is the acceleration on the first pendulum. (Angular acceleration to be precise)
θ2'' is the acceleration on the second pendulum.
g is the accleration of gravity
m1 is the mass of the first(upper) pendulum
m2 is the mass of the second(lower) pendulum
θ1 is the angle of the first pendulum
θ2 is the angle of the second pendulum
θ1' read as theta-prime is the velocity of the first pendulum
θ2' is the velocity of the second pendulum
Once we know the values of the variables above, its pretty to substitute them.

Javascript Demos

Here's a bunch of javascript... things I wrote over the years whenever time permitted.