forked from OpenMDAO/Aviary
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request OpenMDAO#515 from kaushikponnapalli/od_docs
Off-Design documention
- Loading branch information
Showing
5 changed files
with
181 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Off-Design Mission Example\n", | ||
"\n", | ||
"The off-design mission example here demonstrates the capability in the height energy formulation, using the level 2 interface.\n", | ||
"By default Aviary uses a height-energy formulation unless you have specified otherwise.\n", | ||
"Running a sizing mission followed by running fallout and alternate missions on the sized aircraft will be presented.\n", | ||
"An overview of off-design missions is presented in [Off-Design Mission User Guide](../user_guide/off_design_missions).\n", | ||
"\n", | ||
"The example is available in `aviary/examples/off_design_example.py`\n", | ||
"The examples start with `run_aviary_example.py` and add off-design missions.\n", | ||
"\n", | ||
"The results of the sizing problem are saved using `prob.save_sizing_to_json()`.\n", | ||
"By default, this method saves the results to `sizing_problem.json` but the name of the file may be changed using the `json_filename` argument.\n", | ||
"The saved problem may then be used to run off-design missions using `prob.fallout_mission()` and `prob.alternate_mission()`.\n", | ||
"\n", | ||
"This example can be modified to use the 2DOF formulation by using `aircraft_for_bench_GwGm` instead of `aircraft_for_bench_FwFm` and import the default 2DOF phase_info (aviary/interface/default_phase_info/two_dof.py) instead of the `phase_info` declared in the problem.\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"The methods used to run the off-design missions accept the mission parameters `payload_mass`, `mission_range`, `mission_mass`, and `phase_info` as inputs depending on the type of mission being run.\n", | ||
"If these values are not specified, the same values as the design mission are used by default.\n", | ||
"For this example, we simply run a fallout and alternate mission with those default values.\n", | ||
"The expected result is that the range for the fallout mission and the mission mass for the alternate will be the same as the values computed by the sizing mission.\n", | ||
"\n", | ||
"The results of this study are output after interrogating the problem objects." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"\n", | ||
"## Sizing Results\n", | ||
"Design Range = 3375.\n", | ||
"Design Gross mass = 175871.01115631\n", | ||
"Summary Gross mass = 175871.01115631\n", | ||
"\n", | ||
"## Fallout Results\n", | ||
"Summary Range = 3375.00699084\n", | ||
"Design Gross mass = 175871.01115631\n", | ||
"Summary Gross mass = 175871.01115631\n", | ||
"\n", | ||
"## Alternate Results\n", | ||
"Summary Range = 3375.\n", | ||
"Design Gross mass = 175871.01115631\n", | ||
"Summary Gross mass = 175869.64047452\n", | ||
"\n", | ||
"\n", | ||
"In these results, `design` values represent the values used to size the aircraft, while the `summary` values represent the values used in the specific mission that is run.\n", | ||
"We can see that the results are almost identical as expected." | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.11.0" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Off-Design Missions\n", | ||
"\n", | ||
"## Overview\n", | ||
"\n", | ||
"Off-design missions are enabled for the following mission types:\n", | ||
"\n", | ||
"* height_energy (collocation) (completed)\n", | ||
"* 2DOF (collocation) (complete)\n", | ||
"* 2DOF (shooting) (future work)\n", | ||
"* height_energy (shooting) (future work)\n", | ||
"\n", | ||
"An off-design mission can be created either by directly entering the parameters of the sized aircraft or by using the built-in functionality to run an off-design in the same script as the sizing mission.\n", | ||
"There are currently two types of off-design missions supported in Aviary; alternate and fallout.\n", | ||
"For an alternate mission, the target range of the mission and the payload mass are specified and the fuel mass required is solved for.\n", | ||
"Fallout missions meanwhile take the payload and fuel masses as inputs and determine the range of the aircraft.\n", | ||
"To create a simple off-design mission, take your input deck and add the line `settings:problem_type, fallout` or `settings:problem_type, alternate`.\n", | ||
"\n", | ||
"```{note}\n", | ||
"You may need to revise some of the values in your input deck for the off-design mission.\n", | ||
"Since the aircraft is not re-designed, it is assumed that provided inputs constitute a valid aircraft.\n", | ||
"```\n", | ||
"\n", | ||
"From there, the mission may be run as before." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"You may also run multiple off-design missions in the same script used to solve the design mission.\n", | ||
"An examples of this is shown in `off_design_example.py`." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"tags": [ | ||
"remove-cell" | ||
] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"# Testing Cell\n", | ||
"from aviary.docs.tests.utils import check_contains\n", | ||
"import aviary.api as av\n", | ||
"import os\n", | ||
"\n", | ||
"off_design_examples = av.get_path(os.path.join('examples'))\n", | ||
"check_contains(\n", | ||
" ('off_design_example.py'),\n", | ||
" os.listdir(off_design_examples),\n", | ||
" error_string=\"{var} not in \"+str(off_design_examples),\n", | ||
" error_type=FileNotFoundError)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.11.0" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters