pub enum OdeError {
StepSizeUnderflow,
MaxStepsExceeded(usize),
NonFiniteState,
}Expand description
Failure modes of an adaptive integration.
Variants§
StepSizeUnderflow
The step size shrank below machine epsilon while trying to meet the error tolerance — the system is too stiff for the chosen solver, or the tolerances are unattainable.
MaxStepsExceeded(usize)
The interval could not be spanned within max_steps sub-steps; carries
the number of steps taken.
NonFiniteState
The system produced a non-finite (NaN or infinite) error estimate, so the state cannot be trusted and integration stopped.
The usual cause is derivatives or jacobian returning a non-finite
value — for example a numerically-differenced Jacobian
(crate::math::differentiate::NumericalJacobian) that could not form
a column, or an evaluation that left the model’s valid range.
§Why this variant exists
Before bead op-ad6h this case did not error at all: it returned
Ok(()) with a NaN state, because the per-equation error fold used
f64::max, which discards NaN. A wrong answer reported as success is
the worst failure mode available to a solver, so it is now a distinct
error rather than being folded into
StepSizeUnderflow, which would have named
the wrong cause.
Trait Implementations§
Source§impl Error for OdeError
impl Error for OdeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()