conspire/math/integrate/ode/
mod.rs

1use crate::math::{Scalar, Tensor, TensorVec};
2use std::fmt::Debug;
3
4pub mod explicit;
5pub mod implicit;
6
7/// Ordinary differential equation solvers.
8pub trait OdeSolver<Y, U>
9where
10    Self: Debug,
11    Y: Tensor,
12    U: TensorVec<Item = Y>,
13{
14}
15
16/// Fixed-step ordinary differential equation solvers.
17pub trait FixedStep {
18    /// Returns the time step.
19    fn dt(&self) -> Scalar;
20}
21
22/// Variable-step ordinary differential equation solvers.
23pub trait VariableStep {
24    /// Returns the absolute error tolerance.
25    fn abs_tol(&self) -> Scalar;
26    /// Returns the relative error tolerance.
27    fn rel_tol(&self) -> Scalar;
28    /// Returns the multiplier for adaptive time steps.
29    fn dt_beta(&self) -> Scalar;
30    /// Returns the exponent for adaptive time steps.
31    fn dt_expn(&self) -> Scalar;
32    /// Returns the cut back factor for function errors.
33    fn dt_cut(&self) -> Scalar;
34    /// Returns the minimum value for the time step.
35    fn dt_min(&self) -> Scalar;
36}