11 ms·
Awesome stuff! A few months back I found a double pendulum simulation in less than 100 lines of JavaScript. It was a ton of fun to play around with the code. C
by rivaldo 9y ago
Awesome stuff!
A few months back I found a double pendulum simulation in less than 100 lines of JavaScript. It was a ton of fun to play around with the code.
Code and explanation:
http://www.physicsandbox.com/projects/double-pendulum.html http://www.physicsandbox.com/projects/double-pendulum.html
Demo:
http://www.physicsandbox.com/projects/double-pendulum-sim.html http://www.physicsandbox.com/projects/double-pendulum-sim.ht...
- evanb 9y agoFor an accurate double pendulum you almost certainly need a symplectic integrator---not just Euler's method---or risk numerical instabilities that come from nonconservation of energy.
- effie 9y agoAn integrator that is symplectic or conserves energy isn't necessarily accurate, especially if the dynamical system is chaotic. Can you recommend particular algorithm that is accurate for pendulum or double pendulum?
- xchip 9y agoHere is a n-pendulum, solved both iteratively (one constraint at a time) and simultaneously (all the chain at once) http://htmlpreview.github.io/?https://github.com/aguaviva/Physics/blob/master/ChainSimulation.html http://htmlpreview.github.io/?https://github.com/aguaviva/Ph...