Re:Double Pendulum in fewer than 100 lines of JavaScript
by cyphar on Thursday July 10, 2014 @04:12AM
(#8014117)
... that pendulum doesn't mirror reality at all. It's as though the first mass is constantly being accelerated by something other than gravity.
Re:Double Pendulum in fewer than 100 lines of JavaScript
by flannelhead on Thursday July 10, 2014 @05:40AM
(#8014361)
First mass counting from which end? The masses are accelerated by each other as there are rigid rods between them.
The lack of friction and the perfectly rigid coupling between the joints might be what makes it seem lacking reality. If we'd extend the chain with more links, the motion of the outermost mass would become more and more unpredictable due to extreme acceleration.
Of course I might have made a mistake somewhere, but I checked that energy is conserved between the frames of the animation (excluding minor energy drift due to the numerical integration).
My dynamics course teacher actually showed that the double pendulum can be linearized by some approximations (throwing out some negligible terms, small angle approximations etc.), and that way two modes of oscillation could be found: antisymmetric and symmetric oscillation. Just try with small initial angles with OP's script and you'll see.