Skip to main content

integrate_rkmk_adaptive

Function integrate_rkmk_adaptive 

Source
pub fn integrate_rkmk_adaptive<Field, Tab, U, T>(
    rate: impl FnMut(Quantity<T>, &Field::Point) -> Result<Derivative<Field::Increment, T>, String>,
    time: &[Quantity<T>],
    initial_condition: Field::Point,
    abs_tol: Scalar,
    rel_tol: Scalar,
) -> Result<(Times<T>, U), IntegrationError>
where Field: Integrable, Tab: EmbeddedTableau, Field::Point: Clone, Field::Increment: Clone + Differentiable<T>, 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>,
Expand description

Adaptive RKMK: integrate_rkmk with embedded local-error control from the tableau’s D weights. The step is grown or shrunk by 0.9 (tol / e)^{1/p} (clamped to [DT_CUT, 5]), and a step whose error e exceeds abs_tol + rel_tol ‖x_{n+1}‖ is rejected. A rate-evaluation failure is retried with dt *= DT_CUT, the same as a rejected accuracy estimate.

Dense output follows the convention of integrate_rkmk_dae_adaptive: 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 served by the geodesic HermiteSegment of the accepted step containing it. Building the segments costs one extra rate evaluation per accepted step, so it is skipped when not requested.