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 backtrack when they see it. Some of the gradient based optimizers can also handle it correctly (SLSQP for example).



来源:https://stackoverflow.com/questions/47649921/what-is-the-best-way-to-tell-openmdao-driver-or-solver-that-it-is-impossible-to

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!