test_ConstraintDynamicEffectorUnit

test_ConstraintDynamicEffectorUnit.test_constraintEffector(show_plots, function)[source]

Module Unit Test Validation Test Description

This unit test sets up two spacecraft connected by a holonomic constraint effector acting as a physical connection between them. The two spacecraft are set up with an identical mass and symmetrical inertias. One scenario includes gravity to check orbital conservation while the other scenario excludes gravity to check more sensitive constraint violations.

Description of Variables Being Tested

In this file we are checking the principles of conservation of energy and angular momentum. Both the orbital and rotational energy and angular momentum must be maintained. While Baumgarte stabilization is an approximate method, there is still an expected threshold below which these quantities are conserved:

  • combinedOrbAngMom

  • combinedOrbEnergy

  • combinedRotAngMom

  • combinedRotEnergy

We are also checking the constraint violation magnitudes throughout the simulation. Due to the nature of the Baumgarte stabilization method, there must first be a constraint violation before a force is applied to correct the constraint violation and keep the spacecraft aligned. For slow moving spacecraft systems such as this, the constraint violations are expected to remain below a threshold dependent on how dynamic a scenario is. The threshold for the scenario with gravity therefore expects a larger threshold than the scenario without gravity. Accuracy checks based on prior testings are included here to ensure that future changes don’t worsen performance, not to verify any theoretical thresholds. The direction and attitude constraint violations checked are:

  • psi_B1

  • sigma_B2B1