oneshotlm
Compare all models on this prompt →

Double pendulum · hy3

Output generated Cost / run $0.0013 Runtime 43.7s

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

modelhy3
vendorTencent · Hunyuan
harnesspi-agent
generated2026-07-22

METRICS

runtime43.7s
tokens in7.0k
tokens out4.3k
cached2.1k
cost / run$0.0013
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

I'll build a chaotic double pendulum simulation with physics-based equations of motion, colorful visualization, and a fading trail. Let me create this as a self-contained HTML file.

→ write /workspace/index.html (10989 bytes)
toolResult

Successfully wrote 10989 bytes to /workspace/index.html

assistant

The chaotic double pendulum simulation is ready at `/workspace/index.html`. Here's what it includes: **Physics (correct equations of motion):** - Full Lagrangian-derived ODEs for a double pendulum with distinct masses and lengths - 4th-order Runge-Kutta (RK4) integration for numerical stability - 4 sub-steps per frame to keep the simulation from exploding **Visualization:** - Two rods with gradient-shaded bobs (grey/white for bob 1, orange for bob 2) - **Colorful fading trail** of the tip — colors shift from deep pink → orange → cyan along the trail, with alpha and linewidth ramping up for the newest points - Motion blur effect via semi-transparent background clears (`rgba(10,10,10,0.15)`) - An energy bar at the bottom to visualize conservation (kinetic + potential) **Interactivity:** - **Restart** — randomizes the tiny initial perturbation (the source of chaos) - **Pause/Play** - **Clear Trail** - **Speed slider** (0.2x–3x) - **Gravity slider** (1–20) Open `index.html` in any browser to watch the chaos unfold.