pub trait OdeEquations: for<'a> OdeEquationsRef<'a> {
// Required methods
fn rhs(&self) -> <Self as OdeEquationsRef<'_>>::Rhs;
fn mass(&self) -> Option<<Self as OdeEquationsRef<'_>>::Mass>;
fn init(&self) -> <Self as OdeEquationsRef<'_>>::Init;
fn set_params(&mut self, p: &Self::V);
fn get_params(&self, p: &mut Self::V);
// Provided methods
fn root(&self) -> Option<<Self as OdeEquationsRef<'_>>::Root> { ... }
fn out(&self) -> Option<<Self as OdeEquationsRef<'_>>::Out> { ... }
fn reset(&self) -> Option<<Self as OdeEquationsRef<'_>>::Reset> { ... }
fn set_model_index(&mut self, _m: usize) { ... }
}Expand description
this is the trait that defines the ODE equations of the form
$$ M \frac{dy}{dt} = F(t, y) y(t_0) = y_0(t_0) $$
The ODE equations are defined by:
- the right-hand side function
F(t, y), which is given as a NonLinearOp using theRhsassociated type and OdeEquations::rhs function, - the initial condition
y_0(t_0), which is given as a ConstantOp using theInitassociated type and OdeEquations::init function.
Optionally, the ODE equations can also include:
- the mass matrix
Mwhich is given as a LinearOp using theMassassociated type and the OdeEquations::mass function, - the root function
G(t, y)which is given as a NonLinearOp using theRootassociated type and the OdeEquations::root function - the output function
H(t, y)which is given as a NonLinearOp using theOutassociated type and the OdeEquations::out function
Required Methods§
Sourcefn rhs(&self) -> <Self as OdeEquationsRef<'_>>::Rhs
fn rhs(&self) -> <Self as OdeEquationsRef<'_>>::Rhs
returns the right-hand side function F(t, y) as a NonLinearOp
Sourcefn mass(&self) -> Option<<Self as OdeEquationsRef<'_>>::Mass>
fn mass(&self) -> Option<<Self as OdeEquationsRef<'_>>::Mass>
returns the mass matrix M as a LinearOp
Sourcefn init(&self) -> <Self as OdeEquationsRef<'_>>::Init
fn init(&self) -> <Self as OdeEquationsRef<'_>>::Init
returns the initial condition, i.e. y(t), where t is the initial time
Sourcefn set_params(&mut self, p: &Self::V)
fn set_params(&mut self, p: &Self::V)
sets the current parameters of the equations
Sourcefn get_params(&self, p: &mut Self::V)
fn get_params(&self, p: &mut Self::V)
gets the current parameters of the equations
Provided Methods§
Sourcefn root(&self) -> Option<<Self as OdeEquationsRef<'_>>::Root>
fn root(&self) -> Option<<Self as OdeEquationsRef<'_>>::Root>
returns the root function G(t, y) as a NonLinearOp
Sourcefn out(&self) -> Option<<Self as OdeEquationsRef<'_>>::Out>
fn out(&self) -> Option<<Self as OdeEquationsRef<'_>>::Out>
returns the output function H(t, y) as a NonLinearOp
Sourcefn reset(&self) -> Option<<Self as OdeEquationsRef<'_>>::Reset>
fn reset(&self) -> Option<<Self as OdeEquationsRef<'_>>::Reset>
returns the optional reset function R(y) as a NonLinearOp.
When provided, this is called after a root event at index 0 to reset the state.
Sourcefn set_model_index(&mut self, _m: usize)
fn set_model_index(&mut self, _m: usize)
sets the current model index of the equations
Implementations that do not support multiple models may ignore m.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".