openmdao

Is it necessary, or recommended, to define partials w.r.t fixed parameters?

守給你的承諾、 提交于 2021-02-11 15:45:01
问题 As per the title - say you have a fixed parameter like air density. Is it worth defining the partial w.r.t this fixed parameter? 回答1: If you know the value will be fixed forever (i.e. you'll never want to connect it to something else), the you don't need to declare derivatives for that combination of variables. However I consider this to be a bad practice. In my experience, at some point in the future you will end up connecting something to that input, and then the total derivatives will be

OpenMDAO: Solver converging to non-optimal point

混江龙づ霸主 提交于 2020-03-05 05:31:46
问题 I'm trying to understand the limitations of the OpenMDAO optimization algortithms. In particular I setup the following trivial example: from openmdao.api import Problem, ScipyOptimizeDriver, ExecComp, IndepVarComp, ExplicitComponent class AddComp(ExplicitComponent): def setup(self): self.add_input("x") self.add_input("y") self.add_output("obj") def compute(self, inputs, outputs): outputs['obj'] = inputs["x"] + inputs["y"] # build the model prob = Problem() indeps = prob.model.add_subsystem(

OpenMDAO: Solver converging to non-optimal point

左心房为你撑大大i 提交于 2020-03-05 05:31:33
问题 I'm trying to understand the limitations of the OpenMDAO optimization algortithms. In particular I setup the following trivial example: from openmdao.api import Problem, ScipyOptimizeDriver, ExecComp, IndepVarComp, ExplicitComponent class AddComp(ExplicitComponent): def setup(self): self.add_input("x") self.add_input("y") self.add_output("obj") def compute(self, inputs, outputs): outputs['obj'] = inputs["x"] + inputs["y"] # build the model prob = Problem() indeps = prob.model.add_subsystem(

Errors caused by write statements when running f2py-wrapped, PETSc-based fortran code in OpenMDAO

无人久伴 提交于 2020-01-25 22:05:51
问题 I am using f2py to wrap my PETSc-based fortran analysis code for use in OpenMDAO (as suggested in this post). Rather than use f2py directly, I'm instead using it to generate the relevant .c, .pyc, etc. files and then linking them myself using mpif90. In a simple python environment, I can import my .so and run the code without any problems: >>> import module_name >>> module_name.execute() expected code output... However, when trying to do the same thing in an OpenMDAO component, I get the

Errors caused by write statements when running f2py-wrapped, PETSc-based fortran code in OpenMDAO

佐手、 提交于 2020-01-25 22:05:32
问题 I am using f2py to wrap my PETSc-based fortran analysis code for use in OpenMDAO (as suggested in this post). Rather than use f2py directly, I'm instead using it to generate the relevant .c, .pyc, etc. files and then linking them myself using mpif90. In a simple python environment, I can import my .so and run the code without any problems: >>> import module_name >>> module_name.execute() expected code output... However, when trying to do the same thing in an OpenMDAO component, I get the

OpenMDAOv1.x: warning: parallel derivs not running under MPI

人走茶凉 提交于 2020-01-06 19:25:33
问题 I just finished installing OpenMDAOv1.3 on our super computer. The installation was successful and all tests either passed or skipped. However, when I ran the tests I got the following warning: *path/OpenMDAO/openmdao/core/driver.py:228: UserWarning: parallel derivs %s specified but not running under MPI warnings.warn("parallel derivs %s specified but not running under MPI") I'm not sure what to do about this (if anything) and so I am looking for information about the implications of the

IPOPT options for reducing constraint violation after fewer iterations

扶醉桌前 提交于 2020-01-04 06:57:09
问题 I am using IPOPT implemented through OpenMDAO and am having some trouble understanding and controlling the stopping criteria. Here is what I'm experiencing specifically: Initially, IPOPT is able to find a solution that appears to be much better, although constraints are violated slightly (intuition tells me that adjusting a few parameters would likely bring it into the feasible region). From this discussion I understand that "linear or nonlinear equality or inequality constraint will not

(Openmdao 2.4.0) 'compute_partials' function of a Component seems to be run even when forcing 'declare_partials' to FD for this component

佐手、 提交于 2019-12-24 10:56:21
问题 I want to solve MDA for Sellar using Newton non linear solver for the Group . I have defined Disciplines with Derivatives (using 'compute_partials') but I want to check the number of calls to Discipline 'compute' and 'compute_partials' when forcing or not the disciplines not to use their analytical derivatives (using 'declare_partials' in the Problem definition ). The problem is that is seems that the 'compute_partials' function is still called even though I force not to use it . Here is an

What is the best way to tell openMDAO driver or solver that it is impossible to evaluate the model at some point?

血红的双手。 提交于 2019-12-24 07:48:47
问题 Sometimes there are points in a model in which it is impossible to evaluate the objective function, the unknowns or resids. Which is the best way to tell openMDAO that this is an invalid point? Setting the unknowns and resids to nan, inf or some other way? 回答1: OpenMDAO has a special error class, AnalysisError, specifically for this purpose. You should raise the analysis error any time you your analysis can't converge or compute valid outputs. The linesearch algorithms all look for that and

What is the best way to tell openMDAO driver or solver that it is impossible to evaluate the model at some point?

纵饮孤独 提交于 2019-12-24 07:48:08
问题 Sometimes there are points in a model in which it is impossible to evaluate the objective function, the unknowns or resids. Which is the best way to tell openMDAO that this is an invalid point? Setting the unknowns and resids to nan, inf or some other way? 回答1: OpenMDAO has a special error class, AnalysisError, specifically for this purpose. You should raise the analysis error any time you your analysis can't converge or compute valid outputs. The linesearch algorithms all look for that and