Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/topaz1008/double-pendulum
A chaotic double pendulum simulation in Javascript.
https://github.com/topaz1008/double-pendulum
Last synced: 3 months ago
JSON representation
A chaotic double pendulum simulation in Javascript.
- Host: GitHub
- URL: https://github.com/topaz1008/double-pendulum
- Owner: topaz1008
- License: mit
- Created: 2014-11-15T13:35:23.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2024-02-19T07:44:59.000Z (10 months ago)
- Last Synced: 2024-10-04T01:21:24.097Z (3 months ago)
- Language: JavaScript
- Homepage: https://topaz1008.github.io/double-pendulum/pendulum.html
- Size: 293 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Double pendulum simulation in Javascript.
=====================[Live Interactive Demo](https://topaz1008.github.io/double-pendulum/pendulum.html)
The demo shows how very small changes in initial conditions can make for a very different behaviour of the system in a very short time; thus making it a chaotic system.
The demo starts with 2 pendulums using the same initial conditions, one pendulum has one of its starting values changed by EPSILON (configurable) (default is 0.0001)
even with that small of a change the different pendulums will start to diverge after about 5-7 seconds.
[Solver test](https://topaz1008.github.io/double-pendulum/solver-test.html); A graph plotter with several equations; was used in developing `NDSolve` numerical differential equations solver.
More information about the math and equations of motion can be found on [Wikipedia](https://en.wikipedia.org/wiki/Double_pendulum) and [Wolfram science world](https://scienceworld.wolfram.com/physics/DoublePendulum.html).
## NDSolve classA simple numerical differential equations solver. the solver integrates in real time.
Supports the [Euler forward](https://en.wikipedia.org/wiki/Euler_method) method, and the classical [Runge-Kutta](https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods) method (RK4).
Euler's method is a very simple and fast method to numerically solve an ODE. The downside is that it is not very accurate and requires using a very small step size.
Runge-Kutta on the other hand is much more involved, but its very fast and very accurate.
## TODO
* ~~Allow switching graph types on-the-fly~~
* ~~Implement some basic UI components like buttons and/or drop-downs for selecting different graphs~~
* ~~Allow all values to be manipulated in real time and connect all ui elements.~~
* ~~Simplify and encapsulate dom event handling and value syncing and resetting.~~
* Consider re-write in Typescript.