Instructor solution key

Problem Set 03: N-Body Conservation and Close Encounters — Solutions

Separate from student-facing assignment

Problem 3.1: worked solution

For the declared 12-year synthetic setup, the energy-error ratio (coarsest/fine) is 16.05. The complete table is:

steps/yearrelative energy errorrelative angular-momentum errorscaled momentum error
648.558e-122.352e-154.442e-17
1282.131e-122.533e-154.351e-18
2565.333e-131.809e-161.061e-16

Angular momentum has the same overall decrease with refinement: True. Compare all three diagnostics rather than infer one invariant from another. WHFast's fixed-step symplectic structure often yields bounded energy error; the observed finite sequence is not a proof of universal monotonic convergence. Independent verification may integrate the same initial conditions with IAS15 at tighter tolerances.

Problem 3.2: worked solution

For each body i, differentiate the Newtonian potential to obtain a_i=G*sum_(j!=i) m_j (r_j-r_i)/|r_j-r_i|^3. A close-approach timescale can be estimated as t_enc~b/v_rel or, when gravity dominates, t_dyn~sqrt(b^3/[G(m_i+m_j)]). The timestep must be much shorter than the smallest relevant encounter/orbital timescale, then be tested by refinement; no universal fraction is guaranteed for chaotic trajectories. The supplied hierarchy's orbital periods alone do not resolve an arbitrarily close encounter. Either timescale estimate is acceptable if its regime and units are explained.

Problem 3.3: worked solution

Use IAS15 for a close encounter whose short dynamical timescale violates the fixed-step WHFast hierarchy/resolution assumptions; a suitable hybrid method is also acceptable if its encounter switching conditions are justified. Before trusting the result: (1) halve/tighten the adaptive tolerance or maximum step and compare encounter time, minimum separation, and outgoing state; (2) compare total energy/angular momentum before and after with appropriate allowance for adaptive non-symplectic drift. Also check collision/softening policy and conservation of center-of-mass momentum. A visually smooth trajectory is insufficient; state a quantitative convergence threshold.

Scoring guide

Each problem is scored for model/setup (25%), correct computation or derivation (30%), validation and uncertainty (25%), and physical interpretation/communication (20%). Accept alternative correct methods when they meet the same evidence standard. See assessment instructions for error classification and resubmission guidance.