kiwi
kiwi copied to clipboard
How to get an objective function? I want to maximize/minimize stuff.
I am trying to model a home battery solution, where I want to optimize profit from buying/selling energy. The result should charge the battery on cheap hours, and sell it on expensive hours, given the constraints.
The battery has a minimum and maximum capacity (SOC: 0 ... 5 kWh) The charging / discharging speed has a minimum and a maximum (load: -2 ... 2 kW) The energy prices vary per hour, and are known 24 hours in advance. (price[1] .... price[24])
What I am able to do is model the SOC and LOAD constraints. And I can model the profit.hour[n] = load.hour[n] x price.hour[n]. The total profit (objective function) would be profit.hour[1] + profit.hour[2] + ..... + profit.hour[24]
But now the big issue: How do I optimize to get maximum profit? (or alternatively minimize for cost)? I would like to see for each hour what the optimum load should be.