Sun Flux Simulator - aa236b-winter-2019/software-documentation GitHub Wiki
Sun Flux Simulator
This subroutine efficiently computes the flux on the satellite's solar panels, given the orbital position of the satellite and the position of the sun in ECI coordinates.
Packages Required
- numpy
Algorithm
The subroutine first determines whether or not the satellite is in eclipse. In order to maximize efficiency, all geometric calculations are reduced to dot products. Eclipse is considered to have occurred when vector rejection of the spacecraft-Earth separation onto the spacecraft-sun separation does not exceed the radius of the Earth.
The magnitude of the flux is determined by assuming that the total luminosity of the sun is radiated isotropically, which is true to an excellent approximation. Thus, when the satellite's orbit takes it closer to the sun, the flux increases slightly. Since the distance between the spacecraft and the Earth is extremely small compared to the distance between the sun and the Earth, such changes in flux are negligible compared to those due to small changes in attitude. It would be a sufficient approximation to assume that the flux is constant across the orbit, but since this subroutine is not a particular bottleneck in the overall simulation, the calculation was kept.
The total flux on the satellite's solar panels is computed by taking the dot product of the incoming light ray with the normal of each panel surface and scaling the result by the panel area. In the body frame of the satellite, where the surface normals are the unit vectors (and their opposites), this is simply equivalent to examining the components of the light vector. If the dot product is positive, it implies that the panel is facing away from the sun, and the according flux is ignored.
Results
https://github.com/aa236b-winter-2019/software-documentation/blob/master/Images/1.png
This plot shows the total flux on the satellite over a portion of an orbit while the satellite de-tumbles. It is possible to see the initial rapid variation of the flux due the tumbling of the cube, the effect of eclipse, and the slower variation after de-tumbling has reduced the angular velocity to an acceptable value.