The official satellite test has three traps.
We built a checker that catches all three.
1
One satellite, listed twice
Mix the two runs up and the test lies to you.
▸The full story
Satellite 20413 is listed twice in the official file with identical element sets but two different time spans (1,440 to 4,320 minutes, then 1,844,000 to 1,845,100 minutes). Keying results by satellite number silently merges the two runs; the harness compares blocks in file order.
2
A case built to show a known bug
Here, a difference is the right answer.
▸The full story
The official file marks satellite 23599 as showing the Lyddane/AcTan quadrant bug beyond 280.5 minutes. Here the Java reference differs from the build at 16 points, the earliest at 420 minutes; Fortran and MATLAB do not. Those points are reported separately and must all fall after 280.5 minutes, or the check fails.
3
A hidden duplicate
The last line of one file hides 24 extra rows.
▸The full story
The MATLAB reference ends with one unbroken 2,568-character line holding 24 rows of satellite 08195, duplicating every row already in the file except the epoch row. A parser that expects one row per line mis-reads it; the harness parses it separately and checks it against 08195.
With the traps handled, our build matches.
0.09 mm
vs Fortran
0.12 mm
vs MATLAB
0.12 mm
vs Java
83×
inside the 1 cm limit
- 33 test cases
- 666 positions, one by one
- Linux · GCC
- Windows · MinGW
← swipe the chart →
Each dot is one test case. Lower is closer. All sit far below the dashed limit.
▸How the checker works
A portable driver builds David A. Vallado's SGP4 unmodified, then compares every state vector, block by block, with each reference: position, velocity, row counts, and the step at which each of the 6 deliberately decaying or invalid cases stops. It runs on Linux (GCC, on every change) and on Windows (MinGW-w64 GCC), which catches compiler and maths-library differences.
The build stops at exactly the same step as every reference (666 state vectors from 33 cases in total). Tolerance: 1 cm in position, the limit of the digits the reference files publish.
Matching is not the same as accurate.
Our build copies the official code almost perfectly. Any SGP4 prediction is still about a kilometre from the real satellite.
▸What this proves, and what it does not
The build is compared, state vector by state vector, with the official Fortran, MATLAB and Java outputs published alongside it in AIAA 2006-6753.
These four implementations share an algorithm and a lineage — they were published together as companion code to the same paper. Agreement between them demonstrates that this build is numerically correct: it catches build errors, compiler and maths-library differences, and porting mistakes. It is not independent confirmation of the algorithm, and an error common to the lineage would not be caught here.
What this does not measure: SGP4's accuracy. A position propagated from a published TLE is typically around a kilometre from the true position at epoch, and the error grows from there. The sub-millimetre figures above describe agreement between implementations, not knowledge of where a satellite actually is. The two differ by roughly seven orders of magnitude.
Every tool is tested on every build.
8 of 8 known answers match. Each dot is one.
▸Where every known answer comes from
Each expected value comes from an independent source (a physical identity, a published example or an independent calculation), never from the tool's own output.
| Check | Source of the expected value | Result |
|---|---|---|
| ORB-001 | Physical: a geostationary orbit's period equals one sidereal day (86164.0905 s). | ✓ Pass |
| ORB-002 | Closed form T = 2*pi*sqrt(r^3/mu), independently recomputed (92.56 min). | ✓ Pass |
| ORB-003 | Vis-viva for a circular orbit, v = sqrt(mu/r), independently recomputed. | ✓ Pass |
| ORB-004 | Vis-viva for a circular orbit, independently recomputed. | ✓ Pass |
| ORB-005 | Closed-form Hohmann transfer, independently recomputed; agrees with the widely published ~3.89 km/s for 300 km LEO to GEO. | ✓ Pass |
| ORB-006 | Closed-form Hohmann transfer, independently recomputed. | ✓ Pass |
| ORB-007 | Half the transfer-ellipse period, independently recomputed (5.275 h). | ✓ Pass |
| ORB-008 | Identity: a transfer to the same orbit costs nothing. | ✓ Pass |
Toolkit commit dd0281f. Checks re-run on every build of this website and on every change to the toolkit.
