FA-66236 / Aviation weight and balance / Open access
Ground CG taken as the plain average of item arms · case 01
A light item far aft moves the computed CG as much as the airframe itself.
ROOT CAUSE
The CG ignores item weights and averages arms.
VERIFIED REPAIR
Compute CG as total moment divided by total weight.
Unsuccessful approach: Rounding the CG to a whole inch before splitting gear loads changes reactions and the tip decision.
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 = sum(b for _, b in x['items']) / len(x['items'])
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', 1599.3, 8910.7] | ['OK', 1762.2, 8747.8] | Failed |
| aft cargo light nose | ['TIP', 300.5] | ['LIGHT_NOSE', 54.3, 11445.7] | Failed |
| CG exactly over mains | ['TIP', 290.0] | ['TIP', 290.0] | Passed |
| tail tipping | ['TIP', 308.0] | ['TIP', 296.5] | Failed |
| nose exactly five percent | ['OK', 500.0, 9500.0] | ['OK', 500.0, 9500.0] | Passed |
| forward loading | ['OK', 4495.2, 5304.8] | ['OK', 2160.0, 7640.0] | Failed |
| CG a hair forward of mains | ['LIGHT_NOSE', 0.2, 9999.8] | ['LIGHT_NOSE', 0.2, 9999.8] | Passed |
| sampled case 1 | ['OK', 5419.4, 8019.6] | ['OK', 4549.9, 8889.1] | Failed |
| sampled case 2 | ['OK', 5161.1, 1737.9] | ['OK', 4891.9, 2007.1] | Failed |
| sampled case 3 | ['OK', 3185.8, 2368.2] | ['OK', 3207.8, 2346.2] | Failed |
SHA-256 / 6654575dd44746a87d4ce0d43aa803ef4398361b264eeab5fb6a627dde56ebe0
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 = round(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', 1782.1, 8727.9] | ['OK', 1762.2, 8747.8] | Failed |
| aft cargo light nose | ['LIGHT_NOSE', 50.0, 11450.0] | ['LIGHT_NOSE', 54.3, 11445.7] | Failed |
| CG exactly over mains | ['TIP', 290] | ['TIP', 290.0] | Passed |
| tail tipping | ['TIP', 296] | ['TIP', 296.5] | Failed |
| nose exactly five percent | ['OK', 521.7, 9478.3] | ['OK', 500.0, 9500.0] | Failed |
| forward loading | ['OK', 2173.0, 7627.0] | ['OK', 2160.0, 7640.0] | Failed |
| CG a hair forward of mains | ['TIP', 290] | ['LIGHT_NOSE', 0.2, 9999.8] | Failed |
| sampled case 1 | ['OK', 4557.6, 8881.4] | ['OK', 4549.9, 8889.1] | Failed |
| sampled case 2 | ['OK', 4895.0, 2004.0] | ['OK', 4891.9, 2007.1] | Failed |
| sampled case 3 | ['OK', 3199.1, 2354.9] | ['OK', 3207.8, 2346.2] | Failed |
SHA-256 / a19e4e47a605ce7ed351d190f8598abfd0f9cce85dc3bf6fafceb9cd476ef9ed
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.238384+00:00.
Case digest / 54749a31d4e34714fed1e0e987eede1749bde81cb9ca205f5f9eecc70e4439d5