Skip to main content

integrate_rkmk_dae_adaptive

Function integrate_rkmk_dae_adaptive 

Source
pub fn integrate_rkmk_dae_adaptive<Field, Tab, Z, U, V, T>(
    rate: impl FnMut(Quantity<T>, &Field::Point, &Z) -> Result<Derivative<Field::Increment, T>, String>,
    solve: impl FnMut(Quantity<T>, &Field::Point, &Z) -> Result<Z, String>,
    time: &[Quantity<T>],
    initial_condition: (Field::Point, Z),
    abs_tol: Scalar,
    rel_tol: Scalar,
) -> Result<(Times<T>, U, V), IntegrationError>
where Field: Integrable, Tab: EmbeddedTableau, Field::Point: Clone, Field::Increment: Clone + Differentiable<T>, Z: Clone, T: Copy, Quantity<T>: Mul<Scalar, Output = Quantity<T>>, for<'a> &'a Derivative<Field::Increment, T>: Mul<Quantity<T>, Output = Field::Increment>, U: TensorVec<Item = Field::Point>, V: TensorVec<Item = Z>,
Expand description

Adaptive super::rkmk_dae_step: embedded local-error control from the tableau’s D weights over the span [time[0], time[last]], with the same controller as integrate_rkmk_adaptive. A rejected step costs no endpoint constraint solve. Returns the accepted times, the state history, and the matching algebraic history.

Dense output follows the convention of the flat DAE loop: time of length two supplies only the span and the accepted steps are reported, while a longer time is a list of requested report times. Each of those is served by the geodesic HermiteSegment of the accepted step containing it, so the reported state is on the manifold at every requested time and not only at the accepted ones; the algebraic unknown is then re-solved from its constraint there, warm-started along the grid. Building the segments costs one extra rate evaluation per accepted step, so it is skipped when not requested.