Currently, almost all flight optimizers proposed in the literature stay close-sourced, which presents a major disadvantage for the advancement of scientific research.
OpenAP trajectory optimizer (openap.top) is going to change this. It offers researchers easy access to the complex but efficient direct collocation optimization approach. The optimizer adapts to meteorological conditions and can be employed in different flight phases separately or combined. It includes conventional fuel and cost index objectives, as well as climate metrics-based objectives using global warming or temperature potential.
Install
Install the development branch from GitHub:
pip install --upgrade git+https://github.com/junzis/openap-top
Install the stable release from pypi:
pip install --upgrade openap-top
Quick start
Example code to generate a fuel optimal flight between two airports:
import openap.top as otop
optimizer = otop.CompleteFlight("A320", "EHAM", "LGAV", m0=0.85)
flight = optimizer.trajectory(objective="fuel")
You can specify different objective functions as:
flight = optimizer.trajectory(objective="ci:30")
flight = optimizer.trajectory(objective="gwp100")
flight = optimizer.trajectory(objective="gtp100")
The final flight
object is a pandas DataFrame.
Use wind data
To enable wind in your optimizer, you must first download meteorological data in grib
format from ECMWF, for example, the ERA5 data at https://doi.org/10.24381/cds.bd0915c6.
Then enable the wind for the defined optimizer.
Example code:
import openap.top as otop
optimizer = otop.CompleteFlight("A320", "EHAM", "LGAV", m0=0.85)
fgrib = "path_to_the_wind_data.grib"
windfield = top.wind.read_grib(fgrib)
op.enable_wind(windfield)
flight = optimizer.trajectory(objective="fuel")
If your grib file includes multiple timestamps, make sure to filter the correct time in the previous windfield
object (pandas DataFrame).
Example of an optimal flight:
Visualization of the previous flight
using matplotlib
and cartopy
: