test_unitFacetSRPDynamicEffector

test_unitFacetSRPDynamicEffector.test_facetSRPDynamicEffector(show_plots, facetRotAngle1, facetRotAngle2, eclipseIlluminationFactor)[source]

Verification Test Description

The unit test for this module ensures that the calculated Solar Radiation Pressure (SRP) force and torque acting on the spacecraft about the body-fixed point B is properly computed for either a static spacecraft or a spacecraft with any number of articulating facets. The spacecraft geometry defined in this test consists of a cubic hub and two circular solar arrays. Six static square facets represent the cubic hub and four articulated circular facets describe the two articulating solar arrays. To verify the module functionality, the final SRP force and torque simulation values are checked with the truth values computed in python.

Test Parameters

Parameters:
  • show_plots (bool) – (True) Show plots, (False) Do not show plots

  • facetRotAngle1 (double) – [rad] Articulation angle for facets 7 and 8 (solar panel 1)

  • facetRotAngle2 (double) – [rad] Articulation angle for facets 9 and 10 (solar panel 2)

  • eclipseIlluminationFactor (double) – Eclipse illumination factor (0.0 = full shadow, 1.0 = full sunlight)

test_unitFacetSRPDynamicEffector.test_facetSRPFacetCountValidation(numFacets, numArticulatedFacets, numArticulationMsgs, shouldRaise, scheduleEffector, attachToParent)[source]

Verify that initialization rejects a facet count that does not match the facets added.

The force loop walks the geometry lists by the declared facet count rather than by their own size, so a count larger than the facets added indexes past the end of every list and a count smaller silently drops the trailing facets. Neither raised, and the resulting load was wrong without any indication. This is asserted as an error at initialization rather than as a tolerance on a load, because the over-declared case is undefined behavior whose observed effect is not stable. Two facets are always added, so the declared count is what varies.

Test Parameters:

  • numFacets: [int]

    facet count passed to setNumFacets

  • numArticulatedFacets: [int]

    articulated facet count passed to setNumArticulatedFacets

  • numArticulationMsgs: [int]

    number of articulation messages added by addArticulatedFacet

  • shouldRaise: [bool]

    whether initialization must reject the configuration

  • scheduleEffector: [bool]

    whether the effector is added to the task in addition to the spacecraft

  • attachToParent: [bool]

    whether the effector attaches to a spinning body parent instead of the hub

The scheduling and attachment parameters matter because the checks must not depend on either. Spacecraft initialization calls linkInStates() on a dynamic effector attached to the hub, a branching parent calls linkInProperties() on a child attached to it, and neither calls Reset(), which runs only for a module added to a task.

test_unitFacetSRPDynamicEffector.test_facetSRPPartialArticulationRead()[source]

Verify that a partial articulation message read leaves every facet unarticulated.

The angle list is indexed by facet, so reading only some of the articulation messages once shortened the list and shifted every remaining angle onto the wrong facet before running off its end. Two articulated facets are declared and only the second message is written, carrying a right angle that would swing whichever facet received it out of the sunlight. The resulting load is compared against an otherwise identical effector that declares no articulation at all, which the two must match because neither facet may articulate on an incomplete read.