Fixed event handling to properly keep the state changes, plus a few other fixes

This commit is contained in:
connor committed 2026-10-01 12:41:39 -04:00
1 parent 55884190fa
commit c5768ad9c0
8 files changed
+1064 -83

No files matched your search

+35 -21
View File
@@ -8,7 +8,8 @@ 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
- ✅ Continuous callbacks with zero-crossing detection, whose effects can change
the state, the parameters, or end the solution
- ✅ Solution interpolation interface
- ✅ Generic over array dimensions at compile-time
- ✅ Support for ordinary and second-order ODE problems
@@ -79,6 +80,18 @@ Each feature below links to a detailed implementation plan in the `features/` di
### Callbacks
- [x] **[Callback Effects That Can Change the State](features/42-callback-effects.md)** ✅ COMPLETED
- An effect's write to the state was overwritten by the step it was located in,
so a callback could stop a solution but not change one
- `effect(&mut self)`, termination at the crossing, both sides of a jump
recorded, the controller reset across one, and a defined order for two events
in one step
- Raised by `astrokit`, which needs a Modified Rodrigues Parameter shadow set
swap mid-propagation
- **Dependencies**: None
- **Effort**: Medium
- **Status**: All success criteria met; benches unchanged within run-to-run drift
- [ ] **[Discrete Callbacks](features/05-discrete-callbacks.md)**
- Event detection based on conditions (not zero-crossings)
- Useful for time-based events, iteration counts, etc.
@@ -93,13 +106,13 @@ Each feature below links to a detailed implementation plan in the `features/` di
### Solution Interface
- [ ] **[Saveat Functionality](features/07-saveat.md)**
- [ ] **[Saveat Functionality](features/07-saveat-functionality.md)**
- Save solution at specific timepoints
- Dense vs sparse saving strategies
- **Dependencies**: None
- **Effort**: Medium
- [ ] **[Solution Derivatives](features/08-solution-derivatives.md)**
- [ ] **Solution Derivatives** (no plan written yet)
- Access derivatives at any time point via interpolation
- `solution.derivative(t)` interface
- **Dependencies**: None
@@ -111,7 +124,7 @@ Each feature below links to a detailed implementation plan in the `features/` di
### Algorithms
- [ ] **[DP8 (Dormand-Prince 8th order)](features/09-dp8-method.md)**
- [ ] **DP8 (Dormand-Prince 8th order)** (no plan written yet)
- 8th order explicit RK for very high accuracy
- Complements Vern7 for algorithm selection
- **Dependencies**: None
@@ -123,7 +136,7 @@ Each feature below links to a detailed implementation plan in the `features/` di
- **Dependencies**: Linear solver infrastructure, Nordsieck representation
- **Effort**: Large
- [ ] **[Rodas4/Rodas5P](features/11-rodas-methods.md)**
- [ ] **[Rodas4/Rodas5P](features/11-rodas4-rodas5p-methods.md)**
- Higher-order Rosenbrock methods (4th/5th order)
- Better accuracy for stiff problems
- **Dependencies**: Rosenbrock23
@@ -138,7 +151,7 @@ Each feature below links to a detailed implementation plan in the `features/` di
- **Dependencies**: At least one stiff solver (Rosenbrock23 or FBDF)
- **Effort**: Large
- [ ] **[Default Algorithm Selection](features/13-default-algorithm.md)**
- [ ] **[Default Algorithm Selection](features/13-default-algorithm-selection.md)**
- Smart defaults based on problem characteristics
- `solve(problem)` without specifying algorithm
- **Dependencies**: Auto-switching, multiple algorithms
@@ -146,7 +159,7 @@ Each feature below links to a detailed implementation plan in the `features/` di
### Initialization
- [ ] **[Automatic Initial Step Size](features/14-initial-stepsize.md)**
- [ ] **[Automatic Initial Step Size](features/14-automatic-initial-step-size.md)**
- Algorithm to determine good initial dt
- Based on local Lipschitz estimate
- **Dependencies**: None
@@ -154,19 +167,19 @@ Each feature below links to a detailed implementation plan in the `features/` di
### Callbacks
- [ ] **[PresetTimeCallback](features/15-preset-time-callback.md)**
- [ ] **[PresetTimeCallback](features/15-presettimecallback.md)**
- Trigger callbacks at specific predetermined times
- Important for time-varying forcing functions
- **Dependencies**: Discrete callbacks
- **Effort**: Small
- [ ] **[TerminateSteadyState](features/16-terminate-steady-state.md)**
- [ ] **[TerminateSteadyState](features/16-terminatesteadystate.md)**
- Auto-detect when solution reaches steady state
- Stop integration early
- **Dependencies**: Discrete callbacks
- **Effort**: Small
- [ ] **[SavingCallback](features/17-saving-callback.md)**
- [ ] **[SavingCallback](features/17-savingcallback.md)**
- Custom saving logic beyond default
- For memory-efficient large-scale simulations
- **Dependencies**: CallbackSet
@@ -194,7 +207,7 @@ Each feature below links to a detailed implementation plan in the `features/` di
### Algorithms
- [ ] **[Low-Storage Runge-Kutta](features/20-low-storage-rk.md)**
- [ ] **[Low-Storage Runge-Kutta](features/20-low-storage-runge-kutta.md)**
- 2N, 3N, 4N storage variants
- Critical for large-scale problems
- **Dependencies**: None
@@ -212,7 +225,7 @@ Each feature below links to a detailed implementation plan in the `features/` di
- **Dependencies**: Second-order ODE infrastructure (already exists)
- **Effort**: Medium
- [ ] **[Verner Methods Suite](features/23-verner-methods.md)**
- [ ] **[Verner Methods Suite](features/23-verner-methods-suite.md)**
- Vern6, Vern8, Vern9
- Complete Verner family for different accuracy needs
- **Dependencies**: Vern7
@@ -258,19 +271,19 @@ Each feature below links to a detailed implementation plan in the `features/` di
### Advanced Callbacks
- [ ] **[VectorContinuousCallback](features/30-vector-continuous-callback.md)**
- [ ] **[VectorContinuousCallback](features/30-vectorcontinuouscallback.md)**
- Multiple simultaneous event detection
- More efficient than multiple callbacks
- **Dependencies**: CallbackSet
- **Effort**: Medium
- [ ] **[PositiveDomain](features/31-positive-domain.md)**
- [ ] **[PositiveDomain](features/31-positivedomain.md)**
- Enforce positivity constraints
- Important for physical systems
- **Dependencies**: CallbackSet
- **Effort**: Small
- [ ] **[ManifoldProjection](features/32-manifold-projection.md)**
- [ ] **[ManifoldProjection](features/32-manifoldprojection.md)**
- Project solution onto constraint manifolds
- For constrained mechanical systems
- **Dependencies**: CallbackSet
@@ -278,14 +291,14 @@ Each feature below links to a detailed implementation plan in the `features/` di
### Infrastructure
- [ ] **[Nonlinear Solver Infrastructure](features/33-nonlinear-solver.md)**
- [ ] **[Nonlinear Solver Infrastructure](features/33-nonlinear-solver-infrastructure.md)**
- Newton's method
- Quasi-Newton methods
- Generic nonlinear solver interface
- **Dependencies**: Linear solver infrastructure
- **Effort**: Large
- [ ] **[Krylov Linear Solvers](features/34-krylov-solvers.md)**
- [ ] **[Krylov Linear Solvers](features/34-krylov-linear-solvers.md)**
- GMRES, BiCGStab
- For large sparse systems
- **Dependencies**: Linear solver infrastructure
@@ -355,12 +368,12 @@ Each algorithm implementation should include:
## Progress Tracking
Total Features: 41
- Tier 1: 10 features (6/10 complete) ✅
Total Features: 42
- Tier 1: 11 features (7/11 complete) ✅
- Tier 2: 11 features (0/11 complete)
- Tier 3: 20 features (0/20 complete)
**Overall Progress: 14.6% (6/41 features complete)**
**Overall Progress: 16.7% (7/42 features complete)**
### Completed Features
1. ✅ BS3 (Bogacki-Shampine 3/2) - Tier 1 (2025-10-23)
@@ -369,5 +382,6 @@ Total Features: 41
4. ✅ Rosenbrock23 - Tier 1 (2025-10-24)
5. ✅ Tolerances Trait - Tier 1 (2026-09-30)
6. ✅ Runtime Integrator Selection - Tier 1 (2026-09-30)
7. ✅ Callback Effects That Can Change the State - Tier 1 (2026-10-01)
Last updated: 2026-09-30
Last updated: 2026-10-01