Gravity¶
All propagation in Nyx is subjected to twobody gravity, with an option to add on other gravity forces from other objects as needed. The GM parameters for all celestial bodies are those used by NASA JPL. Nyx stores these gravitational parameters in the XB
file provided with Nyx. In the future, Nyx will used another file format, designed to be flightsoftware ready, faster, and totally opensource (note that XBs are already 68 times faster than SPICE BSP files).
This model will propagate the state in Cartesian form, as it does not suffer from singularities.
Twobody¶
Each orbit or spacecraft is represented with respect to a frame, a copy of which is stored with said object. The equations of motion will use the GM parameter of that frame for all computations.
Provided an input vector of position and velocity, the equations of motion will compute the time derivative as follows. The vectors \(\mathbf{r}\) and \(\mathbf{v}\) are respectively the position and velocity of the spacecraft. The \(t\) subscript refers to the current time and \(t'\) the next time in the direction of the propagator (i.e. \(t>t^\prime\) if propagating forward and \(t< t^\prime\) when propagating backward).
Important
If you want to specify a different GM for a given frame, it is important to modify the frame prior to initializing a spacecraft state with that frame. A shortcut to using the GMAT GMs is to initialize the Cosm
as Cosm::de438_gmat()
instead of Cosm::de438()
.
Validation
In summary, Nyx matches GMAT at micrometer or better accuracy in each component of the position and nanometer per second accuracy or better in each component of the velocity. Note that both GMAT and Nyx propagate the state in kilometers. Further, on a 64 bit floating point representation (used by both Nyx and GMAT), the best possible matching is 2e16 kilometers, or 2e13 meters, or 0.2 picometers.
The two body dynamics are validated against GMAT using the GMAT values for \(\mu\). The validation scenario propagates a LEO spacecraft forward in time for one day using an adaptive step RK89 numerical integrator. It compares the final result with the result from the GMAT. It then propagates this final state by one day and ensures that the difference between the backpropagated state and the initial state has an RSS error of less than 10 millimeters (1e5 km).^{1} The RSS error from the backpropagation is actually 1.38 millimeters. The following table shows the absolute errors on the same platform.
X (km)  Y (km)  Z (km)  VX (km/s)  VY (km/s)  VZ (km/s) 

6e12  8e10  1e9  1e12  1e13  5e13 
$ RUST_BACKTRACE=1 cargo test release  val_two_ nocapture
Compiling nyxspace v1.0.0alpha.2 (/home/chris/Workspace/rust/nyx)
Finished release [optimized] target(s) in 6.37s
Running target/release/deps/nyx_spacef0273a0ad4832aca
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 30 filtered out; finished in 0.00s
Running target/release/deps/nyxcliec6c9ca3b3fa86db
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running target/release/deps/lib731ac57663b8679f
running 1 test
==> val_two_body_dynamics absolute errors
6e12 8e10 1e9 1e12 7e13 5e13
RTN: [Earth J2000] 20000101T12:00:00 TAI position = [2436.449999, 2436.450001, 6891.037000] km velocity = [5.088611, 5.088611, 0.000000] km/s
INIT: [Earth J2000] 20000101T12:00:00 TAI position = [2436.450000, 2436.450000, 6891.037000] km velocity = [5.088611, 5.088611, 0.000000] km/s
[Earth J2000] 20000101T12:00:00 TAI sma = 7712.186236 km ecc = 0.001000 inc = 63.434003 deg raan = 135.000000 deg aop = 90.000000 deg ta = 0.000000 deg
[tests/mission_design/orbitaldyn.rs:53] err_r = 0.000001381643705733031
test mission_design::orbitaldyn::val_two_body_dynamics ... ok
Multibody¶
This computation happens in the PointMasses
models. It is the generalization of the equation from the previous "twobody" section.
This model does not affect the velocity components of the time derivative, only the acceleration of the next propagator step, noted as \(\dot{\mathbf{v}}_{t'}\). As such it is implemented as an AccelModel
.
In the following, \(\mathbf{r_{ij}}\) is the position of the \(i\)th celestial body as seen from the integration frame at the integration time. The \(\mathbf{r_{j}}\) vector is the position of the spacecraft as seen from the \(i\)th celestial body.
Validation
In summary, Nyx matches GMAT at 100 micrometer or better accuracy in position (typically tens of micrometers) and 2 micrometer per second or better (typically 100 nanometers per second) accuracy in velocity for a one day propagation. The largest errors are seen when propagating in a nonoptimal frame, specifically, propagating a low lunar orbiter in the EME2000 frame.
The validation of the multibody dynamics inherently includes the validation of the computation of the position of celestial objects. These are currently stored in a proprietary protobuf format, but another opensource format (with FSW in mind) is in the works and will be released before the end of 2021.
The GMAT validation scenarios are available on the repository in tests/GMAT_scripts/propagators
.
The following scenario permutations are tested: + EarthMoon Halo orbit, Low Lunar Orbiter, and LEO + RK8 10s time step, or RK89 with adaptive step size + Earth & Moon point masses, or Earth, Moon, Sun and Jupiter + Cislunar trajectory using an RK4 fixed step of 0.5 seconds with Earth, Moon and Sun gravity, propagated for 36 hours
RSS position errors are in meters, RSS velocity errors in meters per second, but component errors are in kilometers and kilometers per second.
Case  RSS position (m)  RSS velocity (m/s)  Adaptive/Fixed  Point masses  Prop. start date  X (km)  Y (km)  Z (km)  VX (km/s)  VY (km/s)  VZ (km/s) 

EM Halo  1.71624e4  1.58051e9  Fixed  Earth Moon  20200101  6e8  2e7  5e8  1e12  6e13  9e13 
EM Halo  3.21844e4  1.08012e9  Adaptive  Earth Moon  20020207  1e8  3e7  1e7  1e12  1e14  3e14 
EM Halo  1.68523e4  1.59021e9  Fixed  Earth Moon Sun Jupiter  20200101  5e8  2e7  5e8  1e12  6e13  9e13 
EM Halo  1.79139e4  5.16179e10  Adaptive  Earth Moon Sun Jupiter  20020207  4e9  2e7  6e8  5e13  3e14  2e15 
LLO  3.69863e4  4.94220e10  Adaptive  Earth Moon  20020207  1e7  3e7  8e8  5e13  1e13  6e14 
LLO  9.86846e4  1.51935e9  Adaptive  Earth Moon Sun Jupiter  20020207  4e7  9e7  2e7  1e12  4e13  1e13 
LEO  2.62910e3  2.45180e6  Adaptive  Earth Moon Sun Jupiter  20200101  2e8  2e6  2e6  2e9  1e9  9e10 
LEO  4.78574e4  4.46347e7  Adaptive  Earth Sun Jupiter (no Moon!)  20200101  3e9  3e7  4e7  3e10  2e10  2e10 
Cislunar  1.01787e4  1.22381e7  Fixed  Earth Moon Sun  20221127  3e8  8e8  5e8  1e10  4e11  3e11 
Rerun the Halo validation with RUST_BACKTRACE=1 cargo test release  val_halo nocapture
. Rerun the LLO validation with RUST_BACKTRACE=1 cargo test release  val_llo nocapture
. Rerun the LEO validation with RUST_BACKTRACE=1 cargo test release  val_leo_multi nocapture
.

This is the accuracy GMAT expects from a back propagation, as detailed in the GMAT_V&V_ProcessAndResults.pdf file. ↩