-
Notifications
You must be signed in to change notification settings - Fork 9
Performance models: abstraction, API, simplification #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Bah. My golden test is failing because, according to the airports data we download, Denver International Airport moved between the time I made the golden test output and now... I need to figure out some way of making those things stable for testing. For the moment I'll disable the golden test. |
|
OK, I fixed the golden test by making a test airports file that's fixed, based on the sample missions and other airports used in the test. There's a little bit of extra machinery to allow the configuration system to put that stable file "in front of" the normal airports file. Seems to work, and all the tests now pass on both platforms. |
This PR is an initial attempt to organize the performance model part of AEIC more clearly.
Changes
AEIC.performance.types.AircraftState, i.e. altitude, aircraft mass, requested airspeed, requested rate of climb/descent) and a "flight rule" and to get back performance data (AEIC.performance.types.Performance: actual achievable airspeed, actual achievable rate of climb/descent, fuel flow). "Flight rules" are things like "Mach climb", "constant ROCD climb", "constant altitude cruise", etc., although the current legacy performance model only supports "climb, cruise or descent" via theAEIC.performance.types.SimpleFlightRulestype.AEIC.performance.models.BasePerformanceModel. All of these classes are Pydantic models to enable easy initialization from TOML data. The base class has anevaluatemethod that does the performance calculations, and the derived classes have anevaluate_implmethod that actually implements the evaluation (see comments in the code for the reason for splitting things like this). Performance model classes are generic in a flight rules type: this allows for different levels of flight rule flexibility in different performance models. TheLegacyPerformanceModeluses a simple climb/cruise/descent enumeration (AEIC.performance.types.SimpleFlightRules), but a more complex performance model could have programmatic flight rules that a caller of theevaluatemethod can use to implement parameterizable flight rule behavior as required.AEIC.performance.models.PerformanceModel) is used to load performance models from TOML files. This has aloadmethod with a polymorphic return type that decides on what type of performance model to return based on amodel_typefield in the TOML input.PerformanceTableclass that makes the relationship between flight level and mass and the performance model output quantities more explicit, and that uses a simpler and clearer representation of the performance table data that makes the behavior of the model more legible.holdMass(nowhold_mass) value in thecalc_starting_massmethod was wrong (it wasn't a mass at all).make-performance-modelexecutable script has been created to generate (legacy) performance model TOML files from selected data sources. (This is not finished, and Adi and/or Wyatt will need to take a look at it. I think it's OK for the purposes of this PR, but it is definitely unfinished.)Questions
AEIC.utils.standard_atmosphereand one in the weather module. Can we either settle on one or document why we're using one or the other at any particular time?Requests
LegacyBuilder'scalc_starting_mass,fly_climb,fly_cruiseandfly_descentmethods? I believe that the behavior is now correct everywhere, but it would be good to have some other eyes on it. Thesimulation-checks.ipynbnotebook contains plots of all along-trajectory quantities for a single simulation, and it looks OK to me. (There are discontinuities in airspeed at top-of-climb and beginning-of-descent as the performance model switches between the different parts of the performance table, but those are the only obvious anomalies I've seen.)make-performance-modelscript and tell me what's missing/wrong? In particular, can I getFoo_kNfrom the engine database, and what's the deal with LTO files? (see above)AEIC.performance.types.Performanceisn't very good (it's the result of evaluating a performance model on an aircraft state). Also, can you think of a better name for theevaluatemethod on performance models (this is the main method that takes an aircraft state and returns the performance data)? I would also like an accurate descriptive name forFoo_kN!