Class FieldAbstractIntegratedPropagator<T extends org.hipparchus.RealFieldElement<T>>
- java.lang.Object
-
- org.orekit.propagation.FieldAbstractPropagator<T>
-
- org.orekit.propagation.integration.FieldAbstractIntegratedPropagator<T>
-
- All Implemented Interfaces:
FieldPropagator<T>
,FieldPVCoordinatesProvider<T>
- Direct Known Subclasses:
FieldNumericalPropagator
public abstract class FieldAbstractIntegratedPropagator<T extends org.hipparchus.RealFieldElement<T>> extends FieldAbstractPropagator<T>
Common handling ofFieldPropagator
methods for both numerical and semi-analytical propagators.- Author:
- Luc Maisonobe
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
FieldAbstractIntegratedPropagator.MainStateEquations<T extends org.hipparchus.RealFieldElement<T>>
Differential equations for the main state (orbit, attitude and mass).
-
Field Summary
-
Fields inherited from interface org.orekit.propagation.FieldPropagator
DEFAULT_LAW, DEFAULT_MASS, EPHEMERIS_GENERATION_MODE, MASTER_MODE, SLAVE_MODE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FieldAbstractIntegratedPropagator(org.hipparchus.Field<T> field, org.hipparchus.ode.FieldODEIntegrator<T> integrator, boolean meanOrbit)
Build a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addAdditionalEquations(FieldAdditionalEquations<T> additional)
Add a set of user-specified equations to be integrated along with the orbit propagation.<D extends FieldEventDetector<T>>
voidaddEventDetector(D detector)
Add an event detector.protected void
afterIntegration()
Method called just after integration.protected void
beforeIntegration(FieldSpacecraftState<T> initialState, FieldAbsoluteDate<T> tEnd)
Method called just before integration.void
clearEventsDetectors()
Remove all events detectors.protected abstract FieldStateMapper<T>
createMapper(FieldAbsoluteDate<T> referenceDate, double mu, OrbitType orbitType, PositionAngle positionAngleType, AttitudeProvider attitudeProvider, Frame frame)
Create a mapper between raw double components and spacecraft state.int
getBasicDimension()
Get state vector dimension without additional parameters.int
getCalls()
Get the number of calls to the differential equations computation method.Collection<FieldEventDetector<T>>
getEventsDetectors()
Get all the events detectors that have been added.FieldBoundedPropagator<T>
getGeneratedEphemeris()
Get the ephemeris generated during propagation.protected FieldSpacecraftState<T>
getInitialIntegrationState()
Get the initial state for integration.protected org.hipparchus.ode.FieldODEIntegrator<T>
getIntegrator()
Get the integrator used by the propagator.protected abstract FieldAbstractIntegratedPropagator.MainStateEquations<T>
getMainStateEquations(org.hipparchus.ode.FieldODEIntegrator<T> integ)
Get the differential equations to integrate (for main state only).String[]
getManagedAdditionalStates()
Get all the names of all managed states.double
getMu()
Get the central attraction coefficient μ.protected OrbitType
getOrbitType()
Get propagation parameter type.protected PositionAngle
getPositionAngleType()
Get propagation parameter type.protected void
initMapper()
Initialize the mapper.boolean
isAdditionalStateManaged(String name)
Check if an additional state is managed.protected boolean
isMeanOrbit()
Check if only the mean elements should be used in a semianalitical propagation.FieldSpacecraftState<T>
propagate(FieldAbsoluteDate<T> target)
Propagate towards a target date.protected FieldSpacecraftState<T>
propagate(FieldAbsoluteDate<T> tEnd, boolean activateHandlers)
Propagation with or without event detection.FieldSpacecraftState<T>
propagate(FieldAbsoluteDate<T> tStart, FieldAbsoluteDate<T> tEnd)
Propagate from a start date towards a target date.void
setAttitudeProvider(AttitudeProvider attitudeProvider)
Set attitude provider.void
setEphemerisMode()
Set the propagator to ephemeris generation mode.void
setMasterMode(FieldOrekitStepHandler<T> handler)
Set the propagator to master mode with variable steps.void
setMu(double mu)
Set the central attraction coefficient μ.protected void
setOrbitType(OrbitType orbitType)
Set propagation orbit type.protected void
setPositionAngleType(PositionAngle positionAngleType)
Set position angle type.void
setResetAtEnd(boolean resetAtEnd)
Allow/disallow resetting the initial state at end of propagation.void
setSlaveMode()
Set the propagator to slave mode.protected void
setUpEventDetector(org.hipparchus.ode.FieldODEIntegrator<T> integ, FieldEventDetector<T> detector)
Wrap an Orekit event detector and register it to the integrator.protected void
setUpUserEventDetectors()
Set up all user defined event detectors.-
Methods inherited from class org.orekit.propagation.FieldAbstractPropagator
addAdditionalStateProvider, getAdditionalStateProviders, getAttitudeProvider, getField, getFixedStepSize, getFrame, getInitialState, getMode, getPVCoordinates, getStartDate, getStepHandler, resetInitialState, setMasterMode, setStartDate, updateAdditionalStates
-
-
-
-
Constructor Detail
-
FieldAbstractIntegratedPropagator
protected FieldAbstractIntegratedPropagator(org.hipparchus.Field<T> field, org.hipparchus.ode.FieldODEIntegrator<T> integrator, boolean meanOrbit)
Build a new instance.- Parameters:
integrator
- numerical integrator to use for propagation.meanOrbit
- output only the mean orbit.field
- Field used by default
-
-
Method Detail
-
setResetAtEnd
public void setResetAtEnd(boolean resetAtEnd)
Allow/disallow resetting the initial state at end of propagation.By default, at the end of the propagation, the propagator resets the initial state to the final state, thus allowing a new propagation to be started from there without recomputing the part already performed. Calling this method with
resetAtEnd
set to false changes prevents such reset.- Parameters:
resetAtEnd
- if true, at end of each propagation, theinitial state
will be reset to the final state of the propagation, otherwise the initial state will be preserved- Since:
- 9.0
-
initMapper
protected void initMapper()
Initialize the mapper.
-
setAttitudeProvider
public void setAttitudeProvider(AttitudeProvider attitudeProvider)
Set attitude provider.- Specified by:
setAttitudeProvider
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Overrides:
setAttitudeProvider
in classFieldAbstractPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Parameters:
attitudeProvider
- attitude provider
-
setOrbitType
protected void setOrbitType(OrbitType orbitType)
Set propagation orbit type.- Parameters:
orbitType
- orbit type to use for propagation
-
getOrbitType
protected OrbitType getOrbitType()
Get propagation parameter type.- Returns:
- orbit type used for propagation
-
isMeanOrbit
protected boolean isMeanOrbit()
Check if only the mean elements should be used in a semianalitical propagation.- Returns:
- true if only mean elements have to be used
-
setPositionAngleType
protected 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 inCartesian
parameters.- Parameters:
positionAngleType
- angle type to use for propagation
-
getPositionAngleType
protected PositionAngle getPositionAngleType()
Get propagation parameter type.- Returns:
- angle type to use for propagation
-
setMu
public void setMu(double mu)
Set the central attraction coefficient μ.- Parameters:
mu
- central attraction coefficient (m³/s²)
-
getMu
public double getMu()
Get the central attraction coefficient μ.- Returns:
- mu central attraction coefficient (m³/s²)
- See Also:
setMu(double)
-
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(FieldAbsoluteDate)
method is called.- Returns:
- number of calls to the differential equations computation method
-
isAdditionalStateManaged
public boolean isAdditionalStateManaged(String name)
Check if an additional state is managed.Managed states are states for which the propagators know how to compute its evolution. They correspond to additional states for which an
additional state provider
has been registered by calling theaddAdditionalStateProvider
method. If the propagator is anintegrator-based propagator
, the states for which a set ofadditional equations
has been registered by calling theaddAdditionalEquations
method are also counted as managed additional states.Additional states that are present in the
initial state
but have no evolution method registered are not considered as managed states. These unmanaged additional states are not lost during propagation, though. Their value will simply be copied unchanged throughout propagation.- Specified by:
isAdditionalStateManaged
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Overrides:
isAdditionalStateManaged
in classFieldAbstractPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Parameters:
name
- name of the additional state- Returns:
- true if the additional state is managed
-
getManagedAdditionalStates
public String[] getManagedAdditionalStates()
Get all the names of all managed states.- Specified by:
getManagedAdditionalStates
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Overrides:
getManagedAdditionalStates
in classFieldAbstractPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Returns:
- names of all managed states
-
addAdditionalEquations
public void addAdditionalEquations(FieldAdditionalEquations<T> additional)
Add a set of user-specified equations to be integrated along with the orbit propagation.- Parameters:
additional
- additional equations
-
addEventDetector
public <D extends FieldEventDetector<T>> void addEventDetector(D detector)
Add an event detector.- Specified by:
addEventDetector
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Specified by:
addEventDetector
in classFieldAbstractPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Type Parameters:
D
- class type for the generic version- Parameters:
detector
- event detector to add- See Also:
FieldPropagator.clearEventsDetectors()
,FieldPropagator.getEventsDetectors()
-
getEventsDetectors
public Collection<FieldEventDetector<T>> getEventsDetectors()
Get all the events detectors that have been added.- Specified by:
getEventsDetectors
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Specified by:
getEventsDetectors
in classFieldAbstractPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Returns:
- an unmodifiable collection of the added detectors
- See Also:
FieldPropagator.addEventDetector(FieldEventDetector)
,FieldPropagator.clearEventsDetectors()
-
clearEventsDetectors
public void clearEventsDetectors()
Remove all events detectors.- Specified by:
clearEventsDetectors
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Specified by:
clearEventsDetectors
in classFieldAbstractPropagator<T extends org.hipparchus.RealFieldElement<T>>
- See Also:
FieldPropagator.addEventDetector(FieldEventDetector)
,FieldPropagator.getEventsDetectors()
-
setUpUserEventDetectors
protected void setUpUserEventDetectors()
Set up all user defined event detectors.
-
setUpEventDetector
protected void setUpEventDetector(org.hipparchus.ode.FieldODEIntegrator<T> integ, FieldEventDetector<T> detector)
Wrap an Orekit event detector and register it to the integrator.- Parameters:
integ
- integrator into which event detector should be registereddetector
- event detector to wrap
-
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
. So if a specific step handler is needed, it should be added after this method has been callled.- Specified by:
setSlaveMode
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Overrides:
setSlaveMode
in classFieldAbstractPropagator<T extends org.hipparchus.RealFieldElement<T>>
- See Also:
FieldPropagator.setMasterMode(RealFieldElement, FieldOrekitFixedStepHandler)
,FieldPropagator.setMasterMode(FieldOrekitStepHandler)
,FieldPropagator.setEphemerisMode()
,FieldPropagator.getMode()
,FieldPropagator.SLAVE_MODE
-
setMasterMode
public void setMasterMode(FieldOrekitStepHandler<T> 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
. So if a specific step handler is needed, it should be added after this method has been called.- Specified by:
setMasterMode
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Overrides:
setMasterMode
in classFieldAbstractPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Parameters:
handler
- handler called at the end of each finalized step- See Also:
FieldPropagator.setSlaveMode()
,FieldPropagator.setMasterMode(RealFieldElement, FieldOrekitFixedStepHandler)
,FieldPropagator.setEphemerisMode()
,FieldPropagator.getMode()
,FieldPropagator.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
. So if a specific step handler is needed, it should be added after this method has been called.- Specified by:
setEphemerisMode
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Overrides:
setEphemerisMode
in classFieldAbstractPropagator<T extends org.hipparchus.RealFieldElement<T>>
- See Also:
FieldPropagator.getGeneratedEphemeris()
,FieldPropagator.setSlaveMode()
,FieldPropagator.setMasterMode(RealFieldElement, FieldOrekitFixedStepHandler)
,FieldPropagator.setMasterMode(FieldOrekitStepHandler)
,FieldPropagator.getMode()
,FieldPropagator.EPHEMERIS_GENERATION_MODE
-
getGeneratedEphemeris
public FieldBoundedPropagator<T> getGeneratedEphemeris() throws IllegalStateException
Get the ephemeris generated during propagation.- Specified by:
getGeneratedEphemeris
in interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Specified by:
getGeneratedEphemeris
in classFieldAbstractPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Returns:
- generated ephemeris
- Throws:
IllegalStateException
- if the propagator was not set in ephemeris generation mode before propagation- See Also:
FieldPropagator.setEphemerisMode()
-
createMapper
protected abstract FieldStateMapper<T> createMapper(FieldAbsoluteDate<T> referenceDate, double mu, OrbitType orbitType, PositionAngle positionAngleType, AttitudeProvider attitudeProvider, Frame frame)
Create a mapper between raw double components and spacecraft state. /** Simple constructor.The position parameter type is meaningful only if
propagation orbit type
support it. As an example, it is not meaningful for propagation inCartesian
parameters.- Parameters:
referenceDate
- reference datemu
- central attraction coefficient (m³/s²)orbitType
- orbit type to use for mappingpositionAngleType
- angle type to use for propagationattitudeProvider
- attitude providerframe
- inertial frame- Returns:
- new mapper
-
getMainStateEquations
protected abstract FieldAbstractIntegratedPropagator.MainStateEquations<T> getMainStateEquations(org.hipparchus.ode.FieldODEIntegrator<T> integ)
Get the differential equations to integrate (for main state only).- Parameters:
integ
- numerical integrator to use for propagation.- Returns:
- differential equations for main state
-
propagate
public FieldSpacecraftState<T> propagate(FieldAbsoluteDate<T> target)
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 interfaceFieldPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Overrides:
propagate
in classFieldAbstractPropagator<T extends org.hipparchus.RealFieldElement<T>>
- Parameters:
target
- target date towards which orbit state should be propagated- Returns:
- propagated state
-
propagate
public FieldSpacecraftState<T> propagate(FieldAbsoluteDate<T> tStart, FieldAbsoluteDate<T> tEnd)
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.
- Parameters:
tStart
- start date from which orbit state should be propagatedtEnd
- target date to which orbit state should be propagated- Returns:
- propagated state
-
propagate
protected FieldSpacecraftState<T> propagate(FieldAbsoluteDate<T> tEnd, boolean activateHandlers)
Propagation with or without event detection.- Parameters:
tEnd
- target date to which orbit should be propagatedactivateHandlers
- if true, step and event handlers should be activated- Returns:
- state at end of propagation
-
getInitialIntegrationState
protected FieldSpacecraftState<T> getInitialIntegrationState()
Get the initial state for integration.- Returns:
- initial state for integration
-
beforeIntegration
protected void beforeIntegration(FieldSpacecraftState<T> initialState, FieldAbsoluteDate<T> tEnd)
Method called just before integration.The default implementation does nothing, it may be specialized in subclasses.
- Parameters:
initialState
- initial statetEnd
- target date at which state should be propagated
-
afterIntegration
protected void afterIntegration()
Method called just after integration.The default implementation does nothing, it may be specialized in subclasses.
-
getBasicDimension
public int getBasicDimension()
Get state vector dimension without additional parameters.- Returns:
- state vector dimension without additional parameters.
-
getIntegrator
protected org.hipparchus.ode.FieldODEIntegrator<T> getIntegrator()
Get the integrator used by the propagator.- Returns:
- the integrator.
-
-