I am trying to model an Electric Vehicle scheduling to minimise the electricity bill. Of course, the EV will only be able to charge every time that is plugged into a charging station (i.e. it cannot charge when the vehicle is driving). Basically, it is a stationary battery that can be disconnected and connected again.
I already managed to model a stationary battery scheduling before and is working well as I expected, however, I am having a hard time setting up a constraint to connect and disconnect the battery.
In the dataset that I am using the vehicle is plugged in at certain periods of time, and I am using a dictionary like this availDict = dict(enumerate(df[avail]))
that contains values 1 = plugged
and 0 = not plugged
at different times of the day. For example, assuming that when the vehicle is plugged when is not driving then, from 7am to 9am is not plugged as the vehicle is driving, from 9am to 6pm is plugged as the vehicle is not driving, from 6pm to 8pm is not plugged as the vehicle is driving and from 8pm to 7am is plugged as the vehicle is not driving.
At the moment I have tried to model the constraint as a boolean like this:
model.avail_bool = en.Var(model.Time, within=en.Boolean, initialize=1)
model.not_avail_bool = en.Var(model.Time, within=en.Boolean)
I was thinking to use BigM to force the model to constraint the vehicle from charging during that time, but I am having a hard time setting this up.
For further explanation, these are the equations that I am trying to model that I found in a paper:
SOCmin(t) <= SOC(t) <= SOCmax(t)
if avail = 0 (not plugged)
SOCmin(t) = SOCmax(t) = 0
if avail = 1 (plugged) but idle
SOCmin(t) = 0 and SOCmax(t) = SOC
if avail = 1 (plugged) and needed by time (t)
SOCmin(t) = SOCmax(t) = SOC
I hope that I explained my problem properly and hopefully, you are able to understand what I meant.
If there is another suggestion or you need more information please let me know so I can provide it as soon as possible.