我正在使用IPOPT与CASadi接口来建模SOC系统,但解算器总是卡住。我知道它找到了最优解,但它没有返回最优解。当它找到解决方案时,它会不断返回目标中非常小的变化,直到达到最大值
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
1480 4.4540346e+02 5.28e-03 5.42e+03 -1.7 8.26e-02 - 1.00e+00 5.00e-01h 2
1481 4.4546874e+02 3.48e-03 4.10e+03 -1.7 4.87e-02 - 1.00e+00 5.00e-01h 2
1482 4.4544443e+02 2.13e-03 3.96e+03 -1.7 3.36e-02 - 1.00e+00 5.00e-01h 2
1483 4.4553992e+02 8.01e-05 9.22e+00 -1.7 3.82e-02 - 1.00e+00 1.00e+00H 1
1484 4.4549114e+02 8.55e-04 8.52e+03 -1.7 7.03e-02 - 1.00e+00 2.50e-01f 3
1485 4.4550202e+02 1.75e-03 4.58e+03 -1.7 4.03e-02 - 1.00e+00 5.00e-01h 2
1486 4.4551714e+02 1.53e-04 7.55e+00 -1.7 4.29e-02 - 1.00e+00 1.00e+00H 1
1487 4.4548019e+02 8.06e-04 7.84e+03 -1.7 8.26e-02 - 1.00e+00 2.50e-01f 3
这是相关代码。 我将功率变量分为两部分,因为我希望“再生”速率比再生速率低一半
negative = (ca.sign(power) + 1) / 2
positive = (ca.sign(power) - 1) / 2
dsoc = (-power * negative) + (0.5 * power * positive)
当我不修改再生速率时,解算器会收敛到一个解。 例如,这项工作:
negative = (ca.sign(power) + 1) / 2
positive = (ca.sign(power) - 1) / 2
dsoc = (-power * negative) + (power * positive)
但是有了这个代码,它就变成了stucs
negative = (ca.sign(power) + 1) / 2
positive = (ca.sign(power) - 1) / 2
dsoc = (-power * negative) + (0.99*power * positive)
谢谢
不使用
sign
函数,具有不可恢复损耗的能源系统的SOC可以用松弛变量建模。以下是一个IPOPT解决方案,其存储能量的调度效率低50%下面是关于这个问题的additional information
相关问题 更多 >
编程相关推荐