compute_sun_nrelspa#
-
namespace saltro
-
namespace orbits
Functions
-
bool compute_sun_nrelspa(Eigen::Matrix<double, 3, saltro::limits::MAX_LENGTH_TRAJ> &R, const Eigen::Matrix<double, 1, saltro::limits::MAX_LENGTH_TRAJ> &jtime, const int jtime_length, Eigen::Matrix<double, 3, saltro::limits::MAX_LENGTH_TRAJ> &S)#
Compute Sun position vectors using the NREL Solar Position Algorithm (SPA).
Evaluates the Sun direction and distance relative to the spacecraft for each trajectory sample using the NREL Solar Position Algorithm (SPA). This model computes the apparent solar position with higher fidelity than simple analytical approximations, accounting for Earth rotation, orbital geometry, and solar ephemerides.
For each trajectory sample \(k\), the spacecraft-to-Sun vector is computed as:
\[ \mathbf{S}_k = \mathbf{r}_{\odot}(t_k) - \mathbf{R}_k \]where:
\(\mathbf{r}_{\odot}(t_k)\) is the Sun position in an Earth-centered inertial frame at time \(t_k\),
\(\mathbf{R}_k\) is the spacecraft position vector (meters),
\(\mathbf{S}_k\) is the resulting spacecraft-to-Sun vector (meters).
The NREL SPA computes the Sun’s apparent right ascension and declination from Julian centuries \(T\), including corrections for nutation, aberration, and Earth orbital motion. The resulting vectors include the Sun–Earth distance (on the order of 1 AU).
The output Sun vector matrix is written column-wise:
\[ \mathbf{S} = \begin{bmatrix} \mathbf{S}_0 & \mathbf{S}_1 & \cdots & \mathbf{S}_{N-1} \end{bmatrix} \]- Parameters:
R – Spacecraft position vectors (meters). Each column corresponds to one trajectory sample.
jtime – Julian centuries associated with each trajectory sample.
jtime_length – Number of valid trajectory samples.
S – Output spacecraft-to-Sun vectors (meters), column-wise.
- Returns:
True if the computation succeeds for all samples, false otherwise.
-
bool compute_sun_nrelspa(Eigen::Matrix<double, 3, saltro::limits::MAX_LENGTH_TRAJ> &R, const Eigen::Matrix<double, 1, saltro::limits::MAX_LENGTH_TRAJ> &jtime, const int jtime_length, Eigen::Matrix<double, 3, saltro::limits::MAX_LENGTH_TRAJ> &S)#
-
namespace orbits