我难住了。我在 R 中为 NLOPT 制定了一个问题。当前问题解决了 180 个具有 28 个等式约束的变量
该代码是从一个更简单的问题版本中重用的,在我的脚本的早期,有 36 个变量和 20 个等式约束,可以立即使用 NLOPT_LD_SLSQP作为算法。
使用 180 个变量的问题的较大版本会立即产生以下结果NLOPT_LD_SLSQP:
NLopt solver status: -4 ( NLOPT_ROUNDOFF_LIMITED: Roundoff errors led
to a breakdown of the optimization algorithm. In this case, the
returned minimum may
still be useful. (e.g. this error occurs in NEWUOA if one tries to
achieve a tolerance too close to machine precision.) )
Run Code Online (Sandbox Code Playgroud)
这让我感到困惑,因为它可以解决问题的较小版本。同样,它返回起始值并且实际上并不完成任何迭代。所以我实现了,NLOPT_AUGLAG_LD_EQ作为主要算法,NLOPT_LD_SLSQP作为本地算法。现在问题无法解决并产生:
NLopt solver status: -1 ( NLOPT_FAILURE: Generic failure code. …Run Code Online (Sandbox Code Playgroud)