This repo now includes a small, reproducible Python package pendulums (single + double pendulum) with:
- SciPy integration (
solve_ivp, energy drift monitoring) - OpenCV rendering to MP4/WebM/AVI
- optional GIF output via
imageio+pillow
Demo output:
Install dependencies:
uv syncOptional GIF dependencies:
uv sync --extra gifRun double pendulum (MP4):
uv run pendulums --model double --preset chaotic --duration 10 --fps 60 --size 1080 --out out.mp4Run single pendulum:
uv run pendulums --model single --preset calm --duration 10 --fps 60 --size 1080 --out single.mp4GIF (requires --extra gif):
uv run pendulums --model double --preset chaotic --duration 8 --fps 60 --size 720 --out out.gif- If
.webmexport fails, your OpenCV build may lack the needed codec;.mp4is the default recommendation. - Legacy demo files were moved into
legacy/(old matplotlib-based renderer and RK4).
