MATLAB: Linear Programming – Optimization Over One Year

arbitrageconstraintslinear programminglinprogobjective-functionoptimization

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

Best Answer

I think that you might find some enlightenment in these examples:
If you don't have a current version of the toolbox (R2017b or later) then use the solver-based examples linked from each of these problem-based examples.
Alan Weiss
MATLAB mathematical toolbox documentation