oneshotlm
Compare all models on this prompt →

Double pendulum · hy3-preview

Output generated Cost / run $0.0013 Runtime 45.8s

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-preview
vendorTencent · Hunyuan
harnesspi-agent
generated2026-07-22

METRICS

runtime45.8s
tokens in7.2k
tokens out4.4k
cached3.0k
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 create a chaotic double pendulum simulation with the correct physics equations of motion. This is a classic problem in chaotic dynamics - I'll implement the Lagrangian mechanics properly.

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

Successfully wrote 11304 bytes to /workspace/index.html

assistant

The double pendulum simulation is ready at `/workspace/index.html`. Here's what it includes: **Physics (correct Lagrangian mechanics):** - Proper equations of motion derived from the Lagrangian `L = T - V` - RK4 integration with 8 sub-steps per frame for accuracy (chaotic systems diverge quickly with Euler) - Energy conservation can be verified via the on-screen display **Visuals:** - Two arms with gradient-shaded bobs (pink for m₁, green for m₂) - Rainbow-colored fading trail of the tip — hue cycles along the trail length with fading opacity - Slight motion-blur background clear for a glowing effect **Interactivity:** - **Sliders** for `m₁`, `m₂`, `L₁`, `L₂`, and trail length (update live) - **Drag either bob** with the mouse to set a new initial position - **Reset** button to restart with default initial conditions - **Pause/Resume** button Open `index.html` in a browser to watch deterministic chaos unfold.