Skip to content

Commit

Permalink
Merge branch 'OpenMDAO:main' into test_flops_aero_builder
Browse files Browse the repository at this point in the history
  • Loading branch information
xjjiang authored Dec 18, 2024
2 parents 6033e46 + 0eab7f6 commit 5c9b82d
Showing 228 changed files with 10,965 additions and 9,205 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/test_benchmarks.yml
Original file line number Diff line number Diff line change
@@ -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}}
3 changes: 1 addition & 2 deletions .github/workflows/test_docs.yml
Original file line number Diff line number Diff line change
@@ -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}}
6 changes: 3 additions & 3 deletions .github/workflows/test_workflow.yml
Original file line number Diff line number Diff line change
@@ -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
@@ -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:
3 changes: 1 addition & 2 deletions .github/workflows/test_workflow_dev_deps.yml
Original file line number Diff line number Diff line change
@@ -27,8 +27,7 @@ jobs:
SCIPY: 1
PYOPTSPARSE: 'latest'
SNOPT: '7.7'
#OPENMDAO: 'dev'
OPENMDAO: '3.34.2'
OPENMDAO: 'dev'
DYMOS: 'dev'

steps:
1 change: 0 additions & 1 deletion .github/workflows/test_workflow_no_dev_install.yml
Original file line number Diff line number Diff line change
@@ -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]
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion aviary/docs/developer_guide/codebase_overview.ipynb
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
" '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",
" '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",
Original file line number Diff line number Diff line change
@@ -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)"
6 changes: 3 additions & 3 deletions aviary/docs/getting_started/onboarding_ext_subsystem.ipynb
Original file line number Diff line number Diff line change
@@ -217,7 +217,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, `climb`, `cruise` and `descent`) and maximize the final total mass: `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, `climb`, `cruise` and `descent`) and maximize the final total mass: `Dynamic.Vehicle.MASS`."
]
},
{
@@ -233,7 +233,7 @@
"source": [
"# Testing Cell\n",
"from aviary.api import Dynamic\n",
"Dynamic.Mission.MASS;"
"Dynamic.Vehicle.MASS;"
]
},
{
@@ -399,7 +399,7 @@
"id": "ed8c764a",
"metadata": {},
"source": [
"Since our objective is `mass`, we want to print the value of `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 `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:"
]
2 changes: 1 addition & 1 deletion aviary/docs/getting_started/onboarding_level1.ipynb
Original file line number Diff line number Diff line change
@@ -474,7 +474,7 @@
"\n",
"In ground roll phase, throttle setting is set to maximum (1.0). Aviary sets a phase parameter:\n",
"```\n",
"Dynamic.Mission.THROTTLE = 1.0\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",
6 changes: 3 additions & 3 deletions aviary/docs/getting_started/onboarding_level2.ipynb
Original file line number Diff line number Diff line change
@@ -629,12 +629,12 @@
"\n",
"| objective_type | objective |\n",
"| -------------- | --------- |\n",
"| mass | `Dynamic.Mission.MASS` |\n",
"| mass | `Dynamic.Vehicle.MASS` |\n",
"| hybrid_objective | `-final_mass / {takeoff_mass} + final_time / 5.` |\n",
"| fuel_burned | `initial_mass - mass_final` (for `FLOPS` mission only)|\n",
"| fuel | `Mission.Objectives.FUEL` |\n",
"\n",
"As listed in the above, if `objective_type=\"mass\"`, the objective is the final value of `Dynamic.Mission.MASS` at the end of the mission.\n",
"As listed in the above, if `objective_type=\"mass\"`, the objective is the final value of `Dynamic.Vehicle.MASS` at the end of the mission.\n",
"If `objective_type=\"fuel\"`, the objective is the `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:"
]
@@ -659,7 +659,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",
14 changes: 7 additions & 7 deletions aviary/docs/getting_started/onboarding_level3.ipynb
Original file line number Diff line number Diff line change
@@ -334,7 +334,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",
@@ -474,9 +474,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",
@@ -487,9 +487,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",
@@ -500,9 +500,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",
16 changes: 8 additions & 8 deletions aviary/docs/user_guide/SGM_capabilities.ipynb
Original file line number Diff line number Diff line change
@@ -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",
@@ -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",
@@ -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",
")"
]
@@ -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'))"
]
}
],
@@ -298,7 +298,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.3"
}
},
"nbformat": 4,
Original file line number Diff line number Diff line change
@@ -450,9 +450,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",
@@ -463,9 +463,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",
@@ -476,9 +476,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",
Loading

0 comments on commit 5c9b82d

Please sign in to comment.