Skip to main content

OdeSystem

Trait OdeSystem 

Source
pub trait OdeSystem {
    // Required methods
    fn n_eqns(&self) -> usize;
    fn derivatives(&self, x: f64, y: &[f64], dydx: &mut Vec<f64>);

    // Provided method
    fn jacobian(
        &self,
        _x: f64,
        _y: &[f64],
        _dfdx: &mut Vec<f64>,
        _dfdy: &mut SquareMatrix,
    ) { ... }
}
Expand description

Abstract ODE system dy/dx = f(x, y). Maps to Foam::ODESystem.

Required Methods§

Source

fn n_eqns(&self) -> usize

Number of coupled equations (the length of the state vector y).

Source

fn derivatives(&self, x: f64, y: &[f64], dydx: &mut Vec<f64>)

Fill dydx with the derivatives at (x, y).

Provided Methods§

Source

fn jacobian( &self, _x: f64, _y: &[f64], _dfdx: &mut Vec<f64>, _dfdy: &mut SquareMatrix, )

Fill dfdx and dfdy with the Jacobian at (x, y).

Required only by stiff solvers (Rosenbrock23). The default panics.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§