Package odesolver

Interface StepStopCondition


public interface StepStopCondition
A per-accepted-step stopping test for LSODA.

WHY THIS EXISTS RATHER THAN A StepHandler. LSODA implements FirstOrderIntegrator, so it carries addStepHandler and addEventHandler -- and both are EMPTY STUBS that accept a handler and discard it. Code registering one compiles, runs, and is silently never called. This interface is the honest hook: LSODA consults it at the point it records an accepted step, which is the same instant MATLAB's OutputFcn and the native-Python step loop test at, so the four codebases stop on the same condition at the same place.

THE STATE IS 1-INDEXED. LSODA carries its solution in y[1..n] with y[0] unused, the Fortran convention the translation kept; an implementation must read from index 1, not 0.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    stop(double t, double[] y)
     
  • Method Details

    • stop

      boolean stop(double t, double[] y)
      Parameters:
      t - the time of the accepted step
      y - the state at t, 1-indexed: the coordinates are y[1] .. y[n] and y[0] is unused
      Returns:
      true to end the integration here, reporting t as the window's end