oneshotlm
Compare all models on this prompt →

Double pendulum · claude-opus-5

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 · 8 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
I'm building a single-file double pendulum simulator with RK4 numerical integration, adding a trail system that uses HSL colors to fade older points. I'll include interactive controls for play/pause and reset, adjustable parameters like pendulum lengths, masses, gravity and damping via sliders, plus options for trail length and maybe a ghost pendulum for comparison.
write /tmp/ws/index.html (12242 bytes)
toolResult

Successfully wrote 12242 bytes to /tmp/ws/index.html

assistant
thinking
I need to clean up a stray CSS class with extraneous text, and make sure the system initialization properly toggles when main.y is present.
edit {"path":"/tmp/ws/index.html","edits":[{"oldText":" .eq{font:11px/1.6 ui-monospace,monospace; color:#6f7characters}\n","newText":""}]}
toolResult

Successfully replaced 1 block(s) in /tmp/ws/index.html.

assistant
thinking
The Ghost initSystems function reads main.y after reinit, which works fine since it's passed as arguments and evaluated first. The onchange handler for ghosts also reads main.y before reinit, so that's consistent. Trails stay cleared throughout, which is good. Let me do a quick syntax check with Node to make sure everything's solid.
bash {"command":"cd /tmp/ws && node -e \"const s=require('fs').readFileSync('index.html','utf8');const m=s.match(/<script>([\\s\\S]*)<\\/script>/
toolResult

js ok

assistant

Done — `/tmp/ws/index.html` - **Physics**: exact double-pendulum equations of motion (point masses, Lagrangian form) integrated with RK4 at a fixed 1/1200 s step, plus optional viscous damping. Live readout of θ, ω and total energy (a good check: E stays ~constant with damping 0). - **Visuals**: additive-blended fading trail of the tip whose hue cycles along its length, glow, motion-blur wash, mass-scaled bobs. - **Chaos demo**: 5 ghost twins offset by 1e-5 rad show exponential divergence (Δθ₂ shown in HUD). - **Controls**: lengths, masses, gravity, damping, speed, trail length; pause (Space), reset, clear; drag either bob to set initial conditions.

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

modelclaude-opus-5
vendorAnthropic · Claude
harnesspi-agent
generated2026-08-03

EVALUATION

4/5 working

Double pendulum chaos simulator with glowing trails, ghost twins, and draggable bobs; click/drag/space work, arrows don't affect physics.

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 motion4.7%
on click10.6%
on drag4.6%
on wheel2.6%
on enter + space3.0%
on arrow keys0.0%
frame spread53 / 255
console errors0
js errors none

METRICS

runtime81.6s
tokens in30k
tokens out7.6k
cached23k
cost / run$0.2465