Class AbstractODEDetector<T extends AbstractODEDetector<T>>
- Type Parameters:
T
- type of the detector
- All Implemented Interfaces:
ODEEventDetector
- Direct Known Subclasses:
EventSlopeFilter
ODEEventDetector
.- Since:
- 3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final double
Default maximum checking interval (s).static final int
Default maximum number of iterations in the event time search.static final double
Default convergence threshold (s). -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractODEDetector
(AdaptableInterval maxCheck, int maxIter, BracketedUnivariateSolver<UnivariateFunction> solver, ODEEventHandler handler) Build a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract T
create
(AdaptableInterval newMaxCheck, int newmaxIter, BracketedUnivariateSolver<UnivariateFunction> newSolver, ODEEventHandler newHandler) Build a new instance.Get the underlying event handler.Get the maximal time interval between events handler checks.int
Get the upper limit in the iteration count for event localization.Get the root-finding algorithm to use to detect state events.void
init
(ODEStateAndDerivative s0, double t) Initialize event detector at the start of an ODE integration.boolean
Check if the current propagation is forward or backward.withHandler
(ODEEventHandler newHandler) Setup the event handler to call at event occurrences.withMaxCheck
(double newMaxCheck) Setup the maximum checking interval.withMaxCheck
(AdaptableInterval newMaxCheck) Setup the maximum checking interval.withMaxIter
(int newMaxIter) Setup the maximum number of iterations in the event time search.withSolver
(BracketedUnivariateSolver<UnivariateFunction> newSolver) Setup the root-finding algorithm to use to detect state events.withThreshold
(double newThreshold) Setup the convergence threshold.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hipparchus.ode.events.ODEEventDetector
g, reset
-
Field Details
-
DEFAULT_MAX_CHECK
public static final double DEFAULT_MAX_CHECKDefault maximum checking interval (s).- See Also:
-
DEFAULT_THRESHOLD
public static final double DEFAULT_THRESHOLDDefault convergence threshold (s).- See Also:
-
DEFAULT_MAX_ITER
public static final int DEFAULT_MAX_ITERDefault maximum number of iterations in the event time search.- See Also:
-
-
Constructor Details
-
AbstractODEDetector
protected AbstractODEDetector(AdaptableInterval maxCheck, int maxIter, BracketedUnivariateSolver<UnivariateFunction> solver, ODEEventHandler handler) Build a new instance.- Parameters:
maxCheck
- maximum checking interval, must be strictly positive (s)maxIter
- maximum number of iterations in the event time searchsolver
- root-finding algorithm to use to detect state eventshandler
- event handler to call at event occurrences
-
-
Method Details
-
init
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 interfaceODEEventDetector
- Parameters:
s0
- initial time, state vector and derivativet
- target time for the integration
-
getMaxCheckInterval
Get the maximal time interval between events handler checks.- Specified by:
getMaxCheckInterval
in interfaceODEEventDetector
- Returns:
- maximal time interval between events handler checks
-
getMaxIterationCount
public int getMaxIterationCount()Get the upper limit in the iteration count for event localization.- Specified by:
getMaxIterationCount
in interfaceODEEventDetector
- Returns:
- upper limit in the iteration count for event localization
-
getSolver
Get the root-finding algorithm to use to detect state events.- Specified by:
getSolver
in interfaceODEEventDetector
- Returns:
- root-finding algorithm to use to detect state events
-
withMaxCheck
Setup the maximum checking interval.This will override a maximum checking interval if it has been configured previously.
- Parameters:
newMaxCheck
- maximum checking interval- Returns:
- a new detector with updated configuration (the instance is not changed)
-
withMaxCheck
Setup the maximum checking interval.This will override a maximum checking interval if it has been configured previously.
- Parameters:
newMaxCheck
- maximum checking interval- Returns:
- a new detector with updated configuration (the instance is not changed)
- Since:
- 3.0
-
withMaxIter
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
Setup the convergence threshold.This is equivalent to call
withSolver(new BracketingNthOrderBrentSolver(0, newThreshold, 0, 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
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
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
Get the underlying event handler.- Specified by:
getHandler
in interfaceODEEventDetector
- Returns:
- underlying event handler
-
create
protected abstract T create(AdaptableInterval newMaxCheck, int newmaxIter, BracketedUnivariateSolver<UnivariateFunction> newSolver, ODEEventHandler newHandler) Build a new instance.- Parameters:
newMaxCheck
- maximum checking intervalnewmaxIter
- maximum number of iterations in the event time searchnewSolver
- root-finding algorithm to use to detect state eventsnewHandler
- event handler to call at event occurrences- Returns:
- a new instance of the appropriate sub-type
-
isForward
public boolean isForward()Check if the current propagation is forward or backward.- Returns:
- true if the current propagation is forward
-