Package org.orekit.forces
Class PythonForceModel
- java.lang.Object
-
- org.orekit.forces.PythonForceModel
-
- All Implemented Interfaces:
ForceModel
,EventDetectorsProvider
,ParameterDriversProvider
public class PythonForceModel extends Object implements ForceModel
-
-
Field Summary
-
Fields inherited from interface org.orekit.propagation.events.EventDetectorsProvider
DATATION_ACCURACY
-
-
Constructor Summary
Constructors Constructor Description PythonForceModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends CalculusFieldElement<T>>
FieldVector3D<T>acceleration(FieldSpacecraftState<T> s, T[] parameters)
Compute acceleration.Vector3D
acceleration(SpacecraftState s, double[] parameters)
Compute acceleration.<T extends CalculusFieldElement<T>>
voidaddContribution(FieldSpacecraftState<T> s, FieldTimeDerivativesEquations<T> adder)
Compute the contribution of the force model to the perturbing acceleration.void
addContribution(SpacecraftState s, TimeDerivativesEquations adder)
Compute the contribution of the force model to the perturbing acceleration.boolean
dependsOnPositionOnly()
Check if force models depends on position only.void
finalize()
Part of JCC Python interface to objectParameterDriver
getParameterDriver(String name)
Get parameter value from its name.double[]
getParameters()
Get model parameters.<T extends CalculusFieldElement<T>>
T[]getParameters(Field<T> field)
Get model parameters.List<ParameterDriver>
getParametersDrivers()
Get the drivers for parameters.void
init(SpacecraftState initialState, AbsoluteDate target)
Initialize the force model at the start of propagation.boolean
isSupported(String name)
Check if a parameter is supported.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-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.orekit.propagation.events.EventDetectorsProvider
getEventDetectors, getFieldEventDetectors
-
Methods inherited from interface org.orekit.forces.ForceModel
getEventDetectors, getFieldEventDetectors, init
-
Methods inherited from interface org.orekit.utils.ParameterDriversProvider
getNbParametersDriversValue, getParameters, getParameters, getParametersAllValues, getParametersAllValues
-
-
-
-
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
-
init
public void init(SpacecraftState initialState, AbsoluteDate target)
Initialize the force model at the start of propagation. This method will be called before any calls toForceModel.addContribution(SpacecraftState, TimeDerivativesEquations)
,ForceModel.addContribution(FieldSpacecraftState, FieldTimeDerivativesEquations)
,ForceModel.acceleration(SpacecraftState, double[])
orForceModel.acceleration(FieldSpacecraftState, CalculusFieldElement[])
The default implementation of this method does nothing.
- Specified by:
init
in interfaceForceModel
- Parameters:
initialState
- spacecraft state at the start of propagation.target
- date of propagation. Not equal toinitialState.getDate()
.
-
addContribution
public void addContribution(SpacecraftState s, TimeDerivativesEquations adder)
Compute the contribution of the force model to the perturbing acceleration.The default implementation simply adds the
acceleration
as a non-Keplerian acceleration.- Specified by:
addContribution
in interfaceForceModel
- Parameters:
s
- current state information: date, kinematics, attitudeadder
- object where the contribution should be added
-
addContribution
public <T extends CalculusFieldElement<T>> void addContribution(FieldSpacecraftState<T> s, FieldTimeDerivativesEquations<T> adder)
Compute the contribution of the force model to the perturbing acceleration.- Specified by:
addContribution
in interfaceForceModel
- Type Parameters:
T
- type of the elements- Parameters:
s
- current state information: date, kinematics, attitudeadder
- object where the contribution should be added
-
getParameters
public double[] getParameters()
Get model parameters.- Specified by:
getParameters
in interfaceParameterDriversProvider
- Returns:
- model parameters, will throw an
exception if one PDriver has several values driven. If
it's the case (if at least 1 PDriver of the model has several values
driven) the method
ParameterDriversProvider.getParameters(AbsoluteDate)
must be used.
-
getParameters
public <T extends CalculusFieldElement<T>> T[] getParameters(Field<T> field)
Get model parameters.- Specified by:
getParameters
in interfaceParameterDriversProvider
- Type Parameters:
T
- type of the elements- Parameters:
field
- field to which the elements belong- Returns:
- model parameters, will throw an
exception if one PDriver of the has several values driven. If
it's the case (if at least 1 PDriver of the model has several values
driven) the method
ParameterDriversProvider.getParameters(Field, FieldAbsoluteDate)
must be used.
-
dependsOnPositionOnly
public boolean dependsOnPositionOnly()
Check if force models depends on position only.- Specified by:
dependsOnPositionOnly
in interfaceForceModel
- Returns:
- true if force model depends on position only, false if it depends on velocity, either directly or due to a dependency on attitude
-
acceleration
public Vector3D acceleration(SpacecraftState s, double[] parameters)
Compute acceleration.- Specified by:
acceleration
in interfaceForceModel
- Parameters:
s
- current state information: date, kinematics, attitudeparameters
- values of the force model parameters at state date, only 1 value for each parameterDriver- Returns:
- acceleration in same frame as state
-
acceleration
public <T extends CalculusFieldElement<T>> FieldVector3D<T> acceleration(FieldSpacecraftState<T> s, T[] parameters)
Compute acceleration.- Specified by:
acceleration
in interfaceForceModel
- Type Parameters:
T
- type of the elements- Parameters:
s
- current state information: date, kinematics, attitudeparameters
- values of the force model parameters at state date, only 1 value for each parameterDriver- Returns:
- acceleration in same frame as state
-
getParametersDrivers
public List<ParameterDriver> getParametersDrivers()
Get the drivers for parameters.- Specified by:
getParametersDrivers
in interfaceParameterDriversProvider
- Returns:
- drivers for parameters
-
getParameterDriver
public ParameterDriver getParameterDriver(String name)
Get parameter value from its name.- Specified by:
getParameterDriver
in interfaceParameterDriversProvider
- Parameters:
name
- parameter name- Returns:
- parameter value
-
isSupported
public boolean isSupported(String name)
Check if a parameter is supported.Supported parameters are those listed by
ParameterDriversProvider.getParametersDrivers()
.- Specified by:
isSupported
in interfaceParameterDriversProvider
- Parameters:
name
- parameter name to check- Returns:
- true if the parameter is supported
- See Also:
ParameterDriversProvider.getParametersDrivers()
-
-