Lecture 04: N-Body Systems, Invariants, and Close Encounters
How can conservation diagnostics reveal a timestep that looks visually plausible?
14-week course · 3 credits · Week 4
Motivation
How can conservation diagnostics reveal a timestep that looks visually plausible?
Mutual gravity couples all particles, and close approaches shorten local dynamical timescales. WHFast is effective for hierarchical systems with a dominant primary; adaptive IAS15 or hybrid methods are more suitable when close encounters violate that structure.
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
How can conservation diagnostics reveal a timestep that looks visually plausible?
Use the Sun-Earth-Jupiter benchmark with measured mass parameters and declared idealized circular geometry
Good invariant conservation is necessary but not sufficient: conserved errors can coexist with wrong initial conditions, wrong frames, or missing forces.
Core language
Terms for This Lecture
N-body system
Definition: A set of mutually gravitating particles whose accelerations depend on every other particle.
Why it matters here: It helps answer How can conservation diagnostics reveal a timestep that looks visually plausible? within the numerical model described here.
Relationships: Connect it to Invariant, the governing expression \(\ddot{\mathbf r}_i=G\sum_{j\ne i}m_j\frac{\mathbf r_j-\mathbf r_i}{|\mathbf r_j-\mathbf r_i|^3}\), and the computed diagnostic developed later in the lecture.
Boundary or common confusion: Good invariant conservation is necessary but not sufficient: conserved errors can coexist with wrong initial conditions, wrong frames, or missing forces.
Invariant
Definition: A quantity such as total energy or angular momentum that the continuous model conserves.
Why it matters here: It helps answer How can conservation diagnostics reveal a timestep that looks visually plausible? within the numerical model described here.
Relationships: Connect it to Close encounter, the governing expression \(\ddot{\mathbf r}_i=G\sum_{j\ne i}m_j\frac{\mathbf r_j-\mathbf r_i}{|\mathbf r_j-\mathbf r_i|^3}\), and the computed diagnostic developed later in the lecture.
Boundary or common confusion: Good invariant conservation is necessary but not sufficient: conserved errors can coexist with wrong initial conditions, wrong frames, or missing forces.
Close encounter
Definition: A near approach that creates a short dynamical timescale and strong acceleration.
Why it matters here: It helps answer How can conservation diagnostics reveal a timestep that looks visually plausible? within the numerical model described here.
Relationships: Connect it to Center-of-mass frame, the governing expression \(\ddot{\mathbf r}_i=G\sum_{j\ne i}m_j\frac{\mathbf r_j-\mathbf r_i}{|\mathbf r_j-\mathbf r_i|^3}\), and the computed diagnostic developed later in the lecture.
Boundary or common confusion: Good invariant conservation is necessary but not sufficient: conserved errors can coexist with wrong initial conditions, wrong frames, or missing forces.
Center-of-mass frame
Definition: Coordinates measured relative to the system barycenter and its bulk motion.
Why it matters here: It helps answer How can conservation diagnostics reveal a timestep that looks visually plausible? within the numerical model described here.
Relationships: Connect it to Chaos, the governing expression \(\ddot{\mathbf r}_i=G\sum_{j\ne i}m_j\frac{\mathbf r_j-\mathbf r_i}{|\mathbf r_j-\mathbf r_i|^3}\), and the computed diagnostic developed later in the lecture.
Boundary or common confusion: Good invariant conservation is necessary but not sufficient: conserved errors can coexist with wrong initial conditions, wrong frames, or missing forces.
Chaos
Definition: Exponential sensitivity of trajectories to small differences in initial conditions.
Why it matters here: It helps answer How can conservation diagnostics reveal a timestep that looks visually plausible? within the numerical model described here.
Relationships: Connect it to N-body system, the governing expression \(\ddot{\mathbf r}_i=G\sum_{j\ne i}m_j\frac{\mathbf r_j-\mathbf r_i}{|\mathbf r_j-\mathbf r_i|^3}\), and the computed diagnostic developed later in the lecture.
Boundary or common confusion: Good invariant conservation is necessary but not sufficient: conserved errors can coexist with wrong initial conditions, wrong frames, or missing forces.
Physical and mathematical model
State what is being evolved
Mutual gravity couples all particles, and close approaches shorten local dynamical timescales. WHFast is effective for hierarchical systems with a dominant primary; adaptive IAS15 or hybrid methods are more suitable when close encounters violate that structure.
Define the state, coordinates, units, initial/boundary conditions, and domain before interpreting solver output.
Numerical method
Algorithm choice is a modeling decision
Use the Sun-Earth-Jupiter benchmark with measured mass parameters and declared idealized circular geometry; compare fixed steps over 12 years; monitor energy, angular momentum, and center-of-mass momentum; rerun a close-encounter case with an appropriate hybrid method.
Write the model and its assumptions.
Choose a solver and identify its stability, accuracy, and conservation properties.
Record configuration, tolerances or timestep, and output sampling.
Compare against an analytic limit, independent method, or controlled refinement.
Visual reasoning
Sun-Earth-Jupiter hierarchy and conserved quantities
The drawn orbits show the model hierarchy; the separate bars encode generated energy-error diagnostics for the synthetic geometry.
Computed example
One result, with a check
Across 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.
Inputs and method are generated by src/astr474_computations.py; the machine-readable values are in data/generated/computed_results.json.
Good invariant conservation is necessary but not sufficient: conserved errors can coexist with wrong initial conditions, wrong frames, or missing forces.
Verification
What would falsify this result?
Repeat with a smaller timestep, tighter tolerance, or finer spatial grid.
Track conservation or residual structure in addition to visual agreement.
Check units, coordinate frame, boundary conditions, and invariants independently.
Change a random seed when the method is stochastic; report the resulting sampling uncertainty.
Do not report a smoother curve as proof of convergence.
Failure modes
Numerical agreement has a domain
Good invariant conservation is necessary but not sufficient: conserved errors can coexist with wrong initial conditions, wrong frames, or missing forces.
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
How can conservation diagnostics reveal a timestep that looks visually plausible?
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
Use the Sun-Earth-Jupiter benchmark with measured mass parameters and declared idealized circular geometry; compare fixed steps over 12 years; monitor energy, angular momentum, and center-of-mass momentum; rerun a close-encounter case with an appropriate hybrid method.
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 03 varies timestep in REBOUND and asks students to defend the integrator choice for an encounter.
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
Does the implemented equation match the intended physical model?
Does the numerical result converge under a controlled method change?
Does the interpretation stay inside the validity and provenance limits?
Good invariant conservation is necessary but not sufficient: conserved errors can coexist with wrong initial conditions, wrong frames, or missing forces.