In [1]:
import warnings
import matplotlib.pyplot as plt
import opentop
warnings.filterwarnings("ignore")
Specify flight information¶
Required: aircraft type, origin, destination, and take-off mass
Take-off mass can be in kg, or fraction of maximum take-off mass
In [2]:
actype = "A320"
origin = "EHAM"
destination = "LGAV"
m0 = 0.85
m0 * 78
Out[2]:
66.3
Define trip type¶
opentop.CompleteFlight(): full trajectory, non-phase specificopentop.MultiPhase(): full trajectory, including climbing, cruise, and descentopentop.Climb()opentop.Cruise()opentop.Descent()
In [3]:
optimizer = opentop.CompleteFlight(actype, origin, destination, m0)
flight = optimizer.trajectory(objective="fuel")
You can visualize the trajectory quickly with the vis.trajectory() function
In [4]:
opentop.vis.trajectory(flight)
plt.show()
In [5]:
flight = optimizer.trajectory(objective="fuel")
opentop.vis.trajectory(flight)
plt.show()
Cruise phase only¶
In [6]:
optimizer = opentop.Cruise(actype, origin, destination, m0)
flight = optimizer.trajectory(objective="fuel")
opentop.vis.trajectory(flight)
plt.show()
Using different built-in objective functions¶
In [7]:
optimizer = opentop.CompleteFlight(actype, origin, destination, m0)
In [8]:
flight = optimizer.trajectory(objective="fuel")
opentop.vis.trajectory(flight)
plt.show()
In [9]:
flight = optimizer.trajectory(objective="ci:60")
opentop.vis.trajectory(flight)
plt.show()
In [10]:
flight = optimizer.trajectory(objective="gwp100")
opentop.vis.trajectory(flight)
plt.show()
In [11]:
flight = optimizer.trajectory(objective="gtp100")
opentop.vis.trajectory(flight)
plt.show()
Specify different objective functions for different phases¶
In [12]:
flight = optimizer.trajectory(objective="time")
opentop.vis.trajectory(flight)
plt.show()