test_prescribedLinearTranslation

test_prescribedLinearTranslation.test_prescribedLinearTranslation(show_plots, coastOptionBangDuration, smoothingDuration, transPosInit, transPosRef1, transPosRef2, transAccelMax, accuracy)[source]

Validation Test Description

The unit test for this module ensures that the profiled linear translation for a secondary rigid body relative to the spacecraft hub is properly computed for several different simulation configurations. This unit test profiles two successive translations to ensure the module is correctly configured. The secondary body’s initial scalar translational position relative to the spacecraft hub is varied, along with the two final reference positions and the maximum translational acceleration.

This unit test also tests four different methods of profiling the translation. Two profilers prescribe a pure bang-bang or bang-coast-bang linear acceleration profile for the translation. The bang-bang option results in the fastest possible translation; while the bang-coast-bang option includes a coast period with zero acceleration between the acceleration segments. The other two profilers apply smoothing to the bang-bang and bang-coast-bang acceleration profiles so that the secondary body hub-relative rates start and end at zero.

Test Parameters

Parameters
  • show_plots (bool) – Variable for choosing whether plots should be displayed

  • coastOptionBangDuration – (float): [s] Time the acceleration is applied during the bang segments

  • option) ((Variable must be nonzero to select the bang-coast-bang) –

  • smoothingDuration (float) –

  • transPosInit (float) – [m] Initial translational body position from M to F frame origin along transAxis_M

  • transPosRef1 (float) – [m] First reference position from M to F frame origin along transAxis_M

  • transPosRef2 (float) – [m] Second reference position from M to F frame origin along transAxis_M

  • transAccelMax (float) – [m/s^2] Maximum translational acceleration

  • accuracy (float) – Absolute accuracy value used in the validation tests

Description of Variables Being Tested

To verify the module functionality, the final position at the end of each translation segment is checked to match the specified reference position (transPosRef1 and transPosRef2). Additionally, for the smoothed profiler options, the numerical derivative of the profiled displacements and velocities is determined across the entire simulation in this test script. These numerical derivatives are checked with the module’s acceleration and velocity profiles to ensure the profiled acceleration is correctly integrated in the module to obtain the displacements and velocities.