Skip to main content

OdeEquations

Trait OdeEquations 

Source
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:

Optionally, the ODE equations can also include:

Required Methods§

Source

fn rhs(&self) -> <Self as OdeEquationsRef<'_>>::Rhs

returns the right-hand side function F(t, y) as a NonLinearOp

Source

fn mass(&self) -> Option<<Self as OdeEquationsRef<'_>>::Mass>

returns the mass matrix M as a LinearOp

Source

fn init(&self) -> <Self as OdeEquationsRef<'_>>::Init

returns the initial condition, i.e. y(t), where t is the initial time

Source

fn set_params(&mut self, p: &Self::V)

sets the current parameters of the equations

Source

fn get_params(&self, p: &mut Self::V)

gets the current parameters of the equations

Provided Methods§

Source

fn root(&self) -> Option<<Self as OdeEquationsRef<'_>>::Root>

returns the root function G(t, y) as a NonLinearOp

Source

fn out(&self) -> Option<<Self as OdeEquationsRef<'_>>::Out>

returns the output function H(t, y) as a NonLinearOp

Source

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.

Source

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".

Implementations on Foreign Types§

Source§

impl<T: OdeEquations> OdeEquations for &T

Source§

fn rhs(&self) -> <Self as OdeEquationsRef<'_>>::Rhs

Source§

fn mass(&self) -> Option<<Self as OdeEquationsRef<'_>>::Mass>

Source§

fn root(&self) -> Option<<Self as OdeEquationsRef<'_>>::Root>

Source§

fn out(&self) -> Option<<Self as OdeEquationsRef<'_>>::Out>

Source§

fn reset(&self) -> Option<<Self as OdeEquationsRef<'_>>::Reset>

Source§

fn init(&self) -> <Self as OdeEquationsRef<'_>>::Init

Source§

fn set_params(&mut self, _p: &Self::V)

Source§

fn set_model_index(&mut self, _m: usize)

Source§

fn get_params(&self, p: &mut Self::V)

Implementors§

Source§

impl<'a, Eqn, Method> OdeEquations for AdjointEquations<'a, Eqn, Method>
where Eqn: OdeEquationsAdjoint, Method: OdeSolverMethod<'a, Eqn>,

Source§

impl<'a, Eqn> OdeEquations for SensEquations<'a, Eqn>

Source§

impl<Eqn: OdeEquations> OdeEquations for NoAug<Eqn>

Source§

impl<M, Rhs, Init, Mass, Root, Out, Reset> OdeEquations for OdeSolverEquations<M, Rhs, Init, Mass, Root, Out, Reset>
where M: Matrix, Rhs: Op<M = M, V = M::V, T = M::T, C = M::C>, Init: Op<M = M, V = M::V, T = M::T, C = M::C>, Mass: Op<M = M, V = M::V, T = M::T, C = M::C>, Root: Op<M = M, V = M::V, T = M::T, C = M::C>, Out: Op<M = M, V = M::V, T = M::T, C = M::C>, Reset: Op<M = M, V = M::V, T = M::T, C = M::C>, for<'a> ParameterisedOp<'a, Rhs>: NonLinearOp<M = M, V = M::V, T = M::T, C = M::C>, for<'a> ParameterisedOp<'a, Init>: ConstantOp<M = M, V = M::V, T = M::T, C = M::C>, for<'a> ParameterisedOp<'a, Mass>: LinearOp<M = M, V = M::V, T = M::T, C = M::C>, for<'a> ParameterisedOp<'a, Root>: NonLinearOp<M = M, V = M::V, T = M::T, C = M::C>, for<'a> ParameterisedOp<'a, Out>: NonLinearOp<M = M, V = M::V, T = M::T, C = M::C>, for<'a> ParameterisedOp<'a, Reset>: NonLinearOp<M = M, V = M::V, T = M::T, C = M::C>,

Source§

impl<M: MatrixHost<T: DiffSlScalar>, CG: CodegenModule> OdeEquations for DiffSl<M, CG>