compute_orbit#

namespace saltro
namespace orbits

Functions

bool compute_orbit(const Eigen::Vector3d &r0, const Eigen::Vector3d &v0, const Eigen::Matrix<double, 1, saltro::limits::MAX_LENGTH_TRAJ> &jtime, const int jtime_length, const int orbit_model, Eigen::Matrix<double, 3, saltro::limits::MAX_LENGTH_TRAJ> &R, Eigen::Matrix<double, 3, saltro::limits::MAX_LENGTH_TRAJ> &V)#

Propagate an orbit using a selected dynamical model.

Dispatches orbital state propagation to one of the available orbit models based on the integer selector orbit_model.

Given initial position \(\mathbf{r}_0\) and velocity \(\mathbf{v}_0\), the state is propagated to each requested time sample \(t_k\):

\[ \bigl(\mathbf{R}_k, \mathbf{V}_k\bigr) = \Phi_{\text{model}}\!\left(\mathbf{r}_0, \mathbf{v}_0, t_k\right) \]

where:

  • \(\mathbf{R}_k\) is the propagated position vector (meters),

  • \(\mathbf{V}_k\) is the propagated velocity vector (m/s),

  • \(\Phi_{\text{model}}\) is the state transition defined by the selected orbit model.

Supported models:

  • \(0\) → Two-body Keplerian propagation

  • \(1\) → J2 perturbation with RK4 integration

The output state matrices are written column-wise:

\[ \mathbf{R} = \begin{bmatrix} \mathbf{R}_0 & \mathbf{R}_1 & \cdots & \mathbf{R}_{N-1} \end{bmatrix}, \qquad \mathbf{V} = \begin{bmatrix} \mathbf{V}_0 & \mathbf{V}_1 & \cdots & \mathbf{V}_{N-1} \end{bmatrix} \]

This function performs model selection only; the dynamical propagation is delegated to the corresponding orbit model implementation.

Parameters:
  • r0 – Initial position vector in an inertial frame (meters).

  • v0 – Initial velocity vector in an inertial frame (m/s).

  • jtime – Julian centuries corresponding to each trajectory sample.

  • jtime_length – Number of valid trajectory samples.

  • orbit_model – Integer identifier selecting the orbit model: 0 = Keplerian two-body propagation.

  • R – Output propagated position vectors (meters), column-wise.

  • V – Output propagated velocity vectors (m/s), column-wise.

Returns:

True if the selected model propagation succeeds for all samples, false if the model identifier is invalid or a computation fails.