简体   繁体   English

获取 GEKKO 优化问题初始值的最佳方法是什么?

[英]What is the best approach to obtain initial values for a GEKKO optimisation problem?

I have a dynamic control problem with about 35 independent variables, many intermediate variables and a few equations, mainly to enforce a sensible mass balance by limiting certain dependent variables (representing stream flows) to be positive.我有一个动态控制问题,其中包含大约 35 个自变量、许多中间变量和一些方程式,主要是通过将某些因变量(代表 stream 流量)限制为正值来实施合理的质量平衡。

Initially the variables were declared using the m.Var() constructor but I consequently upgraded them to MV an CV variables to capitalize on flexibility of tuning attributes such as COST , DCOST , etc. that these classes add.最初,变量是使用m.Var()构造函数声明的,但我随后将它们升级为 MV 和 CV 变量,以利用这些类添加的调整属性(如COSTDCOST等)的灵活性。

I noticed that IPOPT (3.12) does not produce a solution (Error reported: EXIT: Converged to a point of local infeasibility. Problem may be infeasible ) when a set of variables are configured as MV 's, yet when one is instantiated as a Var a successful solution is returned.我注意到当一组变量被配置为MV时,IPOPT (3.12) 没有产生解决方案(错误报告: EXIT: Converged to a point of local infeasibility. Problem may be infeasible ),但是当一个变量被实例化为Var返回一个成功的解决方案。 I re-instantiated the variable as MV and systematically removed constraints to try and pinpoint the constraining equation.我将变量重新实例化为MV并系统地删除约束以尝试查明约束方程。 I discovered that the set of initial conditions I provided for the independent variables constituted an infeasibility (it resulted in value of -0.02 on a stream that have a positive constraint on it).我发现我为自变量提供的一组初始条件构成了不可行性(它导致 stream 的值为 -0.02,对其具有正约束)。 Although RTOL can probably be used to solve the problem for this case, I do not think it is correct general approach.虽然RTOL可能可以用来解决这种情况的问题,但我认为这不是正确的通用方法。 I have tried COLDSTART=2 but do not know how to interpret the presolve.txt file generated.我试过COLDSTART=2但不知道如何解释生成的presolve.txt文件。

Firstly, is there some standard functionality to assist with this situation or should one make sure the initial guesses represent a feasible solution.首先,是否有一些标准功能可以帮助解决这种情况,或者是否应该确保最初的猜测代表一个可行的解决方案。

Secondly, why would the inability to produce a successful solution only manifest when the variable is declared as an MV as opposed to the less decorated Var ?其次,为什么只有当变量被声明为MV而不是装饰较少的Var时,才能产生成功的解决方案?

The m.Var() creates an additional degree of freedom for the optimizer while m.Param() creates a quantity that is determined by the user. m.Var()为优化器创建了额外的自由度,而m.Param()创建了一个由用户确定的数量。 The m.Var() types can be upgraded to m.SV() as state variables or m.CV() as controlled variables. m.Var()类型可以升级为m.SV()作为 state 变量或m.CV()作为受控变量。 The m.Param() type is upgraded to m.FV() for fixed values or m.MV() for manipulated variables. m.Param()类型升级为m.FV()用于固定值或m.MV()用于操纵变量。 If the STATUS parameter is turned on for those types then they also become degrees of freedom.如果为这些类型打开STATUS参数,那么它们也会变成自由度。 More information on FV , MV , SV , and CV types is given in the APMonitor documentation and Gekko Documentation .有关FVMVSVCV类型的更多信息,请参阅 APMonitor 文档Gekko 文档 The problem likely becomes feasible because of the additional degree of freedom.由于额外的自由度,该问题可能变得可行。 Try setting the m.MV() to an m.SV() to retain the degree of freedom from the m.Var() declaration.尝试将m.MV()设置为m.SV()以保留m.Var()声明的自由度。

Initial solutions are often easiest to obtain from a steady-state simulation.初始解决方案通常最容易从稳态模拟中获得。 There are additional details in this paper:本文中还有其他详细信息:

初始化策略

Here is a flowchart that I typically use:这是我通常使用的流程图:

流程图

There are additional details in the paper on how COLDSTART options work.论文中还有关于COLDSTART选项如何工作的更多详细信息。 If the solver reports a successful solution, then there should be no constraint violations.如果求解器报告成功求解,则不应存在约束违规。

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

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