ASTR 474 · Computational Lab 03

Lab 03: Three-Body Conservation and Encounter Choice

L04 · REBOUND N-body dynamics

Purpose and learning objectives

L04 · REBOUND N-body dynamics. This investigation develops a numerical method and tests its output against a declared benchmark, invariant, uncertainty model, or independent implementation.

Preparation, setup, and inputs

Software: CPython 3.14.6; dependencies in requirements.txt. From repository root run .venv/Scripts/python.exe materials/ASTR474/src/astr474_computations.py. Then use the corresponding CSV/JSON under materials/ASTR474/data/generated/. Required data: generated/nbody_conservation.csv.

Apparatus: computer with local CPU, terminal, text editor, and browser; no telescope, GPU, network account, or paid service is required. Preserve the generated input files and record file hash/version.

Model scope: Three-body orbital geometry is idealized; Astropy solar/Earth/Jupiter mass parameters are published physical constants.

Procedure

  1. Run the 12-year Sun-Earth-Jupiter WHFast experiment at 64, 128, and 256 steps per Earth year.
  2. Record relative energy error, relative angular-momentum error, scaled center-of-mass momentum error, particle masses, geometry, and total steps.
  3. Plot each invariant diagnostic against timestep; estimate the convergence slope from adjacent resolutions.
  4. Introduce a test close approach and explain why the hierarchy assumptions of WHFast may fail; select IAS15 or a hybrid integrator and state the required checks.
  5. Repeat one run from a saved initial-condition file and compare the state and checksums.

Measurement record

QuantityValue or fieldUnit/conventionSource/method
Input configurationRecord solver, version, seed, timestep/grid/toleranceAs defined by the experimentCommand line and source file
Primary diagnosticRecord every resolution/sample/fit row, not just the preferred resultState units and normalizationGenerated CSV/JSON
Independent referenceAcross 12 years, the three-body WHFast relative energy error falls from 8.56e-12 at dt=5.707 d to 5.33e-13 at dt=1.427 d; angular-momentum and scaled momentum errors are tabulated separately.As stated in the generated exampleAnalytic/JPL/invariant cross-check
Uncertainty/sensitivityRepeat with changed resolution, seed, parameter, or methodReport interval or relative changeStudent analysis

Analysis and uncertainty

Timestep sweep quantifies discretization sensitivity. This is not a stability proof for arbitrary N-body initial conditions.

Plot the diagnostic against the controlled parameter; label axes, units, normalization, and reference. Explain any non-monotonic point rather than smoothing or dropping it. If propagating independent errors, state why independence is plausible; preserve correlated/common-mode terms separately.

Deliverables and assessment

  1. Runnable source or notebook export with command, package versions, and all input/output paths.
  2. One scientific figure plus a machine-readable table of measurements and convergence/sampling/residual diagnostics.
  3. A 700-1000 word technical report describing model, method, validation, uncertainty categories, and one failed assumption.
  4. A short claim-evidence table separating result, numerical check, and domain limitation.

Rubric: 30% correct method and setup; 25% validation and numerical diagnostics; 20% uncertainty/provenance; 15% physical interpretation; 10% clarity and reproducibility. Revisions and resubmissions are encouraged under the syllabus mastery policy.

Data and source provenance

Three-body orbital geometry is idealized; Astropy solar/Earth/Jupiter mass parameters are published physical constants. Provenance levels, request records, and source verification limits are documented in reference-log.md; generated files and seeds are documented in data/README.md.

References: