Trajectory OPtimizer using OpenAP
Project description
OpenAP Trajectory Optimizer
This repository contains the flight trajectory optimizer module of OpenAP.
A more detailed user guide can be found at: https://openap.dev/top.
Install
OpenAP.top uses cfgrib
for integrating wind data, cartopy
for plotting, and a few other libraries. I recommend using conda
to install these dependencies. Following is an example how I set it up on my computer for testing.
- Create a new conda environment (
openap-env
) and install the necessary packages:
mamba create -n openap-env python=3.11 -c conda-forge
mamba activate openap-env
mamba install cfgrib cartopy casadi scikit-learn -c conda-forge
- Install the most recent version of
openap
:
pip install --upgrade git+https://github.com/junzis/openap
- Install the most recent version of
openap-top
:
pip install --upgrade git+https://github.com/junzis/openap-top
Quick start
Example code to generate a fuel-optimal flight between two airports:
from openap import top
optimizer = top.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. The following is an example:
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:
from openap import top
from openap.top import wind
optimizer = top.CompleteFlight("A320", "EHAM", "LGAV", m0=0.85)
fgrib = "path_to_the_wind_data.grib"
windfield = wind.read_grib(fgrib)
optimizer.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:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file openap_top-1.5.tar.gz
.
File metadata
- Download URL: openap_top-1.5.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.1 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d967d6700b22e613d3fad3e6a82f132be1609b12aa4ce42dcc29c9addbba08b |
|
MD5 | db44dd09727d920affcf4597107ac4a0 |
|
BLAKE2b-256 | f569619739b5276c0d337ddaf29dcc4bb888a158c6e4b8e95c56296187e3b3fa |
File details
Details for the file openap_top-1.5-py3-none-any.whl
.
File metadata
- Download URL: openap_top-1.5-py3-none-any.whl
- Upload date:
- Size: 27.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.1 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c471a111f54145c344b4744d68becb36896fd007dac4ccb119d0e9f4f759d9d |
|
MD5 | 93d1b4495951a396a9d7e9cc5c35035c |
|
BLAKE2b-256 | fe7c89e7fddbab731d3bc7a6908bd8a58cff9639aeb8b185474558855e00af5c |