Running a Simple Mission#
This example will show how to run an example aircraft through a pre-defined mission in Aviary. We will demonstrate two ways to run this example: through the command line interface, and using the Python API.
Aircraft#
The aircraft model used in this example is Aviary’s “Advanced Single Aisle”. This is a model of a theoretical aircraft with technology predictions of what a next-generation air transport might look like. The advanced single aisle is a conventional “tube-and-wing” configuration that seats 154 passengers - essentially a Boeing 737 or Airbus A320 with slightly improved performance. This aircraft uses the FLOPS analysis for aerodynamics, geometry, and mass estimation.
The aircraft model exists as a csv file (which can be seen here).
Mission#
This example uses the “energy-state” equations of motion. This method highly simplifies the flight physics, representing the aircraft as a point mass. This makes it fairly robust and quick to calculate.
We will be flying this aircraft through Aviary’s default mission profile. It includes 3 segments (climb, cruise, descent) with the following properties:
Climb
Mach starting at 0.2 and ending at 0.72
Altitude starting at 0 ft. and ending at 32,000 ft.
Cruise
Fixed Mach of 0.72
Altitude starting at 32,000 ft. and ending at 34,000 ft.
Descent
Mach starting at 0.72 and ending at 0.36
Altitude starting at 34,000 ft. and ending at 500 ft.
Total range of 1,906 nautical miles
The full mission definition is stored in a “phase_info” dictionary in a Python file (which can be found here)
Running via the Command Line#
We can run this aircraft model through the default mission very simply from the command line using the run_mission command.
This command normally needs the name of the aircraft csv file and phase_info file, since we are using an example model and default phase_info provided in the Aviary source code itself, we only have to specify the name of this known aircraft.
!aviary run_mission advanced_single_aisle_FLOPS
/home/runner/work/Aviary/Aviary/.openmdao-pixi/.pixi/envs/py313/lib/python3.13/site-packages/modopt/core/visualization.py:11: UserWarning: matplotlib not found, plotting disabled.
warnings.warn("matplotlib not found, plotting disabled.")
/home/runner/work/Aviary/Aviary/.openmdao-pixi/.pixi/envs/py313/lib/python3.13/site-packages/openmdao/core/constants.py:16: OMDeprecationWarning:The INF_BOUND sentinel in OpenMDAO is deprecated. Infinite bounds should now be specified using None or +/-np.inf.
The following variables have been overridden by the aircraft definition:
'aircraft:design:landing_to_takeoff_mass_ratio 0.84 unitless
'aircraft:design:touchdown_mass_max 108976.4 lbm
'aircraft:fuel:auxiliary_fuel_mass_capacity 0.0 lbm
'aircraft:fuel:fuselage_fuel_mass_capacity 0.0 lbm
'aircraft:fuel:max_capacity_mass 33136.4 lbm
'aircraft:fuel:wing_fuel_mass_capacity 33136.4 lbm
'aircraft:fuselage:passenger_compartment_length 97.5 ft
'aircraft:fuselage:wetted_area 4235.082096 ft**2
'aircraft:horizontal_tail:wetted_area 576.571192 ft**2
'aircraft:landing_gear:main_gear_oleo_length 106.94 inch
'aircraft:landing_gear:nose_gear_oleo_length 74.86 inch
'aircraft:nacelle:total_wetted_area 488.936564 ft**2
'aircraft:nacelle:wetted_area [244.468282] ft**2
'aircraft:propulsion:total_engine_controls_mass 0.0 lbm
'aircraft:propulsion:total_starter_mass 0.0 lbm
'aircraft:vertical_tail:wetted_area 445.645658 ft**2
'aircraft:wing:aspect_ratio 11.5587605382765 unitless
'aircraft:wing:wetted_area 2210.280228 ft**2
Total number of variables............................: 96
variables with only lower bounds: 93
variables with lower and upper bounds: 3
variables with only upper bounds: 0
Total number of equality constraints.................: 94
Total number of inequality constraints...............: 61
inequality constraints with only lower bounds: 1
inequality constraints with lower and upper bounds: 60
inequality constraints with only upper bounds: 0
Number of Iterations....: 15
(scaled) (unscaled)
Objective...............: 1.3813638330255140e+00 1.3813638330255140e+00
Dual infeasibility......: 3.1079968566188163e-08 3.1079968566188163e-08
Constraint violation....: 5.2930271075420124e-15 5.2930271075420124e-15
Variable bound violation: 0.0000000000000000e+00 0.0000000000000000e+00
Complementarity.........: 9.0922310433388310e-08 9.0922310433388310e-08
Overall NLP error.......: 9.0922310433388310e-08 9.0922310433388310e-08
Number of objective function evaluations = 16
Number of objective gradient evaluations = 16
Number of equality constraint evaluations = 16
Number of inequality constraint evaluations = 16
Number of equality constraint Jacobian evaluations = 16
Number of inequality constraint Jacobian evaluations = 16
Number of Lagrangian Hessian evaluations = 0
Total seconds in IPOPT = 4.524
EXIT: Optimal Solution Found.
Aviary run successful.
If you want to run your own custom aircraft or mission analysis, you will need to provide the filepaths to where the aircraft csv file and phase_info mission files are located. The following command explicitly points to the files used in the above run of the advanced_single_aisle_FLOPS model.
!aviary run_mission --phase_info models/missions/energy_state_default.py models/aircraft/advanced_single_aisle/advanced_single_aisle_FLOPS.csv
/home/runner/work/Aviary/Aviary/.openmdao-pixi/.pixi/envs/py313/lib/python3.13/site-packages/modopt/core/visualization.py:11: UserWarning: matplotlib not found, plotting disabled.
warnings.warn("matplotlib not found, plotting disabled.")
/home/runner/work/Aviary/Aviary/.openmdao-pixi/.pixi/envs/py313/lib/python3.13/site-packages/openmdao/core/constants.py:16: OMDeprecationWarning:The INF_BOUND sentinel in OpenMDAO is deprecated. Infinite bounds should now be specified using None or +/-np.inf.
The following variables have been overridden by the aircraft definition:
'aircraft:design:landing_to_takeoff_mass_ratio 0.84 unitless
'aircraft:design:touchdown_mass_max 108976.4 lbm
'aircraft:fuel:auxiliary_fuel_mass_capacity 0.0 lbm
'aircraft:fuel:fuselage_fuel_mass_capacity 0.0 lbm
'aircraft:fuel:max_capacity_mass 33136.4 lbm
'aircraft:fuel:wing_fuel_mass_capacity 33136.4 lbm
'aircraft:fuselage:passenger_compartment_length 97.5 ft
'aircraft:fuselage:wetted_area 4235.082096 ft**2
'aircraft:horizontal_tail:wetted_area 576.571192 ft**2
'aircraft:landing_gear:main_gear_oleo_length 106.94 inch
'aircraft:landing_gear:nose_gear_oleo_length 74.86 inch
'aircraft:nacelle:total_wetted_area 488.936564 ft**2
'aircraft:nacelle:wetted_area [244.468282] ft**2
'aircraft:propulsion:total_engine_controls_mass 0.0 lbm
'aircraft:propulsion:total_starter_mass 0.0 lbm
'aircraft:vertical_tail:wetted_area 445.645658 ft**2
'aircraft:wing:aspect_ratio 11.5587605382765 unitless
'aircraft:wing:wetted_area 2210.280228 ft**2
Total number of variables............................: 96
variables with only lower bounds: 93
variables with lower and upper bounds: 3
variables with only upper bounds: 0
Total number of equality constraints.................: 94
Total number of inequality constraints...............: 61
inequality constraints with only lower bounds: 1
inequality constraints with lower and upper bounds: 60
inequality constraints with only upper bounds: 0
Number of Iterations....: 15
(scaled) (unscaled)
Objective...............: 1.3813638330255169e+00 1.3813638330255169e+00
Dual infeasibility......: 3.1079973236063813e-08 3.1079973236063813e-08
Constraint violation....: 4.1737581140060579e-15 4.1737581140060579e-15
Variable bound violation: 0.0000000000000000e+00 0.0000000000000000e+00
Complementarity.........: 9.0922310433383651e-08 9.0922310433383651e-08
Overall NLP error.......: 9.0922310433383651e-08 9.0922310433383651e-08
Number of objective function evaluations = 16
Number of objective gradient evaluations = 16
Number of equality constraint evaluations = 16
Number of inequality constraint evaluations = 16
Number of equality constraint Jacobian evaluations = 16
Number of inequality constraint Jacobian evaluations = 16
Number of Lagrangian Hessian evaluations = 0
Total seconds in IPOPT = 4.687
EXIT: Optimal Solution Found.
Aviary run successful.
Running via Python API#
We can also run that exact same problem setup using the basic Python API. Here we call the run_aviary() function with a the same information. Just like with the command line, we are able to take the same shortcuts because we are using pre-provided models and the default mission. However, for completeness the below code shows how to provide a full filepath for the aircraft input file and phase info file. This is the template you will need to use when using custom input files.
import aviary.api as av
prob = av.run_aviary(
aircraft_data='models/aircraft/advanced_single_aisle/advanced_single_aisle_FLOPS.csv',
phase_info='models/missions/energy_state_default',
)
The following variables have been overridden by the aircraft definition:
'aircraft:design:landing_to_takeoff_mass_ratio 0.84 unitless
'aircraft:design:touchdown_mass_max 108976.4 lbm
'aircraft:fuel:auxiliary_fuel_mass_capacity 0.0 lbm
'aircraft:fuel:fuselage_fuel_mass_capacity 0.0 lbm
'aircraft:fuel:max_capacity_mass 33136.4 lbm
'aircraft:fuel:wing_fuel_mass_capacity 33136.4 lbm
'aircraft:fuselage:passenger_compartment_length 97.5 ft
'aircraft:fuselage:wetted_area 4235.082096 ft**2
'aircraft:horizontal_tail:wetted_area 576.571192 ft**2
'aircraft:landing_gear:main_gear_oleo_length 106.94 inch
'aircraft:landing_gear:nose_gear_oleo_length 74.86 inch
'aircraft:nacelle:total_wetted_area 488.936564 ft**2
'aircraft:nacelle:wetted_area [244.468282] ft**2
'aircraft:propulsion:total_engine_controls_mass 0.0 lbm
'aircraft:propulsion:total_starter_mass 0.0 lbm
'aircraft:vertical_tail:wetted_area 445.645658 ft**2
'aircraft:wing:aspect_ratio 11.5587605382765 unitless
'aircraft:wing:wetted_area 2210.280228 ft**2
Total number of variables............................: 96
variables with only lower bounds: 93
variables with lower and upper bounds: 3
variables with only upper bounds: 0
Total number of equality constraints.................: 94
Total number of inequality constraints...............: 61
inequality constraints with only lower bounds: 1
inequality constraints with lower and upper bounds: 60
inequality constraints with only upper bounds: 0
Number of Iterations....: 15
(scaled) (unscaled)
Objective...............: 1.3813638330255185e+00 1.3813638330255185e+00
Dual infeasibility......: 3.1079969502938840e-08 3.1079969502938840e-08
Constraint violation....: 4.7862264380444891e-15 4.7862264380444891e-15
Variable bound violation: 0.0000000000000000e+00 0.0000000000000000e+00
Complementarity.........: 9.0922310433389898e-08 9.0922310433389898e-08
Overall NLP error.......: 9.0922310433389898e-08 9.0922310433389898e-08
Number of objective function evaluations = 16
Number of objective gradient evaluations = 16
Number of equality constraint evaluations = 16
Number of inequality constraint evaluations = 16
Number of equality constraint Jacobian evaluations = 16
Number of inequality constraint Jacobian evaluations = 16
Number of Lagrangian Hessian evaluations = 0
Total seconds in IPOPT = 4.590
EXIT: Optimal Solution Found.
Aviary run successful.
What Just Happened?#
This example just sized an aircraft model to fly a specified mission. Specifically, Aviary performed an optimization to minimize fuel burned during the mission while satisfying the aircraft design loop (finding the aircraft’s gross mass). Only gross mass was a design variable here - the optimizer did not touch any other aircraft properties during the Aviary run. We can see a brief output that shows us the optimization was successful and some stats about the optimization run. All of the behaviors that Aviary decided by default, such as the default mission flown, the objective of minimal fuel, and even how much information was printed to the terminal as the model ran, can all be adjusted. Several of the more advanced examples showcase changing these options.
Viewing Results#
While very little was printed to the terminal after we ran Aviary, all of the results were still saved! If you try running this example for yourself, you should see a new folder named “advanced_single_aisle_FLOPS_out” appear. This reports folder contains a wealth of information about your Aviary run - the Aviary Dashboard walkthrough in the User’s Guide explains how you can view your results.