mod rk4;
mod adaptive;
mod rkf45;
mod rkts54;
mod rkv65;
mod rkv87;
mod rkv98;
mod rkv98_nointerp;
mod rkv98_efficient;
mod rosenbrock;
mod rodas4;
use core::fmt;
use crate::traits::FloatScalar;
use crate::Matrix;
#[cfg(test)]
mod tests;
pub use rk4::{rk4_step, rk4};
pub use adaptive::{RKAdaptive, AdaptiveSettings};
pub use rkf45::RKF45;
pub use rkts54::RKTS54;
pub use rkv65::RKV65;
pub use rkv87::RKV87;
pub use rkv98::RKV98;
pub use rkv98_nointerp::RKV98NoInterp;
pub use rkv98_efficient::RKV98Efficient;
pub use rosenbrock::Rosenbrock;
pub use rodas4::RODAS4;
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum OdeError {
StepNotFinite,
MaxStepsExceeded,
NoDenseOutput,
InterpOutOfBounds,
InterpNotImplemented,
SingularJacobian,
TooManyRejections,
}
impl fmt::Display for OdeError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::StepNotFinite => write!(f, "step error is not finite"),
Self::MaxStepsExceeded => write!(f, "maximum number of steps exceeded"),
Self::NoDenseOutput => write!(f, "no dense output in solution"),
Self::InterpOutOfBounds => write!(f, "interpolation point out of bounds"),
Self::InterpNotImplemented => write!(f, "interpolation not implemented for this solver"),
Self::SingularJacobian => write!(f, "Jacobian matrix is singular"),
Self::TooManyRejections => write!(f, "too many consecutive step rejections"),
}
}
}
pub struct Solution<T: FloatScalar, const M: usize, const N: usize> {
pub t: T,
pub y: Matrix<T, M, N>,
pub evals: usize,
pub accepted: usize,
pub rejected: usize,
#[cfg(feature = "std")]
pub dense: Option<DenseOutput<T, M, N>>,
}
#[cfg(feature = "std")]
pub struct DenseOutput<T: FloatScalar, const M: usize, const N: usize> {
pub t: Vec<T>,
pub h: Vec<T>,
pub stages: Vec<Vec<Matrix<T, M, N>>>,
pub y: Vec<Matrix<T, M, N>>,
}