简体   繁体   English

在壁虎中一起建模微分方程和线性方程?

[英]Modelling of differential and linear equations together in gekko?

Hello everyone and Gekko developers,大家好,Gekko 开发者们,

I want to model the following equations for my Thermal Energy Storage Systems,我想为我的热能存储系统建模以下方程,

微分代数方程

which are both linear and differential.既是线性的又是微分的。 Some variables are also time dependent, come as external parameters.一些变量也是时间相关的,作为外部参数出现。 From the examples of Gekko, it look likes that I can only add equation such as mdl.Equation(T_a.dt() == mt*c_p_w*(T_b-T_a)) / d_w*c_p_w in this format, however for equation not involving differential, I want to add as normal equations also such as mdl.Equation(m[t] == mc - m[t]) .从 Gekko 的例子看来,我只能在这种格式中添加诸如mdl.Equation(T_a.dt() == mt*c_p_w*(T_b-T_a)) / d_w*c_p_w的方程,但是对于方程不是涉及微分,我想添加为正规方程也如mdl.Equation(m[t] == mc - m[t])

ps How can I add both styles, and which mode and solver will allow this. ps 如何添加这两种样式,以及哪种模式和求解器将允许这样做。 ? ?

Thanks,谢谢,

Best regards,此致,

Rahul拉胡尔

I guess you want to implement a MPC for the system ?我猜您想为系统实现 MPC 吗?

The solver modes for each application are displayed in the Gekko Doc, for MPC it should be 6 if you aim for collocation.每个应用程序的求解器模式都显示在 Gekko Doc 中,对于 MPC,如果您的目标是搭配,它应该是 6。 From my experience with Gekko it should work out if you just add the linear equations, as long as these keep the problem feasible.根据我对 Gekko 的经验,如果您只添加线性方程,只要这些使问题可行,就应该可以解决。 Normally, linear algebraic equations don't corrupt your DAE problem.通常,线性代数方程不会破坏您的 DAE 问题。 Secondly, a nonlinear solver will also work for a linear problem (bc linear solvers are implemented in a nonlinear solver), so IPOPT for example should work fine in any case.其次,非线性求解器也适用于线性问题(bc 线性求解器在非线性求解器中实现),因此,例如 IPOPT 在任何情况下都应该可以正常工作。

You can look on the APMonitor website for more examples, I am sure there are some involving linear equations.您可以在 APMonitor 网站上查看更多示例,我确定其中有一些涉及线性方程。 If you are not sure, how to define variables, there is a detailled documentation online.如果您不确定如何定义变量,可以在网上找到详细的文档。 https://gekko.readthedocs.io/en/latest/index.html https://gekko.readthedocs.io/en/latest/index.html

Hope this helps, I am also just a user of gekko that set up a few scripts.希望这会有所帮助,我也只是设置一些脚本的 gekko 用户。

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

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