Crawford (1995): Kepler's Equations in C
Why This Matters for SGP4
Section titled “Why This Matters for SGP4”Paul Crawford is a co-author of the Vallado et al. (2006/2008) Rev-1 paper and the maintainer of the “Dundee code” — the most comprehensive independent SGP4 implementation. This 1995 paper provides the specific Kepler’s equation solver whose bounded Newton-Raphson technique was incorporated into the Rev-1 modernization.
Every SGP4 propagation must solve Kepler’s equation to convert mean anomaly (which advances linearly with time) into true anomaly (the satellite’s actual angular position). The original STR#3 FORTRAN used an unbounded Newton-Raphson iteration that could diverge near perigee for high-eccentricity orbits. Crawford’s paper provides the fix.
Rev-1 Section 6 references this paper explicitly for the correction bounding technique.
Kepler’s Equation
Section titled “Kepler’s Equation”The inverse problem — given , find and then — requires solving:
which has no closed-form solution. Newton-Raphson iteration on gives:
This converges quadratically near the root (roughly doubling significant figures each iteration), but can diverge wildly near perigee at high eccentricities when the initial estimate is poor.
The Bounded Correction
Section titled “The Bounded Correction”Crawford’s key insight is Equation 9:
Since , the eccentric anomaly can never differ from the mean anomaly by more than the eccentricity. Before each Newton-Raphson step, the correction is clamped:
if (fabs(F) >= fabs(ecc * DF)) // Bound exceeded? DE = -SIGN(ecc, F); // Limit correction to +/- eelse DE = F / DF; // Normal Newton-RaphsonThis simple guard prevents divergence without slowing convergence. For the demanding test case , rad, the iteration converges to rad in under 10 steps.
Design Principles
Section titled “Design Principles”Crawford’s implementation satisfies six design objectives that remain relevant for any SGP4 Kepler solver:
| Objective | How Achieved |
|---|---|
| Fast evaluation | Newton-Raphson with precomputed |
| Bounded accuracy | Convergence to EPS = 1e-8 rad (final error EPS) |
| No singularities | atan2(sin, cos) replaces atan(tan) |
| Smooth output | Modulo reduction with remainder restoration |
| Derivatives available | Optional and via chain rule |
| Portable code | ANSI C, no platform dependencies |
The Dundee Code Connection
Section titled “The Dundee Code Connection”Crawford’s affiliation (University of Dundee) and his explicit mention of “conversion of some older programmes (generally written in FORTRAN) to ‘C’” is the genesis of what would become the Dundee code. This independent C translation of SGP4 — maintained by Crawford from the mid-1990s through the 2006 modernization — tracked bug fixes and corrections more carefully than any DoD release.
The Vallado (2006) paper identifies three independent SGP4 fix histories: GSFC, Dundee (Crawford), and AFSPC standalone. Crawford’s was the most comprehensive, pre-dating many corrections that the DoD later confirmed.
Convergence Performance
Section titled “Convergence Performance”Crawford tested the solver across eccentricities from 0.001 to 0.95, evaluating 4096 mean anomaly points per eccentricity:
| Eccentricity | Average Iterations | Worst Case |
|---|---|---|
| 0.001 | 2 | 2 |
| 0.01 | 2 | 3 |
| 0.1 | 3 | 4 |
| 0.5 | 4 | 6 |
| 0.9 | 5 | 8 |
| 0.95 | 6 | 9 |
For typical LEO satellites (e < 0.1), Kepler’s equation is solved in 2-3 iterations. Even highly eccentric orbits like Molniya () need only 4-5.