Interactive multibody dynamics in Processing

Processing is a programming language / IDE built on top of Java that’s intended for simple and visual programming, making it a great tool for WYSIWYS (what you see is what you simulate, actually that is not a real term, I just made it up).

If you’re unsure what Processing is, you might want to check out either the examples on processing.org or the double-pendulum I’ve just built into it. It is a port of my code for Arduino with TFT, but with Processing, it’s cleaner and way nicer to play with!

screenshot_double_pendulum.png

You can find an interactive version of my program here on openprocessing.org. It also includes a general implementation of the Runge-Kutta algorithm for solving ODEs, in case this is needed (without giving any guarantee of correctness or code quality – use on your own risk).

Update 2018-02-11: I’ve just published an updated version that simulates three pendulums in parallel with different algorithms (explicit euler, symplectic euler and runge-kutta). You can find it here.

Advertisements