compute_orbit_keplerian#

namespace saltro
namespace orbits

Functions

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

Propagate an orbit using Keplerian two-body dynamics.

Computes the spacecraft position and velocity along a trajectory by propagating an initial Cartesian state under the Keplerian two-body assumption (central gravitational field, no perturbations).

Given initial state \((\mathbf{r}_0,\mathbf{v}_0)\) at epoch \(t_0\), the state at each time sample \(t_k\) is obtained from Kepler’s equations:

\[ \mathbf{r}_k = \mathbf{r}(t_k;\mathbf{r}_0,\mathbf{v}_0), \qquad \mathbf{v}_k = \mathbf{v}(t_k;\mathbf{r}_0,\mathbf{v}_0) \]

The resulting trajectory matrices are filled 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} \]

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

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

  • jtime – Julian time values at which the orbit should be evaluated.

  • jtime_length – Number of valid time samples.

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

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

Returns:

True if propagation succeeds for all samples, false otherwise.