コンテンツにスキップ

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.

fn zero_like(&self) -> Self

Create a zero vector with the same shape.


fn axpy(&self, scale: f64, other: &Self) -> Self

Compute self + scale * other (AXPY operation).


fn scale(&self, factor: f64) -> Self

Compute self * factor.


fn is_finite(&self) -> bool

Check whether all components are finite (not NaN or Inf).


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))


fn project(&mut self, _t: f64)

Post-step projection (e.g., quaternion normalization). Default no-op.