guorbit / matlab-system-model

Mathematical model of the ASTRAEUS-01 spacecraft and its relevant subsystems.
2 stars 1 forks source link

Write library for effective area calculation #2

Open chgio opened 5 months ago

chgio commented 5 months ago

As specified in the ICD of #1, calculations of the effective area exposed by the spacecraft toward the Sun based on its position and attitude are repeated in both EPS and Thermal blocks.

To keep our model DRY (Don't Repeat Yourself), it would be nice to abstract away as much as possible while still keeping it adaptable to both EPS ($A{eff}$ of solar panels) and Thermal ($A{eff}$ of spacecraft) purposes.

Beredos2 commented 5 months ago

Here's a verbalized algorithm for calculating the effective area of one CubeSat face relative to any celestial body.

  1. Find the satellite's position relative to the Earth-centered-inertial (ECI) frame: this is either provided by ADCS, or must be derived from orbital elements.
  2. Find the position of the celestial body relative to the ECI frame.
  3. Subtract the celestial body position from the spacecraft position, which gives the spacecraft-body vector.
  4. Normalize the spacecraft-body vector (such that its magnitude is 1)
  5. Find the area vector relative to the spacecraft-fixed frame of reference (the area vector is normal to the surface of interest and outward pointing)
  6. Calculate the angle between the area vector and the spacecraft-body vector. If angle is greater than pi (180 degrees), the effective area is zero (that face of the spacecraft is in shadow). If the angle is less than 180, the effective area is equal to the true area times the point product of the two vectors.