Back to Eqiora docs Skip to main content

TimeSystem

Trait TimeSystem 

pub trait TimeSystem {
    // Required methods
    fn dimension(&self) -> usize;
    fn rhs(
        &self,
        time: f64,
        state: &[f64],
        output: &mut [f64],
    ) -> Result<(), Diagnostic>;
    fn rhs_jvp(
        &self,
        time: f64,
        state: &[f64],
        direction: &[f64],
        output: &mut [f64],
    ) -> Result<(), Diagnostic>;

    // Provided method
    fn mass_action(
        &self,
        _time: f64,
        _direction: &[f64],
        _output: &mut [f64],
    ) -> Result<(), Diagnostic> { ... }
}
Description

Infallible-shape, fallible-value action for one lowered first-order system.

Implementations bind all immutable model parameters. Every input and output slice has Self::dimension entries. Methods must overwrite every output entry. An adapter propagates the first diagnostic and rejects non-finite callback results.

Required Methods§

fn dimension(&self) -> usize

Number of scalar state unknowns.

fn rhs( &self, time: f64, state: &[f64], output: &mut [f64], ) -> Result<(), Diagnostic>

Evaluate f(t, y).

§Errors

Returns a stable diagnostic when the lowered action cannot be evaluated.

fn rhs_jvp( &self, time: f64, state: &[f64], direction: &[f64], output: &mut [f64], ) -> Result<(), Diagnostic>

Evaluate the state Jacobian action f_y(t, y) direction.

§Errors

Returns a stable diagnostic when the lowered action cannot be evaluated.

Provided Methods§

fn mass_action( &self, _time: f64, _direction: &[f64], _output: &mut [f64], ) -> Result<(), Diagnostic>

Evaluate M(t) direction for a mass-matrix system.

ODE adapters do not call this method. The default fails closed so an absent mass action cannot silently become an identity matrix.

§Errors

Returns a stable diagnostic when no mass action exists or evaluation fails.

Implementors§