pub trait System<T, V>
where T: FloatNumber,
{ // Required method fn system(&self, x: T, y: &V, dy: &mut V); // Provided method fn solout(&mut self, _x: T, _y: &V, _dy: &V) -> bool { ... } }
Expand description

Trait needed to be implemented by the user

The type parameter T should be either f32 or f64, the trait FloatNumber is used internally to allow generic code.

The type parameter V is a state vector. To have an easy start it is recommend to use nalgebra vectors.

// A predefined type for a vector (works from 1..6)
type Precision = f64
type State = Vector3<Precision>;
type MySystem = System<Precision, State>

// Definition of a higher dimensional vector using nalgebra
type AltState = SVector<Precision, 9>
type MyAltSystem = System<Precision, State>

Required Methods§


fn system(&self, x: T, y: &V, dy: &mut V)

System of ordinary differential equations.

Provided Methods§


fn solout(&mut self, _x: T, _y: &V, _dy: &V) -> bool

Stop function called at every successful integration step. The integration is stopped when this function returns true.