【发布时间】:2019-11-19 23:29:20
【问题描述】:
给定输入值,例如电力消耗、太阳能电池板的发电量、价格(所有在给定时间 t),我们有一个电池,我们想要评估它在任何给定时间应该(放电)/充电多少。 问题可以表述如下:
Pt = price of electricity at time t
Lt = consumption of electricity at time t
Zt = charge of battery at time t (how much is in the battery)
St = Electricity generated from solar generator at time t
Qt = amount the battery (dis)/charges at time t
我们要优化的功能是
Ct = Pt *(Lt - St - Qt)
这样做的目的是尽量减少购买的电量
具有以下约束:
Lt - St - Qt >= 0 (our demand has to be non-negative)
Qmin <= Qt <= Qmax ( the battery can only (dis)/charge between certain values at any given time)
Zmin <= Zt <= Zmax. (the battery has to be within its capacity, i.e. you can't discharge more than the battery holders, and you can charge more than the battery can hold)
Zt+1 = Zt + Qt+1 ( this means that the battery level at the next time step is equal to the battery level at the previous time step plus the amount that was (dis)/charged from the battery)
我遇到的问题是如何在 python (Scipy) 中制定问题,尤其是更新电池电量。
我知道存在其他图书馆(Pyomo、Pulp),欢迎提供解决方案。
【问题讨论】:
-
您在描述问题方面做得非常出色。您尝试过什么解决方法,遇到了什么问题?
-
好吧,我可以使用强化学习来解决这个问题,但从实际意义上讲,这个问题与安全性和决策证明有关。我正在尝试使用 Scipy/pyomo/pulp 使用线性方法来做到这一点。我知道人们已经使用了 MATLAB 中的 fmincon 函数,并使用了文献中的 Pyomo 库,但我不确定如何实际制定问题以使其适合该公式。真正的问题是电池更新,因为它依赖于之前的“tilmestep”/变量
-
我没有看到问题。你熟悉lps吗?当存在线性依赖时,链接你的变量,“你的问题”是很自然的。约束看起来与呈现的完全一样。你尝试了什么?您提供的功能还允许以相同的价格出售能量敌人来购买它。不知道你是否想要那个。
-
我不确定/无法重新表述要在 python 中使用的问题。 LP 中的约束要求不等式或等于零。这里的问题是如何以LP形式写
标签: python optimization pyomo pulp scipy-optimize