Package cnuphys.rk4

Interface IStopper

All Known Implementing Classes:
BeamLineStopper, DefaultCylinderStopper, DefaultPlaneStopper, DefaultRhoStopper, DefaultStopper, DefaultSwimStopper, DefaultZStopper, NewPlaneStopper, NumStepStopper

public interface IStopper
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Get the final independent variable (typically path length in meters)
    void
    setFinalT(double finalT)
    Set the final independent variable (typically path length in meters)
    boolean
    stopIntegration(double t, double[] y)
    Given the current state of the integration, should we stop?
    default boolean
    terminateIntegration(double t, double[] y)
    Generally this is the same as stop integration.
  • Method Details

    • stopIntegration

      boolean stopIntegration(double t, double[] y)
      Given the current state of the integration, should we stop? This allows the integration to stop, for example, if some distance from the origin has been exceeded or if the independent variable passes some threshold. It won't be precise, because the check may not happen on every step, but it should be close.
      Parameters:
      t - the current value of the independent variable (typically pathlength)
      y - the current state vector (typically [x, y, z, vx, vy, vz])
      Returns:
      true if we should stop now.
    • getFinalT

      double getFinalT()
      Get the final independent variable (typically path length in meters)
      Returns:
      the final independent variable (typically path length in meters)
    • setFinalT

      void setFinalT(double finalT)
      Set the final independent variable (typically path length in meters)
      Parameters:
      finalT - the final independent variable (typically path length in meters)
    • terminateIntegration

      default boolean terminateIntegration(double t, double[] y)
      Generally this is the same as stop integration. So most will just return stopIntegration(). But sometimes stop just means we reset and integrate more. For example, with a fixed Z integrator we "stop" when we cross the z boundary however we are not done unless we are within tolerance. If we are within tolerance (on either side) we are really done!
      Parameters:
      t - the current value of the independent variable (typically pathlength)
      y - the current state vector (typically [x, y, z, vx, vy, vz])
      Returns:
      true if we should stop now.