-
Notifications
You must be signed in to change notification settings - Fork 69
Added ability to automatically create parameters for unconnected ODE inputs. #1205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Small fix for vars deeper in the hierarchy
dymos/phase/phase.py
Outdated
self.options.declare('boundary_balance_options', types=dict, default={}, | ||
desc='Options specifying boundary conditions to be satisfied with a solver.') | ||
self.options.declare('auto_add_parameters', types=bool, default=False, | ||
desc='If True, add any otherwise-unconnected ODE inputs add non-optimal parameters.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo? 'add non-optimal parameters' --> 'as non-optimal parameters'
# Add the remaining unconnected inputs as parameters | ||
for inp in unconn_inputs: | ||
if '.' in inp: | ||
# Handle parameters nested in the ODE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have an input rhs_all.a.b.c
that isn't promoted, isn't this code just going to add a parameter for "c"?
Summary
Added new option to Phase:
auto_add_parameters
This currently defaults to
False
as it is still experimental.If it is True, then Dymos will determine those inputs in the ODE that are not otherwise connected via promotion or manual connections, and create corresponding parameters for them.
If an unconnected input is not promoted to the top of the ODE, the corresponding parameter name will just be the name of the variable itself. For example, a variable at a path
'aircraft.wing.mass'
within the ODE hierarchy will just have the parameter name'mass'
.If two variables within the ODE share the same local name, dymos will work backwards through the dotted path and replace dots with underscores, until a unique name is found.
For instance, if the ODE contained paths:
'aircraft.wing.mass'
and'aircraft.landing_gear.mass'
, the added parameters would have names'wing_mass'
and'landing_gear_mass'
, respectively.Related Issues
Backwards incompatibilities
None
New Dependencies
None