Skip to content

Commit

Permalink
Merge pull request #22 from johnjasa/rename_mission_method
Browse files Browse the repository at this point in the history
Minor tweaks to docs and naming
  • Loading branch information
johnjasa authored Jan 2, 2024
2 parents d1a4151 + 494f9b1 commit 2e6be5c
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 59 deletions.
32 changes: 16 additions & 16 deletions aviary/docs/getting_started/onboarding_level1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
},
"outputs": [],
"source": [
"!aviary run_mission --max_iter 1 --mass_origin GASP --mission_origin GASP --optimizer IPOPT models/test_aircraft/aircraft_for_bench_GwGm.csv"
"!aviary run_mission --max_iter 1 --mass_origin GASP --mission_method GASP --optimizer IPOPT models/test_aircraft/aircraft_for_bench_GwGm.csv"
]
},
{
Expand Down Expand Up @@ -250,11 +250,11 @@
"\n",
"- `--mass_origin`: Mass estimation origin to use (either “`GASP`” or “`FLOPS`”). The default is `FLOPS`.\n",
"\n",
"- `--mission_origin`: Mission origin to use (either “`GASP`”, “`FLOPS`”, or “`simple`”). The default is `simple`.\n",
"- `--mission_method`: Mission origin to use (either “`GASP`”, “`FLOPS`”, or “`simple`”). The default is `simple`.\n",
"\n",
"- `--optimizer`: Name of optimizer. Choices are: `SNOPT`, `IPOPT`, `SLSQP`, and `None`. The default is `SNOPT`. If optimizer is `None`, it will be set to `IPOPT` or `SNOPT` depending on the analysis scheme. The optimization objective is fuel burn for level 1 runs. The objective is\n",
" - `mission:objectives:fuel` if `mission_origin` is `GASP` \n",
" - `fuel_burned` if `mission_origin` is `FLOPS`.\n",
" - `mission:objectives:fuel` if `mission_method` is `GASP` \n",
" - `fuel_burned` if `mission_method` is `FLOPS`.\n",
"\n",
"- `--phase_info`: Path to phase info file. If not provided, it is `default_phase_info/gasp.py` if Mission origin is `GASP` and `default_phase_info/flops.py` otherwise.\n",
"\n",
Expand All @@ -278,7 +278,7 @@
},
"outputs": [],
"source": [
"!aviary run_mission models/test_aircraft/aircraft_for_bench_GwGm.csv --optimizer IPOPT --max_iter 1 --mass_origin GASP --mission_origin GASP"
"!aviary run_mission models/test_aircraft/aircraft_for_bench_GwGm.csv --optimizer IPOPT --max_iter 1 --mass_origin GASP --mission_method GASP"
]
},
{
Expand All @@ -300,7 +300,7 @@
"metadata": {},
"outputs": [],
"source": [
"!aviary run_mission models/test_aircraft/aircraft_for_bench_GwFm.csv --mass_origin GASP --mission_origin FLOPS --max_iter 1 --optimizer IPOPT"
"!aviary run_mission models/test_aircraft/aircraft_for_bench_GwFm.csv --mass_origin GASP --mission_method FLOPS --max_iter 1 --optimizer IPOPT"
]
},
{
Expand All @@ -320,7 +320,7 @@
"metadata": {},
"outputs": [],
"source": [
"!aviary run_mission models/test_aircraft/aircraft_for_bench_GwFm.csv --mass_origin GASP --mission_origin GASP --max_iter 1 --optimizer IPOPT"
"!aviary run_mission models/test_aircraft/aircraft_for_bench_GwFm.csv --mass_origin GASP --mission_method GASP --max_iter 1 --optimizer IPOPT"
]
},
{
Expand All @@ -338,7 +338,7 @@
"metadata": {},
"outputs": [],
"source": [
"!aviary run_mission models/test_aircraft/aircraft_for_bench_FwFm.csv --mass_origin FLOPS --mission_origin FLOPS --max_iter 1 --optimizer IPOPT"
"!aviary run_mission models/test_aircraft/aircraft_for_bench_FwFm.csv --mass_origin FLOPS --mission_method FLOPS --max_iter 1 --optimizer IPOPT"
]
},
{
Expand All @@ -349,13 +349,13 @@
"This is because these benches were each individually made to test a particular mass/mission/geometry/aerodynamics combination. They may not work with other combinations. The following commands will work:\n",
"\n",
"```\n",
"aviary run_mission models/test_aircraft/aircraft_for_bench_GwFm.csv --mass_origin GASP --mission_origin FLOPS\n",
"aviary run_mission models/test_aircraft/aircraft_for_bench_FwFm.csv --mass_origin FLOPS --mission_origin FLOPS\n",
"aviary run_mission models/test_aircraft/aircraft_for_bench_GwGm.csv --mass_origin GASP --mission_origin GASP\n",
"aviary run_mission models/test_aircraft/aircraft_for_bench_GwFm.csv --mass_origin GASP --mission_origin FLOPS\n",
"aviary run_mission models/test_aircraft/aircraft_for_bench_GwFm.csv --mass_origin GASP --mission_method FLOPS\n",
"aviary run_mission models/test_aircraft/aircraft_for_bench_FwFm.csv --mass_origin FLOPS --mission_method FLOPS\n",
"aviary run_mission models/test_aircraft/aircraft_for_bench_GwGm.csv --mass_origin GASP --mission_method GASP\n",
"aviary run_mission models/test_aircraft/aircraft_for_bench_GwFm.csv --mass_origin GASP --mission_method FLOPS\n",
"```\n",
"\n",
"As you see, we have marked the file name `Gw`for `mass_origin GASP` and `Fw` for `mass_origin FLOPS`. Similarly, `Gm` for `mission_origin GASP` and `Fm` for `mission_origin FLOPS`."
"As you see, we have marked the file name `Gw`for `mass_origin GASP` and `Fw` for `mass_origin FLOPS`. Similarly, `Gm` for `mission_method GASP` and `Fm` for `mission_method FLOPS`."
]
},
{
Expand Down Expand Up @@ -384,7 +384,7 @@
"metadata": {},
"outputs": [],
"source": [
"!aviary run_mission models/large_single_aisle_1/large_single_aisle_1_GwGm.csv --mass_origin GASP --mission_origin GASP --max_iter 1 --optimizer IPOPT"
"!aviary run_mission models/large_single_aisle_1/large_single_aisle_1_GwGm.csv --mass_origin GASP --mission_method GASP --max_iter 1 --optimizer IPOPT"
]
},
{
Expand All @@ -402,7 +402,7 @@
"metadata": {},
"outputs": [],
"source": [
"!aviary run_mission --mission_origin FLOPS --mass_origin FLOPS --max_iter 1 --optimizer IPOPT models/test_aircraft/aircraft_for_bench_FwFm.csv"
"!aviary run_mission --mission_method FLOPS --mass_origin FLOPS --max_iter 1 --optimizer IPOPT models/test_aircraft/aircraft_for_bench_FwFm.csv"
]
},
{
Expand Down Expand Up @@ -543,7 +543,7 @@
"File `default_phase_info/flops.py` has a `pre_mission` phase and a `post_mission` phase. In `pre_mission`, `takeoff` is the simplified takeoff and in `post_mission`, `landing` is the simplified landing. For `FLOPS` missions, there are [detailed takeoff and landing](../user_guide/FLOPS_based_detailed_takeoff_and_landing) available. But they are not used in `default_phase_info/flops.py`. The other phases are mission phases.\n",
"```\n",
"\n",
"Also, note that `FLOPS` default `phase_info` has an `core_aerodynamics` key for each of mission phases. If you run with `mission_origin FLOPS`, then you need to specify an aero dynamics builder class. On the other hand, for `mission_origin GASP`, the aerodynamics class is predefined by the Aviary developers. For example, `ascent` phase uses `LowSpeedAero` and `accel` phase uses `CruiseAero`."
"Also, note that `FLOPS` default `phase_info` has an `core_aerodynamics` key for each of mission phases. If you run with `mission_method FLOPS`, then you need to specify an aero dynamics builder class. On the other hand, for `mission_method GASP`, the aerodynamics class is predefined by the Aviary developers. For example, `ascent` phase uses `LowSpeedAero` and `accel` phase uses `CruiseAero`."
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions aviary/docs/getting_started/onboarding_level2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -471,11 +471,11 @@
"```\n",
" reg_objective = overall_fuel/10000 + ascent_duration/30.\n",
"```\n",
"where `overall_fuel` has the unit of `lbm` and `ascent_duration` has the unit of seconds. In our case, `mission_origin = GASP`, the final value of objective is `[5.5910123]`, with `ref: 1.0` and `units: blank`. The units should be interpreted as `unitless`.\n",
"where `overall_fuel` has the unit of `lbm` and `ascent_duration` has the unit of seconds. In our case, `mission_method = GASP`, the final value of objective is `[5.5910123]`, with `ref: 1.0` and `units: blank`. The units should be interpreted as `unitless`.\n",
"\n",
"Here, `ref` is the reference value. For different objectives, the range may vary significantly different. We want to normalize the value. Ideally, users should choose `ref` such that the objective is in the range of `(0,1)`. This is required by optimizer.\n",
"\n",
"**Note:** Unfortunately, not all `objective_type` and `mission_origin` combinations work.\n",
"**Note:** Unfortunately, not all `objective_type` and `mission_method` combinations work.\n",
"\n",
"Next is a line to call"
]
Expand Down Expand Up @@ -613,7 +613,7 @@
"metadata": {},
"outputs": [],
"source": [
"!aviary run_mission models/test_aircraft/aircraft_for_bench_FwFm.csv --mission_origin FLOPS --mass_origin FLOPS --max_iter 0 --optimizer IPOPT"
"!aviary run_mission models/test_aircraft/aircraft_for_bench_FwFm.csv --mission_method FLOPS --mass_origin FLOPS --max_iter 0 --optimizer IPOPT"
]
},
{
Expand Down
37 changes: 14 additions & 23 deletions aviary/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,55 +16,46 @@ Features of Aviary include:

## How to Read These Docs

````{margin}
```{note}
You can use the arrow keys on your keyboard to move forward and backward through the documentation.
```
````

The Aviary documentation is broken up into several sections, each of which is designed to teach a different aspect of Aviary.
You can read through the documentation in order, or you can jump to the sections that interest you the most.
Reading the entirety of the docs is highly recommended for new users, but please read through the Getting Started section at a minimum.

## User Guide
You can read through the documentation in order or you can jump to the sections that interest you the most.

```{note}
Use the interactive table of contents on the left side of the page to navigate through the documentation.
```

The Aviary user interface is under development and employs a 3-tiered approach that is broken up into 3 separate levels. The user guide walks through how to use each of these levels.
## User Guide

Level 1 uses a simple input script where the user interacts with Aviary through input .csv files and a command line interface.
Level 2 uses a more complex structure where the user is actually writing a small amount of code and is able to provide their own external subsystems as desired.
Levels 1 and 2 do not strictly require OpenMDAO or Dymos knowledge.
Level 3 gives the user complete control over the Aviary model.
This means that most all details of the Aviary code are exposed to the user so they can fine tune every aspect of their model and debug the most complex models.
The [Aviary user interface](user_guide/user_interface.md) is under development and employs a 3-tiered approach that is broken up into 3 separate levels.
The user guide walks through how to use each of these levels in detail.

The actual finer points of aircraft design and what these input values should be set to are beyond the scope of this documentation.
We refer users to their aircraft design textbooks as well as their experienced coworkers for information in this area.
This user guide is simply designed to teach the basics of using Aviary for aircraft analysis.

## Examples

The Aviary code includes a suite of built-in examples which the Aviary team has developed to demonstrate the capability of the Aviary code.
The Aviary code includes a [suite of built-in examples](examples/intro.md) which the Aviary team has developed to demonstrate the capability of the Aviary code.
These examples range in complexity and length from a Level 1 input file of a simple aircraft analysis including only Aviary core subsystems to a Level 3 input script where the user has added several external subsystems and manually controlled what variables are passed where.
The Aviary team recommends that the examples be used as as starting point for building your first few Aviary models until you have built up examples of your own.

## Theory Guide

As mentioned above, the purpose of this documentation is not to teach aircraft analysis or multidisciplinary design and optimization (MDO) methods but to specifically teach how to use Aviary.
Aviary includes five core subsystems needed for aircraft design.
These are the aerodynamics, propulsion, mass, geometry, and mission analysis subsystems.

The theory guide details how each of these subsystems work and how the integration capability combines them together.
The [theory guide](theory_guide/intro.md) details how the five core subsystems (aerodynamics, propulsion, mass, geometry, and mission analysis) work and how the integration capability combines them together.
The theory guide also gives a much deeper understanding of the equations and modeling assumptions behind Aviary.

## Developer Guide

The Aviary development team is housed out of the National Aeronautics and Space Administration (NASA) but welcomes code input and pull requests from the public.
This [developer guide](developer_guide/codebase_overview.md) walks through each aspect of the code from the perspective of a developer who would like to contribute code.

The Aviary development team is housed out of NASA but welcomes code input and pull requests from the public.
We are developing a formal review process, but at the moment each code contribution will be made as a pull request and reviewed by the development team.
This developer guide walks through the finer details of each aspect of the code from the perspective of a user who would like to contribute code.

## Miscellaneous Resources

There are some features of the Aviary code which are not addressed in the above documentation.
The Miscellaneous Resources section includes documentation on these additional features, as well as other relevant information.
The [miscellaneous resources](misc_resources/FAQ.md) section includes documentation on these additional features, as well as other relevant information.

## Table of contents

Expand Down
2 changes: 1 addition & 1 deletion aviary/docs/user_guide/aviary_commands.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"\n",
"`run_mission` is a command line interface that will run an analysis on a given csv input file.\n",
"\n",
"To use small_single_aisle_GwGm.csv run the command `aviary run_mission --mission_origin GASP --mass_origin GASP models/small_single_aisle/small_single_aisle_GwGm.csv`<br>\n",
"To use small_single_aisle_GwGm.csv run the command `aviary run_mission --mission_method GASP --mass_origin GASP models/small_single_aisle/small_single_aisle_GwGm.csv`<br>\n",
"\n",
"SNOPT is the default optimizer, but IPOPT is available as well."
]
Expand Down
10 changes: 5 additions & 5 deletions aviary/interface/methods_for_level1.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def run_level_1(
outdir='output',
optimizer='SNOPT',
mass_origin='GASP',
mission_origin='GASP',
mission_method='GASP',
phase_info=None,
n2=False,
max_iter=50,
Expand All @@ -131,7 +131,7 @@ def run_level_1(
kwargs['optimizer'] = optimizer

if phase_info is None:
if mission_origin == 'GASP':
if mission_method == 'GASP':
from aviary.interface.default_phase_info.gasp import phase_info, phase_info_parameterization
kwargs['phase_info_parameterization'] = phase_info_parameterization

Expand All @@ -154,7 +154,7 @@ def run_level_1(
# Access the phase_info variable from the loaded module
phase_info = outputted_phase_info.phase_info

prob = run_aviary(input_deck, phase_info, mission_method=mission_origin,
prob = run_aviary(input_deck, phase_info, mission_method=mission_method,
mass_method=mass_origin, **kwargs)

if n2:
Expand Down Expand Up @@ -193,7 +193,7 @@ def _setup_level1_parser(parser):
choices=("GASP", "FLOPS")
)
parser.add_argument(
"--mission_origin",
"--mission_method",
type=str,
default="simple",
help="Mission origin to use",
Expand Down Expand Up @@ -237,7 +237,7 @@ def _exec_level1(args, user_args):
outdir=args.outdir,
optimizer=args.optimizer,
mass_origin=args.mass_origin,
mission_origin=args.mission_origin,
mission_method=args.mission_method,
phase_info=args.phase_info,
n2=args.n2,
max_iter=args.max_iter,
Expand Down
10 changes: 1 addition & 9 deletions aviary/interface/methods_for_level2.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,6 @@ def load_inputs(self, input_filename, engine_builder=None):
aviary_inputs.set_val(Mission.Summary.GROSS_MASS,
val=self.initial_guesses['actual_takeoff_mass'], units='lbm')

# Commonly referenced values
self.enable_engine_sizing = aviary_inputs.get_val(
Aircraft.Engine.SCALE_MASS)
self.cruise_alt = aviary_inputs.get_val(
Mission.Design.CRUISE_ALTITUDE, units='ft')
self.problem_type = aviary_inputs.get_val('problem_type')
self.mass_defect = aviary_inputs.get_val('mass_defect', units='lbm')

self.cruise_mass_final = aviary_inputs.get_val(
Mission.Summary.CRUISE_MASS_FINAL, units='lbm')
self.target_range = aviary_inputs.get_val(
Expand Down Expand Up @@ -1118,7 +1110,7 @@ def add_subsystem_timeseries_outputs(phase, phase_name):

return traj

def add_post_mission_systems(self, include_landing=True, roc_at_toc=None):
def add_post_mission_systems(self, include_landing=True):
"""
Add post-mission systems to the aircraft model. This is akin to the statics group
or the "premission_systems", but occurs after the mission in the execution order.
Expand Down
4 changes: 2 additions & 2 deletions aviary/interface/test/test_cmd_entry_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ def run_and_test_cmd(self, cmd):

@require_pyoptsparse(optimizer="SNOPT")
def bench_test_SNOPT_cmd(self):
cmd = 'aviary run_mission models/test_aircraft/aircraft_for_bench_GwGm.csv --optimizer SNOPT --mass_origin GASP --mission_origin GASP --max_iter 1'
cmd = 'aviary run_mission models/test_aircraft/aircraft_for_bench_GwGm.csv --optimizer SNOPT --mass_origin GASP --mission_method GASP --max_iter 1'
self.run_and_test_cmd(cmd)

@require_pyoptsparse(optimizer="IPOPT")
def bench_test_IPOPT_cmd(self):
cmd = 'aviary run_mission models/test_aircraft/aircraft_for_bench_GwGm.csv --optimizer IPOPT --mass_origin GASP --mission_origin GASP --max_iter 1'
cmd = 'aviary run_mission models/test_aircraft/aircraft_for_bench_GwGm.csv --optimizer IPOPT --mass_origin GASP --mission_method GASP --max_iter 1'
self.run_and_test_cmd(cmd)

def test_diff_configuration_conversion(self):
Expand Down

0 comments on commit 2e6be5c

Please sign in to comment.