SARATH THARAYILST
WRITEUPSCONCEPTSPROJECTSLABABOUT
SARATH THARAYIL
മ
IGARATIPO: AMAZON TRIBUTARIES
/ SYSTEM

Building thoughtful software, writing notes, and shipping experiments across data, AI, and the web.

No cookies, no tracking. Preferences are stored locally in your browser. Anonymous view counts are kept server-side.

Hey, there's a story for the river above/© 2026 Sarath Tharayil/IST --:--:--
← LAB

Double Pendulum

Jun 6, 2026

A pendulum attached to the end of another pendulum. The equations of motion are exact — no approximations. The system is fully deterministic. Yet infinitesimally different starting angles produce completely different trajectories within seconds. Chaos mode makes this visible: six pendulums start nearly identical and rapidly diverge.

L11.00
L21.00
M11.00
M21.00

CHAOS mode: 6 pendulums offset by 0.0002 rad. Watch them diverge. Trail = last 600 positions of bob 2.

/ NOTES
HOW IT WORKS

The Lagrangian equations of motion are derived from the full kinetic and potential energy of both bobs. Integration uses 4th-order Runge-Kutta with a small time step. The bob 2 trail is stored as a circular buffer of recent positions and drawn with fading opacity.

CONTROLS
L1 / L2Length of pendulum arms. Longer arms swing slower.
M1 / M2Mass of the bobs. Higher M1 stabilises the first arm.
Chaos ModeSpawns 6 pendulums with angles offset by 0.0001 rad each. Watch them diverge.
RandomiseSets new random starting angles between −π and π.
WHAT TO TRY

Enable Chaos mode, wait 20 seconds, and watch identical starting conditions produce completely different trails. Set M2 very high to see the second arm drive the first. Start with both arms pointing straight up for the most chaotic behaviour.