Class AbstractFieldODEDetector<T extends AbstractFieldODEDetector<T,E>,E extends CalculusFieldElement<E>>

java.lang.Object
org.hipparchus.ode.events.AbstractFieldODEDetector<T,E>
Type Parameters:
T - type of the detector
E - type of the field elements
All Implemented Interfaces:
FieldODEEventDetector<E>
Direct Known Subclasses:
FieldEventSlopeFilter

public abstract class AbstractFieldODEDetector<T extends AbstractFieldODEDetector<T,E>,E extends CalculusFieldElement<E>> extends Object implements FieldODEEventDetector<E>
Base class for #@link FieldODEEventDetector.
Since:
3.0
  • Field Details Link icon

    • DEFAULT_MAX_CHECK Link icon

      public static final double DEFAULT_MAX_CHECK
      Default maximum checking interval (s).
      See Also:
    • DEFAULT_THRESHOLD Link icon

      public static final double DEFAULT_THRESHOLD
      Default convergence threshold (s).
      See Also:
    • DEFAULT_MAX_ITER Link icon

      public static final int DEFAULT_MAX_ITER
      Default maximum number of iterations in the event time search.
      See Also:
  • Constructor Details Link icon

    • AbstractFieldODEDetector Link icon

      protected AbstractFieldODEDetector(FieldAdaptableInterval<E> maxCheck, int maxIter, BracketedRealFieldUnivariateSolver<E> solver, FieldODEEventHandler<E> handler)
      Build a new instance.
      Parameters:
      maxCheck - maximum checking interval, must be strictly positive (s)
      maxIter - maximum number of iterations in the event time search
      solver - root-finding algorithm to use to detect state events
      handler - event handler to call at event occurrences
  • Method Details Link icon

    • init Link icon

      public void init(FieldODEStateAndDerivative<E> s0, E t)
      Initialize event detector at the start of an ODE integration.

      This method is called once at the start of the integration. It may be used by the event detector to initialize some internal data if needed.

      The default implementation initializes the handler.

      This implementation sets the direction of integration and initializes the event handler. If a subclass overrides this method it should call super.init(s0, t).

      Specified by:
      init in interface FieldODEEventDetector<T extends AbstractFieldODEDetector<T,E>>
      Parameters:
      s0 - initial time, state vector and derivative
      t - target time for the integration
    • getMaxCheckInterval Link icon

      public FieldAdaptableInterval<E> getMaxCheckInterval()
      Get the maximal time interval between events handler checks.
      Specified by:
      getMaxCheckInterval in interface FieldODEEventDetector<T extends AbstractFieldODEDetector<T,E>>
      Returns:
      maximal time interval between events handler checks
    • getMaxIterationCount Link icon

      public int getMaxIterationCount()
      Get the upper limit in the iteration count for event localization.
      Specified by:
      getMaxIterationCount in interface FieldODEEventDetector<T extends AbstractFieldODEDetector<T,E>>
      Returns:
      upper limit in the iteration count for event localization
    • getSolver Link icon

      Get the root-finding algorithm to use to detect state events.
      Specified by:
      getSolver in interface FieldODEEventDetector<T extends AbstractFieldODEDetector<T,E>>
      Returns:
      root-finding algorithm to use to detect state events
    • withMaxCheck Link icon

      public T withMaxCheck(E newMaxCheck)
      Setup the maximum checking interval.

      This will override a maximum checking interval if it has been configured previously.

      Parameters:
      newMaxCheck - maximum checking interval (s)
      Returns:
      a new detector with updated configuration (the instance is not changed)
    • withMaxCheck Link icon

      public T withMaxCheck(FieldAdaptableInterval<E> newMaxCheck)
      Setup the maximum checking interval.

      This will override a maximum checking interval if it has been configured previously.

      Parameters:
      newMaxCheck - maximum checking interval (s)
      Returns:
      a new detector with updated configuration (the instance is not changed)
      Since:
      3.0
    • withMaxIter Link icon

      public T withMaxIter(int newMaxIter)
      Setup the maximum number of iterations in the event time search.

      This will override a number of iterations if it has been configured previously.

      Parameters:
      newMaxIter - maximum number of iterations in the event time search
      Returns:
      a new detector with updated configuration (the instance is not changed)
    • withThreshold Link icon

      public T withThreshold(E newThreshold)
      Setup the convergence threshold.

      This is equivalent to call withSolver(new FieldBracketingNthOrderBrentSolver<>(zero, newThreshold, zero, 5), so it will override a solver if one has been configured previously.

      Parameters:
      newThreshold - convergence threshold
      Returns:
      a new detector with updated configuration (the instance is not changed)
      See Also:
    • withSolver Link icon

      public T withSolver(BracketedRealFieldUnivariateSolver<E> newSolver)
      Setup the root-finding algorithm to use to detect state events.

      This will override a solver if it has been configured previously.

      Parameters:
      newSolver - root-finding algorithm to use to detect state events
      Returns:
      a new detector with updated configuration (the instance is not changed)
      See Also:
    • withHandler Link icon

      public T withHandler(FieldODEEventHandler<E> newHandler)
      Setup the event handler to call at event occurrences.

      This will override a handler if it has been configured previously.

      Parameters:
      newHandler - event handler to call at event occurrences
      Returns:
      a new detector with updated configuration (the instance is not changed)
    • getHandler Link icon

      public FieldODEEventHandler<E> getHandler()
      Get the underlying event handler.
      Specified by:
      getHandler in interface FieldODEEventDetector<T extends AbstractFieldODEDetector<T,E>>
      Returns:
      underlying event handler
    • create Link icon

      protected abstract T create(FieldAdaptableInterval<E> newMaxCheck, int newMaxIter, BracketedRealFieldUnivariateSolver<E> newSolver, FieldODEEventHandler<E> newHandler)
      Build a new instance.
      Parameters:
      newMaxCheck - maximum checking interval
      newMaxIter - maximum number of iterations in the event time search
      newSolver - root-finding algorithm to use to detect state events
      newHandler - event handler to call at event occurrences
      Returns:
      a new instance of the appropriate sub-type
    • isForward Link icon

      public boolean isForward()
      Check if the current propagation is forward or backward.
      Returns:
      true if the current propagation is forward