Class PythonFieldAdditionalEquations<T extends CalculusFieldElement<T>>
- java.lang.Object
-
- org.orekit.propagation.integration.PythonFieldAdditionalEquations<T>
-
- All Implemented Interfaces:
FieldAdditionalEquations<T>
public class PythonFieldAdditionalEquations<T extends CalculusFieldElement<T>> extends Object implements FieldAdditionalEquations<T>
This interface allows users to add their own differential equations to a numerical propagator.In some cases users may need to integrate some problem-specific equations along with classical spacecraft equations of motions. One example is optimal control in low thrust where adjoint parameters linked to the minimized Hamiltonian must be integrated. Another example is formation flying or rendez-vous which use the Clohessy-Whiltshire equations for the relative motion.
This interface allows users to add such equations to a
numerical propagator
. Users provide the equations as an implementation of this interface and register it to the propagator thanks to itsFieldAbstractIntegratedPropagator.addAdditionalEquations(FieldAdditionalEquations)
method. Several such objects can be registered with each numerical propagator, but it is recommended to gather in the same object the sets of parameters which equations can interact on each others states.The additional parameters are gathered in a simple p array. The additional equations compute the pDot array, which is the time-derivative of the p array. Since the additional parameters p may also have an influence on the equations of motion themselves that should be accumulated to the main state derivatives (for example an equation linked to a complex thrust model may induce an acceleration and a mass change), the
computeDerivatives
method can return a double array that will be added to the main state derivatives. This means these equations can be used as an additional force model if needed. If the additional parameters have no influence at all on the main spacecraft state, a null reference may be returned.This interface is the numerical (read not already integrated) counterpart of the
FieldAdditionalStateProvider
interface. It allows to append various additional state parameters to anynumerical propagator
.- Author:
- Luc Maisonobe
- See Also:
AbstractIntegratedPropagator
,AdditionalStateProvider
-
-
Constructor Summary
Constructors Constructor Description PythonFieldAdditionalEquations()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T[]
computeDerivatives(FieldSpacecraftState<T> s, T[] pDot)
Compute the derivatives related to the additional state parameters.void
finalize()
Part of JCC Python interface to objectString
getName()
Get the name of the additional state.void
init(FieldSpacecraftState<T> initialState, FieldAbsoluteDate<T> target)
Initialize the equations at the start of propagation.void
pythonDecRef()
Part of JCC Python interface to objectlong
pythonExtension()
Part of JCC Python interface to objectvoid
pythonExtension(long pythonObject)
Part of JCC Python interface to object
-
-
-
Method Detail
-
pythonExtension
public void pythonExtension(long pythonObject)
Part of JCC Python interface to object
-
pythonExtension
public long pythonExtension()
Part of JCC Python interface to object
-
finalize
public void finalize() throws Throwable
Part of JCC Python interface to object
-
pythonDecRef
public void pythonDecRef()
Part of JCC Python interface to object
-
getName
public String getName()
Get the name of the additional state.- Specified by:
getName
in interfaceFieldAdditionalEquations<T extends CalculusFieldElement<T>>
- Returns:
- name of the additional state
-
init
public void init(FieldSpacecraftState<T> initialState, FieldAbsoluteDate<T> target)
Initialize the equations at the start of propagation.This method will be called once at propagation start, before any calls to
FieldAdditionalEquations.computeDerivatives(FieldSpacecraftState , CalculusFieldElement[])
.The default implementation of this method does nothing.
- Specified by:
init
in interfaceFieldAdditionalEquations<T extends CalculusFieldElement<T>>
- Parameters:
initialState
- initial state information at the start of propagation.target
- date of propagation. Not equal toinitialState.getDate()
.
-
computeDerivatives
public T[] computeDerivatives(FieldSpacecraftState<T> s, T[] pDot)
Compute the derivatives related to the additional state parameters.When this method is called, the spacecraft state contains the main state (orbit, attitude and mass), all the states provided through the
additional state providers
registered to the propagator, and the additional state integrated using this equation. It does not contains any other states to be integrated alongside during the same propagation.- Specified by:
computeDerivatives
in interfaceFieldAdditionalEquations<T extends CalculusFieldElement<T>>
- Parameters:
s
- current state information: date, kinematics, attitude, and additional statepDot
- placeholder where the derivatives of the additional parameters should be put- Returns:
- cumulative effect of the equations on the main state (may be null if equations do not change main state at all)
-
-