I have an optimization model to fulfill the water requirements of a city’s distribution network. The model includes water sources from rainfall collection, river extraction, reservoir storage, and external supply. I need the model to prioritize the order of water sources to meet the demand: first from rainfall collection, then from river extraction, then from reservoir storage, and finally from external supply.
We have modelled it as such:
I am trying to solve a problem in which I have 4 variables: x1 (rainfall collection), x2 (river extraction), x3_t (reservoir storage drained), and x4_t (external supply). x_1 and x_2 can only be chosen once across all timestamps.
I need
x1+ x2 + x3_t + x4_t >= c_t, where t is the current timestamp
We also have x3_t < 100
I basically want to encode:
if x1 + x2 + x3_t >= c_t:
x4_t = 0
How can I enforce that I drain the reservoir storage as much as possible, and only once its drained, do I use the external supply if there’s any remaining demand?
We tried an attempt at big M, but we were quite confused how to make it work for this problem.
snek is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.