Ordinary Differential Equations Library - Development Roadmap
This roadmap outlines the planned features for developing a comprehensive Rust-based ODE solver library, inspired by Julia's OrdinaryDiffEq.jl but adapted for Rust's strengths and idioms.
Current Foundation
The library currently has:
- ✅ Dormand-Prince 4(5) adaptive explicit RK method with dense output
- ✅ Tsit5 explicit RK method with dense output
- ✅ PI step size controller
- ✅ Basic continuous callbacks with zero-crossing detection
- ✅ Solution interpolation interface
- ✅ Generic over array dimensions at compile-time
- ✅ Support for ordinary and second-order ODE problems
Roadmap Organization
Features are organized into three tiers based on priority and dependencies:
- Tier 1: Essential features for general-purpose ODE solving
- Tier 2: Important features for robustness and broader applicability
- Tier 3: Advanced/specialized features for specific problem classes
Each feature below links to a detailed implementation plan in the features/ directory.
Tier 1: Essential Features
Algorithms
-
BS3 (Bogacki-Shampine 3/2) ✅ COMPLETED
- 3rd order explicit RK method with 2nd order error estimate
- Good for moderate accuracy, lower cost than DP5
- Dependencies: None
- Effort: Small
-
Vern7 (Verner 7th order) ✅ COMPLETED
- 7th order explicit RK method for high-accuracy non-stiff problems
- Efficient for tight tolerances (2.7-8.8x faster than DP5 at 1e-10)
- Full 7th order dense output with lazy computation
- Dependencies: None
- Effort: Medium
- Status: All success criteria met, comprehensive benchmarks completed
-
- L-stable 2nd/3rd order Rosenbrock-W method
- First working stiff solver
- Dependencies: Linear solver infrastructure, Jacobian computation
- Effort: Large
Controllers
- PID Controller
- Proportional-Integral-Derivative step size controller
- Better stability than PI controller for difficult problems
- Dependencies: None
- Effort: Small
Callbacks
-
- Event detection based on conditions (not zero-crossings)
- Useful for time-based events, iteration counts, etc.
- Dependencies: None
- Effort: Small
-
- Compose multiple callbacks with ordering
- Essential for complex simulations
- Dependencies: Discrete callbacks
- Effort: Small
Solution Interface
-
- Save solution at specific timepoints
- Dense vs sparse saving strategies
- Dependencies: None
- Effort: Medium
-
- Access derivatives at any time point via interpolation
solution.derivative(t)interface- Dependencies: None
- Effort: Small
Tier 2: Important for Robustness
Algorithms
-
DP8 (Dormand-Prince 8th order)
- 8th order explicit RK for very high accuracy
- Complements Vern7 for algorithm selection
- Dependencies: None
- Effort: Medium
-
FBDF (Fixed-leading-coefficient BDF)
- Multistep method for very stiff problems
- More robust than Rosenbrock for some problem classes
- Dependencies: Linear solver infrastructure, Nordsieck representation
- Effort: Large
-
- Higher-order Rosenbrock methods (4th/5th order)
- Better accuracy for stiff problems
- Dependencies: Rosenbrock23
- Effort: Medium
Algorithm Selection
-
Auto-Switching / Stiffness Detection
- Automatic detection of stiffness
- Switch between non-stiff and stiff solvers
- Composite algorithm infrastructure
- Dependencies: At least one stiff solver (Rosenbrock23 or FBDF)
- Effort: Large
-
- Smart defaults based on problem characteristics
solve(problem)without specifying algorithm- Dependencies: Auto-switching, multiple algorithms
- Effort: Medium
Initialization
- Automatic Initial Step Size
- Algorithm to determine good initial dt
- Based on local Lipschitz estimate
- Dependencies: None
- Effort: Medium
Callbacks
-
- Trigger callbacks at specific predetermined times
- Important for time-varying forcing functions
- Dependencies: Discrete callbacks
- Effort: Small
-
- Auto-detect when solution reaches steady state
- Stop integration early
- Dependencies: Discrete callbacks
- Effort: Small
-
- Custom saving logic beyond default
- For memory-efficient large-scale simulations
- Dependencies: CallbackSet
- Effort: Small
Infrastructure
-
- Generic linear solver interface
- Dense LU factorization
- Foundation for implicit methods
- Dependencies: None
- Effort: Large
-
- Finite difference Jacobians
- Forward-mode automatic differentiation
- Sparse Jacobian support
- Dependencies: None
- Effort: Large
Tier 3: Advanced & Specialized
Algorithms
-
- 2N, 3N, 4N storage variants
- Critical for large-scale problems
- Dependencies: None
- Effort: Medium
-
SSP (Strong Stability Preserving) Methods
- SSPRK22, SSPRK33, SSPRK43, SSPRK53, etc.
- For hyperbolic PDEs and method-of-lines
- Dependencies: None
- Effort: Medium
-
- Velocity Verlet, Leapfrog, KahanLi6, KahanLi8
- For Hamiltonian systems, preserves energy
- Dependencies: Second-order ODE infrastructure (already exists)
- Effort: Medium
-
- Vern6, Vern8, Vern9
- Complete Verner family for different accuracy needs
- Dependencies: Vern7
- Effort: Medium
-
- KenCarp3, KenCarp4, KenCarp5
- Singly Diagonally Implicit RK for stiff problems
- Dependencies: Linear solver infrastructure, nonlinear solver
- Effort: Large
-
- Exp4, EPIRK4, EXPRB53
- For semi-linear stiff problems
- Dependencies: Matrix exponential computation
- Effort: Large
-
- Implicit Euler/Midpoint with Richardson extrapolation
- Adaptive order selection
- Dependencies: Linear solver infrastructure
- Effort: Large
-
- ROCK2, ROCK4, RKC
- For mildly stiff problems with large systems
- Dependencies: None
- Effort: Medium
Controllers
-
- Basic integral controller
- For completeness and testing
- Dependencies: None
- Effort: Small
-
- Advanced controller with prediction
- For challenging adaptive stepping scenarios
- Dependencies: None
- Effort: Medium
Advanced Callbacks
-
- Multiple simultaneous event detection
- More efficient than multiple callbacks
- Dependencies: CallbackSet
- Effort: Medium
-
- Enforce positivity constraints
- Important for physical systems
- Dependencies: CallbackSet
- Effort: Small
-
- Project solution onto constraint manifolds
- For constrained mechanical systems
- Dependencies: CallbackSet
- Effort: Medium
Infrastructure
-
Nonlinear Solver Infrastructure
- Newton's method
- Quasi-Newton methods
- Generic nonlinear solver interface
- Dependencies: Linear solver infrastructure
- Effort: Large
-
- GMRES, BiCGStab
- For large sparse systems
- Dependencies: Linear solver infrastructure
- Effort: Large
-
- ILU, Jacobi, custom preconditioners
- Accelerate Krylov methods
- Dependencies: Krylov solvers
- Effort: Large
Performance & Optimization
-
- First-Same-As-Last reuse
- Reduce function evaluations
- Dependencies: None
- Effort: Small
-
- User-definable error norms
- L2, Linf, weighted norms
- Dependencies: None
- Effort: Small
-
- Limit state values during integration
- For bounded problems
- Dependencies: None
- Effort: Small
Implementation Notes
General Principles
- Rust-first design: Leverage Rust's type system, zero-cost abstractions, and safety guarantees
- Compile-time optimization: Use const generics for array sizes where beneficial
- Trait-based abstraction: Generic over array types, number types, and algorithm components
- Comprehensive testing: Each feature needs convergence tests and comparison to known solutions
- Benchmarking: Track performance as features are added
Testing Strategy
Each algorithm implementation should include:
- Convergence tests: Verify order of accuracy
- Correctness tests: Compare to analytical solutions
- Stiffness tests: For stiff solvers, test on Van der Pol, Robertson, etc.
- Callback tests: Verify event detection accuracy
- Regression tests: Prevent performance degradation
Documentation Requirements
- Public API documentation
- Algorithm descriptions and references
- Usage examples
- Performance characteristics
Progress Tracking
Total Features: 38
- Tier 1: 8 features (2/8 complete) ✅
- Tier 2: 12 features (0/12 complete)
- Tier 3: 18 features (0/18 complete)
Overall Progress: 5.3% (2/38 features complete)
Completed Features
- ✅ BS3 (Bogacki-Shampine 3/2) - Tier 1 (2025-10-23)
- ✅ Vern7 (Verner 7th order) - Tier 1 (2025-10-24)
Last updated: 2025-10-24