oneshotlm
Compare all models on this prompt →

Double pendulum · qwen3.6-flash

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 ↗
transcript · 6 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
thinking
The user wants a single-page web app that simulates a double pendulum with:
1. Correct physics equations of motion
2. Canvas rendering
3. Two arms drawn
4. A colorful fading trail of the tip
5. All in one index.html file
6. No external dependencies

Let me write the double pendulum simulation using the Lagrangian-derived equations of motion:

θ₁'' = (-g(2m₁+m₂)sin(θ₁) - m₂g sin(θ₁-2θ₂) - 2sin(θ₁-θ₂)m₂(θ₂'²L₂ + θ₁'²L₁cos(θ₁-θ₂))) / (L₁(2m₁+m₂-m₂cos(2θ₁-2θ₂)))

θ₂'' = (2sin(θ₁-θ₂)(θ₁'²L₁(m₁+m₂) + g(m₁+m₂)cos(θ₁) + θ₂'²L₂m₂cos(θ₁-θ₂))) / (L₂(2m₁+m₂-m₂cos(2θ₁-2θ₂)))

I'll use RK4 integration for accuracy. The trail will use HSL color cycling and fade out over time.
write /index.html (7272 bytes)
toolResult

EROFS: read-only file system, open '/index.html'

assistant
thinking
The current working directory is /workspace, so I need to write to /workspace/index.html instead of /index.html.
write /workspace/index.html (7271 bytes)
toolResult

Successfully wrote 7271 bytes to /workspace/index.html

assistant
thinking
The user wants me to verify the file exists and maybe provide a brief summary of what was built.

Done! Here's what I built in `/workspace/index.html`: **Double pendulum simulation** with: - **Exact Lagrangian equations of motion** — the classic coupled ODEs for two masses on two rigid rods - **RK4 integration** (4th-order Runge-Kutta) with 4 sub-steps per frame for numerical stability - **Colorful fading trail** of the tip (end bob) — hue shifts over time (HSL rainbow), with opacity fading from bright to ghostly - **Drawn pendulum arms & bobs** with connecting lines - **Motion blur effect** — the canvas background is re-drawn semi-transparently each frame, causing previous positions to naturally fade **Controls:** | Control | Effect | |---|---| | **Reset** | Back to rest initial condition | | **Pause / Resume** | Toggle simulation | | **Trail slider** | Trail length: 200–5000 points | | **Speed slider** | Simulation time scale: 1×–20× | | **g slider** | Gravity: 1–30 m/s² | No external resources — fully self-contained, runs sandboxed in any browser.

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

modelqwen3.6-flash
vendorQwen
harnesspi-agent
generated2026-07-08

EVALUATION

4/5 working

Chaotic double pendulum with colorful fading trails animates continuously, filling into a dense radial pattern over time.

Vision grade · anthropic/claude-sonnet-5

MEASUREMENTS

Raw readings from the capture, not a verdict — the grade above is the only judgement. Percentages are how much of the screen changed; the measure under-reports sparse motion on a dark background.

idle motion2.8%
on click8.6%
on drag9.0%
on wheel9.3%
on enter + space10.6%
on arrow keys10.4%
on w/a/s/d8.6%
frame spread40.6 / 255
console errors0
js errors none

METRICS

runtime43.1s
tokens in13k
tokens out6.1k
cached0
cost / run$0.0094