ASTR 474 · Computational Astrophysics · Lecture 03

Lecture 03: Kepler Orbits with REBOUND

What does a symplectic integrator preserve, and what does it not promise?

14-week course · 3 credits · Week 3

Motivation

What does a symplectic integrator preserve, and what does it not promise?

For a dominant central mass and weak perturbations, Wisdom-Holman splitting separates Keplerian drift from perturbing kicks. WHFast is fixed-step and symplectic; IAS15 is adaptive and high-order. Their errors have different structure and should be selected by the problem, not by a single accuracy slogan.

Today’s result must be interpretable as a physical statement with declared data, algorithm, uncertainty, and a check that could fail.

Learning objectives

After this lecture, you can

Core language

Terms for This Lecture

Symplectic integrator

Definition: A time-stepping map that preserves Hamiltonian phase-space geometry.

Why it matters here: It helps answer What does a symplectic integrator preserve, and what does it not promise? within the numerical model described here.

Relationships: Connect it to Kepler drift, the governing expression \(H=\sum_i\left(\frac{p_i^2}{2m_i}-\frac{GMm_i}{r_i}\right)+H_{\rm interaction}\), and the computed diagnostic developed later in the lecture.

Boundary or common confusion: An ideal two-body propagation is not an ephemeris. Earth-center state, Sun motion, Moon, other planets, and relativistic terms matter when comparing against DE441.

Physical and mathematical model

State what is being evolved

For a dominant central mass and weak perturbations, Wisdom-Holman splitting separates Keplerian drift from perturbing kicks. WHFast is fixed-step and symplectic; IAS15 is adaptive and high-order. Their errors have different structure and should be selected by the problem, not by a single accuracy slogan.

\[H=\sum_i\left(\frac{p_i^2}{2m_i}-\frac{GMm_i}{r_i}\right)+H_{\rm interaction}\]

Define the state, coordinates, units, initial/boundary conditions, and domain before interpreting solver output.

Numerical method

Algorithm choice is a modeling decision

Initialize units before particles; validate the two-body orbit; sweep fixed timesteps; record energy and angular momentum; compare a one-day Sun-Earth propagation with the JPL state in a consistent heliocentric frame.

  1. Write the model and its assumptions.
  2. Choose a solver and identify its stability, accuracy, and conservation properties.
  3. Record configuration, tolerances or timestep, and output sampling.
  4. Compare against an analytic limit, independent method, or controlled refinement.

Visual reasoning

Heliocentric Earth orbit and JPL checkpoints

Earth orbit with DE441 checkpointsAn idealized orbit ellipse is annotated with the two published JPL DE441 state epochs used as initial and one-day comparison states. Sun 2025-01-01 TDB2025-01-02 TDB Orbit shown as a schematic; comparison uses full 3-D vectors and declared frame.
An explicitly schematic orbital ellipse plus the exact two JPL epoch points; the points are close because they are one day apart.

Computed example

One result, with a check

Using Astropy GM_sun, the circular 1-AU Kepler period is 365.25690 d. After one day, REBOUND and independent SciPy two-body runs differ from the DE441 Earth-center vector by 126.0 km and 126.1 km respectively; the residual is model/frame scope, not an accuracy claim.

Inputs and method are generated by src/astr474_computations.py; the machine-readable values are in data/generated/computed_results.json.

An ideal two-body propagation is not an ephemeris. Earth-center state, Sun motion, Moon, other planets, and relativistic terms matter when comparing against DE441.

Verification

What would falsify this result?

Do not report a smoother curve as proof of convergence.

Failure modes

Numerical agreement has a domain

An ideal two-body propagation is not an ephemeris. Earth-center state, Sun motion, Moon, other planets, and relativistic terms matter when comparing against DE441.

Solver error, discretization error, stochastic error, parameter uncertainty, and model discrepancy are different quantities. Diagnose and report them separately.

Active reasoning

Make a prediction before rerunning

What does a symplectic integrator preserve, and what does it not promise?

State a measurable outcome, a competing explanation, and the smallest computation that distinguishes them. Include an expected direction or scaling, then test it.

Workflow

From parameters to auditable output

Initialize units before particles; validate the two-body orbit; sweep fixed timesteps; record energy and angular momentum; compare a one-day Sun-Earth propagation with the JPL state in a consistent heliocentric frame.

Record the exact command, package versions, data path, random seed if applicable, and output checksum. Keep raw inputs unchanged and generated files separate.

Transfer

Lab and problem-set connection

Lab 02 uses the level-2 JPL vector record and distinguishes integrator error from model discrepancy.

Submit plots with labeled axes/units, a concise uncertainty argument, and enough code or intermediate values for a peer to reproduce the claim.

Synthesis

Three durable checks

  1. Does the implemented equation match the intended physical model?
  2. Does the numerical result converge under a controlled method change?
  3. Does the interpretation stay inside the validity and provenance limits?

An ideal two-body propagation is not an ephemeris. Earth-center state, Sun motion, Moon, other planets, and relativistic terms matter when comparing against DE441.

Sources

Technical references

Data and provenance details are recorded in reference-log.md. Last updated 2026-09-27.