A numerical simulation suite for comparing time-stepping methods by tracing gravitational dynamics of projectiles, two-body systems, and three-body systems. The project is implemented primarily in R, with an optional Python helper for regenerating figure-8 initial conditions.
Website: https://sidrichardsquantum.github.io/Celestial_Dynamics_Iteration_Methods/
R-universe: https://sidrichardsquantum.r-universe.dev/CelestialDynamicsIterationMethods
This project compares:
- Euler method
- Midpoint method
- Heun's method
- Runge-Kutta (RK4) method
- Velocity Verlet method
The simulations generate trajectories and energy-conservation diagnostics for:
- projectile motion near Earth's surface
- same-system comparisons across all implemented methods
- Sun-Earth and Earth-Moon two-body systems
- general n-body systems
- special four-body central configurations
- general three-body systems
- special three-body solutions, including figure-8, Lagrange, Euler collinear, and Butterfly I
- restricted three-body examples, including CR3BP and Sitnikov cases
R/constants.R defines G as positive; attraction is handled by explicit signs in the force equations.
Install the development package directly from GitHub:
install.packages("remotes")
remotes::install_github("SidRichardsQuantum/Celestial_Dynamics_Iteration_Methods")After R-universe has built the package, install from R-universe:
options(repos = c(
sidrichardsquantum = "https://sidrichardsquantum.r-universe.dev",
CRAN = "https://cloud.r-project.org"
))
install.packages("CelestialDynamicsIterationMethods")R-universe setup notes and the registry details are in docs/R_UNIVERSE.md.
Run the validation suite:
Rscript tests/run_all_tests.RRegenerate every example plot:
Rscript run_all_examples.RRegenerate analysis tables, diagnostics, and the dashboard:
Rscript analysis/generate_results.RFor source checkouts, example-specific commands, optional Python setup, and generated artifact details, see docs/USAGE.md.
- Usage: setup, commands, examples, repository layout, and generated artifacts
- Theory: method descriptions and numerical context
- Results: generated results, evaluation, and comparison dashboards
- R-universe setup: package registry and install details
DESCRIPTIONandNAMESPACE: lightweight R package metadataR/load.R: project-root-aware loading helpers used by scripts and testsR/methods/: projectile-oriented method implementationsR/systems/two_body/: two-body solvers, method registry, and shared plotting/physics helpersR/systems/n_body/: general 2D n-body RK4 and Velocity Verlet enginesR/systems/three_body/: full and restricted three-body helpersexamples/: runnable examples grouped by model type, including method comparisonsimages/: generated plots grouped by example typeanalysis/: reproducible result-table, diagnostic-plot, and dashboard generationdocs/: usage, theory, and canonical results narrativetests/: validation scripts used locally and in CI.github/workflows/: validation, plot-regeneration, and GitHub Pages deployment workflows
This project is licensed under the MIT License. See LICENSE.
Author: Sid Richards (SidRichardsQuantum)