OpenMDAO / dymos

Open Source Optimization of Dynamic Multidisciplinary Systems
Apache License 2.0
208 stars 66 forks source link

Possible issue when linking a design parameter as a the duration of a phase #655

Closed SkillForce13 closed 3 years ago

SkillForce13 commented 3 years ago

Issue Type

Description

This issue arose from upgrading from OpenMDAO 3.1.0 to 3.11.0 and Dymos 0.15.0 to 1.1.0.

Before the new updated versions, I managed to connect the phase duration to a design parameter with no issue. Now, with the Auto-IVC component it does not find the path to my parameter and only searches it in rhs_col. It also shows an error specifying:

Attempted to connect from 't_duration' to 'rhs_col.parameters:new_time_duration', but 't_duration' is an input. All connections must be from an output to an input.

It is worth mentioning that input_duration=True when defining the phase and the new parameter was defined in the same script with opt=True, so it is a design parameter. The attempted linkage was done using t_duration_targets in the time options of the phase.

In the old OpenMDAO and Dymos version this worked using traj.connect('design_parameters:new_time_duration', 'phase_name.t_duration'). This worked as intended and the design parameter we called _new_timeduration would be the new input for the phase _phase_name.tduration. We could verify this connection in the n2 diagram.

Example

N/A

Environment

Operating System: <Windows 10> Python environment: <Anaconda Python 3.8.11> Packages: <dymos==1.1.0, openmdao==3.11.0>

robfalck commented 3 years ago

This is a bug that results from t_initial_targets being used when input_initial is True, or t_duration_targets being used when input_duration is True.

robfalck commented 3 years ago

@SkillForce13 The latest version of master should resolve this issue. Note that due to some other changes, the latest version of OpenMDAO (3.13.0) is now required.