|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.orekit.propagation.numerical.NumericalPropagator
public class NumericalPropagator
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:
setInitialState(SpacecraftState)
)setMu(double)
)addForceModel(ForceModel)
,
removeForceModels()
)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)
),
additional equations
(for example Jacobians
) should be propagated along with orbital state
(addAdditionalEquations(AdditionalEquations)
),
addEventDetector(EventDetector)
,
clearEventsDetectors()
)setSlaveMode()
,
setMasterMode(double, OrekitFixedStepHandler)
, setMasterMode(OrekitStepHandler)
, setEphemerisMode()
, getGeneratedEphemeris()
)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:
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 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.
SpacecraftState
,
ForceModel
,
OrekitStepHandler
,
OrekitFixedStepHandler
,
IntegratedEphemeris
,
TimeDerivativesEquations
,
Serialized FormField 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 |
---|
public NumericalPropagator(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)
integrator
- numerical integrator to use for propagation.public void setMu(double mu)
mu
- central attraction coefficient (m3/s2)getMu()
,
addForceModel(ForceModel)
public double getMu()
setMu(double)
@Deprecated public void setAttitudeLaw(AttitudeProvider provider)
setAttitudeProvider(AttitudeProvider)
provider
- attitude providerpublic AttitudeProvider getAttitudeProvider()
getAttitudeProvider
in interface Propagator
public AttitudeProvider getAttitudeProviderForces()
getAttitudeProviderForces
in interface Propagator
public AttitudeProvider getAttitudeProviderEvents()
getAttitudeProviderEvents
in interface Propagator
public void setAttitudeProvider(AttitudeProvider attitudeProvider)
ConstantAttitudeLaw
.
setAttitudeProvider
in interface Propagator
attitudeProvider
- attitude providerpublic void setAttitudeProviderForces(AttitudeProvider attitudeForcesProvider)
ConstantAttitudeLaw
.
setAttitudeProviderForces
in interface Propagator
attitudeForcesProvider
- attitude provider for forces computationpublic void setAttitudeProviderEvents(AttitudeProvider attitudeEventsProvider)
ConstantAttitudeLaw
.
setAttitudeProviderEvents
in interface Propagator
attitudeEventsProvider
- attitude provider for events computationpublic void addEventDetector(EventDetector detector)
addEventDetector
in interface Propagator
detector
- event detector to addPropagator.clearEventsDetectors()
,
Propagator.getEventsDetectors()
public Collection<EventDetector> getEventsDetectors()
getEventsDetectors
in interface Propagator
Propagator.addEventDetector(EventDetector)
,
Propagator.clearEventsDetectors()
public void clearEventsDetectors()
clearEventsDetectors
in interface Propagator
Propagator.addEventDetector(EventDetector)
,
Propagator.getEventsDetectors()
public void addForceModel(ForceModel 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).
model
- perturbing ForceModel
to addremoveForceModels()
,
setMu(double)
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)
public List<ForceModel> getForceModels()
addForceModel(ForceModel)
,
getNewtonianAttractionForceModel()
public NewtonianAttraction getNewtonianAttractionForceModel()
setMu(double)
,
getForceModels()
public int getMode()
getMode
in interface Propagator
Propagator.SLAVE_MODE
, Propagator.MASTER_MODE
,
Propagator.EPHEMERIS_GENERATION_MODE
Propagator.setSlaveMode()
,
Propagator.setMasterMode(double, OrekitFixedStepHandler)
,
Propagator.setMasterMode(OrekitStepHandler)
,
Propagator.setEphemerisMode()
public Frame getFrame()
4 cases are possible:
Propagator.setOrbitFrame(Frame)
): it is returned.
getFrame
in interface Propagator
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 callled.
setSlaveMode
in interface Propagator
Propagator.setMasterMode(double, OrekitFixedStepHandler)
,
Propagator.setMasterMode(OrekitStepHandler)
,
Propagator.setEphemerisMode()
,
Propagator.getMode()
,
Propagator.SLAVE_MODE
public void setMasterMode(double h, OrekitFixedStepHandler 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 Propagator
h
- fixed stepsize (s)handler
- handler called at the end of each finalized stepPropagator.setSlaveMode()
,
Propagator.setMasterMode(OrekitStepHandler)
,
Propagator.setEphemerisMode()
,
Propagator.getMode()
,
Propagator.MASTER_MODE
public void setMasterMode(OrekitStepHandler 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 callled.
setMasterMode
in interface Propagator
handler
- handler called at the end of each finalized stepPropagator.setSlaveMode()
,
Propagator.setMasterMode(double, OrekitFixedStepHandler)
,
Propagator.setEphemerisMode()
,
Propagator.getMode()
,
Propagator.MASTER_MODE
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 Propagator
Propagator.getGeneratedEphemeris()
,
Propagator.setSlaveMode()
,
Propagator.setMasterMode(double, OrekitFixedStepHandler)
,
Propagator.setMasterMode(OrekitStepHandler)
,
Propagator.getMode()
,
Propagator.EPHEMERIS_GENERATION_MODE
public void setOrbitType(OrbitType orbitTypeIn)
orbitTypeIn
- orbit type to use for propagationpublic void setOrbitFrame(Frame frame) throws OrekitException
setOrbitFrame
in interface Propagator
frame
- the frame to use.
This frame must be inertial or pseudo-inertial, otherwise an exception is raised.
OrekitException
- if frame is not inertial or pseudo-inertialpublic 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() throws IllegalStateException
getGeneratedEphemeris
in interface Propagator
IllegalStateException
- if the propagator was not set in ephemeris
generation mode before propagationPropagator.setEphemerisMode()
public SpacecraftState getInitialState()
getInitialState
in interface Propagator
public void setInitialState(SpacecraftState initialState)
initialState
- initial statepropagate(AbsoluteDate)
public void resetInitialState(SpacecraftState state)
resetInitialState
in interface Propagator
state
- new initial state to considerpublic void addAdditionalEquations(AdditionalEquations addEqu)
addEqu
- additional equationsSpacecraftState.addAdditionalState(String, double[])
public void addAttitudeEquation(AttitudeEquation addEqu)
addEqu
- attitude additional equationspublic void setMassProviderEquation(MassProvider massProvider)
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.
massProvider
- the mass providerpublic void setAdditionalStateTolerance(String name, double[] absTol, double[] relTol) throws OrekitException
name
- the additional state nameabsTol
- absolute tolerancesrelTol
- relative tolerances
OrekitException
- if additional equation associated with the input additional state name is unknownpublic 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 Propagator
target
- target date towards which orbit state should be propagated
PropagationException
- if state cannot be propagatedpublic SpacecraftState propagate(AbsoluteDate tStart, AbsoluteDate tEnd) 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 Propagator
tStart
- start date from which orbit state should be propagatedtEnd
- target date to which orbit state should be propagated
PropagationException
- if state cannot be propagatedpublic PVCoordinates getPVCoordinates(AbsoluteDate date, Frame frame) throws OrekitException
PVCoordinates
of the body in the selected frame.
getPVCoordinates
in interface PVCoordinatesProvider
date
- current dateframe
- the frame where to define the position
OrekitException
- if position cannot be computed in given framepublic int getCalls()
The number of calls is reset each time the propagate(AbsoluteDate)
method is called.
protected void setUpEventDetector(EventDetector osf)
osf
- event handler to wrappublic int getBasicDimension()
public static double[][] tolerances(double dP, Orbit orbit, OrbitType type)
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.
dP
- user specified position errororbit
- reference orbittype
- propagation type for the meaning of the tolerance vectors elements
(it may be different from orbit.getType()
)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |