test_facetedSRPEffector

test_facetedSRPEffector.test_facetedSRPEffector(show_plots, r_BN_N_init, r_SN_N_init, sigma_BN_init, omega_BN_B_init, illumination_factor)[source]

Verification Test Description

This unit test verifies that the faceted spacecraft solar radiation pressure (SRP) module correctly computes the aggregate force and torque acting on the spacecraft due to impinging photons from the Sun. The inertial Sun state information must be subscribed to the module SpicePlanetStateMsgPayload input message. The module assumes the spacecraft is modeled as a collection of facets, where the facet geometry information is passed as a vector of FacetElementBodyMsgPayload input messages to the module. The facet geometry information is required to be provided in the spacecraft body frame. This SRP module does not make any assumptions regarding whether the facets are rigid or articulate. The facetedSpacecraftModel module can be connected upstream and used to transform the facet geometry data from the facet frames to the spacecraft body frame. This upstream module can also be used to configure articulating facets. Finally, this SRP module also requires the sunlit area of all facets to be pre-computed and connected to the module vector of ProjectedAreaMsgPayload input messages. This information can be passed to the SRP module by connecting the facet geometry information to the facetedSpacecraftProjectedArea module upstream.

This test sets up a simulation with a faceted spacecraft modeled as a cubic hub with two attached circular solar arrays. Six square facets represent the cubic hub and four circular facets represent the two solar arrays. The test varies the initial state information of the spacecraft, the initial state information of the Sun, and the Sun illumination factor. The test checks that the computed SRP forces and torques at each timestep match the values output from the module.

Test Parameters

Parameters:
  • r_BN_N_init (np.ndarray) – [m] shape (3,) Initial spacecraft inertial position

  • r_SN_N_init (np.ndarray) – [m] shape (3,) Initial Sun inertial position

  • sigma_BN_init (np.ndarray) – [-] shape (3,) Initial spacecraft inertial attitude

  • omega_BN_B_init (np.ndarray) – [rad/s] shape (3,) Initial spacecraft inertial angular velocity

  • illumination_factor (float) – [-] Sun visibility factor (0 = full shadow, 1 = full sunlight)

Description of Variables Being Tested

The test checks that the module correctly computes the aggregate srp force and torque acting on the spacecraft body frame at each time step. The values logged from the module are checked to match the computed truth values.