test_nHingedRigidBodyStateEffector

test_nHingedRigidBodyStateEffector.test_nHingedRigidBodyAllTest(show_plots, testCase)[source]

In this integrated test there are two hinged rigid bodies connected to the spacecraft hub, one with 4 interconnected panels and one with 3 interconnected panels. Depending on the scenario, there are different success criteria. Each scenario checks the conservation of orbital angular momentum, the conservation of orbital energy, the conservation of rotational angular momentum and the conservation of rotational energy.

Test Parameters:

  • testCase: [string]

    defines whether or not the gravity is included in this test.

Description of Variables Being Tested

This test checks the conservation of the spacecraft orbital angular momentum, the rotational angular momentum, the orbital energy and the rotational energy.

Test Descriptions:

testCase == ‘Gravity’ In this test the simulation is placed into orbit around Earth with point gravity and has no damping in the hinged rigid bodies.

testCase == ‘NoGravity’ In this test, the spacecraft is placed in free space (no gravity) and has no damping in the hinged rigid bodies.

The following figures show the conservation of the quantities described in the success criteria for each scenario. The conservation plots are all relative difference plots. All conservation plots show integration error which is the desired result. In the python test these values are automatically checked therefore when the tests pass, these values have all been confirmed to be conserved.

test_nHingedRigidBodyStateEffector.test_nHingedRigidBodyDynamicEffectorSegmentBounds(segment, shouldRaise)[source]

Verify that dynamic effectors can attach only to existing panels.

A three-panel chain accepts its first and last panel numbers and rejects the adjacent values outside the valid one-based range.

Test Parameters:

  • segment: [int]

    one-based panel number supplied to addDynamicEffector

  • shouldRaise: [bool]

    whether the panel number is outside the valid range

test_nHingedRigidBodyStateEffector.test_nHingedRigidBodyOutputMessagesMatchDual()[source]

Verify both output-message vectors against the equivalent dual-hinged model.

A two-panel N-hinged effector and a dual-hinged effector are given identical geometry, mass properties, and initial states on the same spacecraft. The hub starts with a non-identity attitude and nonzero translational and angular velocity so that every inertial transformation contributes. The test runs for two steps and compares each panel’s angle, angle rate, inertial position, inertial velocity, attitude, and angular velocity.

test_nHingedRigidBodyStateEffector.test_nHingedRigidBodyPanelValidation(chain, expectedError)[source]

The equations of motion are derived for a chain of identical panels, factoring one panel mass and one hinge to center of mass distance out of the sums that run over the chain. An uneven chain integrates without complaint and a massless one reaches the hub states as NaN, so initialization must reject both. The inertia is not factored out, so dissimilar inertia tensors must initialize.

Test Parameters:

  • chain: [string]

    panel-chain configuration to initialize

  • expectedError: [string]

    text the rejection message must carry, or None when the chain must initialize