Double pendulum · mistral-medium-3.1
Output generated Cost / run $0.0085 Runtime 30.5s
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.
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
METRICS
Transcript · 4 messages
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.
index.html (12588 bytes)Successfully wrote 12588 bytes to index.html
Created a self-contained `index.html` file that simulates a chaotic double pendulum with: 1. **Physics**: Correct equations of motion using Runge-Kutta 4th order integration for accuracy 2. **Visualization**: - Two arms with different colors (green and blue) - Two bobs at the joints - A colorful fading trail that shows the chaotic path - Semi-transparent canvas clearing for smooth trail fading 3. **Controls**: - Start/Pause/Reset buttons - Toggle for the trail visibility - Real-time display of angles and system energy 4. **Styling**: Clean dark theme with responsive layout The simulation runs entirely client-side with no external dependencies. Open the file in any modern browser to see the chaotic behavior. The trail uses a rainbow color gradient that fades over time.