OdeState
Defined in: state.rs:10
pub trait OdeState: [Clone](https://doc.rust-lang.org/std/clone/trait.Clone.html) + [Sized](https://doc.rust-lang.org/std/marker/trait.Sized.html)Algebraic operations required by generic ODE solvers.
Types implementing this trait can be used as state vectors in RK4, Dormand-Prince, and other integration methods without the integrator knowing anything about the domain-specific structure.
Required Methods
Section titled “Required Methods”zero_like()
Section titled “zero_like()”fn zero_like(&self) -> Self
Create a zero vector with the same shape.
axpy()
Section titled “axpy()”fn axpy(&self, scale: f64, other: &Self) -> Self
Compute self + scale * other (AXPY operation).
scale()
Section titled “scale()”fn scale(&self, factor: f64) -> Self
Compute self * factor.
is_finite()
Section titled “is_finite()”fn is_finite(&self) -> bool
Check whether all components are finite (not NaN or Inf).
error_norm()
Section titled “error_norm()”fn error_norm(&self, y_next: &Self, error: &Self, tol: &Tolerances) -> f64
Compute the RMS error norm for adaptive step-size control.
Uses the mixed absolute/relative tolerance formula: sc_i = atol + rtol * max(|y_n_i|, |y_{n+1}_i|) err = sqrt(1/N * sum((delta_i / sc_i)^2))
Provided Methods
Section titled “Provided Methods”project()
Section titled “project()”fn project(&mut self, _t: f64)
Post-step projection (e.g., quaternion normalization). Default no-op.