FA-66221 / Aviation weight and balance / Open access
CG exactly over the main gear reported as light nose · case 01
An aircraft balanced exactly on the mains is reported LIGHT_NOSE with zero nose load instead of TIP.
ROOT CAUSE
The tip test is strict, so a CG exactly at the main gear arm is not treated as tipping.
VERIFIED REPAIR
Treat CG at or aft of the main gear as a tipping condition.
Unsuccessful approach: A 0.01 in margin reports aircraft just forward of the mains as tipping.
Case contract
Input {'items':[[lb,arm]],'main_arm','nose_arm'}. CG at or aft of the main gear -> ['TIP', CG r2]. Otherwise nose reaction = W*(main-CG)/(main-nose), main = W - nose; status 'LIGHT_NOSE' if nose < 5% of total weight else 'OK'. Return [status, nose r1, main r1].
Why this case matters
Ground stability depends on the split of weight between nose and main gear; a CG over or behind the mains tips the aircraft onto its tail.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
w = sum(a for a, _ in x['items'])
m = sum(a * b for a, b in x['items'])
cg = m / w
mg, ng = x['main_arm'], x['nose_arm']
if cg > mg: return ['TIP', round(cg, 2)]
nose = w * (mg - cg) / (mg - ng)
main = w - nose
status = 'LIGHT_NOSE' if nose < 0.05 * w else 'OK'
return [status, round(nose, 1), round(main, 1)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['normal ground load', {'items': [[9000.0, 250.0], [1510.0, 260.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 1762.2, 8747.8]], ['aft cargo light nose', {'items': [[9000.0, 280.0], [2500.0, 321.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 54.3, 11445.7]], ['CG exactly over mains', {'items': [[9000.0, 290.0], [1000.0, 290.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 290.0]], ['tail tipping', {'items': [[9000.0, 285.0], [3000.0, 331.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 296.5]], ['nose exactly five percent', {'items': [[10000.0, 278.5]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 500.0, 9500.0]], ['forward loading', {'items': [[9000.0, 250.0], [800.0, 119.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 2160.0, 7640.0]], ['CG a hair forward of mains', {'items': [[10000.0, 289.995]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 0.2, 9999.8]], ['sampled case 1', {'items': [[8891.0, 243.3], [4548.0, 151.2]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 4549.9, 8889.1]], ['sampled case 2', {'items': [[836.0, 112.7], [2149.0, 136.1], [3914.0, 149.9]], 'main_arm': 290.0, 'nose_arm': 80.0}, ['OK', 4891.9, 2007.1]], ['sampled case 3', {'items': [[2341.0, 136.2], [1333.0, 147.9], [1880.0, 155.7]], 'main_arm': 290.0, 'nose_arm': 40.0}, ['OK', 3207.8, 2346.2]]], [['normal ground load', {'items': [[9000.0, 250.0], [1520.0, 260.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 1763.5, 8756.5]], ['aft cargo light nose', {'items': [[9000.0, 280.0], [2500.0, 322.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 43.5, 11456.5]], ['CG exactly over mains', {'items': [[9000.0, 290.0], [1000.0, 290.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 290.0]], ['tail tipping', {'items': [[9000.0, 285.0], [3000.0, 332.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 296.75]], ['nose exactly five percent', {'items': [[10000.0, 278.5]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 500.0, 9500.0]], ['forward loading', {'items': [[9000.0, 250.0], [800.0, 118.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 2163.5, 7636.5]], ['CG a hair forward of mains', {'items': [[10000.0, 289.995]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 0.2, 9999.8]], ['sampled case 1', {'items': [[966.0, 212.0], [6090.0, 178.6], [4538.0, 174.9], [1442.0, 103.6]], 'main_arm': 290.0, 'nose_arm': 80.0}, ['OK', 7356.6, 5679.4]], ['sampled case 2', {'items': [[4506.0, 204.0], [8513.0, 219.6]], 'main_arm': 290.0, 'nose_arm': 40.0}, ['OK', 3947.3, 9071.7]], ['sampled case 3', {'items': [[8984.0, 243.5], [6602.0, 268.8]], 'main_arm': 290.0, 'nose_arm': 80.0}, ['OK', 2655.8, 12930.2]]], [['normal ground load', {'items': [[9000.0, 250.0], [1530.0, 260.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 1764.8, 8765.2]], ['aft cargo light nose', {'items': [[9000.0, 280.0], [2500.0, 323.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 32.6, 11467.4]], ['CG exactly over mains', {'items': [[9000.0, 290.0], [1000.0, 290.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 290.0]], ['tail tipping', {'items': [[9000.0, 285.0], [3000.0, 333.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 297.0]], ['nose exactly five percent', {'items': [[10000.0, 278.5]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 500.0, 9500.0]], ['forward loading', {'items': [[9000.0, 250.0], [800.0, 117.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 2167.0, 7633.0]], ['CG a hair forward of mains', {'items': [[10000.0, 289.995]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 0.2, 9999.8]], ['sampled case 1', {'items': [[8812.0, 250.9]], 'main_arm': 290.0, 'nose_arm': 80.0}, ['OK', 1640.7, 7171.3]], ['sampled case 2', {'items': [[4325.0, 295.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 295.0]], ['sampled case 3', {'items': [[7004.0, 198.3], [410.0, 239.6], [2416.0, 150.2]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 4350.8, 5479.2]]], [['normal ground load', {'items': [[9000.0, 250.0], [1540.0, 260.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 1766.1, 8773.9]], ['aft cargo light nose', {'items': [[9000.0, 280.0], [2500.0, 324.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 21.7, 11478.3]], ['CG exactly over mains', {'items': [[9000.0, 290.0], [1000.0, 290.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 290.0]], ['tail tipping', {'items': [[9000.0, 285.0], [3000.0, 334.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 297.25]], ['nose exactly five percent', {'items': [[10000.0, 278.5]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 500.0, 9500.0]], ['forward loading', {'items': [[9000.0, 250.0], [800.0, 116.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 2170.4, 7629.6]], ['CG a hair forward of mains', {'items': [[10000.0, 289.995]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 0.2, 9999.8]], ['sampled case 1', {'items': [[1599.0, 205.2]], 'main_arm': 290.0, 'nose_arm': 80.0}, ['OK', 645.7, 953.3]], ['sampled case 2', {'items': [[283.0, 287.5], [2116.0, 231.6], [600.0, 209.2]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 751.1, 2247.9]], ['sampled case 3', {'items': [[2210.0, 260.8]], 'main_arm': 290.0, 'nose_arm': 40.0}, ['OK', 258.1, 1951.9]]], [['normal ground load', {'items': [[9000.0, 250.0], [1550.0, 260.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 1767.4, 8782.6]], ['aft cargo light nose', {'items': [[9000.0, 280.0], [2500.0, 325.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 10.9, 11489.1]], ['CG exactly over mains', {'items': [[9000.0, 290.0], [1000.0, 290.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 290.0]], ['tail tipping', {'items': [[9000.0, 285.0], [3000.0, 335.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 297.5]], ['nose exactly five percent', {'items': [[10000.0, 278.5]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 500.0, 9500.0]], ['forward loading', {'items': [[9000.0, 250.0], [800.0, 115.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 2173.9, 7626.1]], ['CG a hair forward of mains', {'items': [[10000.0, 289.995]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 0.2, 9999.8]], ['sampled case 1', {'items': [[649.0, 272.6]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 49.1, 599.9]], ['sampled case 2', {'items': [[6458.0, 136.9], [8392.0, 168.7]], 'main_arm': 290.0, 'nose_arm': 40.0}, ['OK', 8026.7, 6823.3]], ['sampled case 3', {'items': [[8932.0, 311.4]], 'main_arm': 290.0, 'nose_arm': 80.0}, ['TIP', 311.4]]]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| normal ground load | ['OK', 1762.2, 8747.8] | ['OK', 1762.2, 8747.8] | Passed |
| aft cargo light nose | ['LIGHT_NOSE', 54.3, 11445.7] | ['LIGHT_NOSE', 54.3, 11445.7] | Passed |
| CG exactly over mains | ['LIGHT_NOSE', 0.0, 10000.0] | ['TIP', 290.0] | Failed |
| tail tipping | ['TIP', 296.5] | ['TIP', 296.5] | Passed |
| nose exactly five percent | ['OK', 500.0, 9500.0] | ['OK', 500.0, 9500.0] | Passed |
| forward loading | ['OK', 2160.0, 7640.0] | ['OK', 2160.0, 7640.0] | Passed |
| CG a hair forward of mains | ['LIGHT_NOSE', 0.2, 9999.8] | ['LIGHT_NOSE', 0.2, 9999.8] | Passed |
| sampled case 1 | ['OK', 4549.9, 8889.1] | ['OK', 4549.9, 8889.1] | Passed |
| sampled case 2 | ['OK', 4891.9, 2007.1] | ['OK', 4891.9, 2007.1] | Passed |
| sampled case 3 | ['OK', 3207.8, 2346.2] | ['OK', 3207.8, 2346.2] | Passed |
SHA-256 / 56206c3e15421e678269238be617bfb1fb47405d17ad5392396f054afb2a151e
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
w = sum(a for a, _ in x['items'])
m = sum(a * b for a, b in x['items'])
cg = m / w
mg, ng = x['main_arm'], x['nose_arm']
if cg > mg - 0.01: return ['TIP', round(cg, 2)]
nose = w * (mg - cg) / (mg - ng)
main = w - nose
status = 'LIGHT_NOSE' if nose < 0.05 * w else 'OK'
return [status, round(nose, 1), round(main, 1)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['normal ground load', {'items': [[9000.0, 250.0], [1510.0, 260.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 1762.2, 8747.8]], ['aft cargo light nose', {'items': [[9000.0, 280.0], [2500.0, 321.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 54.3, 11445.7]], ['CG exactly over mains', {'items': [[9000.0, 290.0], [1000.0, 290.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 290.0]], ['tail tipping', {'items': [[9000.0, 285.0], [3000.0, 331.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 296.5]], ['nose exactly five percent', {'items': [[10000.0, 278.5]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 500.0, 9500.0]], ['forward loading', {'items': [[9000.0, 250.0], [800.0, 119.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 2160.0, 7640.0]], ['CG a hair forward of mains', {'items': [[10000.0, 289.995]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 0.2, 9999.8]], ['sampled case 1', {'items': [[8891.0, 243.3], [4548.0, 151.2]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 4549.9, 8889.1]], ['sampled case 2', {'items': [[836.0, 112.7], [2149.0, 136.1], [3914.0, 149.9]], 'main_arm': 290.0, 'nose_arm': 80.0}, ['OK', 4891.9, 2007.1]], ['sampled case 3', {'items': [[2341.0, 136.2], [1333.0, 147.9], [1880.0, 155.7]], 'main_arm': 290.0, 'nose_arm': 40.0}, ['OK', 3207.8, 2346.2]]], [['normal ground load', {'items': [[9000.0, 250.0], [1520.0, 260.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 1763.5, 8756.5]], ['aft cargo light nose', {'items': [[9000.0, 280.0], [2500.0, 322.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 43.5, 11456.5]], ['CG exactly over mains', {'items': [[9000.0, 290.0], [1000.0, 290.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 290.0]], ['tail tipping', {'items': [[9000.0, 285.0], [3000.0, 332.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 296.75]], ['nose exactly five percent', {'items': [[10000.0, 278.5]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 500.0, 9500.0]], ['forward loading', {'items': [[9000.0, 250.0], [800.0, 118.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 2163.5, 7636.5]], ['CG a hair forward of mains', {'items': [[10000.0, 289.995]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 0.2, 9999.8]], ['sampled case 1', {'items': [[966.0, 212.0], [6090.0, 178.6], [4538.0, 174.9], [1442.0, 103.6]], 'main_arm': 290.0, 'nose_arm': 80.0}, ['OK', 7356.6, 5679.4]], ['sampled case 2', {'items': [[4506.0, 204.0], [8513.0, 219.6]], 'main_arm': 290.0, 'nose_arm': 40.0}, ['OK', 3947.3, 9071.7]], ['sampled case 3', {'items': [[8984.0, 243.5], [6602.0, 268.8]], 'main_arm': 290.0, 'nose_arm': 80.0}, ['OK', 2655.8, 12930.2]]], [['normal ground load', {'items': [[9000.0, 250.0], [1530.0, 260.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 1764.8, 8765.2]], ['aft cargo light nose', {'items': [[9000.0, 280.0], [2500.0, 323.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 32.6, 11467.4]], ['CG exactly over mains', {'items': [[9000.0, 290.0], [1000.0, 290.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 290.0]], ['tail tipping', {'items': [[9000.0, 285.0], [3000.0, 333.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 297.0]], ['nose exactly five percent', {'items': [[10000.0, 278.5]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 500.0, 9500.0]], ['forward loading', {'items': [[9000.0, 250.0], [800.0, 117.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 2167.0, 7633.0]], ['CG a hair forward of mains', {'items': [[10000.0, 289.995]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 0.2, 9999.8]], ['sampled case 1', {'items': [[8812.0, 250.9]], 'main_arm': 290.0, 'nose_arm': 80.0}, ['OK', 1640.7, 7171.3]], ['sampled case 2', {'items': [[4325.0, 295.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 295.0]], ['sampled case 3', {'items': [[7004.0, 198.3], [410.0, 239.6], [2416.0, 150.2]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 4350.8, 5479.2]]], [['normal ground load', {'items': [[9000.0, 250.0], [1540.0, 260.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 1766.1, 8773.9]], ['aft cargo light nose', {'items': [[9000.0, 280.0], [2500.0, 324.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 21.7, 11478.3]], ['CG exactly over mains', {'items': [[9000.0, 290.0], [1000.0, 290.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 290.0]], ['tail tipping', {'items': [[9000.0, 285.0], [3000.0, 334.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 297.25]], ['nose exactly five percent', {'items': [[10000.0, 278.5]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 500.0, 9500.0]], ['forward loading', {'items': [[9000.0, 250.0], [800.0, 116.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 2170.4, 7629.6]], ['CG a hair forward of mains', {'items': [[10000.0, 289.995]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 0.2, 9999.8]], ['sampled case 1', {'items': [[1599.0, 205.2]], 'main_arm': 290.0, 'nose_arm': 80.0}, ['OK', 645.7, 953.3]], ['sampled case 2', {'items': [[283.0, 287.5], [2116.0, 231.6], [600.0, 209.2]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 751.1, 2247.9]], ['sampled case 3', {'items': [[2210.0, 260.8]], 'main_arm': 290.0, 'nose_arm': 40.0}, ['OK', 258.1, 1951.9]]], [['normal ground load', {'items': [[9000.0, 250.0], [1550.0, 260.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 1767.4, 8782.6]], ['aft cargo light nose', {'items': [[9000.0, 280.0], [2500.0, 325.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 10.9, 11489.1]], ['CG exactly over mains', {'items': [[9000.0, 290.0], [1000.0, 290.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 290.0]], ['tail tipping', {'items': [[9000.0, 285.0], [3000.0, 335.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 297.5]], ['nose exactly five percent', {'items': [[10000.0, 278.5]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 500.0, 9500.0]], ['forward loading', {'items': [[9000.0, 250.0], [800.0, 115.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 2173.9, 7626.1]], ['CG a hair forward of mains', {'items': [[10000.0, 289.995]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 0.2, 9999.8]], ['sampled case 1', {'items': [[649.0, 272.6]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 49.1, 599.9]], ['sampled case 2', {'items': [[6458.0, 136.9], [8392.0, 168.7]], 'main_arm': 290.0, 'nose_arm': 40.0}, ['OK', 8026.7, 6823.3]], ['sampled case 3', {'items': [[8932.0, 311.4]], 'main_arm': 290.0, 'nose_arm': 80.0}, ['TIP', 311.4]]]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| normal ground load | ['OK', 1762.2, 8747.8] | ['OK', 1762.2, 8747.8] | Passed |
| aft cargo light nose | ['LIGHT_NOSE', 54.3, 11445.7] | ['LIGHT_NOSE', 54.3, 11445.7] | Passed |
| CG exactly over mains | ['TIP', 290.0] | ['TIP', 290.0] | Passed |
| tail tipping | ['TIP', 296.5] | ['TIP', 296.5] | Passed |
| nose exactly five percent | ['OK', 500.0, 9500.0] | ['OK', 500.0, 9500.0] | Passed |
| forward loading | ['OK', 2160.0, 7640.0] | ['OK', 2160.0, 7640.0] | Passed |
| CG a hair forward of mains | ['TIP', 290.0] | ['LIGHT_NOSE', 0.2, 9999.8] | Failed |
| sampled case 1 | ['OK', 4549.9, 8889.1] | ['OK', 4549.9, 8889.1] | Passed |
| sampled case 2 | ['OK', 4891.9, 2007.1] | ['OK', 4891.9, 2007.1] | Passed |
| sampled case 3 | ['OK', 3207.8, 2346.2] | ['OK', 3207.8, 2346.2] | Passed |
SHA-256 / 02e9bb106cf4876c39dc8b2ff790847340380321dfcae1cff078b42d227998fd
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
w = sum(a for a, _ in x['items'])
m = sum(a * b for a, b in x['items'])
cg = m / w
mg, ng = x['main_arm'], x['nose_arm']
if cg >= mg: return ['TIP', round(cg, 2)]
nose = w * (mg - cg) / (mg - ng)
main = w - nose
status = 'LIGHT_NOSE' if nose < 0.05 * w else 'OK'
return [status, round(nose, 1), round(main, 1)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['normal ground load', {'items': [[9000.0, 250.0], [1510.0, 260.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 1762.2, 8747.8]], ['aft cargo light nose', {'items': [[9000.0, 280.0], [2500.0, 321.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 54.3, 11445.7]], ['CG exactly over mains', {'items': [[9000.0, 290.0], [1000.0, 290.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 290.0]], ['tail tipping', {'items': [[9000.0, 285.0], [3000.0, 331.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 296.5]], ['nose exactly five percent', {'items': [[10000.0, 278.5]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 500.0, 9500.0]], ['forward loading', {'items': [[9000.0, 250.0], [800.0, 119.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 2160.0, 7640.0]], ['CG a hair forward of mains', {'items': [[10000.0, 289.995]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 0.2, 9999.8]], ['sampled case 1', {'items': [[8891.0, 243.3], [4548.0, 151.2]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 4549.9, 8889.1]], ['sampled case 2', {'items': [[836.0, 112.7], [2149.0, 136.1], [3914.0, 149.9]], 'main_arm': 290.0, 'nose_arm': 80.0}, ['OK', 4891.9, 2007.1]], ['sampled case 3', {'items': [[2341.0, 136.2], [1333.0, 147.9], [1880.0, 155.7]], 'main_arm': 290.0, 'nose_arm': 40.0}, ['OK', 3207.8, 2346.2]]], [['normal ground load', {'items': [[9000.0, 250.0], [1520.0, 260.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 1763.5, 8756.5]], ['aft cargo light nose', {'items': [[9000.0, 280.0], [2500.0, 322.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 43.5, 11456.5]], ['CG exactly over mains', {'items': [[9000.0, 290.0], [1000.0, 290.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 290.0]], ['tail tipping', {'items': [[9000.0, 285.0], [3000.0, 332.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 296.75]], ['nose exactly five percent', {'items': [[10000.0, 278.5]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 500.0, 9500.0]], ['forward loading', {'items': [[9000.0, 250.0], [800.0, 118.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 2163.5, 7636.5]], ['CG a hair forward of mains', {'items': [[10000.0, 289.995]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 0.2, 9999.8]], ['sampled case 1', {'items': [[966.0, 212.0], [6090.0, 178.6], [4538.0, 174.9], [1442.0, 103.6]], 'main_arm': 290.0, 'nose_arm': 80.0}, ['OK', 7356.6, 5679.4]], ['sampled case 2', {'items': [[4506.0, 204.0], [8513.0, 219.6]], 'main_arm': 290.0, 'nose_arm': 40.0}, ['OK', 3947.3, 9071.7]], ['sampled case 3', {'items': [[8984.0, 243.5], [6602.0, 268.8]], 'main_arm': 290.0, 'nose_arm': 80.0}, ['OK', 2655.8, 12930.2]]], [['normal ground load', {'items': [[9000.0, 250.0], [1530.0, 260.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 1764.8, 8765.2]], ['aft cargo light nose', {'items': [[9000.0, 280.0], [2500.0, 323.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 32.6, 11467.4]], ['CG exactly over mains', {'items': [[9000.0, 290.0], [1000.0, 290.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 290.0]], ['tail tipping', {'items': [[9000.0, 285.0], [3000.0, 333.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 297.0]], ['nose exactly five percent', {'items': [[10000.0, 278.5]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 500.0, 9500.0]], ['forward loading', {'items': [[9000.0, 250.0], [800.0, 117.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 2167.0, 7633.0]], ['CG a hair forward of mains', {'items': [[10000.0, 289.995]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 0.2, 9999.8]], ['sampled case 1', {'items': [[8812.0, 250.9]], 'main_arm': 290.0, 'nose_arm': 80.0}, ['OK', 1640.7, 7171.3]], ['sampled case 2', {'items': [[4325.0, 295.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 295.0]], ['sampled case 3', {'items': [[7004.0, 198.3], [410.0, 239.6], [2416.0, 150.2]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 4350.8, 5479.2]]], [['normal ground load', {'items': [[9000.0, 250.0], [1540.0, 260.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 1766.1, 8773.9]], ['aft cargo light nose', {'items': [[9000.0, 280.0], [2500.0, 324.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 21.7, 11478.3]], ['CG exactly over mains', {'items': [[9000.0, 290.0], [1000.0, 290.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 290.0]], ['tail tipping', {'items': [[9000.0, 285.0], [3000.0, 334.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 297.25]], ['nose exactly five percent', {'items': [[10000.0, 278.5]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 500.0, 9500.0]], ['forward loading', {'items': [[9000.0, 250.0], [800.0, 116.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 2170.4, 7629.6]], ['CG a hair forward of mains', {'items': [[10000.0, 289.995]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 0.2, 9999.8]], ['sampled case 1', {'items': [[1599.0, 205.2]], 'main_arm': 290.0, 'nose_arm': 80.0}, ['OK', 645.7, 953.3]], ['sampled case 2', {'items': [[283.0, 287.5], [2116.0, 231.6], [600.0, 209.2]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 751.1, 2247.9]], ['sampled case 3', {'items': [[2210.0, 260.8]], 'main_arm': 290.0, 'nose_arm': 40.0}, ['OK', 258.1, 1951.9]]], [['normal ground load', {'items': [[9000.0, 250.0], [1550.0, 260.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 1767.4, 8782.6]], ['aft cargo light nose', {'items': [[9000.0, 280.0], [2500.0, 325.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 10.9, 11489.1]], ['CG exactly over mains', {'items': [[9000.0, 290.0], [1000.0, 290.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 290.0]], ['tail tipping', {'items': [[9000.0, 285.0], [3000.0, 335.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['TIP', 297.5]], ['nose exactly five percent', {'items': [[10000.0, 278.5]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 500.0, 9500.0]], ['forward loading', {'items': [[9000.0, 250.0], [800.0, 115.0]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 2173.9, 7626.1]], ['CG a hair forward of mains', {'items': [[10000.0, 289.995]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['LIGHT_NOSE', 0.2, 9999.8]], ['sampled case 1', {'items': [[649.0, 272.6]], 'main_arm': 290.0, 'nose_arm': 60.0}, ['OK', 49.1, 599.9]], ['sampled case 2', {'items': [[6458.0, 136.9], [8392.0, 168.7]], 'main_arm': 290.0, 'nose_arm': 40.0}, ['OK', 8026.7, 6823.3]], ['sampled case 3', {'items': [[8932.0, 311.4]], 'main_arm': 290.0, 'nose_arm': 80.0}, ['TIP', 311.4]]]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| normal ground load | ['OK', 1762.2, 8747.8] | ['OK', 1762.2, 8747.8] | Passed |
| aft cargo light nose | ['LIGHT_NOSE', 54.3, 11445.7] | ['LIGHT_NOSE', 54.3, 11445.7] | Passed |
| CG exactly over mains | ['TIP', 290.0] | ['TIP', 290.0] | Passed |
| tail tipping | ['TIP', 296.5] | ['TIP', 296.5] | Passed |
| nose exactly five percent | ['OK', 500.0, 9500.0] | ['OK', 500.0, 9500.0] | Passed |
| forward loading | ['OK', 2160.0, 7640.0] | ['OK', 2160.0, 7640.0] | Passed |
| CG a hair forward of mains | ['LIGHT_NOSE', 0.2, 9999.8] | ['LIGHT_NOSE', 0.2, 9999.8] | Passed |
| sampled case 1 | ['OK', 4549.9, 8889.1] | ['OK', 4549.9, 8889.1] | Passed |
| sampled case 2 | ['OK', 4891.9, 2007.1] | ['OK', 4891.9, 2007.1] | Passed |
| sampled case 3 | ['OK', 3207.8, 2346.2] | ['OK', 3207.8, 2346.2] | Passed |
SHA-256 / b806b1a487a374606ede77cb6427dfcfc0369016f31034f9fbc1c0a546e779a8
Verification & scope
A deterministic toy loading model with stipulated constants; it is not an approved aircraft flight manual procedure and makes no claim of regulatory conformance. 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:47:41.120376+00:00.
Case digest / ed8d138cfc6773f195ab4ea2ae84bd56189fa203c45c5f193ade38221545382e