openmdao

Splitting up connections between groups

那年仲夏 提交于 2019-12-11 12:54:42
问题 I would like to know the best way to split up the connection command. I have two groups that I want to be modular, an inner group and an outer group. I want the inner group to be a kind of black box where I can switch out or change the inner group without changing all the connections for the outer group. I just want the outer group to have to know the inputs and outputs of the inner group. For an example: import numpy as np from openmdao.api import Group, Problem, Component, IndepVarComp,

compute_totals takes longer with analytical gradient vs complex step

China☆狼群 提交于 2019-12-11 09:38:12
问题 below is the code snippet for a single component problem. setting self.flag --> 1 uses complex step setting self.flag --> 0 uses analytical gradients to approximate/compute partial derivatives. The computational time required for computing total derivatives with option 1 is around 20 sec and option 0 is around 60 sec. I was expecting somehow the opposite because there are thousands of 'compute' function calls with complex step. I checked the function calls and they seem correct. I checked the

Linking IndepVarComps from two Groups in OpenMDAO 1.x

戏子无情 提交于 2019-12-11 05:34:51
问题 I don't understand the error: NameError: Source 'x' cannot be connected to target 'AB.x': Target must be a parameter but 'AB.x' is an unknown. I have read through this response, but am still missing something. I wrote a simple problem to more easily capture the issue: from openmdao.api import Group, Component, IndepVarComp, Problem class A(Component): def __init__(self): super(A, self).__init__() self.add_param('x', val=0.0) self.add_param('y', val=0.0) self.add_output('z', val=0.0) def solve

Plugin issue while installing version 0.13.0 of OpenMDAO

和自甴很熟 提交于 2019-12-11 05:08:54
问题 I recently posted about a cobyla problem with version 0.10.3 of OpenMDAO. Since then I've realized I need version 0.13.0. (This is for eventually using WISDEM). This go around, I am having trouble with plugins. Here's the log for the installation of 0.13.0: http://pastebin.com/UAg2b7YG Additionally, here's the output of executing 'openmdao test': $ openmdao test ...S.....S................................................................S..................S......................................

'TypeError' while using NSGA2 to solve Multi-objective prob. from pyopt-sparse in OpenMDAO 1.x

萝らか妹 提交于 2019-12-11 00:44:58
问题 I am trying to solve a multi-objective optimization problem using openMDAO's pyopt-sparse driver with NSGA2 algorithm. Following is the code: from __future__ import print_function from openmdao.api import IndepVarComp, Component, Problem, Group, pyOptSparseDriver class Circ2(Component): def __init__(self): super(Circ2, self).__init__() self.add_param('x', val=10.0) self.add_param('y', val=10.0) self.add_output('f1', val=40.0) self.add_output('f2', val=40.0) def solve_nonlinear(self, params,

Can DOE driver results feed Metamodel component?

天涯浪子 提交于 2019-12-08 12:46:09
问题 I am interested in exploring surrogate based optimization. I am not yet writing opendao code, just trying to figure out to what extent OpenMDAO will support this work. I see that it has a DOE driver to generate training data (http://openmdao.readthedocs.org/en/1.5.0/usr-guide/tutorials/doe-drivers.html), I see that it has several surrogate models that can be added to a meta model (http://openmdao.readthedocs.org/en/1.5.0/usr-guide/examples/krig_sin.html). Yet, I haven't found an example where

Paraboloid optimization requiring scaling

邮差的信 提交于 2019-12-08 04:43:24
问题 I wanted to use scalers and ended up testing your Paraboloid example from OpenMDAO 0.x docs with OpenMDAO 1.x, but I get weird results with or without scalers. Here is the code : from __future__ import print_function import sys from openmdao.api import IndepVarComp, Component, Problem, Group, ScipyOptimizer class Paraboloid(Component): def __init__(self): super(Paraboloid, self).__init__() self.add_param('x', val=0.0) self.add_param('y', val=0.0) self.add_output('f_xy', val=0.0) def solve

OpenMDAO - CO (Collaborative Optimization) on Sellar test case

北战南征 提交于 2019-12-04 05:26:52
问题 An almost similar question was asked but subproblem class was implemented in OpenMDAO to tackle this issue but does not seem to work in my case I am trying to solve Sellar in CO architecture , starting from subproblem example on 1.7.3 version and sellar classes It runs but it doesn't converge. My guess is that it is coming from initial value of each optimization (always restarting from "cold" start) If anyone can help, i would be gratful ! here is the code (I guess I could have made it more

OpenMDAO - CO (Collaborative Optimization) on Sellar test case

微笑、不失礼 提交于 2019-12-02 07:27:04
An almost similar question was asked but subproblem class was implemented in OpenMDAO to tackle this issue but does not seem to work in my case I am trying to solve Sellar in CO architecture , starting from subproblem example on 1.7.3 version and sellar classes It runs but it doesn't converge. My guess is that it is coming from initial value of each optimization (always restarting from "cold" start) If anyone can help, i would be gratful ! here is the code (I guess I could have made it more compact using promotes of variables but I was a bit afraid to get lost for debug :-)) class CO1(Group):

How to use nested problems in OpenMDAO 1.x?

五迷三道 提交于 2019-11-27 09:36:19
I am trying to implement Collaborative Optimization & other multi-level architectures on OpenMDAO. I read here that this can be done by defining a separate solve_nonlinear method in the Subclass of Problem. The issue is that while running the problem instance the defined solve_linear is not being called. Here is the code - from __future__ import print_function, division import numpy as np import time from openmdao.api import Component,Group, IndepVarComp, ExecComp,\ Problem, ScipyOptimizer, NLGaussSeidel, ScipyGMRES class SellarDis1(Component): """Component containing Discipline 1.""" def _