Optimization with time-dependent constraint

조회 수: 17 (최근 30일)
Iñigo Azpiri
Iñigo Azpiri 2022년 1월 24일
답변: Alan Weiss 2022년 1월 24일
I am trying to find the optimal operation of a battery to perform energy arbitrage, which consists in charging energy when prizes are low and discharging when prizes are high.
The information that I have is:
P_bat = 10 %Battery power in MW
E_bat = 40 %Battery capacity in MWh
price = rand (1,24) %1x24 array with hourly energy prices in USD/MWh
And the results I would expect from the optimization are:
d %1x24 array with energy discharged every hour in MWh
c %1x24 array with energy charged every hour in MWh
SOC %1x24 with the battery State of Charge in MWh (initial value 0)
I have identified f as the function that I have to minimize to obtain maximum profit
Which has these constraints:
But there is another important constraint to the problem:
I am basing my code in this answer in the forum, but since the state of charge in a certain hour depends on its value on the previous hour, I am unable to translate this into the constraints function. I hope you can help me.

채택된 답변

Alan Weiss
Alan Weiss 2022년 1월 24일
For an example of a similar problem, see Optimal Dispatch of Power Generators: Problem-Based.
Alan Weiss
MATLAB mathematical toolbox documentation

추가 답변 (1개)

Torsten
Torsten 2022년 1월 24일
Use "linprog" and define the 24 equalities
SOC_i - (SOC_i-1 + c_i - d_i) = 0 (i=1,...24)
in the matrix Aeq with SOC_1,...,SOC_24 as additional unknowns.
  댓글 수: 1
Iñigo Azpiri
Iñigo Azpiri 2022년 1월 24일
Thanks, Torsten. I will try this approach.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Problem-Based Optimization Setup에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by