Linear Programming - Optimization Over One Year
古いコメントを表示
Dear Community,
I am totally stuck on this problem and am really looking forward to your ideas:
I try to find a solution to a linear optimization problem. I want to maximize the total arbitrage value for one year. In each hour arbitrage can be defined as the product of price (Pt) and amount of energy (Et). The amount is positive when energy is bought and negative when energy is sold.
The optimization function can be defined as:
max (Pt*Et) summed over one year (t=1 to t=8670)
There are two constraints to this function:
0 <= St <= Smax (Smax = Energy Capacity, constant)
-Pmax <= Et <= Pmax (Pmax = Power Limit, constant)
The hourly state of charge (St) is defined as follows:
St = St-1 + Et * n , if Et => 0 (with St-1 being the state of charge from the previous hour)
St = St-1 + Et * m , if Et < 0
I want the program to return the amount of energy stored or discharged for each hour of the year (8670 hours) so that the maximum arbitrage value for that year was reached. Means, it shall not optimize for each day but rather optimize for one whole year. If this problem turns out to be too heavy computational wise, one could shrink the time frame to two weeks.
Having consulted this help page ( Link ) I could not come up with a solution to optimize for a set of interdependent time steps. Can you?
Thanks so much in advance, Mathias
採用された回答
その他の回答 (1 件)
Mathias Dirksmeier
2018 年 7 月 18 日
9 件のコメント
Alan Weiss
2018 年 7 月 18 日
Please look at the links I gave. This is not a nonlinear constraint, and you should not be using fmincon.
Alan Weiss
MATLAB mathematical toolbox documentation
Mathias Dirksmeier
2018 年 7 月 19 日
Alan Weiss
2018 年 7 月 19 日
I think that you should make an auxiliary binary variable yt that indicates whether Et is negative. I assume that there are positive constants m and M such that, for the times when Et is negative,
-M <= Et <= -m
In this case, you can construct yt automatically as done in several of the examples I linked, and then I think that you can make your objective function linear by using yt as part of the cost. If I am wrong and the objective function has to be quadratic, then I believe that you can use the technique in this example to model your problem.
Alan Weiss
MATLAB mathematical toolbox documentation
Mathias Dirksmeier
2018 年 7 月 23 日
Alan Weiss
2018 年 7 月 23 日
It is straightforward to include the binary variable into the cost function. Just take your expressions:
St = St-1 + Et * n , if Et => 0
St = St-1 + Et * m , if Et < 0
and write them in terms of yt, where yt = 1 indicates Et < 0:
St = St-1 + Et*n + yt*Et*(m - n)
This may not be the only way to incorporate the variable, but it is a correct way.
Alan Weiss
MATLAB mathematical toolbox documentation
Mathias Dirksmeier
2018 年 7 月 23 日
編集済み: Mathias Dirksmeier
2018 年 7 月 23 日
Alan Weiss
2018 年 7 月 23 日
It would. Is that a problem?
Alan Weiss
MATLAB mathematical toolbox documentation
Mathias Dirksmeier
2018 年 7 月 24 日
Alan Weiss
2018 年 7 月 24 日
It depends on the MILP and the nonlinear program. There are a lot of tricks that can be used to solve an MILP because it is linear in the variables. Nonlinear problems are quite hard in general. But again, it depends on the problems.
Alan Weiss
MATLAB mathematical toolbox documentation
カテゴリ
ヘルプ センター および File Exchange で Solver Outputs and Iterative Display についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!