# Frozen Kozai–Lidov trajectory experiment

This is a synthetic dynamical benchmark, not observed exoplanet data. The raw CSVs contain actual REBOUND 5.2.2 IAS15 Cartesian integrations; the analysis separately integrates the doubly averaged quadrupole equations. Two additional instantaneous-quadrupole controls separate averaging from force truncation.

## Run from a downloaded folder

Use Python 3.9 or newer. No third-party package is needed for analysis. Keep the scripts, eight CSVs and `ias15-provenance.json` in one folder.

```sh
python3 analyze-frozen-orbits.py --data-dir . --output-dir rerun-analysis
```

The script verifies each raw CSV SHA-256, derives eccentricity and mutual inclination from positions and velocities, integrates the averaged vector equations, and writes `period-analysis.json` plus eight derived CSVs. The supplied `expected-analysis/` folder is the frozen expected result. Compare the new JSON with `expected-analysis/period-analysis.json`.

For initial inclination 75 degrees, period / secular time is:

| Outer / inner semimajor axis | Full Newtonian | Instantaneous quadrupole | Doubly averaged quadrupole |
| --- | ---: | ---: | ---: |
| 6 | 5.005 | 4.810 | 4.670 |
| 20 | 4.675 | 4.665 | 4.670 |

Periods are grouped peak spacings after smoothing over one outer orbit. Half/double window changes are method sensitivity, not observational confidence intervals. The stable branch and the stopped near-polar excursion supply no large-excursion period. Individual peaks and raw-state residuals remain available in the outputs. Each derived CSV also preserves the unwrapped averaged argument of periapsis; the default angle advances about 407.826 degrees over 12 secular times, identifying circulation.

## Coordinates, clocks and force models

Set G = primary mass = companion mass = initial inner semimajor axis = 1. The test particle is massless. The inner Kepler period is 2 pi; secular time is the cube of the outer-to-inner semimajor-axis ratio. Initial inner eccentricity is 0.05. Both initial periapses lie along positive x, the inner plane is xy and the outer plane rotates about x by the stated inclination. The companion-primary circular relative angular speed is sqrt(2 / outer separation cubed).

CSV columns are time, x, y, z, vx, vy, vz, outer_x, outer_y, outer_z. Positions and velocities are extracted relative to the primary in nonrotating axes. Saved cadence is 0.005 secular times. The full reference includes central attraction, full companion attraction and the primary-frame indirect acceleration. The two quadrupole controls retain the fast companion clock but truncate its differential force at quadratic tidal order. The separately integrated double average uses maximum RK4 step 0.001 secular times, retaining raw vectors without projecting their constraints.

Near-primary distance 0.03 stops the reference generator. The near-polar full record ends at 2.180 secular times; the averaged record ends around 2.160. Neither is continued past its successful saved interval. A completed cycle is required before reporting a period. No collision, disruption or dissipative tides are modeled. The GR example is conservative averaged precession only; no direct GR trajectory is supplied. The browser additionally stops before the primary gravitational radius reaches one percent of periapsis, a conservative chosen weak-field boundary.

## Optional regeneration

Install REBOUND 5.2.2 in a separate environment, or supply its package path with `--rebound-path`. Its source is pinned at https://github.com/hannorein/rebound/tree/c34134716cd484ed9cdb9f7d54ef8d859bdf547d. REBOUND is GPL-3.0-only; the package itself is not bundled. The independent analysis requires no REBOUND dependency.

```sh
python3 generate-ias15-reference.py --output-dir regenerated-inputs
python3 analyze-frozen-orbits.py --data-dir regenerated-inputs --output-dir regenerated-analysis
```

The generator records accuracy parameter 1e-11, actual platform and Python version, input conditions and raw file hashes. Different platforms or versions can change last-bit states and hashes. Keep the newly generated provenance beside regenerated files; do not reuse old hashes.

## Primary reading

- Tremaine and Yavetz, arXiv:1309.5244v1, potential 18, vector equations 23, constraints 24 and the near-circular limit.
- Liu, Muñoz and Lai, arXiv:1409.6717v2, quadrupole/octupole potentials and conservative short-range forces.
- Official REBOUND Kozai example: https://rebound.hanno-rein.de/c_examples/kozai/ and IAS15 documentation.
- Gupta et al., DOI 10.1038/s41586-024-07688-3: observed eccentric orbit and conditional illustrative migration history.
- Klein and Hamilton, arXiv:2606.19456v1: behavior after relaxing double averaging; not numerically reproduced by the browser's averaged GR model.

The raw benchmark states and analysis scripts were created for this teaching experiment. Published paper figures and publisher software are linked, not redistributed. This archive contains scientific inputs, standalone analysis and outputs; it contains no Lab Engine entry or compiled browser runtime.
