oneshotlm
Compare all models on this prompt →

Double pendulum · glm-5.3

Output generated Cost / run $0.0114 Runtime 24.3s

Prompt for this run

Simulate a chaotic double pendulum on a canvas using the correct equations of motion, drawing the arms and a colorful fading trail of the tip.

⛨ sandboxed Open in new tab ↗

TAKE IT TO CODE

A single self-contained HTML file — copy it and open in any browser, or reuse the prompt with your own pi-agent run.

RUN

modelglm-5.3
vendorZ.ai · GLM
harnesspi-agent
generated2026-08-27

METRICS

runtime24.3s
tokens in4.6k
tokens out1.8k
cached2.8k
cost / run$0.0114
Transcript · 4 messages
user

Simulate a chaotic double pendulum on a canvas using the correct equations of motion, drawing the arms and a colorful fading trail of the tip.

assistant
→ write index.html (4414 bytes)
toolResult

Successfully wrote 4414 bytes to index.html

assistant

Done — `index.html` contains the complete simulation: - **Physics**: exact double-pendulum equations of motion (standard point-mass Lagrangian form) integrated with 4th-order Runge–Kutta at 240 Hz substeps, so energy stays near-conserved (displayed in the HUD). - **Rendering**: canvas arms with two bobs, plus a ~900-point fading trail of the tip drawn with a cycling rainbow hue, thickness and alpha growing toward the newest point, over a slow-fading background. - **Interaction**: click anywhere to kick the tip toward the cursor, press `r` to reset with new random initial angles, resizes with the window.