org.orekit.propagation
Class AbstractPropagator

java.lang.Object
  extended by org.orekit.propagation.AbstractPropagator
All Implemented Interfaces:
Serializable, Propagator, PVCoordinatesProvider
Direct Known Subclasses:
AbstractEphemeris, AbstractLyddanePropagator, AdapterPropagator, Analytical2DPropagator, AnalyticalIntegratedEphemeris, EcksteinHechlerPropagator, Ephemeris, IntegratedEphemeris, J2SecularPropagator, KeplerianPropagator, MultiIntegratedEphemeris, PVCoordinatePropagator, TLEPropagator

public abstract class AbstractPropagator
extends Object
implements Propagator

Common handling of 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 one method must be implemented by derived classes: propagateOrbit(AbsoluteDate). The first method should perform straightforward propagation starting from some internally stored initial state up to the specified target date.

Author:
Luc Maisonobe
See Also:
Serialized Form

Field Summary
static String MASS
          Default prefix for additional state provider from MassProvider.
 
Fields inherited from interface org.orekit.propagation.Propagator
EPHEMERIS_GENERATION_MODE, MASTER_MODE, SLAVE_MODE
 
Constructor Summary
protected AbstractPropagator(AttitudeProvider attitudeProvider)
          Build a new instance.
protected AbstractPropagator(AttitudeProvider attitudeProviderForces, AttitudeProvider attitudeProviderEvents)
          Build a new instance.
 
Method Summary
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 addAdditionalStateProvider(MassProvider massProvider)
          Add a set of state parameters from MassProvider to be computed along with the orbit propagation.
 void addEventDetector(EventDetector detector)
          Add an event detector.
protected  SpacecraftState basicPropagate(AbsoluteDate date)
          Propagate an orbit 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.
 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  void manageStateFrame()
          Manage the state frame : the orbit to propagate is converted in the propagation frame.
 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  Orbit propagateOrbit(AbsoluteDate date)
          Extrapolate an orbit up to a specific target date.
 void resetInitialState(SpacecraftState state)
          Reset the propagator initial state.
 void setAttitudeProvider(AttitudeProvider attitudeProvider)
          Set attitude provider for forces and events computation.
 void setAttitudeProviderEvents(AttitudeProvider attProviderEvents)
          Set attitude provider for events computation.
 void setAttitudeProviderForces(AttitudeProvider attProviderForces)
          Set attitude provider for forces computation.
 void setEphemerisMode()
          Set the propagator to ephemeris generation mode.
 void setMasterMode(double h, OrekitFixedStepHandler handler)
          Set the propagator to master mode with fixed steps.
 void setMasterMode(OrekitStepHandler 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 startDate)
          Set a start date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MASS

public static final String MASS
Default prefix for additional state provider from MassProvider.

See Also:
Constant Field Values
Constructor Detail

AbstractPropagator

protected AbstractPropagator(AttitudeProvider attitudeProvider)
Build a new instance.

Parameters:
attitudeProvider - provider for attitude computation in case of both forces and events computation

AbstractPropagator

protected AbstractPropagator(AttitudeProvider attitudeProviderForces,
                             AttitudeProvider attitudeProviderEvents)
Build a new instance.

Parameters:
attitudeProviderForces - provider for attitude computation in case of forces computation
attitudeProviderEvents - provider for attitude computation in case of events computation
Method Detail

setStartDate

protected void setStartDate(AbsoluteDate startDate)
Set a start date.

Parameters:
startDate - start date

getAttitudeProvider

public AttitudeProvider getAttitudeProvider()
Get attitude provider.

Specified by:
getAttitudeProvider in interface Propagator
Returns:
attitude provider for forces computation (by default)

getAttitudeProviderForces

public AttitudeProvider getAttitudeProviderForces()
Get attitude provider for forces computation.

Specified by:
getAttitudeProviderForces in interface Propagator
Returns:
attitude provider for forces computation

getAttitudeProviderEvents

public AttitudeProvider getAttitudeProviderEvents()
Get attitude provider for events computation.

Specified by:
getAttitudeProviderEvents in interface Propagator
Returns:
attitude provider for events computation

setAttitudeProvider

public void setAttitudeProvider(AttitudeProvider attitudeProvider)
Set attitude provider for forces and events computation. A default attitude provider is available in ConstantAttitudeLaw.

Specified by:
setAttitudeProvider in interface Propagator
Parameters:
attitudeProvider - attitude provider

setAttitudeProviderForces

public void setAttitudeProviderForces(AttitudeProvider attProviderForces)
Set attitude provider for forces computation. A default attitude provider is available in ConstantAttitudeLaw.

Specified by:
setAttitudeProviderForces in interface Propagator
Parameters:
attProviderForces - attitude provider for forces computation

setAttitudeProviderEvents

public void setAttitudeProviderEvents(AttitudeProvider attProviderEvents)
Set attitude provider for events computation. A default attitude provider is available in ConstantAttitudeLaw.

Specified by:
setAttitudeProviderEvents in interface Propagator
Parameters:
attProviderEvents - attitude provider for events computation

setOrbitFrame

public void setOrbitFrame(Frame frame)
                   throws OrekitException
Set propagation frame.

Specified by:
setOrbitFrame in interface Propagator
Parameters:
frame - the frame to use. This frame must be inertial or pseudo-inertial, otherwise an exception is raised.
Throws:
OrekitException - if frame is not inertial or pseudo-inertial

getPvProvider

public PVCoordinatesProvider getPvProvider()
Get PV coordinates provider.

Returns:
PV coordinates provider

getInitialState

public SpacecraftState getInitialState()
                                throws OrekitException
Get the propagator initial state.

Specified by:
getInitialState in interface Propagator
Returns:
initial state
Throws:
OrekitException - if state cannot be retrieved

getMode

public int getMode()
Get the current operating mode of the propagator.

Specified by:
getMode in interface Propagator
Returns:
one of Propagator.SLAVE_MODE, Propagator.MASTER_MODE, Propagator.EPHEMERIS_GENERATION_MODE
See Also:
Propagator.setSlaveMode(), Propagator.setMasterMode(double, OrekitFixedStepHandler), Propagator.setMasterMode(OrekitStepHandler), Propagator.setEphemerisMode()

getFrame

public Frame getFrame()
Get the frame in which the orbit is propagated.

4 cases are possible:

Specified by:
getFrame in interface Propagator
Returns:
frame in which the orbit is propagated

setSlaveMode

public void setSlaveMode()
Set the propagator to slave mode.

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.

Specified by:
setSlaveMode in interface Propagator
See Also:
Propagator.setMasterMode(double, OrekitFixedStepHandler), Propagator.setMasterMode(OrekitStepHandler), Propagator.setEphemerisMode(), Propagator.getMode(), Propagator.SLAVE_MODE

setMasterMode

public void setMasterMode(double h,
                          OrekitFixedStepHandler handler)
Set the propagator to master mode with fixed steps.

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.

Specified by:
setMasterMode in interface Propagator
Parameters:
h - fixed stepsize (s)
handler - handler called at the end of each finalized step
See Also:
Propagator.setSlaveMode(), Propagator.setMasterMode(OrekitStepHandler), Propagator.setEphemerisMode(), Propagator.getMode(), Propagator.MASTER_MODE

setMasterMode

public void setMasterMode(OrekitStepHandler handler)
Set the propagator to master mode with variable steps.

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.

Specified by:
setMasterMode in interface Propagator
Parameters:
handler - handler called at the end of each finalized step
See Also:
Propagator.setSlaveMode(), Propagator.setMasterMode(double, OrekitFixedStepHandler), Propagator.setEphemerisMode(), Propagator.getMode(), Propagator.MASTER_MODE

setEphemerisMode

public void setEphemerisMode()
Set the propagator to ephemeris generation mode.

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.

Specified by:
setEphemerisMode in interface Propagator
See Also:
Propagator.getGeneratedEphemeris(), Propagator.setSlaveMode(), Propagator.setMasterMode(double, OrekitFixedStepHandler), Propagator.setMasterMode(OrekitStepHandler), Propagator.getMode(), Propagator.EPHEMERIS_GENERATION_MODE

getGeneratedEphemeris

public BoundedPropagator getGeneratedEphemeris()
Get the ephemeris generated during propagation.

Specified by:
getGeneratedEphemeris in interface Propagator
Returns:
generated ephemeris
See Also:
Propagator.setEphemerisMode()

addEventDetector

public void addEventDetector(EventDetector detector)
Add an event detector.

Specified by:
addEventDetector in interface Propagator
Parameters:
detector - event detector to add
See Also:
Propagator.clearEventsDetectors(), Propagator.getEventsDetectors()

getEventsDetectors

public Collection<EventDetector> getEventsDetectors()
Get all the events detectors that have been added.

Specified by:
getEventsDetectors in interface Propagator
Returns:
an unmodifiable collection of the added detectors
See Also:
Propagator.addEventDetector(EventDetector), Propagator.clearEventsDetectors()

clearEventsDetectors

public void clearEventsDetectors()
Remove all events detectors.

Specified by:
clearEventsDetectors in interface Propagator
See Also:
Propagator.addEventDetector(EventDetector), Propagator.getEventsDetectors()

addAdditionalStateProvider

public void addAdditionalStateProvider(AdditionalStateProvider additionalStateProvider)
Add a set of user-specified state parameters to be computed along with the orbit propagation.

Parameters:
additionalStateProvider - provider for additional state

addAdditionalStateProvider

public void addAdditionalStateProvider(MassProvider massProvider)
Add a set of state parameters from MassProvider to be computed along with the orbit propagation.

Parameters:
massProvider - mass provider for additional state

propagate

public SpacecraftState propagate(AbsoluteDate target)
                          throws PropagationException
Propagate towards a target date.

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.

Specified by:
propagate in interface Propagator
Parameters:
target - target date towards which orbit state should be propagated
Returns:
propagated state
Throws:
PropagationException - if state cannot be propagated

propagate

public SpacecraftState propagate(AbsoluteDate start,
                                 AbsoluteDate target)
                          throws PropagationException
Propagate from a start date towards a target date.

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.

Specified by:
propagate in interface Propagator
Parameters:
start - start date from which orbit state should be propagated
target - target date to which orbit state should be propagated
Returns:
propagated state
Throws:
PropagationException - if state cannot be propagated

acceptStep

protected SpacecraftState acceptStep(AbsoluteDate target,
                                     double epsilon)
                              throws OrekitException,
                                     TooManyEvaluationsException,
                                     NoBracketingException
Accept a step, triggering events and step handlers.

Parameters:
target - final propagation time
epsilon - threshold for end date detection
Returns:
state at the end of the step
Throws:
OrekitException - if the switching function cannot be evaluated
TooManyEvaluationsException - if an event cannot be located
NoBracketingException - if bracketing cannot be performed

manageStateFrame

protected void manageStateFrame()
                         throws OrekitException
Manage the state frame : the orbit to propagate is converted in the propagation frame.

Throws:
OrekitException - if the frame of the initial state is not inertial or pseudo-inertial

getPVCoordinates

public PVCoordinates getPVCoordinates(AbsoluteDate date,
                                      Frame frame)
                               throws OrekitException
Get the PVCoordinates of the body in the selected frame.

Specified by:
getPVCoordinates in interface PVCoordinatesProvider
Parameters:
date - current date
frame - the frame where to define the position
Returns:
position/velocity of the body (m and m/s)
Throws:
OrekitException - if position cannot be computed in given frame

basicPropagate

protected SpacecraftState basicPropagate(AbsoluteDate date)
                                  throws PropagationException
Propagate an orbit without any fancy features.

This method is similar in spirit to the propagate(org.orekit.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.

Parameters:
date - target date for propagation
Returns:
state at specified date
Throws:
PropagationException - if propagation cannot reach specified date

propagateOrbit

protected abstract Orbit propagateOrbit(AbsoluteDate date)
                                 throws PropagationException
Extrapolate an orbit up to a specific target date.

Parameters:
date - target date for the orbit
Returns:
extrapolated parameters
Throws:
PropagationException - if some parameters are out of bounds

resetInitialState

public void resetInitialState(SpacecraftState state)
                       throws PropagationException
Reset the propagator initial state.

Specified by:
resetInitialState in interface Propagator
Parameters:
state - new initial state to consider
Throws:
PropagationException - if initial state cannot be reset


Copyright © 2016 CNES. All Rights Reserved.