org.orekit.propagation.numerical
Class NumericalPropagator

java.lang.Object
  extended by org.orekit.propagation.numerical.NumericalPropagator
All Implemented Interfaces:
Serializable, Propagator, PVCoordinatesProvider

public class NumericalPropagator
extends Object
implements Propagator

This class propagates SpacecraftState using numerical integration.

Numerical propagation is much more accurate than analytical propagation like for example keplerian or Eckstein-Hechler, but requires a few more steps to set up to be used properly. Whereas analytical propagators are configured only thanks to their various constructors and can be used immediately after construction, numerical propagators configuration involve setting several parameters between construction time and propagation time.

The configuration parameters that can be set are:

From these configuration parameters, only the initial state is mandatory. The default propagation settings are in equinoctial parameters with true longitude argument. If the central attraction coefficient is not explicitly specified, the one used to define the initial orbit will be used. However, specifying only the initial state and perhaps the central attraction coefficient would mean the propagator would use only keplerian forces. In this case, the simpler KeplerianPropagator class would perhaps be more effective.

The underlying numerical integrator set up in the constructor may also have its own configuration parameters. Typical configuration parameters for adaptive stepsize integrators are the min, max and perhaps start step size as well as the absolute and/or relative errors thresholds.

The state that is seen by the integrator is a simple six elements double array. The six first elements are either:

The following code snippet shows a typical setting for Low Earth Orbit propagation in equinoctial parameters and true longitude argument:

 final double dP       = 0.001;
 final double minStep  = 0.001;
 final double maxStep  = 500;
 final double initStep = 60;
 AdaptiveStepsizeIntegrator integrator = new DormandPrince853Integrator(minStep, maxStep, AbsTolerance, RelTolerance);
 integrator.setInitialStepSize(initStep);
 propagator = new NumericalPropagator(integrator);
 

The same propagator can be reused for several state extrapolations, by resetting the initial state without modifying the other configuration parameters. However, the same instance cannot be used simultaneously by different threads, the class is not thread-safe.

Author:
Mathieu Roméro, Luc Maisonobe, Guylaine Prat, Fabien Maussion, Véronique Pommier-Maurussane, Pierre Cardoso
See Also:
SpacecraftState, ForceModel, OrekitStepHandler, OrekitFixedStepHandler, IntegratedEphemeris, TimeDerivativesEquations, Serialized Form

Field Summary
 
Fields inherited from interface org.orekit.propagation.Propagator
EPHEMERIS_GENERATION_MODE, MASTER_MODE, SLAVE_MODE
 
Constructor Summary
NumericalPropagator(FirstOrderIntegrator integrator)
          Create a new instance of NumericalPropagator, based on orbit definition mu.
 
Method Summary
 void addAdditionalEquations(AdditionalEquations addEqu)
          Add a set of user-specified equations to be integrated along with the orbit propagation.
 void addAttitudeEquation(AttitudeEquation addEqu)
          Add a set of user-specified attitude equations to be integrated along with the orbit propagation.
 void addEventDetector(EventDetector detector)
          Add an event detector.
 void addForceModel(ForceModel model)
          Add a force model to the global perturbation model.
 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.
 int getBasicDimension()
          Get state vector dimension without additional parameters.
 int getCalls()
          Get the number of calls to the differential equations computation method.
 Collection<EventDetector> getEventsDetectors()
          Get all the events detectors that have been added.
 List<ForceModel> getForceModels()
          Get perturbing force models list.
 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.
 double getMu()
          Get the central attraction coefficient μ.
 NewtonianAttraction getNewtonianAttractionForceModel()
          Get the Newtonian attraction from the central body force model.
 OrbitType getOrbitType()
          Get propagation parameter type.
 PositionAngle getPositionAngleType()
          Get propagation parameter type.
 PVCoordinates getPVCoordinates(AbsoluteDate date, Frame frame)
          Get the PVCoordinates of the body in the selected frame.
 SpacecraftState propagate(AbsoluteDate target)
          Propagate towards a target date.
 SpacecraftState propagate(AbsoluteDate tStart, AbsoluteDate tEnd)
          Propagate from a start date towards a target date.
 void removeForceModels()
          Remove all perturbing force models from the global perturbation model.
 void resetInitialState(SpacecraftState state)
          Reset the propagator initial state.
 void setAdditionalStateTolerance(String name, double[] absTol, double[] relTol)
          Add additional state tolerances.
 void setAttitudeLaw(AttitudeProvider provider)
          Deprecated. as of 6.0 replaced by setAttitudeProvider(AttitudeProvider)
 void setAttitudeProvider(AttitudeProvider attitudeProvider)
          Set attitude provider for forces and events computation.
 void setAttitudeProviderEvents(AttitudeProvider attitudeEventsProvider)
          Set attitude provider for events computation.
 void setAttitudeProviderForces(AttitudeProvider attitudeForcesProvider)
          Set attitude provider for forces computation.
 void setEphemerisMode()
          Set the propagator to ephemeris generation mode.
 void setInitialState(SpacecraftState initialState)
          Set the initial state.
 void setIntegrator(FirstOrderIntegrator integrator)
          Set the integrator.
 void setMassProviderEquation(MassProvider massProvider)
          Add additional equations associated with the mass provider.
 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 setMu(double mu)
          Set the central attraction coefficient μ.
The Newtonian attraction from the central body force model will be updated with the new coefficient.
 void setOrbitFrame(Frame frame)
          Set propagation frame.
 void setOrbitType(OrbitType orbitTypeIn)
          Set propagation orbit type.
 void setPositionAngleType(PositionAngle positionAngleType)
          Set position angle type.
 void setSlaveMode()
          Set the propagator to slave mode.
protected  void setUpEventDetector(EventDetector osf)
          Wrap an Orekit event detector and register it to the integrator.
static double[][] tolerances(double dP, Orbit orbit, OrbitType type)
          Estimate tolerance vectors for integrators.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumericalPropagator

public NumericalPropagator(FirstOrderIntegrator integrator)
Create a new instance of NumericalPropagator, based on orbit definition mu. After creation, the instance is empty, i.e. there are no perturbing forces at all. This means that if addForceModel is not called after creation, the integrated orbit will follow a keplerian evolution only. The defaults are OrbitType.EQUINOCTIAL for propagation orbit type and PositionAngle.TRUE for position angle type.

Parameters:
integrator - numerical integrator to use for propagation.
Method Detail

setIntegrator

public void setIntegrator(FirstOrderIntegrator integrator)
Set the integrator.

Parameters:
integrator - numerical integrator to use for propagation.

setMu

public void setMu(double mu)
Set the central attraction coefficient μ.
The Newtonian attraction from the central body force model will be updated with the new coefficient.

Parameters:
mu - central attraction coefficient (m3/s2)
See Also:
getMu(), addForceModel(ForceModel)

getMu

public double getMu()
Get the central attraction coefficient μ.

Returns:
mu central attraction coefficient (m3/s2)
See Also:
setMu(double)

setAttitudeLaw

@Deprecated
public void setAttitudeLaw(AttitudeProvider provider)
Deprecated. as of 6.0 replaced by setAttitudeProvider(AttitudeProvider)

Set the attitude provider.

Parameters:
provider - attitude provider

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 attitudeForcesProvider)
Set attitude provider for forces computation. A default attitude provider is available in ConstantAttitudeLaw.

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

setAttitudeProviderEvents

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

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

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()

addForceModel

public void addForceModel(ForceModel model)
Add a force model to the global perturbation model.

If the force is an attraction model, the central attraction coefficient of this force will be used during the propagation.

If the force is a Newtonian attraction model, the central attraction coefficient will be updated but the force will not be added to the model (already present).

If this method is not called at all, the integrated orbit will follow a keplerian evolution only (using the central attraction coefficient of the orbit).

Parameters:
model - perturbing ForceModel to add
See Also:
removeForceModels(), setMu(double)

removeForceModels

public void removeForceModels()
Remove all perturbing force models from the global perturbation model.

Once all perturbing forces have been removed (and as long as no new force model is added), the integrated orbit will follow a keplerian evolution only.

See Also:
addForceModel(ForceModel)

getForceModels

public List<ForceModel> getForceModels()
Get perturbing force models list.

Returns:
list of perturbing force models
See Also:
addForceModel(ForceModel), getNewtonianAttractionForceModel()

getNewtonianAttractionForceModel

public NewtonianAttraction getNewtonianAttractionForceModel()
Get the Newtonian attraction from the central body force model.

Returns:
Newtonian attraction force model
See Also:
setMu(double), getForceModels()

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.

Note that this method has the side effect of replacing the step handlers of the underlying integrator set up in the constructor or the setIntegrator method. So if a specific step handler is needed, it should be added after this method has been callled.

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.

Note that this method has the side effect of replacing the step handlers of the underlying integrator set up in the constructor or the setIntegrator method. So if a specific step handler is needed, it should be added after this method has been called.

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.

Note that this method has the side effect of replacing the step handlers of the underlying integrator set up in the constructor or the setIntegrator method. So if a specific step handler is needed, it should be added after this method has been callled.

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.

Note that this method has the side effect of replacing the step handlers of the underlying integrator set up in the constructor or the setIntegrator method. So if a specific step handler is needed, it should be added after this method has been called.

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

setOrbitType

public void setOrbitType(OrbitType orbitTypeIn)
Set propagation orbit type.

Parameters:
orbitTypeIn - orbit type to use for propagation

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

getOrbitType

public OrbitType getOrbitType()
Get propagation parameter type.

Returns:
orbit type used for propagation

setPositionAngleType

public void setPositionAngleType(PositionAngle positionAngleType)
Set position angle type.

The position parameter type is meaningful only if propagation orbit type support it. As an example, it is not meaningful for propagation in Cartesian parameters.

Parameters:
positionAngleType - angle type to use for propagation

getPositionAngleType

public PositionAngle getPositionAngleType()
Get propagation parameter type.

Returns:
angle type to use for propagation

getGeneratedEphemeris

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

Specified by:
getGeneratedEphemeris in interface Propagator
Returns:
generated ephemeris
Throws:
IllegalStateException - if the propagator was not set in ephemeris generation mode before propagation
See Also:
Propagator.setEphemerisMode()

getInitialState

public SpacecraftState getInitialState()
Get the propagator initial state.

Specified by:
getInitialState in interface Propagator
Returns:
initial state

setInitialState

public void setInitialState(SpacecraftState initialState)
Set the initial state.

Parameters:
initialState - initial state
See Also:
propagate(AbsoluteDate)

resetInitialState

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

Specified by:
resetInitialState in interface Propagator
Parameters:
state - new initial state to consider

addAdditionalEquations

public void addAdditionalEquations(AdditionalEquations addEqu)
Add a set of user-specified equations to be integrated along with the orbit propagation. If the set of equations is already registered, it is replaced by the new one.

Parameters:
addEqu - additional equations
See Also:
SpacecraftState.addAdditionalState(String, double[])

addAttitudeEquation

public void addAttitudeEquation(AttitudeEquation addEqu)
Add a set of user-specified attitude equations to be integrated along with the orbit propagation. If the set of attitude equations is already registered for the current attitude, it is replaced by the new one.

Parameters:
addEqu - attitude additional equations

setMassProviderEquation

public void setMassProviderEquation(MassProvider massProvider)
Add additional equations associated with the mass provider. A null-mass detector associated with the input mass provider is automatically added.

Note that this method should be called after setSlaveMode() or setMasterMode(OrekitStepHandler) or setEphemerisMode() since this method reset the integrator step handlers list.

WARNING: This method should be called only once and provided mass provider should be the same used for force models.

Parameters:
massProvider - the mass provider

setAdditionalStateTolerance

public void setAdditionalStateTolerance(String name,
                                        double[] absTol,
                                        double[] relTol)
                                 throws OrekitException
Add additional state tolerances.

Parameters:
name - the additional state name
absTol - absolute tolerances
relTol - relative tolerances
Throws:
OrekitException - if additional equation associated with the input additional state name is unknown

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 tStart,
                                 AbsoluteDate tEnd)
                          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:
tStart - start date from which orbit state should be propagated
tEnd - target date to which orbit state should be propagated
Returns:
propagated state
Throws:
PropagationException - if state cannot be propagated

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

getCalls

public int getCalls()
Get the number of calls to the differential equations computation method.

The number of calls is reset each time the propagate(AbsoluteDate) method is called.

Returns:
number of calls to the differential equations computation method

setUpEventDetector

protected void setUpEventDetector(EventDetector osf)
Wrap an Orekit event detector and register it to the integrator.

Parameters:
osf - event handler to wrap

getBasicDimension

public int getBasicDimension()
Get state vector dimension without additional parameters.

Returns:
state vector dimension without additional parameters.

tolerances

public static double[][] tolerances(double dP,
                                    Orbit orbit,
                                    OrbitType type)
Estimate tolerance vectors for integrators.

The errors are estimated from partial derivatives properties of orbits, starting from a scalar position error specified by the user. Considering the energy conservation equation V = sqrt(mu (2/r - 1/a)), we get at constant energy (i.e. on a Keplerian trajectory):

 V2 r |dV| = mu |dr|
 
So we deduce a scalar velocity error consistent with the position error. From here, we apply orbits Jacobians matrices to get consistent errors on orbital parameters.

The tolerances are only orders of magnitude, and integrator tolerances are only local estimates, not global ones. So some care must be taken when using these tolerances. Setting 1mm as a position error does NOT mean the tolerances will guarantee a 1mm error position after several orbits integration.

Parameters:
dP - user specified position error
orbit - reference orbit
type - propagation type for the meaning of the tolerance vectors elements (it may be different from orbit.getType())
Returns:
a two rows array, row 0 being the absolute tolerance error and row 1 being the relative tolerance error


Copyright © 2016 CNES. All Rights Reserved.