|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.cnes.sirius.patrius.propagation.numerical.multi.MultiNumericalPropagator
public class MultiNumericalPropagator
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, MultiOrekitFixedStepHandler), setMasterMode(MultiOrekitStepHandler),
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,
MultiOrekitStepHandler,
MultiOrekitFixedStepHandler,
MultiIntegratedEphemeris,
TimeDerivativesEquations| Field Summary |
|---|
| Fields inherited from interface fr.cnes.sirius.patrius.propagation.MultiPropagator |
|---|
EPHEMERIS_GENERATION_MODE, MASTER_MODE, SLAVE_MODE |
| Constructor Summary | |
|---|---|
MultiNumericalPropagator(FirstOrderIntegrator integrator)
Create a new instance of MultiNumericalPropagator. |
|
| Method Summary | |
|---|---|
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,AttitudeProvider> localAttProvForces,
Map<String,AttitudeProvider> 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 |
addMassProviderEquation(MassProvider massProvider,
String satId)
Add additional equations associated with the mass provider. |
void |
clearEventsDetectors()
Remove all events detectors. |
AttitudeProvider |
getAttitudeProvider(String satId)
Get the default attitude provider. |
AttitudeProvider |
getAttitudeProviderEvents(String satId)
Get the attitude provider for events computation. |
AttitudeProvider |
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 |
setAttitudeProviderEvents(AttitudeProvider attitudeProviderEvents,
String satId)
Set attitude provider for events computation. |
void |
setAttitudeProviderForces(AttitudeProvider attitudeProviderForces,
String satId)
Set attitude provider for forces computation. |
void |
setEphemerisMode()
Set the propagator to ephemeris generation mode. |
void |
setIntegrator(FirstOrderIntegrator integrator)
Set the integrator. |
void |
setMasterMode(double h,
MultiOrekitFixedStepHandler handler)
Set the propagator to master mode with fixed steps. |
void |
setMasterMode(MultiOrekitStepHandler handler)
Set the propagator to master mode with variable steps. |
void |
setMu(double mu,
String satId)
Set the central attraction coefficient μ. The Newtonian attraction from the central body force model will be updated with the new 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,AttitudeProvider> localAttProvForces,
Map<String,AttitudeProvider> localAttProvEvents,
String satId)
Wrap an Orekit event detector and register it to the integrator. |
protected void |
setUpEventDetector(MultiEventDetector osf,
Map<String,AttitudeProvider> localAttProvForces,
Map<String,AttitudeProvider> localAttProvEvents)
Wrap an Orekit multi-sat event detector and register it to the integrator. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
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.
integrator - numerical integrator to use for propagation.| Method Detail |
|---|
public void setIntegrator(FirstOrderIntegrator integrator)
Set the 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 OrekitException
absoluteTolerance - the orbit absolute tolerance of the specified spacecraft.relativeTolerance - the orbit relative tolerance of the specified spacecraft.satId - the spacecraft ID.
OrekitException - The length of the input orbit tolerance is different from 6
public 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 AttitudeProvider getAttitudeProvider(String satId)
MultiPropagatorGet 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.
getAttitudeProvider in interface MultiPropagatorsatId - the spacecraft ID
public AttitudeProvider getAttitudeProviderForces(String satId)
MultiPropagatorGet the attitude provider for forces computation.
getAttitudeProviderForces in interface MultiPropagatorsatId - the spacecraft ID
public AttitudeProvider getAttitudeProviderEvents(String satId)
MultiPropagatorGet the attitude provider for events computation.
getAttitudeProviderEvents in interface MultiPropagatorsatId - the spacecraft ID
public void setAttitudeProvider(AttitudeProvider attitudeProvider,
String satId)
MultiPropagatorSet 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 MultiPropagatorattitudeProvider - attitude providersatId - the spacecraft ID
public void setAttitudeProviderForces(AttitudeProvider attitudeProviderForces,
String satId)
MultiPropagatorSet 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 MultiPropagatorattitudeProviderForces - attitude provider for forces computationsatId - the spacecraft ID
public void setAttitudeProviderEvents(AttitudeProvider attitudeProviderEvents,
String satId)
MultiPropagatorSet 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 MultiPropagatorattitudeProviderEvents - attitude provider for events computationsatId - the spacecraft ID
public void setOrbitFrame(String satId,
Frame frame)
throws OrekitException
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.
OrekitException - if frame is not inertial or
apseudo-inertial framepublic void addEventDetector(MultiEventDetector detector)
MultiPropagator
addEventDetector in interface MultiPropagatordetector - event detector to addMultiPropagator.clearEventsDetectors(),
MultiPropagator.getEventsDetectors()
public void addEventDetector(EventDetector detector,
String satId)
MultiPropagatorMultiPropagator.addInitialState(SpacecraftState, String).
addEventDetector in interface MultiPropagatordetector - event detector to addsatId - the spacecraft IDMultiPropagator.clearEventsDetectors(),
MultiPropagator.getEventsDetectors()public Collection<MultiEventDetector> getEventsDetectors()
MultiPropagatordetectors that have been added.
getEventsDetectors in interface MultiPropagatorMultiPropagator.addEventDetector(MultiEventDetector),
MultiPropagator.addEventDetector(EventDetector, String),
MultiPropagator.clearEventsDetectors()public void clearEventsDetectors()
MultiPropagator
clearEventsDetectors in interface MultiPropagatorMultiPropagator.addEventDetector(MultiEventDetector),
MultiPropagator.addEventDetector(EventDetector, String),
MultiPropagator.getEventsDetectors()
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()
MultiPropagator
getMode in interface MultiPropagatorMultiPropagator.SLAVE_MODE, MultiPropagator.MASTER_MODE, MultiPropagator.EPHEMERIS_GENERATION_MODEMultiPropagator.setSlaveMode(),
MultiPropagator.setMasterMode(double, MultiOrekitFixedStepHandler),
MultiPropagator.setMasterMode(MultiOrekitStepHandler),
MultiPropagator.setEphemerisMode()public Frame getFrame(String satId)
MultiPropagatorThe 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 MultiPropagatorsatId - the spacecraft ID
MultiPropagator.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 MultiPropagatorMultiPropagator.setSlaveMode()
public void setMasterMode(double h,
MultiOrekitFixedStepHandler 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 MultiPropagatorh - fixed stepsize (s)handler - handler called at the end of each finalized stepsetMasterMode(double, MultiOrekitFixedStepHandler)public void setMasterMode(MultiOrekitStepHandler 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 MultiPropagatorhandler - handler called at the end of each finalized step#setMasterMode(MultiOrekitStepHandler)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 MultiPropagatorMultiPropagator.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)
MultiPropagator
getGeneratedEphemeris in interface MultiPropagatorsatId - the spacecraft ID
MultiPropagator.setEphemerisMode()public Map<String,SpacecraftState> getInitialStates()
MultiPropagator
getInitialStates in interface MultiPropagator
public void addInitialState(SpacecraftState initialState,
String satId)
throws OrekitException
MultiPropagator
addInitialState in interface MultiPropagatorinitialState - the new spacecraft statesatId - the spacecraft ID
OrekitException - 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 addMassProviderEquation(MassProvider massProvider,
String satId)
Note that this method should be called after setSlaveMode() or
setMasterMode(MultiOrekitStepHandler) or setEphemerisMode() since this method reset the
integrator step handlers list.
massProvider - the mass providersatId - the spacecraft ID.
public void setAdditionalStateTolerance(String name,
double[] absTol,
double[] relTol,
String satId)
throws OrekitException
name - the additional state nameabsTol - absolute tolerancesrelTol - relative tolerancessatId - the spacecraft ID.
OrekitException - if additional equation associated with the input additional state name is unknown
public Map<String,SpacecraftState> propagate(AbsoluteDate target)
throws PropagationException
MultiPropagatorSimple 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 MultiPropagatortarget - target date towards which orbit state should be propagated
PropagationException - if state cannot be propagated
public Map<String,SpacecraftState> propagate(AbsoluteDate start,
AbsoluteDate target)
throws PropagationException
MultiPropagatorThose 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 MultiPropagatorstart - start date from which orbit state should be propagatedtarget - target date to which orbit state should be propagated
PropagationException - if state cannot be propagated
protected void addEventHandlers(boolean activateHandlers,
Map<String,AttitudeProvider> localAttProvForces,
Map<String,AttitudeProvider> 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,AttitudeProvider> localAttProvForces,
Map<String,AttitudeProvider> localAttProvEvents,
String satId)
osf - event handler to wraplocalAttProvForces - attitude providers for forces computationlocalAttProvEvents - attitude providers for events computation.satId - spacecraft id
protected void setUpEventDetector(MultiEventDetector osf,
Map<String,AttitudeProvider> localAttProvForces,
Map<String,AttitudeProvider> localAttProvEvents)
osf - event handler to wraplocalAttProvForces - attitude providers for forces computationlocalAttProvEvents - attitude providers for events computation
public PVCoordinates getPVCoordinates(AbsoluteDate date,
Frame frame,
String satId)
throws OrekitException
PVCoordinates of the body in the selected frame.
date - current dateframe - the frame where to define the positionsatId - spacecraft id
OrekitException - 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||