|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.orekit.propagation.numerical.NumericalPropagator
public class NumericalPropagator
This class propagates orbits 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())addEventDetector(EventDetector),
clearEventsDetectors())setSlaveMode(),
setMasterMode(double, OrekitFixedStepHandler), setMasterMode(OrekitStepHandler), setEphemerisMode(), getGeneratedEphemeris())From these configuration parameters, only the initial state is mandatory. 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 propagator is only in one mode at a time.
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 seven elements double array.
The six first elements are the equinoxial orbit parameters (a, ex,
ey, hx, hy, lv) in meters and radians, and
the last element is the mass in kilograms. The following code snippet shows a typical
setting for Low Earth Orbit propagation:
final double minStep = 0.001;
final double maxStep = 1000;
final double initStep = 60;
final double[] absTolerance = {
0.001, 1.0e-9, 1.0e-9, 1.0e-6, 1.0e-6, 1.0e-6, 0.001
};
final double[] relTolerance = {
1.0e-7, 1.0e-4, 1.0e-4, 1.0e-7, 1.0e-7, 1.0e-7, 1.0e-7
};
AdaptiveStepsizeIntegrator integrator =
new DormandPrince853Integrator(minStep, maxStep, absTolerance, relTolerance);
integrator.setInitialStepSize(initStep);
propagator = new NumericalPropagator(integrator);
The same propagator can be reused for several orbit 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 Form| Field Summary | |
|---|---|
protected TimeDerivativesEquations |
adder
Gauss equations handler. |
protected AttitudeLaw |
attitudeLaw
Attitude law. |
protected int |
calls
Counter for differential equations calls. |
protected SpacecraftState |
currentState
Current state to propagate. |
protected java.util.List<EventDetector> |
detectors
Event detectors not related to force models. |
protected java.util.List<ForceModel> |
forceModels
Force models used during the extrapolation of the Orbit. |
protected SpacecraftState |
initialState
Initial state to propagate. |
protected org.apache.commons.math.ode.FirstOrderIntegrator |
integrator
Integrator selected by the user for the orbital extrapolation process. |
protected int |
mode
Current mode. |
protected ModeHandler |
modeHandler
Propagator mode handler. |
protected double |
mu
Central body gravitational constant. |
protected AbsoluteDate |
startDate
Start date. |
protected double[] |
stateVector
State vector. |
| Fields inherited from interface org.orekit.propagation.Propagator |
|---|
EPHEMERIS_GENERATION_MODE, MASTER_MODE, SLAVE_MODE |
| Constructor Summary | |
|---|---|
NumericalPropagator(org.apache.commons.math.ode.FirstOrderIntegrator integrator)
Create a new instance of NumericalPropagator, based on orbit definition mu. |
|
| Method Summary | |
|---|---|
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. |
int |
getCalls()
Get the number of calls to the differential equations computation method. |
java.util.Collection<EventDetector> |
getEventsDetectors()
Get all the events detectors that have been added. |
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 μ. |
PVCoordinates |
getPVCoordinates(AbsoluteDate date,
Frame frame)
Get the PVCoordinates of the body in the selected frame. |
SpacecraftState |
propagate(AbsoluteDate finalDate)
Propagate 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 |
setAttitudeLaw(AttitudeLaw attitudeLaw)
Set the attitude law. |
void |
setEphemerisMode()
Set the propagator to ephemeris generation mode. |
void |
setInitialState(SpacecraftState initialState)
Set the initial state. |
void |
setIntegrator(org.apache.commons.math.ode.FirstOrderIntegrator integrator)
Set the integrator. |
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 μ. |
void |
setSlaveMode()
Set the propagator to slave mode. |
protected void |
setUpEventDetector(EventDetector osf)
Wrap an Orekit 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 |
| Field Detail |
|---|
protected AttitudeLaw attitudeLaw
protected double mu
protected final java.util.List<ForceModel> forceModels
protected final java.util.List<EventDetector> detectors
protected final double[] stateVector
protected AbsoluteDate startDate
protected SpacecraftState initialState
protected SpacecraftState currentState
protected transient org.apache.commons.math.ode.FirstOrderIntegrator integrator
protected int calls
protected TimeDerivativesEquations adder
protected ModeHandler modeHandler
protected int mode
| Constructor Detail |
|---|
public NumericalPropagator(org.apache.commons.math.ode.FirstOrderIntegrator integrator)
addForceModel is not
called after creation, the integrated orbit will follow a keplerian
evolution only.
integrator - numerical integrator to use for propagation.| Method Detail |
|---|
public void setIntegrator(org.apache.commons.math.ode.FirstOrderIntegrator integrator)
integrator - numerical integrator to use for propagation.public void setMu(double mu)
mu - central attraction coefficient (m^3/s^2)getMu(),
addForceModel(ForceModel)public double getMu()
setMu(double)public void setAttitudeLaw(AttitudeLaw attitudeLaw)
attitudeLaw - attitude lawpublic void addEventDetector(EventDetector detector)
addEventDetector in interface Propagatordetector - event detector to addPropagator.clearEventsDetectors(),
Propagator.getEventsDetectors()public java.util.Collection<EventDetector> getEventsDetectors()
getEventsDetectors in interface PropagatorPropagator.addEventDetector(EventDetector),
Propagator.clearEventsDetectors()public void clearEventsDetectors()
clearEventsDetectors in interface PropagatorPropagator.addEventDetector(EventDetector),
Propagator.getEventsDetectors()public void addForceModel(ForceModel model)
If the force models is associated to discrete events, these
events will be handled automatically, they must not
be added using the addEventDetector
method.
If this method is not called at all, the integrated orbit will follow a keplerian evolution only.
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 int getMode()
getMode in interface PropagatorPropagator.SLAVE_MODE, Propagator.MASTER_MODE,
Propagator.EPHEMERIS_GENERATION_MODEPropagator.setSlaveMode(),
Propagator.setMasterMode(double, OrekitFixedStepHandler),
Propagator.setMasterMode(OrekitStepHandler),
Propagator.setEphemerisMode()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 PropagatorPropagator.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 callled.
setMasterMode in interface Propagatorh - fixed stepsize (s)handler - handler called at the end of each finalized stepPropagator.setSlaveMode(),
Propagator.setMasterMode(OrekitStepHandler),
Propagator.setEphemerisMode(),
Propagator.getMode(),
Propagator.MASTER_MODEpublic 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 Propagatorhandler - handler called at the end of each finalized stepPropagator.setSlaveMode(),
Propagator.setMasterMode(double, OrekitFixedStepHandler),
Propagator.setEphemerisMode(),
Propagator.getMode(),
Propagator.MASTER_MODEpublic 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 callled.
setEphemerisMode in interface PropagatorPropagator.getGeneratedEphemeris(),
Propagator.setSlaveMode(),
Propagator.setMasterMode(double, OrekitFixedStepHandler),
Propagator.setMasterMode(OrekitStepHandler),
Propagator.getMode(),
Propagator.EPHEMERIS_GENERATION_MODE
public BoundedPropagator getGeneratedEphemeris()
throws java.lang.IllegalStateException
getGeneratedEphemeris in interface Propagatorjava.lang.IllegalStateException - if the propagator was not set in ephemeris
generation mode before propagationPropagator.setEphemerisMode()public SpacecraftState getInitialState()
getInitialState in interface Propagatorpublic void setInitialState(SpacecraftState initialState)
initialState - initial statepropagate(AbsoluteDate)public void resetInitialState(SpacecraftState state)
resetInitialState in interface Propagatorstate - new initial state to consider
public SpacecraftState propagate(AbsoluteDate finalDate)
throws PropagationException
Simple propagators use only the target date as the specification for
computing the propagated state. More feature rich propagators like the
ones implemented the extended interface Propagator 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 BasicPropagatorfinalDate - target date towards which orbit state should be propagated
PropagationException - if state cannot be propagated
public PVCoordinates getPVCoordinates(AbsoluteDate date,
Frame frame)
throws OrekitException
PVCoordinates of the body in the selected frame.
getPVCoordinates in interface PVCoordinatesProviderdate - 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 wrap
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||