How to model the constraint for a minimum consecutive running time of a machine?
AnsweredI'm working with a power generation scheduling problem. For example, for machine A, B, C and 24 hours a day, given power demand of each hour, machine cost per hour, machine start cost, how to schedule the machines to minimize the total cost. The model above is simple except there's one constraint: every machine has to run consecutively for x hours of each run. For example, for machine A, it has to run consecutively for 5 hours of each run. Let binary variable u denote the status (1 = on and 0 = off) of machine A and consider the statuses of the first 12 hours:
For u = [0 0 1 1 1 1 1 1 1 0 0 0], the minimum consecutive number of 1 is 7 > 5, so this is a valid plan.
For u = [0 1 1 1 0 0 1 1 1 1 0 0], the minimum consecutive number of 1 is 3 < 5, so this plan is invalid.
How to model such constraint?

Hi San,
Here's a general idea  let me know if you get stuck figuring out the details.
You could add another binary for each hour, indicating whether the plant is switched on at the start of that hour. Each of those binaries can then be linked to the five existing binaries for the corresponding hours (e.g. link the "switch on at t=4" to "plant on at t=4,5,6,7,8"). Most likely while you try and come up with the right constraints, you'll notice that you need binaries for switching off at a specific hour too... but it's more fun if you find out for yourself, why that variable might be necessary.
You can find inspiration here in our modeling example for power generation.
Kind regards,
Ronad0
Please sign in to leave a comment.
Comments
1 comment