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.
View the generated results site: https://sidrichardsquantum.github.io/Celestial_Dynamics_Iteration_Methods/
For setup, commands, examples, and repository layout, see USAGE.md. For method descriptions, see THEORY.md. For generated results, evaluation, and comparison dashboards, see RESULTS.md.
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
constants.R defines G as positive; attraction is handled by explicit signs in the force equations.
Run all validations:
Rscript tests/run_all_tests.RRegenerate every example plot:
Rscript run_all_examples.RRegenerate analysis tables, diagnostics, and the dashboard:
Rscript analysis/generate_results.RRun only three-body checks:
Rscript tests/validate_three_body.Riteration_methods/: projectile-oriented method implementationscelestial_systems/two_body/: two-body solvers, method registry, and shared plotting/physics helperscelestial_systems/n_body/: general 2D n-body RK4 and Velocity Verlet enginescelestial_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 generationtests/: 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)