pub trait ImplicitRates<X, F, J, UX, UR, T = Time>where
Self: Debug,
X: Differentiable<T> + Tensor,
Derivative<X, T>: Tensor,
UX: TensorVec<Item = X>,
UR: TensorVec<Item = Derivative<X, T>>,{
// Required method
fn integrate(
&self,
rate: impl FnMut(Quantity<T>, &X) -> Result<Derivative<X, T>, String>,
residual: impl FnMut(Quantity<T>, &X, &Derivative<X, T>) -> Result<F, String>,
tangent: impl FnMut(Quantity<T>, &X, &Derivative<X, T>, Quantity<T>) -> Result<J, String>,
solver: impl RootFinding<F, J, X>,
equality_constraint: impl Fn(Quantity<T>) -> EqualityConstraints,
sparse: Option<SparseSolver>,
time: &[Quantity<T>],
initial_state: X,
) -> Result<(Times<T>, UX, UR), IntegrationError>;
}Expand description
Implicit integrators for first-order systems.
C\dot{x} + f(t, x) = 0Required Methods§
Sourcefn integrate(
&self,
rate: impl FnMut(Quantity<T>, &X) -> Result<Derivative<X, T>, String>,
residual: impl FnMut(Quantity<T>, &X, &Derivative<X, T>) -> Result<F, String>,
tangent: impl FnMut(Quantity<T>, &X, &Derivative<X, T>, Quantity<T>) -> Result<J, String>,
solver: impl RootFinding<F, J, X>,
equality_constraint: impl Fn(Quantity<T>) -> EqualityConstraints,
sparse: Option<SparseSolver>,
time: &[Quantity<T>],
initial_state: X,
) -> Result<(Times<T>, UX, UR), IntegrationError>
fn integrate( &self, rate: impl FnMut(Quantity<T>, &X) -> Result<Derivative<X, T>, String>, residual: impl FnMut(Quantity<T>, &X, &Derivative<X, T>) -> Result<F, String>, tangent: impl FnMut(Quantity<T>, &X, &Derivative<X, T>, Quantity<T>) -> Result<J, String>, solver: impl RootFinding<F, J, X>, equality_constraint: impl Fn(Quantity<T>) -> EqualityConstraints, sparse: Option<SparseSolver>, time: &[Quantity<T>], initial_state: X, ) -> Result<(Times<T>, UX, UR), IntegrationError>
Solves an initial value problem for a first-order system, given the residual of the system as a function of time, state, and rate, and its tangent with respect to the state.
The rate function is only evaluated for the initial rate. The tangent is handed the time step, from which the weight of the capacity in the effective tangent follows. The solution contains the states and rates at each time. The time step is that of the integrator when time holds only the initial and final times, and otherwise time is the sequence of steps.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".