Hi everyone,
I'm just new to this forum so forgive me if I not up to speed of any customs or rules of conduct or anything..
I have a problem which I can't seem to fix on my own.
I'm trying to optimize a problem right now, using the OpenSolver. In short: the optimization problem is minimizing costs of electricity use of electric vehicles (EVs) which have a certain driving pattern. The goal is to simulate an optimal charging strategy during the hours that the EV is connected to the grid, where electricity prices vary per hour. Since the EVs have batteries, they also allow electricity to be sold back to the grid. The decision variables contain the electricity extracted/sold back to the grid per specific hour.
So for example: the car is connected to the grid at 10PM at 10 kWh and needs to be charged with 50 kWh the next morning at 09AM. The OpenSolver needs to find in which hours it is the cheapest to charge the vehicle. If prices between hours vary enough, it may also be possible that it discharges (earns money with the electricity) to reduce charging costs further.
Here comes the catch: the price for electricity when discharging the vehicle differ from the price when charging. I want to include an IF-statement here to account for this (i.e. IFS(charge in hour I <0; charge* charge price; charge in hour I >0; charge*discharge price). The solver however does not recognize this since (I think) the IF statement is based on the decision variables. I've tried many things, but can't seem to work around an IF statement that is (in)directly based on the decision variables..
Anyone that might know how to help?
Bookmarks