public class PropagationNewtonianPoint extends PropagationPointElement implements IPartialDifferentiable
PropagationStateElement
representing the position (and velocity) of a body
with its second derivative defined by Newton's second law of motion: Acceleration = AppliedForce / MassModifier | Constructor and Description |
---|---|
|
PropagationNewtonianPoint()
Initializes a new instance.
|
protected |
PropagationNewtonianPoint(PropagationNewtonianPoint existingInstance,
CopyContext context)
Initializes a new instance as a copy of an existing instance.
|
|
PropagationNewtonianPoint(String id,
ReferenceFrame propagationFrame,
Cartesian initialPosition,
Cartesian initialVelocity)
Initializes a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkForSameDefinition(PropagationNewtonianPoint other)
Checks to determine if another instance has the same definition as this instance and
returns
true if it does. |
protected boolean |
checkForSameDefinition(PropagationPointElement other)
Checks to determine if another instance has the same definition as this instance and
returns
true if it does. |
Object |
clone(CopyContext context)
Clones this object using the specified context.
|
protected int |
computeCurrentDefinitionHashCode()
Computes a hash code based on the current properties of this object.
|
void |
enumerateDependencies(DependencyEnumerator enumerator)
Enumerates the dependencies of this object by calling
DependencyEnumerator#enumerate(T) for each object that this object directly depends upon. |
protected void |
freezeAggregatedObjects()
Called by
DefinitionalObject.freeze() to also freeze any objects that are considered to be a part of this object. |
Vector |
getAccelerationVector()
|
List<ForceModel> |
getAppliedForces()
Gets a list of the forces applied at the
IntegrationPoint (get ). |
PropagationStateElementConverter |
getConverter(EvaluatorGroup group,
Motion1<int[]> stateInputIndices)
Gets an instance of an output type which can convert the output of propagation
back into the native type of this state element.
|
PropagationStateElementEvaluator |
getDerivatives(EvaluatorGroup group)
This is used by the
NumericalPropagatorDefinition to obtain an instance of a state element evaluator
that can compute the derivatives of this element of the state during propagation. |
int |
getDimension()
Gets the dimension of the values produced by the object.
|
Cartesian |
getInitialPosition()
Gets the initial position.
|
Cartesian |
getInitialVelocity()
Gets the initial velocity.
|
ReferenceFrame |
getIntegrationFrame()
Gets the inertial
ReferenceFrame in which the position, velocity, and forces are defined. |
Point |
getIntegrationPoint()
Gets a
Point which is parameterized on the position and velocity in the state during integration. |
Scalar |
getMass()
Gets the total point mass of the body on which the forces are applied.
|
int |
getOrder()
Gets the order of the differential equation corresponding to this element.
|
PartialDerivativesEvaluator |
getPartialDerivativesEvaluator(List<IPartialDifferentiable> independentVariables,
EvaluatorGroup group)
Gets an evaluator that calculates the partial derivatives of the acceleration of the
IntegrationPoint (get )
with respect to any of the independentVariables parameters that apply. |
PropagationStateParameter |
getStateParameter()
Gets a parameter which represents the state during propagation.
|
void |
setInitialPosition(Cartesian value)
Sets the initial position.
|
void |
setInitialVelocity(Cartesian value)
Sets the initial velocity.
|
void |
setIntegrationFrame(ReferenceFrame value)
Sets the inertial
ReferenceFrame in which the position, velocity, and forces are defined. |
void |
setMass(Scalar value)
Sets the total point mass of the body on which the forces are applied.
|
void |
setStateParameter(PropagationStateParameter value)
Sets a parameter which represents the state during propagation.
|
checkForSameDefinition
checkForSameDefinition, getIdentification, getIncludeHighestDerivativeInOutput, getStateUpdater, setIdentification, setIncludeHighestDerivativeInOutput
areSameDefinition, areSameDefinition, areSameDefinition, areSameDefinition, areSameDefinition, collectionItemsAreSameDefinition, collectionItemsAreSameDefinition, collectionItemsAreSameDefinition, dictionaryItemsAreSameDefinition, freeze, getCollectionHashCode, getCollectionHashCode, getCollectionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDefinitionHashCode, getDictionaryHashCode, getIsFrozen, isSameDefinition, throwIfFrozen
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDefinitionHashCode, isSameDefinition
public PropagationNewtonianPoint()
public PropagationNewtonianPoint(String id, ReferenceFrame propagationFrame, @Nonnull Cartesian initialPosition, @Nonnull Cartesian initialVelocity)
id
- A unique string identifying this position in the output.propagationFrame
- The inertial frame in which to propagate.initialPosition
- The position at the starting epoch of propagation.initialVelocity
- The velocity at the starting epoch of propagation.protected PropagationNewtonianPoint(@Nonnull PropagationNewtonianPoint existingInstance, @Nonnull CopyContext context)
See ICloneWithContext.clone(CopyContext)
for more information about how to implement this constructor
in a derived class.
existingInstance
- The existing instance to copy.context
- A CopyContext
that controls the depth of the copy.ArgumentNullException
- Thrown when existingInstance
or context
is null
.public Object clone(CopyContext context)
This method should be implemented to call a copy constructor on the class of the
object being cloned. The copy constructor should take the CopyContext
as a parameter
in addition to the existing instance to copy. The copy constructor should first call
CopyContext.addObjectMapping(T, T)
to identify the newly constructed instance
as a copy of the existing instance. It should then copy all fields, using
CopyContext.updateReference(T)
to copy any reference fields.
A typical implementation of ICloneWithContext
:
public static class MyClass implements ICloneWithContext {
public MyClass(MyClass existingInstance, CopyContext context) {
context.addObjectMapping(existingInstance, this);
someReference = context.updateReference(existingInstance.someReference);
}
@Override
public final Object clone(CopyContext context) {
return new MyClass(this, context);
}
private Object someReference;
}
In general, all fields that are reference types should be copied with a call to
CopyContext.updateReference(T)
. There are a couple of exceptions:
If one of these exceptions applies, the CopyContext
should be given an opportunity
to update the reference before the reference is copied explicitly. Use
CopyContext.updateReference(T)
to update the reference. If CopyContext.updateReference(T)
returns
the original object, indicating that the context does not have a replacement registered,
then copy the object manually by invoking a Clone method, a copy constructor, or by manually
constructing a new instance and copying the values.
alwaysCopy = context.updateReference(existingInstance.alwaysCopy);
if (existingInstance.alwaysCopy != null && alwaysCopy == existingInstance.alwaysCopy) {
alwaysCopy = (AlwaysCopy) existingInstance.alwaysCopy.clone(context);
}
If you are implementing an evaluator (a class that implements IEvaluator
), the
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
method shares some responsibilities with the
copy context constructor. Code duplication can be avoided by doing the following:
CopyContext.updateReference(T)
. You should still call CopyContext.updateReference(T)
on any references to
non-evaluators.
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
as the last line in the constructor and pass it the
same CopyContext
passed to the constructor.
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
as normal. See the reference documentation for
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
for more information on implementing that method.
public MyClass(MyClass existingInstance, CopyContext context) {
super(existingInstance, context);
someReference = context.updateReference(existingInstance.someReference);
evaluatorReference = existingInstance.evaluatorReference;
updateEvaluatorReferences(context);
}
@Override
public void updateEvaluatorReferences(CopyContext context) {
evaluatorReference = context.updateReference(evaluatorReference);
}
@Override
public Object clone(CopyContext context) {
return new MyClass(this, context);
}
private Object someReference;
private IEvaluator evaluatorReference;
clone
in interface ICloneWithContext
clone
in class DefinitionalObject
context
- The context to use to perform the copy.protected final boolean checkForSameDefinition(PropagationPointElement other)
true
if it does. Derived classes MUST override this method and check
all new fields introduced by the derived class for definitional equivalence. It is NOT necessary
to check base class fields because the base class will already have done that. When overriding this method,
you should NOT call the base implementation because it will return false
for all derived-class instances.
Derived classes should check the type of other
to preserve the symmetric nature of IEquatableDefinition.isSameDefinition(java.lang.Object)
.checkForSameDefinition
in class PropagationPointElement
other
- The other instance to compare to this one.true
if the two objects are defined equivalently; otherwise false
.protected boolean checkForSameDefinition(PropagationNewtonianPoint other)
true
if it does. Derived classes MUST override this method and check
all new fields introduced by the derived class for definitional equivalence. It is NOT necessary
to check base class fields because the base class will already have done that. When overriding this method,
you should NOT call the base implementation because it will return false
for all derived-class instances.
Derived classes should check the type of other
to preserve the symmetric nature of IEquatableDefinition.isSameDefinition(java.lang.Object)
.other
- The other instance to compare to this one.true
if the two objects are defined equivalently; otherwise false
.protected int computeCurrentDefinitionHashCode()
PropagationNewtonianPoint.checkForSameDefinition(agi.foundation.propagators.advanced.PropagationPointElement)
method.computeCurrentDefinitionHashCode
in class PropagationPointElement
public void enumerateDependencies(DependencyEnumerator enumerator)
DependencyEnumerator#enumerate(T)
for each object that this object directly depends upon.
Derived classes which contain additional dependencies MUST override this method, call the base
implementation, and enumerate dependencies introduced by the derived class.enumerateDependencies
in interface IEnumerateDependencies
enumerateDependencies
in class DefinitionalObject
enumerator
- The enumerator that is informed of the dependencies of this object.protected void freezeAggregatedObjects()
DefinitionalObject.freeze()
to also freeze any objects that are considered to be a part of this object.
Derived classes which contain additional aggregated objects MUST override this method, call the base
implementation, and freeze aggregated objects introduced by the derived class. The objects that need to be
frozen in this method are frequently created in this object's constructor and are not settable via
properties.freezeAggregatedObjects
in class DefinitionalObject
public int getDimension()
Vectors
would have a dimension of three, and Scalars
of one. A PartialDerivativesEvaluator
created by this type will have a RowDimension
(get
) equal to this
property, and a ColumnDimension
(get
) equal to the summation
of the dimensions of the independent variables that this object is dependent on.getDimension
in interface IPartialDifferentiable
getDimension
in class PropagationStateElement
public int getOrder()
getOrder
in class PropagationStateElement
public final void setInitialPosition(@Nonnull Cartesian value)
public final void setInitialVelocity(@Nonnull Cartesian value)
public Point getIntegrationPoint()
Point
which is parameterized on the position and velocity in the state during integration.
This point is only valid while the NumericalPropagator
is running.
For more general use, a PointInterpolator
should be created from the
NumericalPropagationStateHistory
produced by the propagator.getIntegrationPoint
in class PropagationPointElement
public PropagationStateParameter getStateParameter()
NumericalPropagator
objects are running in the same EvaluatorGroup
,
such as when elements of a state require additional instances of a NumericalPropagator
inside their implementation in order to produce their values. In such cases, it may
be necessary to distinguish between the state of the exterior propagator and the
state of the interior propagator. In these cases, it is up to the user to ensure
that both the state and all of its elements are configured with the same parameter.
Otherwise, the state will throw an exception when creating its propagator.getStateParameter
in class PropagationStateElement
public void setStateParameter(PropagationStateParameter value)
NumericalPropagator
objects are running in the same EvaluatorGroup
,
such as when elements of a state require additional instances of a NumericalPropagator
inside their implementation in order to produce their values. In such cases, it may
be necessary to distinguish between the state of the exterior propagator and the
state of the interior propagator. In these cases, it is up to the user to ensure
that both the state and all of its elements are configured with the same parameter.
Otherwise, the state will throw an exception when creating its propagator.setStateParameter
in class PropagationStateElement
public final List<ForceModel> getAppliedForces()
Gets a list of the forces applied at the IntegrationPoint
(get
).
The Kind
(get
) of force will determine whether a given force
will be divided by mass in order to compute the Newtonian acceleration
of the IntegrationPoint
(get
).
Inertial acceleration = AppliedForce / Mass + AppliedSpecificForce + AppliedReactionForce
public final Scalar getMass()
AppliedForces
(get
) based on this mass.public final void setMass(Scalar value)
AppliedForces
(get
) based on this mass.public ReferenceFrame getIntegrationFrame()
ReferenceFrame
in which the position, velocity, and forces are defined.
Note that the AppliedForces
(get
) should all be inertial forces, even if they are expressed with
different Axes
which may be rotating with respect to each other. For instance, drag may be expressed
using Earth fixed axes while gravity is given in Earth inertial axes but both are inertial forces.
No fictitious forces will be added or removed from them due to differences in reference frames.
By default, the integration frame is set to the InertialFrame
(get
/ set
) of the Earth.getIntegrationFrame
in class PropagationPointElement
public void setIntegrationFrame(ReferenceFrame value)
ReferenceFrame
in which the position, velocity, and forces are defined.
Note that the AppliedForces
(get
) should all be inertial forces, even if they are expressed with
different Axes
which may be rotating with respect to each other. For instance, drag may be expressed
using Earth fixed axes while gravity is given in Earth inertial axes but both are inertial forces.
No fictitious forces will be added or removed from them due to differences in reference frames.
By default, the integration frame is set to the InertialFrame
(get
/ set
) of the Earth.setIntegrationFrame
in class PropagationPointElement
public final Vector getAccelerationVector()
Gets a Vector
representing the acceleration according to Newton's second law of motion
in the given inertial IntegrationFrame
(get
/ set
).
When using partial derivatives (such as using a StateTransitionMatrix
to calculate covariance over time)
note that the PropagationNewtonianPoint
itself is the IPartialDifferentiable
which represents the partials
of the acceleration, not the Vector
returned by this method.
Vector
representing the Newtonian inertial acceleration.public PropagationStateElementConverter getConverter(EvaluatorGroup group, @Nonnull Motion1<int[]> stateInputIndices)
EvaluatorGroup
.getConverter
in class PropagationStateElement
group
- The evaluator group in which to configure the parameters.stateInputIndices
- The set of indices corresponding to the location
of each value or derivative of this state element in the overall state.public PropagationStateElementEvaluator getDerivatives(EvaluatorGroup group)
NumericalPropagatorDefinition
to obtain an instance of a state element evaluator
that can compute the derivatives of this element of the state during propagation.
It cannot be used outside of a NumericalPropagator
as the geometry for the propagation state
will be unavailable.getDerivatives
in class PropagationStateElement
group
- The group in which to create the evaluator and its dependents.public final PartialDerivativesEvaluator getPartialDerivativesEvaluator(List<IPartialDifferentiable> independentVariables, EvaluatorGroup group)
IntegrationPoint
(get
)
with respect to any of the independentVariables
parameters that apply.getPartialDerivativesEvaluator
in interface IPartialDifferentiable
independentVariables
- The list of IPartialDifferentiable
representing the independent
variables that the created partial derivative evaluator calculates partials with respect to.group
- The evaluator group to contain the evaluator.PartialDerivativesEvaluator
.