Aircraft Definition

# Testing Cell
from pathlib import Path

from aviary.api import Aircraft, Mission, Settings, get_path
from aviary.utils.doctape import get_variable_name, glue_variable

glue_variable(get_variable_name(Aircraft.AirConditioning.MASS_SCALER), md_code=True)
glue_variable(get_variable_name(Aircraft.AntiIcing.MASS_SCALER), md_code=True)
glue_variable(get_variable_name(Aircraft.APU.MASS_SCALER), md_code=True)

glue_variable(get_variable_name(Mission.Constraints.MAX_MACH), md_code=True)
glue_variable(get_variable_name(Mission.Design.GROSS_MASS), md_code=True)
glue_variable(get_variable_name(Mission.Design.RANGE), md_code=True)

glue_variable(get_variable_name(Settings.EQUATIONS_OF_MOTION), md_code=True)
glue_variable(get_variable_name(Settings.AERODYNAMICS_METHOD), md_code=True)
glue_variable(get_variable_name(Settings.MASS_METHOD), md_code=True)

glue_variable(get_variable_name(Aircraft.Wing.INPUT_STATION_DISTRIBUTION), md_code=True)

Path.exists(get_path('advanced_single_aisle.csv'))

Aircraft.AirConditioning.MASS_SCALER

Aircraft.AntiIcing.MASS_SCALER

Aircraft.APU.MASS_SCALER

Mission.Constraints.MAX_MACH

Mission.Design.GROSS_MASS

Mission.Design.RANGE

Settings.EQUATIONS_OF_MOTION

Settings.AERODYNAMICS_METHOD

Settings.MASS_METHOD

Aircraft.Wing.INPUT_STATION_DISTRIBUTION

True

Aircraft Definition#

Aviary requires some information about the properties of the vehicle before analysis can be performed. Which specific variables are needed depends on which analysis methods are being used. Aircraft variables must be defined in a fixed format to be understood by Aviary. There are two main ways for a user to specify these properties: through a input file, or a Python object.

Note

The aircraft definition provides the values of inputs to your Aviary problem, or initial conditions of design variables. If you specify a variable that is normally an output of an internal calculation, it becomes an override.

All variables provided here are pre-processed by Aviary before optimization begins for sanity checks and resolving ambiguous or conflicting sets of variables.

Input File#

This file takes the form of a comma-separated-values (.csv) file, with columns for variable name, value, and units. If a variable is unitless, then the units column is optional, or “unitless” can be specified for clarity.

Below are some excerpts from an input file (the full file can be found here):

# Input Values
{glue:md}aircraft:air_conditioning:mass_scaler, 0.98094, unitless
{glue:md}aircraft:anti_icing:mass_scaler,       0.53202, unitless
{glue:md}aircraft:apu:mass_scaler,              1.02321, unitless

{glue:md}mission:constraints:max_mach,          0.785,   unitless
{glue:md}mission:design:gross_mass,             130000,  lbm
{glue:md}mission:design:range,                  3500,    NM

{glue:md}settings:equations_of_motion,          energy_state
{glue:md}settings:aerodynamics_method,          FLOPS
{glue:md}settings:mass_method,                  FLOPS

The csv format allows for comments (seen here using a # preceding the comma). As seen in the example, these files can contain all kinds of information such as numbers and text. Aviary attempts to use the Variable Metadata to store your values in the appropriate Python type for that variable, such as knowing when variables should a string versus a float or integer. If your variable requires a list (or other iterable like a numpy array, tuple, etc.) provide each individual item in the array as it’s own column in the csv file, like so:

{glue:md}aircraft:wing:input_station_distribution, 0, 0.34453777998, 0.919, 1, unitless

Python Definition#

When using the Python API, you have the option to provide aircraft inputs as a file or in the form of an AviaryValues object. Other than following the requirements for that data object, there are no additional steps needed to set up your inputs in this way.