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:
And the results I would expect from the optimization are:
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.