FAILURE MAP
← Case archive

FA-69711 / Orbital propagation / Open access

Elliptic time of flight between anomalies: Arcs crossing periapsis get negative durations · case 01

Flights through periapsis report negative time.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The mean anomaly difference is not wrapped into [0,2pi).

THE FAILURE

The mean anomaly difference is not wrapped into [0,2pi).

Unsuccessful approach: Taking the absolute difference measures the arc backwards.

Case contract

Input [a, e, nu1, nu2, mu] (degrees). Convert each true anomaly to eccentric anomaly with the half-angle atan2 form and to mean anomaly in [0,2pi); flight always proceeds forward, so dM=(M2-M1) mod 2pi. Return dM/n seconds rounded to 3 with n=sqrt(mu/a^3).

Why this case matters

Orbit determination and mission planning chain many small conversions; one wrong branch or unit silently moves a spacecraft by kilometres.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    a,e,n1,n2,mu=x
    def Ma(nu):
        nu=math.radians(nu)
        E=2*math.atan2(math.sqrt(1-e)*math.sin(nu/2),math.sqrt(1+e)*math.cos(nu/2))
        return (E-e*math.sin(E))%(2*math.pi)
    n=math.sqrt(mu/a**3)
    dM=Ma(n2)-Ma(n1)
    return round(dM/n,3)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('elliptic time of flight between anomalies [7000.0, 0.1, 270.0, 30.0, 398600.4418]', [7000.0, 0.1, 270.0, 30.0, 398600.4418], 1670.595), ('elliptic time of flight between anomalies [7000.0, 0.1, 0.0, 90.0, 398600.4418]', [7000.0, 0.1, 0.0, 90.0, 398600.4418], 1271.911), ('elliptic time of flight between anomalies [26560.0, 0.7, 10.0, 350.0, 398600.4418]', [26560.0, 0.7, 10.0, 350.0, 398600.4418], 42774.887), ('elliptic time of flight between anomalies [26560.0, 0.7, 180.0, 200.0, 398600.4418]', [26560.0, 0.7, 180.0, 200.0, 398600.4418], 8874.68), ('elliptic time of flight between anomalies [1.0, 0.5, 45.0, 45.0, 1.0]', [1.0, 0.5, 45.0, 45.0, 1.0], 0.0), ('elliptic time of flight between anomalies [1.0, 0.3, 300.0, 60.0, 1.0]', [1.0, 0.3, 300.0, 60.0, 1.0], 1.172), ('elliptic time of flight between anomalies [1.0, 0.0, 0.0, 180.0, 1.0]', [1.0, 0.0, 0.0, 180.0, 1.0], 3.142)], [('elliptic time of flight between anomalies [1.0, 0.3, 300.0, 60.0, 1.0]', [1.0, 0.3, 300.0, 60.0, 1.0], 1.172), ('elliptic time of flight between anomalies [26560.0, 0.7, 180.0, 200.0, 398600.4418]', [26560.0, 0.7, 180.0, 200.0, 398600.4418], 8874.68), ('elliptic time of flight between anomalies [1.0, 0.5, 45.0, 45.0, 1.0]', [1.0, 0.5, 45.0, 45.0, 1.0], 0.0), ('elliptic time of flight between anomalies [1.0, 0.0, 0.0, 180.0, 1.0]', [1.0, 0.0, 0.0, 180.0, 1.0], 3.142), ('elliptic time of flight between anomalies [2.0, 0.9, 170.0, 190.0, 1.0]', [2.0, 0.9, 170.0, 190.0, 1.0], 7.512), ('elliptic time of flight between anomalies [2.0, 0.9, 350.0, 10.0, 1.0]', [2.0, 0.9, 350.0, 10.0, 1.0], 0.023), ('elliptic time of flight between anomalies [7000.0, 0.1, 0.0, 90.0, 398600.4418]', [7000.0, 0.1, 0.0, 90.0, 398600.4418], 1271.911)], [('elliptic time of flight between anomalies [2.0, 0.9, 350.0, 10.0, 1.0]', [2.0, 0.9, 350.0, 10.0, 1.0], 0.023), ('elliptic time of flight between anomalies [1.0, 0.0, 0.0, 180.0, 1.0]', [1.0, 0.0, 0.0, 180.0, 1.0], 3.142), ('elliptic time of flight between anomalies [2.0, 0.9, 170.0, 190.0, 1.0]', [2.0, 0.9, 170.0, 190.0, 1.0], 7.512), ('elliptic time of flight between anomalies [7000.0, 0.1, 0.0, 90.0, 398600.4418]', [7000.0, 0.1, 0.0, 90.0, 398600.4418], 1271.911), ('elliptic time of flight between anomalies [7000.0, 0.1, 270.0, 30.0, 398600.4418]', [7000.0, 0.1, 270.0, 30.0, 398600.4418], 1670.595), ('elliptic time of flight between anomalies [26560.0, 0.7, 10.0, 350.0, 398600.4418]', [26560.0, 0.7, 10.0, 350.0, 398600.4418], 42774.887), ('elliptic time of flight between anomalies [26560.0, 0.7, 180.0, 200.0, 398600.4418]', [26560.0, 0.7, 180.0, 200.0, 398600.4418], 8874.68)], [('elliptic time of flight between anomalies [7000.0, 0.1, 270.0, 30.0, 398600.4418]', [7000.0, 0.1, 270.0, 30.0, 398600.4418], 1670.595), ('elliptic time of flight between anomalies [7000.0, 0.1, 0.0, 90.0, 398600.4418]', [7000.0, 0.1, 0.0, 90.0, 398600.4418], 1271.911), ('elliptic time of flight between anomalies [26560.0, 0.7, 10.0, 350.0, 398600.4418]', [26560.0, 0.7, 10.0, 350.0, 398600.4418], 42774.887), ('elliptic time of flight between anomalies [26560.0, 0.7, 180.0, 200.0, 398600.4418]', [26560.0, 0.7, 180.0, 200.0, 398600.4418], 8874.68), ('elliptic time of flight between anomalies [1.0, 0.5, 45.0, 45.0, 1.0]', [1.0, 0.5, 45.0, 45.0, 1.0], 0.0), ('elliptic time of flight between anomalies [1.0, 0.3, 300.0, 60.0, 1.0]', [1.0, 0.3, 300.0, 60.0, 1.0], 1.172), ('elliptic time of flight between anomalies [1.0, 0.0, 0.0, 180.0, 1.0]', [1.0, 0.0, 0.0, 180.0, 1.0], 3.142)], [('elliptic time of flight between anomalies [1.0, 0.3, 300.0, 60.0, 1.0]', [1.0, 0.3, 300.0, 60.0, 1.0], 1.172), ('elliptic time of flight between anomalies [26560.0, 0.7, 180.0, 200.0, 398600.4418]', [26560.0, 0.7, 180.0, 200.0, 398600.4418], 8874.68), ('elliptic time of flight between anomalies [1.0, 0.5, 45.0, 45.0, 1.0]', [1.0, 0.5, 45.0, 45.0, 1.0], 0.0), ('elliptic time of flight between anomalies [1.0, 0.0, 0.0, 180.0, 1.0]', [1.0, 0.0, 0.0, 180.0, 1.0], 3.142), ('elliptic time of flight between anomalies [2.0, 0.9, 170.0, 190.0, 1.0]', [2.0, 0.9, 170.0, 190.0, 1.0], 7.512), ('elliptic time of flight between anomalies [2.0, 0.9, 350.0, 10.0, 1.0]', [2.0, 0.9, 350.0, 10.0, 1.0], 0.023), ('elliptic time of flight between anomalies [7000.0, 0.1, 0.0, 90.0, 398600.4418]', [7000.0, 0.1, 0.0, 90.0, 398600.4418], 1271.911)]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
elliptic time of flight between anomalies [7000.0, 0.1, 270.0, 30.0, 398600.4418]-4157.9221670.595Failed
elliptic time of flight between anomalies [7000.0, 0.1, 0.0, 90.0, 398600.4418]1271.9111271.911Passed
elliptic time of flight between anomalies [26560.0, 0.7, 10.0, 350.0, 398600.4418]42774.88742774.887Passed
elliptic time of flight between anomalies [26560.0, 0.7, 180.0, 200.0, 398600.4418]8874.688874.68Passed
elliptic time of flight between anomalies [1.0, 0.5, 45.0, 45.0, 1.0]0.00.0Passed
elliptic time of flight between anomalies [1.0, 0.3, 300.0, 60.0, 1.0]-5.1111.172Failed
elliptic time of flight between anomalies [1.0, 0.0, 0.0, 180.0, 1.0]3.1423.142Passed

SHA-256 / 7bd72d0067032a4bec5994de42093ec62f42851ed5864008dc3d3a70e8bce511

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    a,e,n1,n2,mu=x
    def Ma(nu):
        nu=math.radians(nu)
        E=2*math.atan2(math.sqrt(1-e)*math.sin(nu/2),math.sqrt(1+e)*math.cos(nu/2))
        return (E-e*math.sin(E))%(2*math.pi)
    n=math.sqrt(mu/a**3)
    dM=abs(Ma(n2)-Ma(n1))
    return round(dM/n,3)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('elliptic time of flight between anomalies [7000.0, 0.1, 270.0, 30.0, 398600.4418]', [7000.0, 0.1, 270.0, 30.0, 398600.4418], 1670.595), ('elliptic time of flight between anomalies [7000.0, 0.1, 0.0, 90.0, 398600.4418]', [7000.0, 0.1, 0.0, 90.0, 398600.4418], 1271.911), ('elliptic time of flight between anomalies [26560.0, 0.7, 10.0, 350.0, 398600.4418]', [26560.0, 0.7, 10.0, 350.0, 398600.4418], 42774.887), ('elliptic time of flight between anomalies [26560.0, 0.7, 180.0, 200.0, 398600.4418]', [26560.0, 0.7, 180.0, 200.0, 398600.4418], 8874.68), ('elliptic time of flight between anomalies [1.0, 0.5, 45.0, 45.0, 1.0]', [1.0, 0.5, 45.0, 45.0, 1.0], 0.0), ('elliptic time of flight between anomalies [1.0, 0.3, 300.0, 60.0, 1.0]', [1.0, 0.3, 300.0, 60.0, 1.0], 1.172), ('elliptic time of flight between anomalies [1.0, 0.0, 0.0, 180.0, 1.0]', [1.0, 0.0, 0.0, 180.0, 1.0], 3.142)], [('elliptic time of flight between anomalies [1.0, 0.3, 300.0, 60.0, 1.0]', [1.0, 0.3, 300.0, 60.0, 1.0], 1.172), ('elliptic time of flight between anomalies [26560.0, 0.7, 180.0, 200.0, 398600.4418]', [26560.0, 0.7, 180.0, 200.0, 398600.4418], 8874.68), ('elliptic time of flight between anomalies [1.0, 0.5, 45.0, 45.0, 1.0]', [1.0, 0.5, 45.0, 45.0, 1.0], 0.0), ('elliptic time of flight between anomalies [1.0, 0.0, 0.0, 180.0, 1.0]', [1.0, 0.0, 0.0, 180.0, 1.0], 3.142), ('elliptic time of flight between anomalies [2.0, 0.9, 170.0, 190.0, 1.0]', [2.0, 0.9, 170.0, 190.0, 1.0], 7.512), ('elliptic time of flight between anomalies [2.0, 0.9, 350.0, 10.0, 1.0]', [2.0, 0.9, 350.0, 10.0, 1.0], 0.023), ('elliptic time of flight between anomalies [7000.0, 0.1, 0.0, 90.0, 398600.4418]', [7000.0, 0.1, 0.0, 90.0, 398600.4418], 1271.911)], [('elliptic time of flight between anomalies [2.0, 0.9, 350.0, 10.0, 1.0]', [2.0, 0.9, 350.0, 10.0, 1.0], 0.023), ('elliptic time of flight between anomalies [1.0, 0.0, 0.0, 180.0, 1.0]', [1.0, 0.0, 0.0, 180.0, 1.0], 3.142), ('elliptic time of flight between anomalies [2.0, 0.9, 170.0, 190.0, 1.0]', [2.0, 0.9, 170.0, 190.0, 1.0], 7.512), ('elliptic time of flight between anomalies [7000.0, 0.1, 0.0, 90.0, 398600.4418]', [7000.0, 0.1, 0.0, 90.0, 398600.4418], 1271.911), ('elliptic time of flight between anomalies [7000.0, 0.1, 270.0, 30.0, 398600.4418]', [7000.0, 0.1, 270.0, 30.0, 398600.4418], 1670.595), ('elliptic time of flight between anomalies [26560.0, 0.7, 10.0, 350.0, 398600.4418]', [26560.0, 0.7, 10.0, 350.0, 398600.4418], 42774.887), ('elliptic time of flight between anomalies [26560.0, 0.7, 180.0, 200.0, 398600.4418]', [26560.0, 0.7, 180.0, 200.0, 398600.4418], 8874.68)], [('elliptic time of flight between anomalies [7000.0, 0.1, 270.0, 30.0, 398600.4418]', [7000.0, 0.1, 270.0, 30.0, 398600.4418], 1670.595), ('elliptic time of flight between anomalies [7000.0, 0.1, 0.0, 90.0, 398600.4418]', [7000.0, 0.1, 0.0, 90.0, 398600.4418], 1271.911), ('elliptic time of flight between anomalies [26560.0, 0.7, 10.0, 350.0, 398600.4418]', [26560.0, 0.7, 10.0, 350.0, 398600.4418], 42774.887), ('elliptic time of flight between anomalies [26560.0, 0.7, 180.0, 200.0, 398600.4418]', [26560.0, 0.7, 180.0, 200.0, 398600.4418], 8874.68), ('elliptic time of flight between anomalies [1.0, 0.5, 45.0, 45.0, 1.0]', [1.0, 0.5, 45.0, 45.0, 1.0], 0.0), ('elliptic time of flight between anomalies [1.0, 0.3, 300.0, 60.0, 1.0]', [1.0, 0.3, 300.0, 60.0, 1.0], 1.172), ('elliptic time of flight between anomalies [1.0, 0.0, 0.0, 180.0, 1.0]', [1.0, 0.0, 0.0, 180.0, 1.0], 3.142)], [('elliptic time of flight between anomalies [1.0, 0.3, 300.0, 60.0, 1.0]', [1.0, 0.3, 300.0, 60.0, 1.0], 1.172), ('elliptic time of flight between anomalies [26560.0, 0.7, 180.0, 200.0, 398600.4418]', [26560.0, 0.7, 180.0, 200.0, 398600.4418], 8874.68), ('elliptic time of flight between anomalies [1.0, 0.5, 45.0, 45.0, 1.0]', [1.0, 0.5, 45.0, 45.0, 1.0], 0.0), ('elliptic time of flight between anomalies [1.0, 0.0, 0.0, 180.0, 1.0]', [1.0, 0.0, 0.0, 180.0, 1.0], 3.142), ('elliptic time of flight between anomalies [2.0, 0.9, 170.0, 190.0, 1.0]', [2.0, 0.9, 170.0, 190.0, 1.0], 7.512), ('elliptic time of flight between anomalies [2.0, 0.9, 350.0, 10.0, 1.0]', [2.0, 0.9, 350.0, 10.0, 1.0], 0.023), ('elliptic time of flight between anomalies [7000.0, 0.1, 0.0, 90.0, 398600.4418]', [7000.0, 0.1, 0.0, 90.0, 398600.4418], 1271.911)]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
elliptic time of flight between anomalies [7000.0, 0.1, 270.0, 30.0, 398600.4418]4157.9221670.595Failed
elliptic time of flight between anomalies [7000.0, 0.1, 0.0, 90.0, 398600.4418]1271.9111271.911Passed
elliptic time of flight between anomalies [26560.0, 0.7, 10.0, 350.0, 398600.4418]42774.88742774.887Passed
elliptic time of flight between anomalies [26560.0, 0.7, 180.0, 200.0, 398600.4418]8874.688874.68Passed
elliptic time of flight between anomalies [1.0, 0.5, 45.0, 45.0, 1.0]0.00.0Passed
elliptic time of flight between anomalies [1.0, 0.3, 300.0, 60.0, 1.0]5.1111.172Failed
elliptic time of flight between anomalies [1.0, 0.0, 0.0, 180.0, 1.0]3.1423.142Passed

SHA-256 / b9072fbef94753c3061e9ba396d539a179db13addc710c2b05db58c518bb20c6

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

A deterministic toy two-body model with stipulated constants and conventions; not flight dynamics software or a validated SGP4 implementation. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:48:13.862107+00:00.

Case digest / 346421e8e8c942ff2f29201f643e75b8d358c8ed24240b6c601e55fc20659656