Interactive Double Pendulum Playground
Posted3 months agoActive3 months ago
theabbie.github.ioResearchstory
skepticalmixed
Debate
60/100
Physics SimulationDouble PendulumInteractive Visualization
Key topics
Physics Simulation
Double Pendulum
Interactive Visualization
The Interactive Double Pendulum Playground is a web-based simulation that has sparked discussion about its physical accuracy and potential improvements, with some users praising its interactivity and others criticizing its realism.
Snapshot generated from the HN discussion
Discussion Activity
Moderate engagementFirst comment
2h
Peak period
8
0-6h
Avg / period
3.1
Comment distribution22 data points
Loading chart...
Based on 22 loaded comments
Key moments
- 01Story posted
Oct 8, 2025 at 1:18 AM EDT
3 months ago
Step 01 - 02First comment
Oct 8, 2025 at 2:56 AM EDT
2h after posting
Step 02 - 03Peak activity
8 comments in 0-6h
Hottest window of the conversation
Step 03 - 04Latest activity
Oct 11, 2025 at 7:44 AM EDT
3 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
ID: 45512342Type: storyLast synced: 11/20/2025, 12:38:35 PM
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
A vibe-coded double pendulum sim should produce a much better result than the physics on this page. Claude Code made this just now off one prompt, the physics are much better: https://keir.is/swinging
So, what else might be wrong I wondered. Well, it seems to move in the wrong direction... so I checked how the pendulum is displayed. And sure enough, I think there's a sign error:
Note how the upper bob uses ang0 while the lower one has -ang1. Meanwhile the physics derivation assumes both angles are against the vertical, so have same sign.Changing -ang1 to ang1 does indeed make the pendulum move in a natural way, except now dragging it is flipped. Ie you drag it left and it moves right. Another sign error in setLowerBobPos. Fixing that as well it now works as I'd expect.
[1]: https://dassencio.org/46
[2]: https://lpsa.swarthmore.edu/NumInt/NumIntFourth.html##sectio...
https://news.ycombinator.com/item?id=26998308
But no, PR was merged in short order. Lesson learned.
https://github.com/theabbie/DoublePendulum?tab=readme-ov-fil...
If you want to see what a real physically sensible double pendulum sim looks like:
https://www.myphysicslab.com/pendulum/double-pendulum-en.htm...
EDIT: I just noticed someone found an error and apparently it's fixed now.
Not sure if this got a second lease on life from the mods after clearing the old comments and resetting the submission date to today, or how did it make the front page again.
[0] https://news.ycombinator.com/from?site=theabbie.github.io
If not, describe what feels off, as it feels fine to my untrained eyes after the sign fix.
When the angle at the joint is 180° the Energy and Angular momentum determines v_1 and v_2, the velocities of the masses. It is known that Energy and Angular momentum both conserve.
Therefore the system will play out the same after states when the inner joint is 180°, and all the parameters will be periodical between 2 such states.
You can observe this in the demonstration in TFA: set gravity to 0, and observe how the graph rotates, especially the furthest points from the origin (where the angle at the joint is 180°).
edit: there are probably 2 different solutions for when the joint angle is 180°? I've found a graph where one furthest place from the origin is really pointy, and then the other is rather round.
[1] https://en.wikipedia.org/wiki/Harmonograph
(I contributed to this Wikipedia article over two decades ago!)
For the demonstration, I'd have it under a blanket in the front of the room when students came in. I'd turn the lights out, only turn the outer LED on, and set it in motion. Then I'd cover it up, turn the lights on, and ask students to sketch what they thought was under the blanket. Then I'd turn the lights out again, turn both LEDs on, and set it in motion again.
Most people were able to sketch something pretty close to a double pendulum after that second demonstration. I also set up a camera and did some time lapses, and got pictures that look just like this online demo.
Super fun project, and students loved it! :)