public class MultiNumericalPropagator extends Object implements MultiPropagator, Observer
This class is copied from NumericalPropagator
and adapted to multi propagation.
This class propagates N SpacecraftState
using numerical integration. Each state is identified with an ID of
type String.
Multi spacecraft numerical propagation requires steps to set up the propagator to be used properly.
At least one satellite should be added to the propagator usingaddInitialState(SpacecraftState, String)
.
Then, the following configuration parameters
can be set for each state:
setMu(double, String)
)addForceModel(ForceModel, String)
, removeForceModels()
)additional equations
(for example Jacobians
) should be propagated along with orbital state (
addAdditionalEquations(AdditionalEquations, String)
),
addEventDetector(EventDetector, String)
, clearEventsDetectors()
)The following general parameters can also be set :
type
of orbital parameters to be used for propagation ( setOrbitType(OrbitType)
),
type
of position angle to be used in orbital parameters to be used for propagation
where it is relevant (setPositionAngleType(PositionAngle)
),
addEventDetector(MultiEventDetector)
,
clearEventsDetectors()
)setSlaveMode()
,
setMasterMode(double, MultiPatriusFixedStepHandler)
, setMasterMode(MultiPatriusStepHandler)
,
setEphemerisMode()
, getGeneratedEphemeris(String)
)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.
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.
A state that is seen by the integrator is a simple six elements double array. The six first elements are either:
equinoctial orbit parameters
(a, ex,
ey, hx, hy, λM or λE or λv) in
meters and radians,Keplerian orbit parameters
(a, e, i, ω, Ω, M
or E or v) in meters and radians,circular orbit parameters
(a, ex,
ey, i, Ω, αM or αE or αv) in meters and radians,Cartesian orbit parameters
(x, y, z, vx,
vy, vz) in meters and meters per seconds.
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 MultiNumericalPropagator(integrator);
The same instance cannot be used simultaneously by different threads, the class is not thread-safe.
SpacecraftState
,
ForceModel
,
MultiPatriusStepHandler
,
MultiPatriusFixedStepHandler
,
MultiIntegratedEphemeris
,
TimeDerivativesEquations
EPHEMERIS_GENERATION_MODE, MASTER_MODE, SLAVE_MODE
Constructor and Description |
---|
MultiNumericalPropagator(FirstOrderIntegrator integrator)
Create a new instance of MultiNumericalPropagator.
|
Modifier and Type | Method and Description |
---|---|
void |
addAdditionalEquations(AdditionalEquations addEqu,
String satId)
Add a set of user-specified equations to be integrated along with the orbit propagation.
|
void |
addAttitudeEquation(AttitudeEquation addEqu,
String satId)
Add a set of user-specified attitude equations to be integrated along with the orbit
propagation.
|
void |
addEventDetector(EventDetector detector,
String satId)
Add an event detector to a specific spacecraft.
|
void |
addEventDetector(MultiEventDetector detector)
Add a multi spacecraft event detector.
|
protected void |
addEventHandlers(boolean activateHandlers,
Map<String,MultiAttitudeProvider> localAttProvForces,
Map<String,MultiAttitudeProvider> localAttProvEvents)
Add event handlers to integrator.
|
void |
addForceModel(ForceModel model,
String satId)
Add a force model to the global perturbation model of a specific spacecraft.
|
void |
addInitialState(SpacecraftState initialState,
String satId)
Add a new spacecraft state to be propagated.
|
void |
clearEventsDetectors()
Remove all events detectors.
|
MultiAttitudeProvider |
getAttitudeProvider(String satId)
Get the default attitude provider.
|
MultiAttitudeProvider |
getAttitudeProviderEvents(String satId)
Get the attitude provider for events computation.
|
MultiAttitudeProvider |
getAttitudeProviderForces(String satId)
Get the attitude provider for forces computation.
|
int |
getCalls()
Get the number of calls to the differential equations computation method.
|
Collection<MultiEventDetector> |
getEventsDetectors()
Get all the events
detectors that have been added. |
List<ForceModel> |
getForceModels(String satId)
Get perturbing force models list.
|
Frame |
getFrame(String satId)
Get the frame in which the orbit is propagated.
|
BoundedPropagator |
getGeneratedEphemeris(String satId)
Get the ephemeris generated during propagation for a defined spacecraft.
|
Map<String,SpacecraftState> |
getInitialStates()
Get the propagator initial states.
|
int |
getMode()
Get the current operating mode of the propagator.
|
double |
getMu(String satId)
Get the central attraction coefficient μ.
|
NewtonianAttraction |
getNewtonianAttractionForceModel(String satId)
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,
String satId)
Get the
PVCoordinates of the body in the selected frame. |
Map<String,SpacecraftState> |
propagate(AbsoluteDate target)
Propagate towards a target date.
|
Map<String,SpacecraftState> |
propagate(AbsoluteDate start,
AbsoluteDate target)
Propagate from a start date towards a target date.
|
void |
removeForceModels()
Remove all perturbing force models from the global perturbation model.
|
void |
setAdditionalStateTolerance(String name,
double[] absTol,
double[] relTol,
String satId)
Add additional state tolerances.
|
void |
setAttitudeProvider(AttitudeProvider attitudeProvider,
String satId)
Set attitude provider for defined spacecraft.
|
void |
setAttitudeProvider(MultiAttitudeProvider attitudeProvider,
String satId)
Set attitude provider.
|
void |
setAttitudeProviderEvents(AttitudeProvider attitudeProviderEvents,
String satId)
Set attitude provider for events computation.
|
void |
setAttitudeProviderEvents(MultiAttitudeProvider attitudeProviderEvents,
String satId)
Set attitude provider for events.
|
void |
setAttitudeProviderForces(AttitudeProvider attitudeProviderForces,
String satId)
Set attitude provider for forces computation.
|
void |
setAttitudeProviderForces(MultiAttitudeProvider attitudeProviderForces,
String satId)
Set attitude provider for forces.
|
void |
setEphemerisMode()
Set the propagator to ephemeris generation mode.
|
void |
setIntegrator(FirstOrderIntegrator integrator)
Set the integrator and declare the MultiNumericalPropagator object as observer of the specified integrator.
|
void |
setMassProviderEquation(MassProvider massProvider,
String satId)
Add additional equations associated with the mass provider.
|
void |
setMasterMode(double h,
MultiPatriusFixedStepHandler handler)
Set the propagator to master mode with fixed steps.
|
void |
setMasterMode(MultiPatriusStepHandler handler)
Set the propagator to master mode with variable steps.
|
void |
setMu(double mu,
String satId)
Set the central attraction coefficient μ.
|
void |
setOrbitFrame(String satId,
Frame frame)
Set a frame for propagation The initial state must have first been added using the
addInitialState(SpacecraftState, String) method before defining the associated
integration frame. |
void |
setOrbitTolerance(double[] absoluteTolerance,
double[] relativeTolerance,
String satId)
Set the orbit tolerance of a defined state.
|
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,
Map<String,MultiAttitudeProvider> localAttProvForces,
Map<String,MultiAttitudeProvider> localAttProvEvents,
String satId)
Wrap an Orekit event detector and register it to the integrator.
|
protected void |
setUpEventDetector(MultiEventDetector osf,
Map<String,MultiAttitudeProvider> localAttProvForces,
Map<String,MultiAttitudeProvider> localAttProvEvents)
Wrap an Orekit multi-sat event detector and register it to the integrator.
|
void |
update(Observable o,
Object eventHandlerIn) |
public MultiNumericalPropagator(FirstOrderIntegrator integrator)
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
.
The new instance of MultiNumericalPropagator is declared as an observer
of the contained
integrator. As observer, it gets notified if a detector is deleted in the integrator sub-layer, to update its own
detectors list.
integrator
- numerical integrator to use for propagation.public void setIntegrator(FirstOrderIntegrator integrator)
Set the integrator and declare the MultiNumericalPropagator object as observer of the specified integrator.
The orbit tolerances (vector or scalar tolerances) given to the integrator are used as default tolerances. The method {setOrbitTolerance(double[], double[], String)
should
be called to define the expected orbit tolerance.integrator
- numerical integrator to use for propagation.public void setOrbitTolerance(double[] absoluteTolerance, double[] relativeTolerance, String satId) throws PatriusException
absoluteTolerance
- the orbit absolute tolerance of the specified spacecraft.relativeTolerance
- the orbit relative tolerance of the specified spacecraft.satId
- the spacecraft ID.PatriusException
- The length of the input orbit tolerance is different from 6public void setMu(double mu, String satId)
mu
- central attraction coefficient (m3/s2)satId
- the spacecraft ID.getMu(String)
,
addForceModel(ForceModel, String)
public double getMu(String satId)
satId
- the spacecraft ID.setMu(double, String)
public MultiAttitudeProvider getAttitudeProvider(String satId)
Get the default attitude provider.
The unique attitude provider given by default is returned. If null, the attitude provider for forces computation, and then the attitude provider for events computation is returned.
Warning: if you provided an AttitudeProvider
then to get back your AttitudeProvider
, the
returned MultiAttitudeProvider
should be cast to MultiAttitudeProviderWrapper
and method
MultiAttitudeProviderWrapper.getAttitudeProvider()
should be used.
getAttitudeProvider
in interface MultiPropagator
satId
- the spacecraft IDpublic MultiAttitudeProvider getAttitudeProviderForces(String satId)
Get the attitude provider for forces computation.
Warning: if you provided an AttitudeProvider
then to get back your AttitudeProvider
, the
returned MultiAttitudeProvider
should be cast to MultiAttitudeProviderWrapper
and method
MultiAttitudeProviderWrapper.getAttitudeProvider()
should be used.
getAttitudeProviderForces
in interface MultiPropagator
satId
- the spacecraft IDpublic MultiAttitudeProvider getAttitudeProviderEvents(String satId)
Get the attitude provider for events computation.
Warning: if you provided an AttitudeProvider
then to get back your AttitudeProvider
, the
returned MultiAttitudeProvider
should be cast to MultiAttitudeProviderWrapper
and method
MultiAttitudeProviderWrapper.getAttitudeProvider()
should be used.
getAttitudeProviderEvents
in interface MultiPropagator
satId
- the spacecraft IDpublic void setAttitudeProvider(AttitudeProvider attitudeProvider, String satId)
Set attitude provider for defined spacecraft.
A default attitude provider is available in ConstantAttitudeLaw
.
The spacecraft defined by the input ID should already be added using
MultiPropagator.addInitialState(SpacecraftState, String)
.
setAttitudeProvider
in interface MultiPropagator
attitudeProvider
- attitude providersatId
- the spacecraft IDpublic void setAttitudeProvider(MultiAttitudeProvider attitudeProvider, String satId)
attitudeProvider
- attitude providersatId
- satellite ID for attitude providerpublic void setAttitudeProviderForces(AttitudeProvider attitudeProviderForces, String satId)
Set attitude provider for forces computation.
A default attitude provider is available in ConstantAttitudeLaw
.
The spacecraft defined by the input ID should already be added using
MultiPropagator.addInitialState(SpacecraftState, String)
.
setAttitudeProviderForces
in interface MultiPropagator
attitudeProviderForces
- attitude provider for forces computationsatId
- the spacecraft IDpublic void setAttitudeProviderForces(MultiAttitudeProvider attitudeProviderForces, String satId)
attitudeProviderForces
- attitude provider for forcessatId
- satellite ID for attitude providerpublic void setAttitudeProviderEvents(AttitudeProvider attitudeProviderEvents, String satId)
Set attitude provider for events computation.
A default attitude provider is available in ConstantAttitudeLaw
.
The spacecraft defined by the input ID should already be added using
MultiPropagator.addInitialState(SpacecraftState, String)
.
setAttitudeProviderEvents
in interface MultiPropagator
attitudeProviderEvents
- attitude provider for events computationsatId
- the spacecraft IDpublic void setAttitudeProviderEvents(MultiAttitudeProvider attitudeProviderEvents, String satId)
attitudeProviderEvents
- attitude provider for eventssatId
- satellite ID for attitude providerpublic void setOrbitFrame(String satId, Frame frame) throws PatriusException
addInitialState(SpacecraftState, String)
method before defining the associated
integration frame.satId
- the spacecraft IDframe
- the frame to use. This frame must be inertial or pseudo-inertial, otherwise an
exception is risen.PatriusException
- if frame is not inertial or apseudo-inertial frame
public void addEventDetector(MultiEventDetector detector)
addEventDetector
in interface MultiPropagator
detector
- event detector to addMultiPropagator.clearEventsDetectors()
,
MultiPropagator.getEventsDetectors()
public void addEventDetector(EventDetector detector, String satId)
MultiPropagator.addInitialState(SpacecraftState, String)
.addEventDetector
in interface MultiPropagator
detector
- event detector to addsatId
- the spacecraft IDMultiPropagator.clearEventsDetectors()
,
MultiPropagator.getEventsDetectors()
public Collection<MultiEventDetector> getEventsDetectors()
detectors
that have been added.getEventsDetectors
in interface MultiPropagator
MultiPropagator.addEventDetector(MultiEventDetector)
,
MultiPropagator.addEventDetector(EventDetector, String)
,
MultiPropagator.clearEventsDetectors()
public void clearEventsDetectors()
public void addForceModel(ForceModel model, String satId)
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).
model
- perturbing ForceModel
to addsatId
- the spacecraft ID.removeForceModels()
,
setMu(double, String)
public void removeForceModels()
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.
addForceModel(ForceModel, String)
public List<ForceModel> getForceModels(String satId)
satId
- the spacecraft ID.addForceModel(ForceModel, String)
,
getNewtonianAttractionForceModel(String)
public NewtonianAttraction getNewtonianAttractionForceModel(String satId)
satId
- the spacecraft ID.setMu(double, String)
,
getForceModels(String)
public int getMode()
getMode
in interface MultiPropagator
MultiPropagator.SLAVE_MODE
, MultiPropagator.MASTER_MODE
, MultiPropagator.EPHEMERIS_GENERATION_MODE
MultiPropagator.setSlaveMode()
,
MultiPropagator.setMasterMode(double, MultiPatriusFixedStepHandler)
,
MultiPropagator.setMasterMode(MultiPatriusStepHandler)
,
MultiPropagator.setEphemerisMode()
public Frame getFrame(String satId)
The propagation frame is the definition frame of the initial state, so this method should be called after this state has been set.
The spacecraft defined by the input ID should already be added using
MultiPropagator.addInitialState(SpacecraftState, String)
.
getFrame
in interface MultiPropagator
satId
- the spacecraft IDMultiPropagator.addInitialState(SpacecraftState, String)
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.
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.
setSlaveMode
in interface MultiPropagator
MultiPropagator.setSlaveMode()
public void setMasterMode(double h, MultiPatriusFixedStepHandler 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 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.
setMasterMode
in interface MultiPropagator
h
- fixed stepsize (s)handler
- handler called at the end of each finalized stepsetMasterMode(double, MultiPatriusFixedStepHandler)
public void setMasterMode(MultiPatriusStepHandler 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 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.
setMasterMode
in interface MultiPropagator
handler
- handler called at the end of each finalized step#setMasterMode(MultiPatriusStepHandler)
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.
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.
setEphemerisMode
in interface MultiPropagator
MultiPropagator.setEphemerisMode()
public void setOrbitType(OrbitType orbitTypeIn)
orbitTypeIn
- orbit type to use for propagationpublic OrbitType getOrbitType()
public void setPositionAngleType(PositionAngle positionAngleType)
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.
positionAngleType
- angle type to use for propagationpublic PositionAngle getPositionAngleType()
public BoundedPropagator getGeneratedEphemeris(String satId)
getGeneratedEphemeris
in interface MultiPropagator
satId
- the spacecraft IDMultiPropagator.setEphemerisMode()
public Map<String,SpacecraftState> getInitialStates()
getInitialStates
in interface MultiPropagator
public void addInitialState(SpacecraftState initialState, String satId) throws PatriusException
addInitialState
in interface MultiPropagator
initialState
- the new spacecraft statesatId
- the spacecraft IDPatriusException
- if an initial state is already defined with this ID.
if the input ID is null.
if the date of the initial state is different from the initial states already defined in the
propagator.public void addAdditionalEquations(AdditionalEquations addEqu, String satId)
addEqu
- additional equationssatId
- the spacecraft ID.SpacecraftState.addAdditionalState(String, double[])
public void addAttitudeEquation(AttitudeEquation addEqu, String satId)
addEqu
- attitude additional equationssatId
- the spacecraft ID.public void setMassProviderEquation(MassProvider massProvider, String satId)
Note that this method should be called after setSlaveMode()
or
setMasterMode(MultiPatriusStepHandler)
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.
massProvider
- the mass providersatId
- the spacecraft ID.public void setAdditionalStateTolerance(String name, double[] absTol, double[] relTol, String satId) throws PatriusException
name
- the additional state nameabsTol
- absolute tolerancesrelTol
- relative tolerancessatId
- the spacecraft ID.PatriusException
- if additional equation associated with the input additional state
name is unknownpublic Map<String,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.
propagate
in interface MultiPropagator
target
- target date towards which orbit state should be propagatedPropagationException
- if state cannot be propagatedpublic Map<String,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.
propagate
in interface MultiPropagator
start
- start date from which orbit state should be propagatedtarget
- target date to which orbit state should be propagatedPropagationException
- if state cannot be propagatedprotected void addEventHandlers(boolean activateHandlers, Map<String,MultiAttitudeProvider> localAttProvForces, Map<String,MultiAttitudeProvider> localAttProvEvents)
activateHandlers
- if true, step and event handlers should be activatedlocalAttProvForces
- attitude providers for forces computationlocalAttProvEvents
- attitude providers for events computation.protected void setUpEventDetector(EventDetector osf, Map<String,MultiAttitudeProvider> localAttProvForces, Map<String,MultiAttitudeProvider> localAttProvEvents, String satId)
osf
- event handler to wraplocalAttProvForces
- attitude providers for forces computationlocalAttProvEvents
- attitude providers for events computation.satId
- spacecraft idprotected void setUpEventDetector(MultiEventDetector osf, Map<String,MultiAttitudeProvider> localAttProvForces, Map<String,MultiAttitudeProvider> localAttProvEvents)
osf
- event handler to wraplocalAttProvForces
- attitude providers for forces computationlocalAttProvEvents
- attitude providers for events computationpublic PVCoordinates getPVCoordinates(AbsoluteDate date, Frame frame, String satId) throws PatriusException
PVCoordinates
of the body in the selected frame.date
- current dateframe
- the frame where to define the positionsatId
- spacecraft idPatriusException
- if position/velocity cannot be computed in given framepublic int getCalls()
The number of calls is reset each time the propagate(AbsoluteDate)
method is called.
public void update(Observable o, Object eventHandlerIn)
Copyright © 2019 CNES. All rights reserved.