org.orekit.utils
Class PVCoordinates

java.lang.Object
  extended by org.orekit.utils.PVCoordinates
All Implemented Interfaces:
Serializable, TimeShiftable<PVCoordinates>
Direct Known Subclasses:
PVCoordinatesDPFacade, TimeStampedPVCoordinates

public class PVCoordinates
extends Object
implements TimeShiftable<PVCoordinates>, Serializable

Simple container for Position/Velocity/Acceleration triplets.

The state can be slightly shifted to close dates. This shift is based on a simple quadratic model. It is not intended as a replacement for proper orbit propagation (it is not even Keplerian!) but should be sufficient for either small time shifts or coarse accuracy.

This class is the angular counterpart to AngularCoordinates.

Instances of this class are guaranteed to be immutable.

Author:
Fabien Maussion, Luc Maisonobe
See Also:
Serialized Form

Field Summary
static PVCoordinates ZERO
          Fixed position/velocity/acceleration at origin (both p, v and a are zero vectors).
 
Constructor Summary
PVCoordinates()
          Simple constructor.
PVCoordinates(double a, PVCoordinates pv)
          Multiplicative constructor.
PVCoordinates(double a1, PVCoordinates pv1, double a2, PVCoordinates pv2)
          Linear constructor.
PVCoordinates(double a1, PVCoordinates pv1, double a2, PVCoordinates pv2, double a3, PVCoordinates pv3)
          Linear constructor.
PVCoordinates(double a1, PVCoordinates pv1, double a2, PVCoordinates pv2, double a3, PVCoordinates pv3, double a4, PVCoordinates pv4)
          Linear constructor.
PVCoordinates(FieldVector3D<DerivativeStructure> p)
          Builds a PVCoordinates triplet from a FieldVector3D<DerivativeStructure>.
PVCoordinates(PVCoordinates start, PVCoordinates end)
          Subtractive constructor.
PVCoordinates(Vector3D position, Vector3D velocity)
          Builds a PVCoordinates triplet with zero acceleration.
PVCoordinates(Vector3D position, Vector3D velocity, Vector3D acceleration)
          Builds a PVCoordinates triplet.
 
Method Summary
static PVCoordinates crossProduct(PVCoordinates pv1, PVCoordinates pv2)
          Compute the cross-product of two instances.
static Vector3D estimateVelocity(Vector3D start, Vector3D end, double dt)
          Estimate velocity between two positions.
 Vector3D getAcceleration()
          Gets the acceleration.
 Vector3D getAngularVelocity()
          Get the angular velocity (spin) of this point as seen from the origin.
 Vector3D getMomentum()
          Gets the momentum.
 Vector3D getPosition()
          Gets the position.
 Vector3D getVelocity()
          Gets the velocity.
static PVCoordinates interpolate(AbsoluteDate date, boolean useVelocities, Collection<Pair<AbsoluteDate,PVCoordinates>> sample)
          Deprecated. since 3.1 replaced with TimeStampedPVCoordinates.interpolate(AbsoluteDate, CartesianDerivativesFilter, Collection)
 PVCoordinates negate()
          Get the opposite of the instance.
 PVCoordinates normalize()
          Normalize the position part of the instance.
 PVCoordinates shiftedBy(double dt)
          Get a time-shifted state.
 FieldVector3D<DerivativeStructure> toDerivativeStructureVector(int order)
          Transform the instance to a FieldVector3D<DerivativeStructure>.
 String toString()
          Return a string representation of this position/velocity/acceleration triplet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ZERO

public static final PVCoordinates ZERO
Fixed position/velocity/acceleration at origin (both p, v and a are zero vectors).

Constructor Detail

PVCoordinates

public PVCoordinates()
Simple constructor.

Sets the Coordinates to default : (0 0 0) (0 0 0) (0 0 0).


PVCoordinates

public PVCoordinates(Vector3D position,
                     Vector3D velocity)
Builds a PVCoordinates triplet with zero acceleration.

Parameters:
position - the position vector (m)
velocity - the velocity vector (m/s)

PVCoordinates

public PVCoordinates(Vector3D position,
                     Vector3D velocity,
                     Vector3D acceleration)
Builds a PVCoordinates triplet.

Parameters:
position - the position vector (m)
velocity - the velocity vector (m/s)
acceleration - the acceleration vector (m/s²)

PVCoordinates

public PVCoordinates(double a,
                     PVCoordinates pv)
Multiplicative constructor.

Build a PVCoordinates from another one and a scale factor.

The PVCoordinates built will be a * pv

Parameters:
a - scale factor
pv - base (unscaled) PVCoordinates

PVCoordinates

public PVCoordinates(PVCoordinates start,
                     PVCoordinates end)
Subtractive constructor.

Build a relative PVCoordinates from a start and an end position.

The PVCoordinates built will be end - start.

Parameters:
start - Starting PVCoordinates
end - ending PVCoordinates

PVCoordinates

public PVCoordinates(double a1,
                     PVCoordinates pv1,
                     double a2,
                     PVCoordinates pv2)
Linear constructor.

Build a PVCoordinates from two other ones and corresponding scale factors.

The PVCoordinates built will be a1 * u1 + a2 * u2

Parameters:
a1 - first scale factor
pv1 - first base (unscaled) PVCoordinates
a2 - second scale factor
pv2 - second base (unscaled) PVCoordinates

PVCoordinates

public PVCoordinates(double a1,
                     PVCoordinates pv1,
                     double a2,
                     PVCoordinates pv2,
                     double a3,
                     PVCoordinates pv3)
Linear constructor.

Build a PVCoordinates from three other ones and corresponding scale factors.

The PVCoordinates built will be a1 * u1 + a2 * u2 + a3 * u3

Parameters:
a1 - first scale factor
pv1 - first base (unscaled) PVCoordinates
a2 - second scale factor
pv2 - second base (unscaled) PVCoordinates
a3 - third scale factor
pv3 - third base (unscaled) PVCoordinates

PVCoordinates

public PVCoordinates(double a1,
                     PVCoordinates pv1,
                     double a2,
                     PVCoordinates pv2,
                     double a3,
                     PVCoordinates pv3,
                     double a4,
                     PVCoordinates pv4)
Linear constructor.

Build a PVCoordinates from four other ones and corresponding scale factors.

The PVCoordinates built will be a1 * u1 + a2 * u2 + a3 * u3 + a4 * u4

Parameters:
a1 - first scale factor
pv1 - first base (unscaled) PVCoordinates
a2 - second scale factor
pv2 - second base (unscaled) PVCoordinates
a3 - third scale factor
pv3 - third base (unscaled) PVCoordinates
a4 - fourth scale factor
pv4 - fourth base (unscaled) PVCoordinates

PVCoordinates

public PVCoordinates(FieldVector3D<DerivativeStructure> p)
Builds a PVCoordinates triplet from a FieldVector3D<DerivativeStructure>.

The vector components must have time as their only derivation parameter and have consistent derivation orders.

Parameters:
p - vector with time-derivatives embedded within the coordinates
Method Detail

toDerivativeStructureVector

public FieldVector3D<DerivativeStructure> toDerivativeStructureVector(int order)
                                                               throws OrekitException
Transform the instance to a FieldVector3D<DerivativeStructure>.

The DerivativeStructure coordinates correspond to time-derivatives up to the user-specified order.

Parameters:
order - derivation order for the vector components
Returns:
vector with time-derivatives embedded within the coordinates
Throws:
OrekitException - if the user specified order is too large

estimateVelocity

public static Vector3D estimateVelocity(Vector3D start,
                                        Vector3D end,
                                        double dt)
Estimate velocity between two positions.

Estimation is based on a simple fixed velocity translation during the time interval between the two positions.

Parameters:
start - start position
end - end position
dt - time elapsed between the dates of the two positions
Returns:
velocity allowing to go from start to end positions

shiftedBy

public PVCoordinates shiftedBy(double dt)
Get a time-shifted state.

The state can be slightly shifted to close dates. This shift is based on a simple Taylor expansion. It is not intended as a replacement for proper orbit propagation (it is not even Keplerian!) but should be sufficient for either small time shifts or coarse accuracy.

Specified by:
shiftedBy in interface TimeShiftable<PVCoordinates>
Parameters:
dt - time shift in seconds
Returns:
a new state, shifted with respect to the instance (which is immutable)
See Also:
AbsoluteDate.shiftedBy(double), Attitude.shiftedBy(double), Orbit.shiftedBy(double), SpacecraftState.shiftedBy(double)

interpolate

public static PVCoordinates interpolate(AbsoluteDate date,
                                        boolean useVelocities,
                                        Collection<Pair<AbsoluteDate,PVCoordinates>> sample)
Deprecated. since 3.1 replaced with TimeStampedPVCoordinates.interpolate(AbsoluteDate, CartesianDerivativesFilter, Collection)

Interpolate position-velocity.

The interpolated instance is created by polynomial Hermite interpolation ensuring velocity remains the exact derivative of position.

Note that even if first time derivatives (velocities) from sample can be ignored, the interpolated instance always includes interpolated derivatives. This feature can be used explicitly to compute these derivatives when it would be too complex to compute them from an analytical formula: just compute a few sample points from the explicit formula and set the derivatives to zero in these sample points, then use interpolation to add derivatives consistent with the positions.

Parameters:
date - interpolation date
useVelocities - if true, use sample points velocities, otherwise ignore them and use only positions
sample - sample points on which interpolation should be done
Returns:
a new position-velocity, interpolated at specified date

getPosition

public Vector3D getPosition()
Gets the position.

Returns:
the position vector (m).

getVelocity

public Vector3D getVelocity()
Gets the velocity.

Returns:
the velocity vector (m/s).

getAcceleration

public Vector3D getAcceleration()
Gets the acceleration.

Returns:
the acceleration vector (m/s²).

getMomentum

public Vector3D getMomentum()
Gets the momentum.

This vector is the p ⊗ v where p is position, v is velocity and ⊗ is cross product. To get the real physical angular momentum you need to multiply this vector by the mass.

The returned vector is recomputed each time this method is called, it is not cached.

Returns:
a new instance of the momentum vector (m2/s).

getAngularVelocity

public Vector3D getAngularVelocity()
Get the angular velocity (spin) of this point as seen from the origin.

The angular velocity vector is parallel to the angular momentum and is computed by ω = p × v / ||p||²

Returns:
the angular velocity vector
See Also:
Angular Velocity on Wikipedia

negate

public PVCoordinates negate()
Get the opposite of the instance.

Returns:
a new position-velocity which is opposite to the instance

crossProduct

public static PVCoordinates crossProduct(PVCoordinates pv1,
                                         PVCoordinates pv2)
Compute the cross-product of two instances.

Parameters:
pv1 - first instances
pv2 - second instances
Returns:
the cross product v1 ^ v2 as a new instance

normalize

public PVCoordinates normalize()
Normalize the position part of the instance.

The computed coordinates first component (position) will be a normalized vector, the second component (velocity) will be the derivative of the first component (hence it will generally not be normalized), and the third component (acceleration) will be the derivative of the second component (hence it will generally not be normalized).

Returns:
a new instance, with first component normalized and remaining component computed to have consistent derivatives

toString

public String toString()
Return a string representation of this position/velocity/acceleration triplet.

Overrides:
toString in class Object
Returns:
string representation of this position/velocity/acceleration triplet


Copyright © 2017 CNES. All Rights Reserved.