Simulation - spacecraft-design-lab-2019/documentation GitHub Wiki
Details on the simulation used for hardware in the loop
Numerical Integration
Numerical integration is accomplished via Runge-Kutta 4 (rk4). Background information on rk4 can be found here.
Sensors
- Antenna
- Battery charge
- Sun sensor
- Magnetometer
- Gyro
Orbit Perturbations
Based on our intended Low Earth Orbit, the most significant perturbations will be J2 and Drag.
Nongravitational Forces
Aerodynamic drag
Originally we were going to use the MSISE-00 atmospheric model for grabbing densities, but this takes too long to run for hardware in the loop testing (MSISE-00 lookups consume significant portion of runtime in early testing). Instead, we've grabbing a sample atmospheric density values over a range of altitudes and curve fitted a two-term exponential model: rho = 4.436e-09 * exp(-0.01895 * Alt) + 4.895e-12 * exp(-0.008471 * Alt)
This allows for quick evaluation of density value for drag calculation, lowering the program runtime
Other Notes:
- NumPy cross products take a long time to compute, so to reduce program runtime we have written our own for drag calculation.
- MSISE-00 seems to have a bug where calls for 2019 do not work. This probably won't be an issue, since our mission is not during this period and a lot of testing can happen in 2020, and we have elected to go with an equation driven model instead
Face information (vector direction, surface area, center of pressure) is stored in a face class in the constants.py file. The moment arm is taken to be the distance from the center of mass to the center of pressure of a face. This moment arm is crossed with the vectorized drag force to compute the moment due to drag.
Magnetic field drag
Magnetic field information is obtained through calls to pyIGRF. pyIGRF is a package of IGRF-12 (International geomagnetic Reference Field) for Python. Details can be found here.
Solar wind drag and micrometeoroids
This will not be a part of the simulation as effects are small
Solar radiation pressure
This will not be a part of the simulation as effects are small
Third-Body Interactions
- Moon (Will not consider)
- Sun
- Other planets (Will not consider)
Nonspherical Mass Distributions
- Earth's oblateness (we will incorporate J2 perturbations