Skip to main content

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.

  1. 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
  1. Install the most recent version of openap:
pip install --upgrade git+https://github.com/junzis/openap
  1. 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:

example_optimal_flight

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:

example_optimal_flight

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openap_top-1.4.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

openap_top-1.4-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file openap_top-1.4.tar.gz.

File metadata

  • Download URL: openap_top-1.4.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.1 Linux/6.5.0-1022-azure

File hashes

Hashes for openap_top-1.4.tar.gz
Algorithm Hash digest
SHA256 637734bbaebab6ac7d0c2116f3b2fb7c0a041c51c697be7d2e0c1b1cc938ebb3
MD5 b1276f3f26bd6939906834e7e37a3dba
BLAKE2b-256 7597a073012cccd993978e7245df4183d6fe1d616bd5fc1624de5b807ae7efb2

See more details on using hashes here.

File details

Details for the file openap_top-1.4-py3-none-any.whl.

File metadata

  • Download URL: openap_top-1.4-py3-none-any.whl
  • Upload date:
  • Size: 27.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.1 Linux/6.5.0-1022-azure

File hashes

Hashes for openap_top-1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 976660fc756d5e99eb62c21871509f292ee3abc4e2e53608055441dff2c4f77e
MD5 2c498135a98350d0a0b8aa767df8a7a4
BLAKE2b-256 44871986bcd3e64499055168079aaedb1fe5c167ac720c4486db9792a0986494

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page