heyoka.model.state_to_rsw

Contents

heyoka.model.state_to_rsw#

heyoka.model.state_to_rsw(*, pos: Iterable[expression], vel: Iterable[expression], r: Iterable[expression], v: Iterable[expression]) tuple[list[expression], list[expression]]#

Convert state to the RSW frame.

Added in version 7.9.0.

Given a state defined by Cartesian position and velocity vectors pos and vel in a non-rotating reference frame, this function will transform the state into the RSW frame defined by the reference position r and velocity v (which must be expressed in the same reference frame).

The RSW frame has its origin at r and basis vectors:

\[\begin{split}\begin{align} \hat{\boldsymbol{R}} & = \frac{\boldsymbol{r}}{\left| \boldsymbol{r} \right|},\\ \hat{\boldsymbol{S}} & = \hat{\boldsymbol{W}} \times \hat{\boldsymbol{R}},\\ \hat{\boldsymbol{W}} & = \frac{\boldsymbol{r}\times\boldsymbol{v}}{\left| \boldsymbol{r}\times\boldsymbol{v} \right|}. \end{align}\end{split}\]

That is, \(\hat{\boldsymbol{R}}\) is aligned in the direction of \(\boldsymbol{r}\), \(\hat{\boldsymbol{W}}\) in the direction of the angular momentum \(\boldsymbol{r}\times\boldsymbol{v}\) and \(\hat{\boldsymbol{S}}\) completes the right-handed triad. The RSW frame is rotating and its origin is moving with velocity \(\boldsymbol{v}\).

While the transformation of the position pos into the RSW frame is fully defined by the reference state r and v, the transformation of the velocity vel depends on the angular velocity of the RSW frame, which is not uniquely determined by r and v alone. Computing it correctly requires knowledge of the reference acceleration or an assumption about the frame rotation.

In this function, we assume that the angular velocity of the RSW frame is

\[\boldsymbol{\omega} = \frac{\boldsymbol{r}\times\boldsymbol{v}}{\left|\boldsymbol{r}\right|^2},\]

that is, the frame is rotating as-if the reference state r and v were evolving on a Keplerian orbit.

Note

The RSW frame is also known under several other denominations, including RSW_ROTATING, RTN, RIC, LVLH, QSW and possibly others.

Parameters:
  • pos – the Cartesian position vector to be transformed.

  • vel – the Cartesian velocity vector to be transformed.

  • r – the Cartesian position of the origin of the RSW frame.

  • v – the Cartesian velocity of the origin of the RSW frame.

Returns:

pos and vel transformed in the RSW reference frame defined by r and v.