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:
- Heat dissipation
- Double pendulum (try it here)
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:
After a few seconds it already becomes pretty interesting:
And after a while it looks pretty crazy:
There are more pictures in the picture folder, but why dont you just go ahead and play with it yourself?
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.