简体   繁体   English

Pyomo多重积分

[英]Pyomo Multiple Integrals

Is there a continuous (integral) analog to Pyomo's sum function which could do several summations at once 是否有一个与Pyomo求和函数的连续(积分)模拟,可以一次执行多个求和

sum(model.x[i,j] for i in model.index_is, for j in model.index_js)

Heat_Conduction.py in the dae examples has a reference to nested integration, but it is commented out and it throws a ValueError: Integral must be indexed by a Continuous S whenever I comment it back in. dae示例中的Heat_Conduction.py引用了嵌套的集成,但已注释掉,并引发ValueError:每当我将其注释回时,Integral必须由Continuous S索引。

# def _obj(m):
#     return Integral(Integral(expr=m.intExp,wrt=m.x,bounds=(0,10)), wrt=m.y,bounds=(0,5))
# m.obj = Objective(rule=_obj)

I've searched everywhere, but I couldn't find a working example and I couldn't understand the docs. 我到处搜索过,但找不到有效的示例,也无法理解文档。

Thanks in advance 提前致谢

The Integral component is not fully developed and I wouldn't recommend using it. 集成组件尚未完全开发,我不建议您使用它。 A better way to formulate a continuous integral using Pyomo.DAE components would be to differentiate your integral equation and convert it to a differential equation. 用Pyomo.DAE组件公式化连续积分的更好方法是微分积分方程并将其转换为微分方程。 See the discussion here: How to define an Integral as an objective function in pyomo? 请参阅此处的讨论: 如何在pyomo中将积分定义为目标函数?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM