public class ExtremumApproachDetector extends AbstractDetector<ExtremumApproachDetector>
This class finds extremum approach events (i.e. closest or farthest approach).
The default implementation behavior is to continue
propagation at farthest approach and to
stop
propagation at closest approach. This can be changed by calling
AbstractDetector.withHandler(EventHandler)
after construction (go to the end of the documentation to see an example).
As this detector needs two objects (moving relative to each other), it embeds one
coordinates provider
for the secondary object and is registered as an event detector in
the propagator of the primary object. The secondary object coordinates provider
will
therefore be driven by this detector (and hence by the propagator in which this detector is registered).
In order to avoid infinite recursion, care must be taken to have the secondary object provider being completely
independent from anything else. In particular, if the provider is a propagator, it should not be run
together in a propagators parallelizer
with the propagator this detector is
registered in. It is fine however to configure two separate propagators PsA and PsB with similar settings for the
secondary object and one propagator Pm for the primary object and then use Psa in this detector registered within Pm
while Pm and Psb are run in the context of a propagators parallelizer
.
For efficiency reason during the event search loop, it is recommended to have the secondary provider be an analytical propagator or an ephemeris. A numerical propagator as a secondary propagator works but is expected to be computationally costly.
Also, it is possible to detect solely one type of event using an event slope filter
. For
example in order to only detect closest approach, one should type the following :
ExtremumApproachDetector extremumApproachDetector = new ExtremumApproachDetector(secondaryPVProvider);
EventDetector closeApproachDetector = new EventSlopeFilter<ExtremumApproachDetector>(extremumApproachDetector,FilterType.TRIGGER_ONLY_INCREASING_EVENTS);
Propagator.addEventDetector(EventDetector)
,
EventSlopeFilter
,
FilterType
DEFAULT_MAX_ITER, DEFAULT_MAXCHECK, DEFAULT_THRESHOLD
Constructor and Description |
---|
ExtremumApproachDetector(double maxCheck,
double threshold,
int maxIter,
EventHandler<? super ExtremumApproachDetector> handler,
PVCoordinatesProvider secondaryPVProvider)
Constructor.
|
ExtremumApproachDetector(PVCoordinatesProvider secondaryPVProvider)
Constructor with default values.
|
Modifier and Type | Method and Description |
---|---|
protected PVCoordinates |
computeDeltaPV(SpacecraftState s)
Compute the relative PV between primary and secondary objects.
|
protected ExtremumApproachDetector |
create(double newMaxCheck,
double newThreshold,
int newMaxIter,
EventHandler<? super ExtremumApproachDetector> newHandler)
Build a new instance.
|
double |
g(SpacecraftState s)
The
g is positive when the primary object is getting further away from the secondary object and is
negative when it is getting closer to it. |
eventOccurred, getHandler, getMaxCheckInterval, getMaxIterationCount, getThreshold, init, isForward, resetState, withHandler, withMaxCheck, withMaxIter, withThreshold
public ExtremumApproachDetector(PVCoordinatesProvider secondaryPVProvider)
By default, the implemented behavior is to continue
propagation at farthest approach and
to stop
propagation at closest approach.
secondaryPVProvider
- PVCoordinates provider of the other object with which we want to find out the extremum
approach.public ExtremumApproachDetector(double maxCheck, double threshold, int maxIter, EventHandler<? super ExtremumApproachDetector> handler, PVCoordinatesProvider secondaryPVProvider)
This constructor is to be used if the user wants to change the default behavior of the detector.
maxCheck
- Maximum checking interval (s).threshold
- Convergence threshold (s).maxIter
- Maximum number of iterations in the event time search.handler
- Event handler to call at event occurrences.secondaryPVProvider
- PVCoordinates provider of the other object with which we want to find out the extremum
* approach.EventHandler
public double g(SpacecraftState s)
g
is positive when the primary object is getting further away from the secondary object and is
negative when it is getting closer to it.g
in interface EventDetector
g
in class AbstractDetector<ExtremumApproachDetector>
s
- the current state information: date, kinematics, attitudeprotected PVCoordinates computeDeltaPV(SpacecraftState s)
s
- Spacecraft state.protected ExtremumApproachDetector create(double newMaxCheck, double newThreshold, int newMaxIter, EventHandler<? super ExtremumApproachDetector> newHandler)
create
in class AbstractDetector<ExtremumApproachDetector>
newMaxCheck
- maximum checking interval (s)newThreshold
- convergence threshold (s)newMaxIter
- maximum number of iterations in the event time searchnewHandler
- event handler to call at event occurrencesCopyright © 2002-2022 CS GROUP. All rights reserved.