test_ThrusterStateEffectorUnit
- test_ThrusterStateEffectorUnit.test_unitThrusters(testFixture, show_plots, thrustNumber, initialConditions, duration, long_angle, lat_angle, location, swirlTorque, rate, attachBody)[source]
Validation Test Description
This unit test script tests the stateEffector implementation of thrusters. It sets up the thruster module and runs a combination of 6 different scenarios. Each scenario uses either one or two thrusters, while also changing the thruster’s locations and whether thruster 1 is firing or not.
For information on how the thruster module works and what the closed-form solution for the
thrustFactor
variable is, see Module: thrusterStateEffector. Given thethrustFactor
\(\kappa\), the thrust is computed as follows:\[\textbf{F} = \kappa \cdot F_{\mathrm{max}} \cdot \hat{n}\]where \(\hat{n}\) is the thruster’s direction vector. The torque is computed by:
\[\textbf{T} = \textbf{r}\times\textbf{F} + \kappa \cdot T_{\mathrm{maxSwirl}} \cdot \hat{n}\]where \(\textbf{r}\) corresponds to the thruster’s position relative to the spacecraft’s center of mass and the second term represents the swirl torque. The mass flow rate is given by:
\[\dot{m} = \dfrac{F}{g\cdot I_{sp}}\]where \(g\) is Earth’s gravitational acceleration and \(I_{sp}\) is the thruster’s specific impulse.
Test Parameters
- Parameters:
thrustNumber (int) – number of thrusters used in the simulation
initialConditions (float) – initial value of the
thrustFactor
variable for thruster 1. Thruster always startsoff.
duration (float) – duration of the thrust in seconds.
long_angle (float) – longitude angle in degrees for thruster 1. Thruster 2 is also impacted by this value.
lat_angle (float) – latitude angle in degrees for thruster 1. Thruster 2 is also impacted by this value.
location (float) – location of thruster 1.
swirlTorque (float) – maximum value of the swirl torque on the thruster.
rate (int) – simulation rate in nanoseconds.
attachBody (flag) – whether the thruster is attached to the hub or to a different body.
Description of Variables Being Tested
In this file we are checking the values of the variables
thrForce
thrTorque
mDot
All these variables are compared to the true values from the closed-form expressions given in Module: thrusterStateEffector.