public abstract class StelaAbstractPropagator extends Object implements Propagator
Propagator
methods for analytical propagators.
This abstract class allows to provide easily the full set of Propagator
methods, including all propagation
modes support and discrete events support for any simple propagation method. Only two methods must be implemented by
derived classes: propagateSpacecraftState(AbsoluteDate)
and getMass(AbsoluteDate)
. The first method
should perform straightforward propagation starting from some internally stored initial state up to the specified
target date.
Modifier and Type | Field and Description |
---|---|
protected AttitudeProvider |
attitudeProviderByDefault
Attitude provider given by default for one attitude.
|
protected AttitudeProvider |
attitudeProviderEvents
Attitude provider for events computation.
|
protected AttitudeProvider |
attitudeProviderForces
Attitude provider for forces computation.
|
protected Collection<EventState> |
eventsStates
Event steps.
|
protected FirstOrderIntegrator |
integrator
Integrator for the orbital extrapolation process.
|
protected PatriusFixedStepHandler |
oldStepHandler
Entry Step handler.
|
EPHEMERIS_GENERATION_MODE, MASTER_MODE, SLAVE_MODE
Modifier | Constructor and Description |
---|---|
protected |
StelaAbstractPropagator(AttitudeProvider attitudeProviderInForces,
AttitudeProvider attitudeProviderInEvents,
StelaBasicInterpolator inInterpolator)
Build a new instance.
|
protected |
StelaAbstractPropagator(AttitudeProvider attitudeProviderIn,
StelaBasicInterpolator inInterpolator)
Build a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected SpacecraftState |
acceptStep(AbsoluteDate target,
double epsilon)
Accept a step, triggering events and step handlers.
|
void |
addAdditionalStateProvider(AdditionalStateProvider additionalStateProvider)
Add a set of user-specified state parameters to be computed along with the orbit propagation.
|
void |
addEventDetector(EventDetector detector)
Add an event detector.
|
protected SpacecraftState |
basicPropagate(AbsoluteDate date)
Propagate a SpacecraftState without any fancy features.
|
void |
clearEventsDetectors()
Remove all events detectors.
|
AttitudeProvider |
getAttitudeProvider()
Get attitude provider.
|
AttitudeProvider |
getAttitudeProviderEvents()
Get attitude provider for events computation.
|
AttitudeProvider |
getAttitudeProviderForces()
Get attitude provider for forces computation.
|
Collection<EventDetector> |
getEventsDetectors()
Get all the events detectors that have been added.
|
Frame |
getFrame()
Get the frame in which the orbit is propagated.
|
BoundedPropagator |
getGeneratedEphemeris()
Get the ephemeris generated during propagation.
|
SpacecraftState |
getInitialState()
Get the propagator initial state.
|
protected abstract double |
getMass(AbsoluteDate date)
Get the mass.
|
int |
getMode()
Get the current operating mode of the propagator.
|
PVCoordinates |
getPVCoordinates(AbsoluteDate date,
Frame frame)
Get the
PVCoordinates of the body in the selected frame. |
PVCoordinatesProvider |
getPvProvider()
Get PV coordinates provider.
|
protected abstract List<PatriusStepHandler> |
getStepHandlers()
Provides a list of step handlers to be performed during propagation.
|
List<TimeDerivativeData> |
getTimeDerivativesList()
Returns time derivatives list.
|
protected SpacecraftState |
goAhead(double stepSize,
double dt,
AbsoluteDate target)
go one step ahead
|
boolean |
isStoreTimeDerivatives()
Returns flag indicating if time derivatives dE'/dt must be stored.
|
SpacecraftState |
propagate(AbsoluteDate target)
Propagate towards a target date.
|
SpacecraftState |
propagate(AbsoluteDate start,
AbsoluteDate target)
Propagate from a start date towards a target date.
|
protected abstract SpacecraftState |
propagateSpacecraftState(AbsoluteDate date)
Extrapolate a spacecraftState up to a specific target date.
|
protected SpacecraftState |
propagationManagement(SpacecraftState state,
double stepSize,
double dt,
AbsoluteDate target)
Manages the current step, method to override when user wants to deal with exceptions during the propagation.
|
void |
resetInitialState(SpacecraftState state)
Reset the propagator initial state.
|
void |
setAttitudeProvider(AttitudeProvider attitudeProviderIn)
Set attitude provider for forces and events computation.
|
void |
setAttitudeProviderEvents(AttitudeProvider attitudeProviderIn)
Set attitude provider for events computation.
|
void |
setAttitudeProviderForces(AttitudeProvider attitudeProviderIn)
Set attitude provider for forces computation.
|
void |
setEphemerisMode()
Set the propagator to ephemeris generation mode.
|
void |
setIntegrator(FirstOrderIntegrator inIntegrator)
Set the integrator.
|
void |
setMasterMode(double h,
PatriusFixedStepHandler handler)
Set the propagator to master mode with fixed steps.
|
void |
setMasterMode(PatriusStepHandler handler)
Set the propagator to master mode with variable steps.
|
void |
setOrbitFrame(Frame frame)
Set propagation frame.
|
void |
setSlaveMode()
Set the propagator to slave mode.
|
protected void |
setStartDate(AbsoluteDate startDateIn)
Set a start date.
|
void |
setStoreTimeDerivatives(boolean isStoreTimeDerivatives)
Setter for flag indicating if time derivatives dE'/dt must be stored.
|
protected PatriusFixedStepHandler oldStepHandler
protected final Collection<EventState> eventsStates
protected FirstOrderIntegrator integrator
protected AttitudeProvider attitudeProviderForces
protected AttitudeProvider attitudeProviderEvents
protected AttitudeProvider attitudeProviderByDefault
protected StelaAbstractPropagator(AttitudeProvider attitudeProviderIn, StelaBasicInterpolator inInterpolator)
attitudeProviderIn
- provider for attitude computationinInterpolator
- the interpolator used during the propagationprotected StelaAbstractPropagator(AttitudeProvider attitudeProviderInForces, AttitudeProvider attitudeProviderInEvents, StelaBasicInterpolator inInterpolator)
attitudeProviderInForces
- attitude for forces computationattitudeProviderInEvents
- attitude for events computationinInterpolator
- the interpolator used during the propagationprotected void setStartDate(AbsoluteDate startDateIn)
startDateIn
- start datepublic AttitudeProvider getAttitudeProvider()
getAttitudeProvider
in interface Propagator
public AttitudeProvider getAttitudeProviderForces()
getAttitudeProviderForces
in interface Propagator
public AttitudeProvider getAttitudeProviderEvents()
getAttitudeProviderEvents
in interface Propagator
public void setAttitudeProvider(AttitudeProvider attitudeProviderIn)
ConstantAttitudeLaw
.setAttitudeProvider
in interface Propagator
attitudeProviderIn
- attitude providerpublic void setAttitudeProviderForces(AttitudeProvider attitudeProviderIn)
ConstantAttitudeLaw
.setAttitudeProviderForces
in interface Propagator
attitudeProviderIn
- attitude provider for forces computationpublic void setAttitudeProviderEvents(AttitudeProvider attitudeProviderIn)
ConstantAttitudeLaw
.setAttitudeProviderEvents
in interface Propagator
attitudeProviderIn
- attitude provider for events computationpublic PVCoordinatesProvider getPvProvider()
public SpacecraftState getInitialState() throws PatriusException
getInitialState
in interface Propagator
PatriusException
- if state cannot be retrievedpublic int getMode()
getMode
in interface Propagator
Propagator.SLAVE_MODE
, Propagator.MASTER_MODE
, Propagator.EPHEMERIS_GENERATION_MODE
Propagator.setSlaveMode()
,
Propagator.setMasterMode(double, PatriusFixedStepHandler)
,
Propagator.setMasterMode(PatriusStepHandler)
,
Propagator.setEphemerisMode()
public Frame getFrame()
4 cases are possible:
Propagator.setOrbitFrame(Frame)
): it is returned.getFrame
in interface Propagator
public void setSlaveMode()
This mode is used when the user needs only the final orbit at the target time. The (slave) propagator computes this result and return it to the calling (master) application, without any intermediate feedback.
This is the default mode.
public void setMasterMode(double h, PatriusFixedStepHandler handler)
This mode is used when the user needs to have some custom function called at the end of each finalized step during integration. The (master) propagator integration loop calls the (slave) application callback methods at each finalized step.
Note that mean elements will be provided by the step handler.setMasterMode
in interface Propagator
h
- fixed stepsize (s)handler
- handler called at the end of each finalized stepPropagator.setSlaveMode()
,
Propagator.setMasterMode(PatriusStepHandler)
,
Propagator.setEphemerisMode()
,
Propagator.getMode()
,
Propagator.MASTER_MODE
public void setMasterMode(PatriusStepHandler handler)
This mode is used when the user needs to have some custom function called at the end of each finalized step during integration. The (master) propagator integration loop calls the (slave) application callback methods at each finalized step.
Note that mean elements will be provided by the step handler.setMasterMode
in interface Propagator
handler
- handler called at the end of each finalized stepPropagator.setSlaveMode()
,
Propagator.setMasterMode(double, PatriusFixedStepHandler)
,
Propagator.setEphemerisMode()
,
Propagator.getMode()
,
Propagator.MASTER_MODE
public void setEphemerisMode()
This mode is used when the user needs random access to the orbit state at any time between the initial and target times, and in no sequential order. A typical example is the implementation of search and iterative algorithms that may navigate forward and backward inside the propagation range before finding their result.
Beware that since this mode stores all intermediate results, it may be memory intensive for long integration ranges and high precision/short time steps.
public void setOrbitFrame(Frame frame) throws PatriusException
setOrbitFrame
in interface Propagator
frame
- the frame to use.
This frame must be inertial or pseudo-inertial, otherwise an exception is raised.PatriusException
- if frame is not inertial or pseudo-inertialpublic BoundedPropagator getGeneratedEphemeris()
getGeneratedEphemeris
in interface Propagator
Propagator.setEphemerisMode()
public void addEventDetector(EventDetector detector)
addEventDetector
in interface Propagator
detector
- event detector to addPropagator.clearEventsDetectors()
,
Propagator.getEventsDetectors()
public Collection<EventDetector> getEventsDetectors()
getEventsDetectors
in interface Propagator
Propagator.addEventDetector(EventDetector)
,
Propagator.clearEventsDetectors()
public void clearEventsDetectors()
clearEventsDetectors
in interface Propagator
Propagator.addEventDetector(EventDetector)
,
Propagator.getEventsDetectors()
public void addAdditionalStateProvider(AdditionalStateProvider additionalStateProvider) throws PatriusException
additionalStateProvider
- provider for additional statePatriusException
- if an additional state with the same name is already presentpublic SpacecraftState propagate(AbsoluteDate target) throws PropagationException
Simple propagators use only the target date as the specification for computing the propagated state. More feature rich propagators can consider other information and provide different operating modes or G-stop facilities to stop at pinpointed events occurrences. In these cases, the target date is only a hint, not a mandatory objective.
Note that mean elements are returned.propagate
in interface Propagator
target
- target date towards which orbit state should be propagatedPropagationException
- if state cannot be propagatedpublic SpacecraftState propagate(AbsoluteDate start, AbsoluteDate target) throws PropagationException
Those propagators use a start date and a target date to compute the propagated state. For propagators using event detection mechanism, if the provided start date is different from the initial state date, a first, simple propagation is performed, without processing any event computation. Then complete propagation is performed from start date to target date.
Note that mean elements are returned.propagate
in interface Propagator
start
- start date from which orbit state should be propagatedtarget
- target date to which orbit state should be propagatedPropagationException
- if state cannot be propagatedprotected abstract List<PatriusStepHandler> getStepHandlers()
protected SpacecraftState goAhead(double stepSize, double dt, AbsoluteDate target) throws PropagationException
stepSize
- the current stepsizedt
- the dt timetarget
- target date to propagatePropagationException
- propagation exceptionprotected SpacecraftState propagationManagement(SpacecraftState state, double stepSize, double dt, AbsoluteDate target) throws PatriusException
state
- the current SpacecraftStatestepSize
- the current stepsizedt
- the dt timetarget
- target date to propagatePatriusException
- Orekit exceptionprotected SpacecraftState acceptStep(AbsoluteDate target, double epsilon) throws PatriusException
target
- final propagation timeepsilon
- threshold for end date detectionPatriusException
- if the switching function cannot be evaluatedpublic PVCoordinates getPVCoordinates(AbsoluteDate date, Frame frame) throws PatriusException
PVCoordinates
of the body in the selected frame.getPVCoordinates
in interface PVCoordinatesProvider
date
- current dateframe
- the frame where to define the positionPatriusException
- if position cannot be computed in given frameprotected SpacecraftState basicPropagate(AbsoluteDate date) throws PropagationException
This method is similar in spirit to the propagate(fr.cnes.sirius.patrius.time.AbsoluteDate)
method, except that it does not call
any handler during propagation, nor any discrete events. It always stop exactly at the specified date.
date
- target date for propagationPropagationException
- if propagation cannot reach specified dateprotected abstract SpacecraftState propagateSpacecraftState(AbsoluteDate date) throws PatriusException
date
- target date for the orbitPatriusException
- * if some parameters are out of boundsprotected abstract double getMass(AbsoluteDate date) throws PropagationException
date
- target date for the orbitPropagationException
- if some parameters are out of boundspublic void resetInitialState(SpacecraftState state) throws PropagationException
resetInitialState
in interface Propagator
state
- new initial state to considerPropagationException
- if initial state cannot be resetpublic void setIntegrator(FirstOrderIntegrator inIntegrator)
inIntegrator
- integrator to use for propagation.public boolean isStoreTimeDerivatives()
public void setStoreTimeDerivatives(boolean isStoreTimeDerivatives)
isStoreTimeDerivatives
- flag indicating if time derivatives dE'/dt must be storedpublic List<TimeDerivativeData> getTimeDerivativesList()
Copyright © 2019 CNES. All Rights Reserved.