Class FieldExtremumApproachDetector<T extends CalculusFieldElement<T>>
- java.lang.Object
-
- org.orekit.propagation.events.FieldAbstractDetector<FieldExtremumApproachDetector<T>,T>
-
- org.orekit.propagation.events.FieldExtremumApproachDetector<T>
-
- All Implemented Interfaces:
FieldEventDetector<T>
public class FieldExtremumApproachDetector<T extends CalculusFieldElement<T>> extends FieldAbstractDetector<FieldExtremumApproachDetector<T>,T>
Finder for extremum approach events.This class finds extremum approach events (i.e. closest or farthest approach).
The default implementation behavior is to
continue
propagation at farthest approach and tostop
propagation at closest approach. This can be changed by callingFieldAbstractDetector.withHandler(FieldEventHandler)
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
fielded coordinates provider
for the secondary object and is registered as an event detector in the propagator of the primary object. The secondary objectfielded coordinates provider
will therefore be driven by this detector (and hence by the propagator in which this detector is registered). Note that you can also create this detector using a standardcoordinates provider
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 apropagators 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 :FieldExtremumApproachDetector<Type> extremumApproachDetector = new FieldExtremumApproachDetector<>(field, secondaryPVProvider); FieldEventDetector<Type> closeApproachDetector = new FieldEventSlopeFilter<>(extremumApproachDetector, FilterType.TRIGGER_ONLY_INCREASING_EVENTS);
- Since:
- 11.3
- Author:
- Vincent Cucchietti
- See Also:
FieldPropagator.addEventDetector(FieldEventDetector)
,FieldEventSlopeFilter
,FilterType
-
-
Field Summary
-
Fields inherited from class org.orekit.propagation.events.FieldAbstractDetector
DEFAULT_MAX_ITER, DEFAULT_MAXCHECK, DEFAULT_THRESHOLD
-
-
Constructor Summary
Constructors Modifier Constructor Description FieldExtremumApproachDetector(Field<T> field, FieldPVCoordinatesProvider<T> secondaryPVProvider)
Constructor with default values.FieldExtremumApproachDetector(Field<T> field, PVCoordinatesProvider secondaryPVProvider)
Constructor with default values.protected
FieldExtremumApproachDetector(FieldAdaptableInterval<T> maxCheck, T threshold, int maxIter, FieldEventHandler<T> handler, FieldPVCoordinatesProvider<T> secondaryPVProvider)
Constructor.protected
FieldExtremumApproachDetector(T maxCheck, T threshold, int maxIter, FieldEventHandler<T> handler, FieldPVCoordinatesProvider<T> secondaryPVProvider)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description FieldPVCoordinates<T>
computeDeltaPV(FieldSpacecraftState<T> s)
Deprecated.The output type of this method shall be modified in the future to improve code efficiency (though it will still give access to the relative position and velocity)protected FieldExtremumApproachDetector<T>
create(FieldAdaptableInterval<T> newMaxCheck, T newThreshold, int newMaxIter, FieldEventHandler<T> newHandler)
Build a new instance.T
g(FieldSpacecraftState<T> s)
Theg
is positive when the primary object is getting further away from the secondary object and is negative when it is getting closer to it.FieldPVCoordinatesProvider<T>
getSecondaryPVProvider()
Get the secondary position-velocity provider stored in this instance.-
Methods inherited from class org.orekit.propagation.events.FieldAbstractDetector
getDetectionSettings, getHandler, getMaxCheckInterval, getMaxIterationCount, getThreshold, init, isForward, withDetectionSettings, withHandler, withMaxCheck, withMaxCheck, withMaxIter, withThreshold
-
-
-
-
Constructor Detail
-
FieldExtremumApproachDetector
public FieldExtremumApproachDetector(Field<T> field, PVCoordinatesProvider secondaryPVProvider)
Constructor with default values.By default, the implemented behavior is to
continue
propagation at farthest approach and tostop
propagation at closest approach.BEWARE : This constructor will "fieldify" given secondary PV coordinates provider.
- Parameters:
field
- field the type of number to usesecondaryPVProvider
- PVCoordinates provider of the other object with which we want to find out the extremum approach.
-
FieldExtremumApproachDetector
public FieldExtremumApproachDetector(Field<T> field, FieldPVCoordinatesProvider<T> secondaryPVProvider)
Constructor with default values.By default, the implemented behavior is to
continue
propagation at farthest approach and tostop
propagation at closest approach.- Parameters:
field
- field the type of number to usesecondaryPVProvider
- PVCoordinates provider of the other object with which we want to find out the extremum approach.
-
FieldExtremumApproachDetector
protected FieldExtremumApproachDetector(T maxCheck, T threshold, int maxIter, FieldEventHandler<T> handler, FieldPVCoordinatesProvider<T> secondaryPVProvider)
Constructor.This constructor is to be used if the user wants to change the default behavior of the detector.
- Parameters:
maxCheck
- Maximum checking interval.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.- See Also:
FieldEventHandler
-
FieldExtremumApproachDetector
protected FieldExtremumApproachDetector(FieldAdaptableInterval<T> maxCheck, T threshold, int maxIter, FieldEventHandler<T> handler, FieldPVCoordinatesProvider<T> secondaryPVProvider)
Constructor.This constructor is to be used if the user wants to change the default behavior of the detector.
- Parameters:
maxCheck
- Maximum checking interval.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.- See Also:
EventHandler
-
-
Method Detail
-
computeDeltaPV
@Deprecated public FieldPVCoordinates<T> computeDeltaPV(FieldSpacecraftState<T> s)
Deprecated.The output type of this method shall be modified in the future to improve code efficiency (though it will still give access to the relative position and velocity)Compute the relative PV between primary and secondary objects.- Parameters:
s
- Spacecraft state.- Returns:
- Relative position between primary (=s) and secondaryPVProvider.
-
getSecondaryPVProvider
public FieldPVCoordinatesProvider<T> getSecondaryPVProvider()
Get the secondary position-velocity provider stored in this instance.- Returns:
- the secondary position-velocity provider stored in this instance
-
g
public T g(FieldSpacecraftState<T> s)
Theg
is positive when the primary object is getting further away from the secondary object and is negative when it is getting closer to it.- Parameters:
s
- the current state information: date, kinematics, attitude- Returns:
- value of the switching function
-
create
protected FieldExtremumApproachDetector<T> create(FieldAdaptableInterval<T> newMaxCheck, T newThreshold, int newMaxIter, FieldEventHandler<T> newHandler)
Build a new instance.- Specified by:
create
in classFieldAbstractDetector<FieldExtremumApproachDetector<T extends CalculusFieldElement<T>>,T extends CalculusFieldElement<T>>
- Parameters:
newMaxCheck
- maximum checking intervalnewThreshold
- convergence threshold (s)newMaxIter
- maximum number of iterations in the event time searchnewHandler
- event handler to call at event occurrences- Returns:
- a new instance of the appropriate sub-type
-
-