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 recommended to use nalgebra vectors.
use ode_solvers::{System, SVector, Vector3};
// A predefined type for a vector (works from 1..6)
type Precision = f64;
type State = Vector3<Precision>;
type MySystem = dyn System<Precision, State>;
// Definition of a higher dimensional vector using nalgebra
type AltState = SVector<Precision, 9>;
type MyAltSystem = dyn System<Precision, State>;