oneshotlm
Compare all models on this prompt →

Double pendulum · granite-4.1-8b

Output generated Cost / run $0.0004 Runtime 12.0s

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

modelgranite-4.1-8b
vendorIBM · Granite
harnesspi-agent
generated2026-08-01

METRICS

runtime12.0s
tokens in4.6k
tokens out1.3k
cached3.2k
cost / run$0.0004
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 (3037 bytes)
toolResult

Successfully wrote 3037 bytes to index.html

assistant

The single‑page web app `index.html` has been created in the current directory (`/tmp/ws`). It includes: - **CSS** inside a `<style>` tag for minimal styling. - **JavaScript** inside a `<script>` tag that: - Implements the correct coupled equations of motion for a chaotic double pendulum. - Uses a small time step (`dt = 0.01`) and forward‑Euler integration. - Draws the two arms on a `<canvas>` and renders a colorful, fading trail of the tip’s path. - Updates continuously with `requestAnimationFrame`. You can open `index.html` in any modern browser to see the chaotic motion. No external resources are required; the entire simulation runs sandboxed.