gpt4 book ai didi

algorithm - 使用 ISRES 搜索算法通过 nloptr 指定约束

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:22:06 25 4
gpt4 key购买 nike

我有一个具有非线性约束但没有雅可比矩阵的非线性最小化问题。我想使用 nloptr R 优化包中的 ISRES 搜索算法。我有点困惑是否应该将不等式约束定义为 ineq<=0 或 ineq>=。在 nloptr 的文档中,似乎不等式约束应表述为 ineq<=0,而在 ISRES 函数的文档中,不等式约束被表述为 ineq>=0。

最佳答案

在你的优化问题(nloptr)中你应该写:

eval_g_ineq = your_inequality

它会起作用。

您应该将“您的不平等”定义为不等于零。

例如,如果你想说 x 不能等于 2,你应该将其表述为

your_inequality <- (x - 2) 

关于algorithm - 使用 ISRES 搜索算法通过 nloptr 指定约束,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28993027/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com