Repository navigation
fix(performance): use the BADA3 OPF maximum payload in the mass estimate - #73
Merged
Merged
Conversation
BADA3Adapter.MPL always returned None, although pyBADA reads the maximum payload from the OPF file. The mass estimate then took MTOW - OEW as the payload, so with the default payload factor 1.0 the zero-fuel weight was MTOW and every BADA3 flight took off at MTOW. BADA4 flights already used their BADA maximum payload. BADA3Adapter.MPL now returns the OPF value, as BADA4Adapter.MPL does. The MTOW - OEW fallback is kept for a BADA file without MPL. The fuel-burn guardrail still uses MTOW - OEW on purpose. Updates the units audit (I4), the user docs that said BADA 3 has no MPL, and adds tests for the adapter and the mass estimate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BADA 3.16 U2____.OPF (also used by pyBADA for G850, GFLY, M17 and M55) gives a maximum payload of 0, which the mass estimate would take as zero payload (ZFW = OEW) whatever the payload factor. A missing, zero, negative or NaN MPL now falls back to MTOW - OEW with the warning. No type in the NEATS BADA mapping is affected; BADA 4.2.1 has no such value. Also corrects the I4 audit note (the -21 % minimum is a GLF5). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ramondalmau
added a commit
that referenced
this pull request
Oct 21, 2026
… the code runs them (#74) * docs: state the 15 % fuel reserve used in the initial mass estimate input-prioritization.md and mrv-specification.md gave the fuel reserve of the initial mass estimate as about 3 % of trip fuel. The code uses 15 % (DEFAULT_FUEL_RESERVE_FRACTION = 0.15, following Teoh et al. 2024). Records the item in the units audit (Section 9 and the follow-up status table) and sets the I4 status row to #73. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: describe the mass-estimate iterations as the code runs them The user docs said steps 2-4 of the mass estimate run twice. The code runs one constant-mass BADA pass, then up to three passes from the updated TOW, and stops when the TOW changes by 1 % or less of the previous TOW (max_mass_estimation_iter = 4, max_rel_mass_diff = 0.01). The last pass is kept; a BADA 3 or altitude-fallback retry starts the estimate again. Measured with the real code on the 4,303 computed NEATS_FINAL sample flights: 2,769 stop after two passes, 1,415 after three, 119 after four (3 of them at the cap with a change of 1.0-1.4 %). Recorded in the units audit, Section 9. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Audit item I4.
BADA3Adapter.MPLalways returnedNone, although pyBADA reads the maximum payload from the BADA3 OPF file. The mass estimate then used MTOW − OEW as the payload. With the default payload factor 1.0 that gives ZFW = MTOW, so every BADA3 flight took off at MTOW: 1,050 of 1,050 in the NEATS_FINAL sample.BADA4 flights already used their real maximum payload. The same aircraft therefore got two different masses depending on the BADA family. For the A20N, BADA 3.16 and 4.2.1 give identical MTOW 79 t, OEW 46 t and MPL 18.3 t, yet the BADA3 path was about 11 t heavier.
Change
BADA3Adapter.MPLreturns the OPF maximum payload, asBADA4Adapter.MPLalready does.U2____.OPFgives 0; pyBADA also uses that file for G850, GFLY, M17 and M55. None of these types is in the NEATS mapping.Effect on results (please review, Philippe)
Before/after on every flight of the NEATS_FINAL NM sample (4,959 flights), real code, no patches. The current
devreproduces production exactly on all 4,302 computed flights.dev)BADA3 per flight (fuel):
NOx falls more than fuel and nvPM number rises: both emission indices depend on thrust, which is lower at lower mass.
What to look at
src/pyneats/steps/performance/bada_adapters.py:BADA3Adapter.MPL(4 lines).src/pyneats/steps/performance/bada_model.py: the MPL guard in_estimate_initial_mass_iterative.docs/internal/pyneats_units_audit.md: the I4 note and the status table.Everything else is docstrings, user docs and tests.
Verification
tests/test_bada3_max_payload.py:Not in this PR
docs/explanation/input-prioritization.mdandmrv-specification.mdgive the fuel reserve as 3 % of trip fuel; the code uses 15 %. This is pre-existing and will be a separate fix.