methods_for_level1.py

methods_for_level1.py#

This file contains functions needed to run Aviary using the Level 1 interface.

aviary.interface.methods_for_level1.run_aviary(aircraft_filename, phase_info, optimizer=None, analysis_scheme=AnalysisScheme.COLLOCATION, objective_type=None, record_filename='problem_history.db', restart_filename=None, max_iter=50, run_driver=True, make_plots=True, phase_info_parameterization=None, optimization_history_filename=None, verbosity=Verbosity.BRIEF)[source]

Run the Aviary optimization problem for a specified aircraft configuration and mission.

This function creates an instance of the AviaryProblem class using provided phase information, mission, and mass methods. It processes aircraft and options data from the given aircraft filename, checks for clashing inputs, and sets up pre- and post-mission systems. The optimization problem is formulated, initialized with guesses, and run to find a solution.

Parameters:
  • aircraft_filename (str) – Filename from which to load the aircraft and options data.

  • phase_info (dict) – Information about the phases of the mission.

  • optimizer (str) – The optimizer to use.

  • analysis_scheme (AnalysisScheme, optional) – The analysis scheme to use, defaults to AnalysisScheme.COLLOCATION.

  • objective_type (str, optional) – Type of the optimization objective.

  • record_filename (str, optional) – Filename for recording the solution, defaults to ‘dymos_solution.db’.

  • restart_filename (str, optional) – Filename to use for restarting the optimization, if applicable.

  • max_iter (int, optional) – Maximum number of iterations for the optimizer, defaults to 50.

  • run_driver (bool, optional) – If True, the driver will be run, defaults to True.

  • make_plots (bool, optional) – If True, generate plots during the optimization, defaults to True.

  • phase_info_parameterization (function, optional) – Additional information to parameterize the phase_info object based on desired cruise altitude and Mach.

  • optimization_history_filename (str or Path) – The name of the database file where the driver iterations are to be recorded. The default is None.

  • verbosity (Verbosity or int) – Sets level of information outputted to the terminal during model execution.

Returns:

The AviaryProblem instance after running the optimization problem.

Return type:

AviaryProblem

Notes

The function allows for user overrides on aircraft and options data. It raises warnings or errors if there are clashing user inputs. Users can modify or add methods to alter the Aviary problem’s behavior.

aviary.interface.methods_for_level1.run_level_1(input_deck, outdir='output', optimizer='SNOPT', phase_info=None, n2=False, max_iter=50, analysis_scheme=AnalysisScheme.COLLOCATION)[source]

This file enables running aviary from the command line with a user specified input deck. usage: aviary run_mission [input_deck] [opt_args]