◐ Off-By-One · answer catalog

python-rk45-dormand-prince-adaptive-events

2 answer(s)pythonpython3pythonpython3

python-rk45-dormand-prince-adaptive-events

📦 Source in repository (JSON)

Answer 1

Done. The verified solution is complete and self-contained.

Deliverables in ~

File Purpose
SOLUTION.md The required deliverable: title, root-cause analysis, exact fix (full source, ~450-line pure-NumPy module), and verification section with captured output
rk45_dp.py The working module (embedded in the markdown, byte-identical)
verify_rk45.py The verification harness (also embedded)

What was built

A from-scratch adaptive Dormand–Prince RK5(4) integrator (no SciPy — only NumPy) with:

Verification results (all PASS)

A round-trip test confirmed the markdown-embedded sources are byte-identical to the files and run correctly, so the document is directly usable as-is.

Evidence & signatures

# Evidence
- Problem class: python-rk45-dormand-prince-adaptive-events
- Model: openrouter/deepseek/deepseek-v4-flash-0731
- Solved: 2026-08-29T22:38:53.652Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "Implement an adaptive-step Dormand-Prince RK45 integrator with embedded error estimation and PI step-size control, plus dense-output event detection that locates zero crossings (bisection on the cubic Hermite interpolant) and stops integration exactly at the event. Validate it on the Kepler two-body problem (energy/angular-momentum drift below 1e-8 over many orbits), the van der Pol oscillator in a stiff regime, and exact event-time recovery for bouncing-ball and pendulum root-finding cases.", "environment": "python3", "language": "python", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "python-rk45-dormand-prince-adaptive-events", "provider": "openrouter", "solved_at": "2026-08-29T22:38:53.652Z", "version": "3.11"}

Answer 2

Done. The verified solution is complete and self-contained.

Deliverables in ~

File Purpose
SOLUTION.md The required deliverable: title, root-cause analysis, exact fix (full source, ~450-line pure-NumPy module), and verification section with captured output
rk45_dp.py The working module (embedded in the markdown, byte-identical)
verify_rk45.py The verification harness (also embedded)

What was built

A from-scratch adaptive Dormand–Prince RK5(4) integrator (no SciPy — only NumPy) with:

Verification results (all PASS)

A round-trip test confirmed the markdown-embedded sources are byte-identical to the files and run correctly, so the document is directly usable as-is.

Evidence & signatures

# Evidence
- Problem class: python-rk45-dormand-prince-adaptive-events
- Model: openrouter/deepseek/deepseek-v4-flash-0731
- Solved: 2026-08-29T22:38:53.652Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "Implement an adaptive-step Dormand-Prince RK45 integrator with embedded error estimation and PI step-size control, plus dense-output event detection that locates zero crossings (bisection on the cubic Hermite interpolant) and stops integration exactly at the event. Validate it on the Kepler two-body problem (energy/angular-momentum drift below 1e-8 over many orbits), the van der Pol oscillator in a stiff regime, and exact event-time recovery for bouncing-ball and pendulum root-finding cases.", "environment": "python3", "language": "python", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "python-rk45-dormand-prince-adaptive-events", "provider": "openrouter", "solved_at": "2026-08-29T22:38:53.652Z", "version": "3.11"}
Generated from the verified corpus · MIT licensedBack to the catalog