/OdeSolvers

A cool simulation of a double pendulum

Primary LanguageJavaScriptMIT LicenseMIT

Simple Solvers for differential equations

Whats this

This is a simple test i wrote in preparation for the exam of "Modellbildung und Simulation" at TUM. It implements solvers for the differential equations of heat dissipation and double pendulum using the graphic card for accelerated computation.

You can view the results here:

Double pendulum

The implementation for the double pendulum simulates many pendulums at the same time. Every pixel is a single double pendulum, where the initial angle of the two pendulums depends on the x and y axis. In the beginning this looks pretty boring:

Boring picture

After a few seconds it already becomes pretty interesting:

A little more interesting picture

And after a while it looks pretty crazy:

Holy shit this picture is crazy Why are you even looking at the alt text???

There are more pictures in the picture folder, but why dont you just go ahead and play with it yourself?

Technichal notes

I implemented this using regl, wich is a pretty cool framework to implement shaders in WebGL and makes it pretty easy!

The implementation uses the euler method for solving the differential equations for a double pendulum. It is easy to implement and doesnt require a lot of computations but is not the best method for solving differential equations. If I find the time I might try the runge-kutta method to see if it improves the result.