Skip to content

Commit

Permalink
Merge branch 'main' into glue_getting_started
Browse files Browse the repository at this point in the history
  • Loading branch information
xjjiang authored Dec 18, 2024
2 parents 91ded8c + 0eab7f6 commit be7505c
Show file tree
Hide file tree
Showing 228 changed files with 10,973 additions and 9,213 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/test_benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ jobs:
SCIPY: 1
PYOPTSPARSE: 'v2.9.1'
SNOPT: '7.7'
#OPENMDAO: 'latest'
OPENMDAO: '3.34.2'
OPENMDAO: 'latest'
DYMOS: 'latest'
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
SSH_KNOWN_HOSTS: ${{secrets.SSH_KNOWN_HOSTS}}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ jobs:
SCIPY: 1
PYOPTSPARSE: 'v2.9.1'
SNOPT: '7.7'
#OPENMDAO: 'latest'
OPENMDAO: '3.34.2'
OPENMDAO: 'latest'
DYMOS: 'latest'
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
SSH_KNOWN_HOSTS: ${{secrets.SSH_KNOWN_HOSTS}}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ jobs:
matrix:
include:
# oldest versions of openmdao/dymos
# Note: bugfixes sometimes require incrementing the minimal version of openmdao or dymos.
- NAME: oldest
PY: '3.9'
NUMPY: '1.20'
SCIPY: '1.6'
PYOPTSPARSE: 'v2.9.1'
SNOPT: '7.7'
OPENMDAO: '3.33.0'
OPENMDAO: '3.35.0'
DYMOS: '1.8.0'

# latest versions of openmdao/dymos
Expand All @@ -50,8 +51,7 @@ jobs:
SCIPY: 1
PYOPTSPARSE: 'v2.9.1'
SNOPT: '7.7'
#OPENMDAO: 'latest'
OPENMDAO: '3.34.2'
OPENMDAO: 'latest'
DYMOS: 'latest'

steps:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test_workflow_dev_deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ jobs:
SCIPY: 1
PYOPTSPARSE: 'latest'
SNOPT: '7.7'
#OPENMDAO: 'dev'
OPENMDAO: '3.34.2'
OPENMDAO: 'dev'
DYMOS: 'dev'

steps:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test_workflow_no_dev_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ jobs:
echo ""
echo "Temporarily install specific versions for now."
pip install "numpy<2"
pip install "openmdao==3.34.2"
pip install packaging
pip install .[all]
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,9 @@ coloring_files/
# OpenMDAO N2 diagrams
n2.html

# Input and output lists
input_list.txt
output_list.txt

# Windows downloads
*:Zone.Identifier
20 changes: 10 additions & 10 deletions aviary/docs/developer_guide/codebase_overview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
"from aviary.utils.doctape import glue_variable\n",
"\n",
"structure = {\n",
" 'docs': 'contains the doc files for Aviary',\n",
" 'examples': 'contains example code for using Aviary, including external subsystem examples',\n",
" 'interface': 'is where most code that users interact with is located',\n",
" 'mission': 'contains OpenMDAO components and groups for modeling the aircraft mission',\n",
" 'models': 'contains aircraft and propulsion models for use in Aviary examples and tests',\n",
" 'subsystems': 'is where the aerodynamic, propulsion, mass, and geometry core subsystems are located',\n",
" 'utils': 'contains utility functions for use in Aviary code, examples, and tests',\n",
" 'validation_cases': 'contains validation cases for testing and benchmarking Aviary',\n",
" 'variable_info': 'contains the variable meta data as well as several variable classes that are used in Aviary',\n",
" 'visualization': 'is where the Aviary dashboard is located',\n",
" 'docs':'contains the doc files for Aviary',\n",
" 'examples':'contains example code for using Aviary, including external subsystem examples',\n",
" 'interface':'is where most code that users interact with is located',\n",
" 'mission':'contains OpenMDAO components and groups for modeling the aircraft mission',\n",
" 'models':'contains aircraft and propulsion models for use in Aviary examples and tests',\n",
" 'subsystems':'is where the aerodynamic, atmosphere, energy, propulsion, mass, and geometry core subsystems are located',\n",
" 'utils':'contains utility functions for use in Aviary code, examples, and tests',\n",
" 'validation_cases':'contains validation cases for testing and benchmarking Aviary',\n",
" 'variable_info':'contains the variable meta data as well as several variable classes that are used in Aviary',\n",
" 'visualization':'is where the Aviary dashboard is located',\n",
" }\n",
"\n",
"bulleted_list = ''\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
"aircraft_filename = 'models/test_aircraft/aircraft_for_bench_FwFm.csv'\n",
"optimizer = \"IPOPT\"\n",
"make_plots = True\n",
"max_iter = 200\n",
"max_iter = 100\n",
"\n",
"prob = av.run_aviary(aircraft_filename, phase_info, optimizer=optimizer,\n",
" make_plots=make_plots, max_iter=max_iter)"
Expand Down
4 changes: 2 additions & 2 deletions aviary/docs/getting_started/onboarding_ext_subsystem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@
"\n",
"The steps in bold are related specifically to subsystems. So, almost all of the steps involve subsystems. As long as your external subsystem is built based on the guidelines, Aviary will take care of your subsystem.\n",
"\n",
"The next example is the [battery subsystem](https://github.com/OpenMDAO/Aviary/blob/main/aviary/docs/user_guide/battery_subsystem_example). The battery subsystem provides methods to define the battery subsystem's states, design variables, fixed values, initial guesses, and mass names. It also provides methods to build OpenMDAO systems for the pre-mission and mission computations of the subsystem, to get the constraints for the subsystem, and to preprocess the inputs for the subsystem. This subsystem has its own set of variables. We will build an Aviary model with full phases (namely, {glue:md}`climb`, {glue:md}`cruise` and {glue:md}`descent` as we are using defaults for height energy based phases) and maximize the final total mass: {glue:md}`Dynamic.Mission.MASS`."
"The next example is the [battery subsystem](https://github.com/OpenMDAO/Aviary/blob/main/aviary/docs/user_guide/battery_subsystem_example). The battery subsystem provides methods to define the battery subsystem's states, design variables, fixed values, initial guesses, and mass names. It also provides methods to build OpenMDAO systems for the pre-mission and mission computations of the subsystem, to get the constraints for the subsystem, and to preprocess the inputs for the subsystem. This subsystem has its own set of variables. We will build an Aviary model with full phases (namely, {glue:md}`climb`, {glue:md}`cruise` and {glue:md}`descent`) and maximize the final total mass: `Dynamic.Vehicle.MASS`."
]
},
{
Expand Down Expand Up @@ -536,7 +536,7 @@
"id": "ed8c764a",
"metadata": {},
"source": [
"Since our objective is `mass`, we want to print the value of {glue:md}`Dynamic.Mission.MASS`. Remember, we have imported Dynamic from aviary.variable_info.variables for this purpose.\n",
"Since our objective is `mass`, we want to print the value of {glue:md}`Dynamic.Vehicle.MASS`. Remember, we have imported Dynamic from aviary.variable_info.variables for this purpose.\n",
"\n",
"So, we have to print the final mass in a different way. Keep in mind that we have three phases in the mission and that final mass is our objective. So, we can get the final mass of the descent phase instead. Let us try this approach. Let us comment out the print statement of final mass (and the import of Dynamic), then add the following lines:"
]
Expand Down
2 changes: 1 addition & 1 deletion aviary/docs/getting_started/onboarding_level1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@
"\n",
"In {glue:md}`groundroll` phase, initial guess of {glue:md}`throttle` setting is set to maximum `(0.956, 0.956)`. Aviary sets a phase parameter:\n",
"```\n",
"Dynamic.Mission.THROTTLE = 0.956.\n",
"Dynamic.Vehicle.Propulsion.THROTTLE = 1.0\n",
"```\n",
"For the [`COLLOCATION`](https://openmdao.github.io/dymos/getting_started/collocation.html) setting, there is one [segment](https://openmdao.github.io/dymos/getting_started/intro_to_dymos/intro_segments.html) (`'num_segments': 1`) and polynomial interpolation degree is 3 (`'order': 3`). Increasing the number of segments and/or increasing the degree of polynomial will improve accuracy but will also increase the complexity of computation. For groundroll, it is unnecessary.\n",
"\n",
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 @@ -876,8 +876,8 @@
"| fuel_burned | `initial_mass - mass_final` (for `height_energy` mission only)|\n",
"| fuel | {glue:md}`Mission.Objectives.FUEL` |\n",
"\n",
"As listed in the above, if `objective_type='mass'`, the objective is the final value of {glue:md}`Dynamic.Mission.MASS` at the end of the mission.\n",
"If `objective_type='fuel'`, the objective is the {glue:md}`Mission.Objectives.FUEL`.\n",
"As listed in the above, if `objective_type=\"mass\"`, the objective is the final value of {glue:md}`Dynamic.Vehicle.MASS` at the end of the mission.\n",
"If `objective_type=\"fuel\"`, the objective is the {glue:md}`Mission.Objectives.FUEL`.\n",
"There is a special objective type: `hybrid_objective`. When `objective_type='hybrid_objective'`, the objective is a mix of minimizing fuel burn and minimizing the mission duration:"
]
},
Expand All @@ -901,7 +901,7 @@
"from aviary.utils.doctape import check_contains\n",
"\n",
"mo = Mission.Objectives\n",
"dm = Dynamic.Mission\n",
"dm = Dynamic.Vehicle\n",
"expected_objective = {'mass':dm.MASS, 'hybrid_objective':'obj_comp.obj',\n",
" 'fuel_burned':Mission.Summary.FUEL_BURNED, 'fuel':mo.FUEL}\n",
"\n",
Expand Down
14 changes: 7 additions & 7 deletions aviary/docs/getting_started/onboarding_level3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@
"# link phases #\n",
"###############\n",
"\n",
"traj.link_phases(['climb', 'cruise', 'descent'], ['time', av.Dynamic.Mission.MASS, av.Dynamic.Mission.DISTANCE], connected=strong_couple)\n",
"traj.link_phases(['climb', 'cruise', 'descent'], ['time', av.Dynamic.Vehicle.MASS, av.Dynamic.Mission.DISTANCE], connected=strong_couple)\n",
"\n",
"param_vars = [av.Aircraft.Nacelle.CHARACTERISTIC_LENGTH,\n",
" av.Aircraft.Nacelle.FINENESS,\n",
Expand Down Expand Up @@ -507,9 +507,9 @@
" av.Dynamic.Mission.ALTITUDE, ys=[alt_i_climb, alt_f_climb]), units='m')\n",
"prob.set_val(\n",
" 'traj.climb.controls:mach', climb.interp(\n",
" av.Dynamic.Mission.MACH, ys=[mach_i_climb, mach_f_climb]), units='unitless')\n",
" av.Dynamic.Atmosphere.MACH, ys=[mach_i_climb, mach_f_climb]), units='unitless')\n",
"prob.set_val('traj.climb.states:mass', climb.interp(\n",
" av.Dynamic.Mission.MASS, ys=[mass_i_climb, mass_f_climb]), units='kg')\n",
" av.Dynamic.Vehicle.MASS, ys=[mass_i_climb, mass_f_climb]), units='kg')\n",
"prob.set_val('traj.climb.states:distance', climb.interp(\n",
" av.Dynamic.Mission.DISTANCE, ys=[range_i_climb, range_f_climb]), units='m')\n",
"\n",
Expand All @@ -520,9 +520,9 @@
" av.Dynamic.Mission.ALTITUDE, ys=[alt_i_cruise, alt_f_cruise]), units='m')\n",
"prob.set_val(\n",
" 'traj.cruise.controls:mach', cruise.interp(\n",
" av.Dynamic.Mission.MACH, ys=[cruise_mach, cruise_mach]), units='unitless')\n",
" av.Dynamic.Atmosphere.MACH, ys=[cruise_mach, cruise_mach]), units='unitless')\n",
"prob.set_val('traj.cruise.states:mass', cruise.interp(\n",
" av.Dynamic.Mission.MASS, ys=[mass_i_cruise, mass_f_cruise]), units='kg')\n",
" av.Dynamic.Vehicle.MASS, ys=[mass_i_cruise, mass_f_cruise]), units='kg')\n",
"prob.set_val('traj.cruise.states:distance', cruise.interp(\n",
" av.Dynamic.Mission.DISTANCE, ys=[range_i_cruise, range_f_cruise]), units='m')\n",
"\n",
Expand All @@ -533,9 +533,9 @@
" av.Dynamic.Mission.ALTITUDE, ys=[alt_i_descent, alt_f_descent]), units='m')\n",
"prob.set_val(\n",
" 'traj.descent.controls:mach', descent.interp(\n",
" av.Dynamic.Mission.MACH, ys=[mach_i_descent, mach_f_descent]), units='unitless')\n",
" av.Dynamic.Atmosphere.MACH, ys=[mach_i_descent, mach_f_descent]), units='unitless')\n",
"prob.set_val('traj.descent.states:mass', descent.interp(\n",
" av.Dynamic.Mission.MASS, ys=[mass_i_descent, mass_f_descent]), units='kg')\n",
" av.Dynamic.Vehicle.MASS, ys=[mass_i_descent, mass_f_descent]), units='kg')\n",
"prob.set_val('traj.descent.states:distance', descent.interp(\n",
" av.Dynamic.Mission.DISTANCE, ys=[distance_i_descent, distance_f_descent]), units='m')\n",
"\n",
Expand Down
16 changes: 8 additions & 8 deletions aviary/docs/user_guide/SGM_capabilities.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@
" problem_name=phase_name,\n",
" outputs=[\"normal_force\", \"alpha\"],\n",
" states=[\n",
" Dynamic.Mission.MASS,\n",
" Dynamic.Vehicle.MASS,\n",
" Dynamic.Mission.DISTANCE,\n",
" Dynamic.Mission.ALTITUDE,\n",
" Dynamic.Mission.VELOCITY,\n",
" ],\n",
" # state_units=['lbm','nmi','ft'],\n",
" alternate_state_rate_names={\n",
" Dynamic.Mission.MASS: Dynamic.Mission.FUEL_FLOW_RATE_NEGATIVE_TOTAL},\n",
" Dynamic.Vehicle.MASS: Dynamic.Vehicle.Propulsion.FUEL_FLOW_RATE_NEGATIVE_TOTAL},\n",
" **simupy_args,\n",
" )\n",
"\n",
Expand Down Expand Up @@ -196,11 +196,11 @@
"full_traj = FlexibleTraj(\n",
" Phases=phase_info,\n",
" traj_final_state_output=[\n",
" Dynamic.Mission.MASS,\n",
" Dynamic.Vehicle.MASS,\n",
" Dynamic.Mission.DISTANCE,\n",
" ],\n",
" traj_initial_state_input=[\n",
" Dynamic.Mission.MASS,\n",
" Dynamic.Vehicle.MASS,\n",
" Dynamic.Mission.DISTANCE,\n",
" Dynamic.Mission.ALTITUDE,\n",
" ],\n",
Expand All @@ -210,11 +210,11 @@
" # third key is event_idx associated with input\n",
" ('groundroll', Dynamic.Mission.VELOCITY, 0,),\n",
" ('climb3', Dynamic.Mission.ALTITUDE, 0,),\n",
" ('cruise', Dynamic.Mission.MASS, 0,),\n",
" ('cruise', Dynamic.Vehicle.MASS, 0,),\n",
" ],\n",
" traj_intermediate_state_output=[\n",
" ('cruise', Dynamic.Mission.DISTANCE),\n",
" ('cruise', Dynamic.Mission.MASS),\n",
" ('cruise', Dynamic.Vehicle.MASS),\n",
" ]\n",
")"
]
Expand Down Expand Up @@ -278,7 +278,7 @@
"from aviary.utils.doctape import check_value\n",
"\n",
"for phase_name, phase in descent_phases.items():\n",
" check_value(phase['user_options'][Dynamic.Mission.THROTTLE],(0, 'unitless'))"
" check_value(phase['user_options'][Dynamic.Vehicle.Propulsion.THROTTLE],(0, 'unitless'))"
]
}
],
Expand All @@ -298,7 +298,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,9 @@
" av.Dynamic.Mission.ALTITUDE, ys=[alt_i_climb, alt_f_climb]), units='m')\n",
"prob.set_val(\n",
" 'traj.climb.controls:mach', climb.interp(\n",
" av.Dynamic.Mission.MACH, ys=[mach_i_climb, mach_f_climb]), units='unitless')\n",
" av.Dynamic.Atmosphere.MACH, ys=[mach_i_climb, mach_f_climb]), units='unitless')\n",
"prob.set_val('traj.climb.states:mass', climb.interp(\n",
" av.Dynamic.Mission.MASS, ys=[mass_i_climb, mass_f_climb]), units='kg')\n",
" av.Dynamic.Vehicle.MASS, ys=[mass_i_climb, mass_f_climb]), units='kg')\n",
"prob.set_val('traj.climb.states:distance', climb.interp(\n",
" av.Dynamic.Mission.DISTANCE, ys=[distance_i_climb, distance_f_climb]), units='m')\n",
"\n",
Expand All @@ -462,9 +462,9 @@
" av.Dynamic.Mission.ALTITUDE, ys=[alt_i_cruise, alt_f_cruise]), units='m')\n",
"prob.set_val(\n",
" 'traj.cruise.controls:mach', cruise.interp(\n",
" av.Dynamic.Mission.MACH, ys=[cruise_mach, cruise_mach]), units='unitless')\n",
" av.Dynamic.Atmosphere.MACH, ys=[cruise_mach, cruise_mach]), units='unitless')\n",
"prob.set_val('traj.cruise.states:mass', cruise.interp(\n",
" av.Dynamic.Mission.MASS, ys=[mass_i_cruise, mass_f_cruise]), units='kg')\n",
" av.Dynamic.Vehicle.MASS, ys=[mass_i_cruise, mass_f_cruise]), units='kg')\n",
"prob.set_val('traj.cruise.states:distance', cruise.interp(\n",
" av.Dynamic.Mission.DISTANCE, ys=[distance_i_cruise, distance_f_cruise]), units='m')\n",
"\n",
Expand All @@ -475,9 +475,9 @@
" av.Dynamic.Mission.ALTITUDE, ys=[alt_i_descent, alt_f_descent]), units='m')\n",
"prob.set_val(\n",
" 'traj.descent.controls:mach', descent.interp(\n",
" av.Dynamic.Mission.MACH, ys=[mach_i_descent, mach_f_descent]), units='unitless')\n",
" av.Dynamic.Atmosphere.MACH, ys=[mach_i_descent, mach_f_descent]), units='unitless')\n",
"prob.set_val('traj.descent.states:mass', descent.interp(\n",
" av.Dynamic.Mission.MASS, ys=[mass_i_descent, mass_f_descent]), units='kg')\n",
" av.Dynamic.Vehicle.MASS, ys=[mass_i_descent, mass_f_descent]), units='kg')\n",
"prob.set_val('traj.descent.states:distance', descent.interp(\n",
" av.Dynamic.Mission.DISTANCE, ys=[distance_i_descent, distance_f_descent]), units='m')\n",
"\n",
Expand Down
Loading

0 comments on commit be7505c

Please sign in to comment.