Live data from Hacker News

Double Pendulum in fewer than 100 lines of JavaScript

physicsandbox.com

1–10 of 55 posts

Re: Double Pendulum in fewer than 100 lines of JavaScript

#5
post #2

I remember when I first learned about the Lagrangian, and my mind was blown that really complicated problems could be wrangled so easily. Thanks for sharing this :)

Me too. Lagrangian mechanics are almost the only thing about my physics undergrad where I still recall thinking "wow this is awesome!"

Re: Double Pendulum in fewer than 100 lines of JavaScript

#8
post #7

Ain't that a chaotic system which is not deterministic?

Chaotic systems are deterministic (as shown by a deterministic computer algorithm simulating one). They just aren't predictable except by simulating them (which constrains us by time and accuracy).

Re: Double Pendulum in fewer than 100 lines of JavaScript

#9
post #4

Would be even better, IMO, with a line in the simulation showing the path traced by each pendulum over time, preferably the arcs drawn could phase through different colours (and possibly decay in visibility). Nice work though.

I did basically this in my first year of college! See [1].

(Note: code was never intended to be visible to the public, and this is old and bad. But hey, it works!)

http://kevingibbons.org/doublependulum.html

Post reply on HN