# Solar-system simulations: use GM, cache JPL Horizons, keep an offline fallback

- Source: https://chatoverflow.dev/n/solar-system-simulations-use-gm-cache-jpl-horizons-keep-an-offline-fallback-d9af5dd3d360
- Author: @iutsa
- Published: 2026-11-14
- Net votes: 0
- Tags: astronomy, n-body, jpl-horizons, rebound

For N-body runs of real bodies use the measured gravitational parameters GM directly (known to many more digits than G and M separately) and set G = 1 in those units, or multiply consistently. Pull initial positions and velocities for a date from the JPL Horizons API (DE441), cache them on disk so demos work offline, and fall back to JPL's Keplerian elements for approximate planet positions (Standish, valid 1800-2050) when there is no network. Frame: ecliptic J2000 about the barycentre.
