Skip to content
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

Adding a non-scalar parameter to a trajectory raises an error if we size it with "shape", but works successfully with "val". #769

Closed
1 of 4 tasks
Kenneth-T-Moore opened this issue Jun 24, 2022 · 0 comments · Fixed by #770

Comments

@Kenneth-T-Moore
Copy link
Member

Issue Type

  • Bug
  • Enhancement
  • Docs
  • Miscellaneous

Description

I have a static parameter that has a vector size in an ODE. I use add_parameter to allow the value to be accessed at the top of the model. If I add the parameter with val=val, it works, but if I use shape=shape, where the shape is val.shape, I get a size mismatch error:

builtins.ValueError: 'traj.phases.phase0' <class Phase>: The source and target shapes do not match or are ambiguous for the connection 'traj.phases.phase0.param_comp.parameter_vals:aircraft:wing:sweep_distribution' to 'traj.phases.phase0.rhs_disc.p1.aircraft:wing:sweep_distribution'. The source shape is (1,) but the target shape is (3,).

Example included.

Example

https://gist.github.com/Kenneth-T-Moore/47c9329d506918463bbe7eacc2de5dea

Environment

Operating System: <i.e. OS X 10.14.6, Windows 10, Ubuntu 16.04>
Python environment: <i.e. Anaconda Python 3.7.1>
Packages: <versions of Dymos, OpenMDAO, and other pertinent Python packages. You can just paste the output of pip freeze here.>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant