Verner 7 Integrator (#1)

Co-authored-by: Connor Johnstone <connor.johnstone@arcfield.com>
Reviewed-on: #1
This commit is contained in:
2025-10-24 14:07:56 -04:00
parent e1e6f8b4bb
commit 0ca488b7da
10 changed files with 1561 additions and 119 deletions

View File

@@ -6,22 +6,34 @@ and field line tracing:
## Features
- A relatively efficient Dormand Prince 5th(4th) order integration algorithm, which is effective for
non-stiff problems
- A PI-controller for adaptive time stepping
- The ability to define "callback events" and stop or change the integator or underlying ODE if
certain conditions are met (zero crossings)
- A fourth order interpolator for the Domand Prince algorithm
- Parameters in the derivative and callback functions
### Explicit Runge-Kutta Methods (Non-Stiff Problems)
| Method | Order | Stages | Dense Output | Best Use Case |
|--------|-------|--------|--------------|---------------|
| **BS3** (Bogacki-Shampine) | 3(2) | 4 | 3rd order | Moderate accuracy (rtol ~ 1e-4 to 1e-6) |
| **DormandPrince45** | 5(4) | 7 | 4th order | General purpose (rtol ~ 1e-6 to 1e-8) |
| **Vern7** (Verner) | 7(6) | 10+6 | 7th order | High accuracy (rtol ~ 1e-8 to 1e-12) |
**Performance at 1e-10 tolerance:**
- Vern7: **2.7-8.8x faster** than DP5
- Vern7: **50x+ faster** than BS3
See [benchmark report](VERN7_BENCHMARK_REPORT.md) for detailed performance analysis.
### Other Features
- **Adaptive time stepping** with PI controller
- **Callback events** with zero-crossing detection
- **Dense output interpolation** at any time point
- **Parameters** in derivative and callback functions
- **Lazy computation** of extra interpolation stages (Vern7)
### Future Improvements
- More algorithms
- Rosenbrock
- Verner
- Tsit(5)
- Runge Kutta Cash Karp
- Rosenbrock methods (for stiff problems)
- Tsit5
- Runge-Kutta Cash-Karp
- Composite Algorithms
- Automatic Stiffness Detection
- Fixed Time Steps