public class ThreeBodiesAngleDetector extends AbstractDetector implements MultiEventDetector
If body1, body2 and body3 are the three bodies, the detector computes the angle between the two vectors v21 (vector from body2 to body1) and v23 (vector from body2 to body3), and compare it with the threshold angle value.
The default implementation behavior is to stop
propagation when the angle between
the three bodies is reached. This can be changed by using provided constructors.
EventDetector
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
ThreeBodiesAngleDetector.BodyOrder
Bodies order type.
|
EventDetector.Action
DEFAULT_MAXCHECK, DEFAULT_THRESHOLD
DECREASING, INCREASING, INCREASING_DECREASING
DECREASING, INCREASING, INCREASING_DECREASING
Constructor and Description |
---|
ThreeBodiesAngleDetector(PVCoordinatesProvider firstBody,
PVCoordinatesProvider secondBody,
PVCoordinatesProvider thirdBody,
double angle)
Build a new three bodies angle detector.
|
ThreeBodiesAngleDetector(PVCoordinatesProvider firstBody,
PVCoordinatesProvider secondBody,
PVCoordinatesProvider thirdBody,
double angle,
double maxCheck,
double threshold)
Build a new three bodies angle detector with complimentary parameters.
|
ThreeBodiesAngleDetector(PVCoordinatesProvider firstBody,
PVCoordinatesProvider secondBody,
PVCoordinatesProvider thirdBody,
double angle,
double maxCheck,
double threshold,
EventDetector.Action action)
Build a new three bodies angle detector with complimentary parameters.
|
ThreeBodiesAngleDetector(PVCoordinatesProvider bodyA,
PVCoordinatesProvider bodyB,
ThreeBodiesAngleDetector.BodyOrder bodyC,
double angle)
Build a new three bodies angle detector with a position among the parameters.
|
ThreeBodiesAngleDetector(PVCoordinatesProvider bodyA,
PVCoordinatesProvider bodyB,
ThreeBodiesAngleDetector.BodyOrder bodyC,
double angle,
double maxCheck,
double threshold)
Build a new three bodies angle detector with complimentary parameters.
|
ThreeBodiesAngleDetector(PVCoordinatesProvider bodyA,
PVCoordinatesProvider bodyB,
ThreeBodiesAngleDetector.BodyOrder bodyC,
double angle,
double maxCheck,
double threshold,
EventDetector.Action action)
Build a new three bodies angle detector with complimentary parameters.
|
ThreeBodiesAngleDetector(PVCoordinatesProvider bodyA,
PVCoordinatesProvider bodyB,
ThreeBodiesAngleDetector.BodyOrder bodyC,
double angle,
double maxCheck,
double threshold,
EventDetector.Action action,
boolean remove)
Build a new three bodies angle detector with complimentary parameters.
|
ThreeBodiesAngleDetector(String firstId,
String secondId,
String thirdId,
double angle,
double maxCheck,
double threshold,
EventDetector.Action action)
Build a new three bodies angle detector.
|
Modifier and Type | Method and Description |
---|---|
EventDetector |
copy()
A copy of the detector.
|
EventDetector.Action |
eventOccurred(Map<String,SpacecraftState> s,
boolean increasing,
boolean forward)
Handle an event and choose what to do next.
|
EventDetector.Action |
eventOccurred(SpacecraftState s,
boolean increasing,
boolean forward)
Handle an angle event and choose what to do next.
|
double |
g(Map<String,SpacecraftState> s)
Compute the value of the switching function.
|
double |
g(SpacecraftState s)
Compute the value of the switching function.
|
double |
getAlignmentAngle()
Get the alignment angle.
|
PVCoordinatesProvider |
getFirstBody()
Get 1st body.
|
String |
getInSpacecraftId1()
Get the first spacecraft id.
|
String |
getInSpacecraftId2()
Get the second spacecraft id.
|
String |
getInSpacecraftId3()
Get the third spacecraft id.
|
PVCoordinatesProvider |
getSecondBody()
Get 2nd body.
|
PVCoordinatesProvider |
getThirdBody()
Get 3rd body.
|
void |
init(Map<String,SpacecraftState> s0,
AbsoluteDate t)
Initialize event handler at the start of a propagation.
|
void |
init(SpacecraftState s0,
AbsoluteDate t)
Initialize event handler at the start of a propagation.
|
Map<String,SpacecraftState> |
resetStates(Map<String,SpacecraftState> oldStates)
Reset the states (including additional states) prior to continue propagation.
|
boolean |
shouldBeRemoved()
This method is called after
EventDetector.eventOccurred(fr.cnes.sirius.patrius.propagation.SpacecraftState, boolean, boolean) has been triggered. |
getMaxCheckInterval, getMaxIterationCount, getSlopeSelection, getThreshold, resetState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMaxCheckInterval, getMaxIterationCount, getSlopeSelection, getThreshold
public ThreeBodiesAngleDetector(PVCoordinatesProvider firstBody, PVCoordinatesProvider secondBody, PVCoordinatesProvider thirdBody, double angle)
Propagator
).
If v21 is the vector from the second body to the first body and v23 is the vector from the second body to the third body, the detected angle will be the angle (in the range 0-Π) between v21 and v23.
firstBody
- the first bodysecondBody
- the second bodythirdBody
- the third bodyangle
- angle in rad triggering the event.public ThreeBodiesAngleDetector(PVCoordinatesProvider firstBody, PVCoordinatesProvider secondBody, PVCoordinatesProvider thirdBody, double angle, double maxCheck, double threshold)
Propagator
).
If v21 is the vector from the second body to the first body and v23 is the vector from the second body to the third body, the detected angle will be the angle (in the range 0-Π) between v21 and v23.
The default implementation behavior is to stop
propagation when the angle is
reached.
firstBody
- the first bodysecondBody
- the second bodythirdBody
- the third bodyangle
- angle in rad triggering the event.maxCheck
- maximum check (see AbstractDetector
)threshold
- convergence threshold (see AbstractDetector
)public ThreeBodiesAngleDetector(PVCoordinatesProvider firstBody, PVCoordinatesProvider secondBody, PVCoordinatesProvider thirdBody, double angle, double maxCheck, double threshold, EventDetector.Action action)
Propagator
).
If v21 is the vector from the second body to the first body and v23 is the vector from the second body to the third body, the detected angle will be the angle (in the range 0-Π) between v21 and v23.
firstBody
- the first bodysecondBody
- the second bodythirdBody
- the third bodyangle
- angle in rad triggering the event.maxCheck
- maximum check (see AbstractDetector
)threshold
- convergence threshold (see AbstractDetector
)action
- action performed at angle detectionpublic ThreeBodiesAngleDetector(PVCoordinatesProvider bodyA, PVCoordinatesProvider bodyB, ThreeBodiesAngleDetector.BodyOrder bodyC, double angle)
Propagator
). The orbit of one of the
three bodies is implicitly the one which is propagated by the propagator associated to this
event detector.
If v21 is the vector from the second body to the first body and v23 is the vector from the second body to the third body, the detected angle will be the angle (in the range 0-Π) between v21 and v23.
bodyA
- first body (if the body C is the second or third body), second body otherwisebodyB
- third body (if the body C is the first or second body), second body otherwisebodyC
- position within the constellation of the body whose orbit will be propagated by
the propagator associated to this event detectorangle
- angle in rad triggering the event.public ThreeBodiesAngleDetector(PVCoordinatesProvider bodyA, PVCoordinatesProvider bodyB, ThreeBodiesAngleDetector.BodyOrder bodyC, double angle, double maxCheck, double threshold)
Propagator
). The orbit of one of the three
bodies is implicitly the one which is propagated by the propagator associated to this event
detector.
If v21 is the vector from the second body to the first body and v23 is the vector from the second body to the third body, the detected angle will be the angle (in the range 0-Π) between v21 and v23.
The default implementation behavior is to stop
propagation when the angle is
reached.
bodyA
- first body (if the body C is the second or third body), second body otherwisebodyB
- third body (if the body C is the first or second body), second body otherwisebodyC
- position within the constellation of the body whose orbit will be propagated by
the propagator associated to this event detectorangle
- angle in rad triggering the event.maxCheck
- maximum check (see AbstractDetector
)threshold
- convergence threshold (see AbstractDetector
)public ThreeBodiesAngleDetector(PVCoordinatesProvider bodyA, PVCoordinatesProvider bodyB, ThreeBodiesAngleDetector.BodyOrder bodyC, double angle, double maxCheck, double threshold, EventDetector.Action action)
Propagator
). The orbit of one of the three
bodies is implicitly the one which is propagated by the propagator associated to this event
detector.
If v21 is the vector from the second body to the first body and v23 is the vector from the second body to the third body, the detected angle will be the angle (in the range 0-Π) between v21 and v23.
bodyA
- first body (if the body C is the second or third body), second body otherwisebodyB
- third body (if the body C is the first or second body), second body otherwisebodyC
- position within the constellation of the body whose orbit will be propagated by
the propagator associated to this event detectorangle
- angle in rad triggering the event.maxCheck
- maximum check (see AbstractDetector
)threshold
- convergence threshold (see AbstractDetector
)action
- action performed at angle detectionpublic ThreeBodiesAngleDetector(PVCoordinatesProvider bodyA, PVCoordinatesProvider bodyB, ThreeBodiesAngleDetector.BodyOrder bodyC, double angle, double maxCheck, double threshold, EventDetector.Action action, boolean remove)
Propagator
). The orbit of one of the three
bodies is implicitly the one which is propagated by the propagator associated to this event
detector.
If v21 is the vector from the second body to the first body and v23 is the vector from the second body to the third body, the detected angle will be the angle (in the range 0-Π) between v21 and v23.
bodyA
- first body (if the body C is the second or third body), second body otherwisebodyB
- third body (if the body C is the first or second body), second body otherwisebodyC
- position within the constellation of the body whose orbit will be propagated by
the propagator associated to this event detectorangle
- angle in rad triggering the event.maxCheck
- maximum check (see AbstractDetector
)threshold
- convergence threshold (see AbstractDetector
)action
- action performed at angle detectionremove
- true if detector should be removed at angle detectionpublic ThreeBodiesAngleDetector(String firstId, String secondId, String thirdId, double angle, double maxCheck, double threshold, EventDetector.Action action)
If v21 is the vector from the second body to the first body and v23 is the vector from the second body to the third body, the detected angle will be the angle (in the range 0-Π) between v21 and v23.
firstId
- first body (if the body C is the second or third body), second body otherwisesecondId
- third body (if the body C is the first or second body), second body otherwisethirdId
- position within the constellation of the body whose orbit will be propagated
by the propagator associated to this event detectorangle
- angle in rad triggering the event.maxCheck
- maximum check (see AbstractDetector
)threshold
- convergence threshold (see AbstractDetector
)action
- action performed at angle detectionpublic EventDetector.Action eventOccurred(SpacecraftState s, boolean increasing, boolean forward) throws PatriusException
eventOccurred
in interface EventDetector
eventOccurred
in class AbstractDetector
s
- the current state informationincreasing
- if true, the value of the switching function increases when times increases
around eventforward
- if true, the integration variable (time) increases during integrationPatriusException
- if some specific error occurspublic boolean shouldBeRemoved()
EventDetector.eventOccurred(fr.cnes.sirius.patrius.propagation.SpacecraftState, boolean, boolean)
has been triggered. It returns true if the
current detector should be removed after first event detection. WARNING: this method
can be called only once a event has been triggered. Before, the value is not available.shouldBeRemoved
in interface EventDetector
shouldBeRemoved
in interface MultiEventDetector
shouldBeRemoved
in class AbstractDetector
public double g(SpacecraftState s) throws PatriusException
g
in interface EventDetector
g
in class AbstractDetector
s
- the current state informationPatriusException
- if some specific error occurspublic void init(SpacecraftState s0, AbsoluteDate t)
This method is called once at the start of the propagation. It may be used by the event handler to initialize some internal data if needed.
init
in interface EventDetector
init
in class AbstractDetector
s0
- initial statet
- target time for the integrationpublic PVCoordinatesProvider getFirstBody()
public PVCoordinatesProvider getSecondBody()
public PVCoordinatesProvider getThirdBody()
public double getAlignmentAngle()
public void init(Map<String,SpacecraftState> s0, AbsoluteDate t)
This method is called once at the start of the propagation. It may be used by the event handler to initialize some internal data if needed.
init
in interface MultiEventDetector
s0
- map of initial statest
- target time for the integrationpublic double g(Map<String,SpacecraftState> s) throws PatriusException
This function must be continuous (at least in its roots neighborhood), as the integrator will need to find its roots to locate the events.
g
in interface MultiEventDetector
s
- the current states information: date, kinematics, attitudes for forces
and events computation, and additional states for each statesPatriusException
- if some specific error occurspublic EventDetector.Action eventOccurred(Map<String,SpacecraftState> s, boolean increasing, boolean forward) throws PatriusException
The scheduling between this method and the MultiOrekitStepHandler method handleStep is to call this method first
and handleStep
afterwards. This scheduling allows the propagator to pass true
as the
isLast
parameter to the step handler to make it aware the step will be the last one if this method
returns EventDetector.Action.STOP
. As the interpolator may be
used to navigate back throughout the last step MultiOrekitStepNormalizer does for example), user code called by
this method and user code called by step handlers may experience apparently out of order values of the
independent time variable. As an example, if the same user object implements both this MultiEventDetector
interface and the MultiOrekitFixedStepHandler interface, a forward integration may
call its eventOccurred
method with a state at 2000-01-01T00:00:10 first and call its
handleStep
method with a state at 2000-01-01T00:00:09 afterwards. Such out of order calls are
limited to the size of the integration step for MultiOrekitStepHandler and to the size of the fixed step for
MultiOrekitFixedStepHandler.
eventOccurred
in interface MultiEventDetector
s
- the current states information: date, kinematics, attitude for forces
and events computation, and additional states for each statesincreasing
- if true, the value of the switching function increases
when times increases around event (note that increase is measured with respect
to physical time, not with respect to propagation which may go backward in time)forward
- if true, the integration variable (time) increases during integration.EventDetector.Action.STOP
,
EventDetector.Action.RESET_STATE
,
EventDetector.Action.RESET_DERIVATIVES
,
EventDetector.Action.CONTINUE
PatriusException
- if some specific error occurspublic Map<String,SpacecraftState> resetStates(Map<String,SpacecraftState> oldStates) throws PatriusException
This method is called after the step handler has returned and before the next step is started, but only when
MultiEventDetector.eventOccurred(java.util.Map<java.lang.String, fr.cnes.sirius.patrius.propagation.SpacecraftState>, boolean, boolean)
has itself returned the
EventDetector.Action.RESET_STATE
indicator. It allows the user
to reset the state for the next step, without perturbing the step handler of the finishing step. If the
MultiEventDetector.eventOccurred(java.util.Map<java.lang.String, fr.cnes.sirius.patrius.propagation.SpacecraftState>, boolean, boolean)
never returns the
EventDetector.Action.RESET_STATE
indicator, this function will
never be called, and it is safe to simply return null.
resetStates
in interface MultiEventDetector
oldStates
- old statesPatriusException
- if the states cannot be resetedpublic String getInSpacecraftId1()
public String getInSpacecraftId2()
public String getInSpacecraftId3()
public EventDetector copy()
The following attributes are not deeply copied:
PVCoordinatesProvider
PVCoordinatesProvider
PVCoordinatesProvider
copy
in interface EventDetector
Copyright © 2019 CNES. All rights reserved.