Working with Relative States

Top  Previous  Next

There are different options for working with Relative States that include setting and reporting the relative motion state. The relative states can be classified using local Cartesian or Curvilinear states or by defining a relative position and velocity. This ability is accessible by using the Get/Set Relative Cartesian or Relative Curvilinear methods or by using the RelativeMotionUtilities object.

 

Reference Frames


Relative states can be specified in any of the following attitude reference frames.

 

ICRF

VNB

LVLH

Geodetic

UVW

RIC

LVC (Cylindrical)

RIC Cylindrical

RIC Spherical

BCS

 

Note: BCS and Geodetic systems are only supported for getting or setting a Spacecraft's Relative Cartesian or Curvilinear position and the RelativeMotionUtilities.ConvertRelativePosition() method.

 

 

Relative States


Relative States are used to identify the position and velocity of a secondary Spacecraft relative to a primary Spacecraft.

 

Cartesian Relative State

FreeFlyer allows the ability to get or set the Relative Cartesian state, position, and velocity in one of the available reference frames. The Cartesian Relative State can be defined or reported with respect to a Spacecraft using the SetRelativeCartesianState() and the GetRelativeCartesianState() methods. If a reference frame is not specified, the ICRF frame is used by default.

 

The methods can be used as shown in the example below.

 

Spacecraft primarySC;

Spacecraft secondarySC;

 

// Set the relative state in Cartesian coordinates

Array cartesianRelativeState = {0, 0, 10, 10, 0, 0}; // Position (km) and Velocity (km/s) State

 

// Set the Relative Cartesian State

secondarySC.SetRelativeCartesianState(primarySC, cartesianRelativeState);

// This overload allows a user to define the Set Reference Frame

secondarySC.SetRelativeCartesianState(primarySC, cartesianRelativeState, 6 /* RIC Frame */);

 

// Set the Relative Cartesian Position

secondarySC.SetRelativeCartesianPosition(primarySC, cartesianRelativeState[0:2]);

// This overload allows a user to define the Set Reference Frame

secondarySC.SetRelativeCartesianPosition(primarySC, cartesianRelativeState[0:2], 6 /* RIC Frame */);

 

// Set the Relative Cartesian Velocity

secondarySC.SetRelativeCartesianVelocity(primarySC, cartesianRelativeState[3:5]);

// This overload allows a user to define the Set Reference Frame

secondarySC.SetRelativeCartesianVelocity(primarySC, cartesianRelativeState[3:5], 6 /* RIC Frame */);

 

 

// Get the Relative Cartesian State 

Report secondarySC.GetRelativeCartesianState(primarySC);

// This overload allows a user to define the Get Reference Frame

Report secondarySC.GetRelativeCartesianState(primarySC, 6 /* RIC Frame */);

 

// Get the Relative Cartesian Position

Report secondarySC.GetRelativeCartesianPosition(primarySC);

// This overload allows a user to define the Get Reference Frame

Report secondarySC.GetRelativeCartesianPosition(primarySC, 6 /* RIC Frame */);

 

// Get the Relative Cartesian Velocity

Report secondarySC.GetRelativeCartesianVelocity(primarySC);

// This overload allows a user to define the Get Reference Frame

Report secondarySC.GetRelativeCartesianVelocity(primarySC, 6 /* RIC Frame */);

 

Curvilinear Relative State

FreeFlyer allows the ability to Get or Set the Relative curvilinear state, position, and velocity in one of the available reference frames. The Curvilinear Relative State can be defined or reported with respect to a Spacecraft using the Spacecraft.SetRelativeCurvilinearState() and the Spacecraft.GetRelativeCurvilinearState() methods. If a curvilinear frame isn't specified, the LVC curvilinear frame is used.

 

The methods can be used as shown in the example below.

 

// Set the relative state in Curvilinear coordinates

Array curvilinearRelativeState = {0, 0, 10, 10, 0, 0}; // Position (km) and Velocity (km/s) State

 

// Set the Relative Curvilinear State

secondarySC.SetRelativeCurvilinearState(primarySC, curvilinearRelativeState);

// This overload allows a user to define the Set Curvilinear Reference Frame

secondarySC.SetRelativeCurvilinearState(primarySC, curvilinearRelativeState, 9 /* RIC Spherical Frame */);

 

// Set the Relative Curvilinear Position

secondarySC.SetRelativeCurvilinearPosition(primarySC, curvilinearRelativeState[0:2]);

// This overload allows a user to define the Set Curvilinear Reference Frame

secondarySC.SetRelativeCurvilinearPosition(primarySC, curvilinearRelativeState[0:2], 9 /* RIC Spherical Frame */);

 

// Set the Relative Curvilinear Velocity

secondarySC.SetRelativeCurvilinearVelocity(primarySC, curvilinearRelativeState[3:5]);

// This overload allows a user to define the Set Curvilinear Reference Frame

secondarySC.SetRelativeCurvilinearVelocity(primarySC, curvilinearRelativeState[3:5], 9 /* RIC Spherical Frame */);

 

 

// Get the Relative Curvilinear State

Report secondarySC.GetRelativeCurvilinearState(primarySC);

// This overload allows a user to define the Get Curvilinear Reference Frame

Report secondarySC.GetRelativeCurvilinearState(primarySC, 9 /* RIC Spherical Frame */);

 

// Get the Relative Curvilinear Position

Report secondarySC.GetRelativeCurvilinearPosition(primarySC);

// This overload allows a user to define the Get Curvilinear Reference Frame

Report secondarySC.GetRelativeCurvilinearPosition(primarySC, 9 /* RIC Spherical Frame */);

 

// Get the Relative Curvilinear Velocity

Report secondarySC.GetRelativeCurvilinearVelocity(primarySC);

// This overload allows a user to define the Get Curvilinear Reference Frame

Report secondarySC.GetRelativeCurvilinearVelocity(primarySC, 9 /* RIC Spherical Frame */);

 

 

Using the RelativeMotionUtilities Object


The built-in RelativeMotionUtilities object provides several static utility methods for relative motion analysis. It provides the capability to:

 

1.Compute the predicted future state for a Spacecraft using the HCW equations of motion.

2.Compute the required delta-v vector for a Spacecraft to achieve a future relative position using the HCW equations of motion.

3.Convert a relative state between different relative motion reference frames.

 

Compute the Future HCW State

The RelativeMotionUtilities.ComputeStateHCW() method can be used to predict the future state, position and velocity, of a Spacecraft using the HCW integrator. The predicted state is computed by propagating the HCW equations of motion using a specified coordinate set with a relative-state vector. By default the Cartesian coordinate set is used, but a user can select a different coordinate set using the CoordinateSetToPropagate argument.

 

The method can be used as shown in the example below.

 

Spacecraft primarySC;

Spacecraft secondarySC;

 

Array futureState[6];

 

// Set the relative state

Array relativeState = {0, 0, 10, 10, 0, 0}; // Position (km) and Velocity (km/s) State

 

// Set the TimeSpan Interval

TimeSpan deltaT = TIMESPAN(1 hours);

 

// Set the Mean motion

Variable meanMotion = 10; // rad/s

 

// Compute the future state from a reference Spacecraft for a specified time interval

futureState = RelativeMotionUtilities.ComputeStateHCW(secondarySC, primarySC, deltaT, 0 /* Cartesian */);

futureState = RelativeMotionUtilities.ComputeStateHCW(secondarySC, primarySC, deltaT, 0 /* Cartesian */, 2 /* RIC Spherical */); // Propagates the state in the RIC Spherical coordinate system

 

// Compute the future state from a state relative to a primary Spacecraft for a specified time interval

// Note: These overloads assume Earth is the central body

futureState = RelativeMotionUtilities.ComputeStateHCW(relativeState, meanMotion, deltaT, 6 /* RIC */);

futureState = RelativeMotionUtilities.ComputeStateHCW(relativeState, meanMotion, deltaT, 6 /* RIC */, 2 /* RIC Spherical */); // Propagates the state in the RIC Spherical coordinate system

 

Compute the Required Delta-V for a Future HCW State

The RelativeMotionUtilities.ComputeDeltaVHCW() method can be used to predict the required delta-v to achieve a desired future relative position and the resulting velocity at the future position. The predicted delta-v and future relative velocity are computed by propagating the HCW equations of motion1.

 

The method can be used as shown in the example below.

 

// Set the future relative position

Array futurePosition = {0, 0, 10}; // km

 

// Computes the required Delta-V for a future relative position in the primary Spacecraft’s ICRF frame

Array predictedDV = RelativeMotionUtilities.ComputeDeltaVHCW(secondarySC, primarySC, futurePosition, deltaT, 0 /* Cartesian */);

 

// Array for outputted computed future velocity future state

Array futureVelocity[3];

 

// Computes the required Delta-V and relative velocity for a future relative position in the primary Spacecraft’s ICRF frame

predictedDV = RelativeMotionUtilities.ComputeDeltaVHCW(secondarySC, primarySC, futurePosition, deltaT, 0 /* Cartesian */, futureVelocity);

 

Convert Relative States

The RelativeMotionUtilities object provides the ability to convert relative states between reference frames. The RelativeMotionUtilities.ConvertRelativeState() method can be used to convert a relative state vector, representing the state of one Spacecraft with respect to another, to a different reference frame. The RelativeMotionUtilities.ConvertRelativePosition() and RelativeMotionUtilities.ConvertRelativeVelocity() methods provide additional options for converting the position or velocity of a relative state.

 

// Convert the relative state

Array relativeVNBState = RelativeMotionUtilities.ConvertRelativeState(0 /* ICRF */, 1 /* VNB */, primarySC, relativeICRFState);

 

// Convert the relative position

// Note: BCS and Geodetic systems are only supported

//       for the ConvertRelativePosition() method

Array relativeVNBPosition = RelativeMotionUtilities.ConvertRelativePosition(0 /* ICRF */, 1 /* VNB */, primarySC, relativeICRFState[0:2]);

 

// Convert the relative velocity

Array relativeVNBVelocity = RelativeMotionUtilities.ConvertRelativeVelocity(0 /* ICRF */, 1 /* VNB */, primarySC, relativeICRFState);

 

 

References:


1. H. Curtis, Orbital Mechanics for Engineering Students. Elsevier, p. 330-331, 2005.

 

 

See Also


Attitude Reference Frames

RelativeMotionUtilities Properties and Methods