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 -
Hi Ronald,
Can we do this without binaries? The binaries can be quite costly when we run large models (nearly 1000 power plants, with a horizon of 24hourx90days).
Thanks,
0 -
Hi Farhad,
Jumping in for Ronald here as this question is closely related to work I did during postgrad.
The problem of consecutive run time can be formulated in a way which has a nice property that the solutions to the linear relaxation are naturally integer feasible. This means the binary decision variables can be relaxed to continuous variables. However typically in real-world problems there are additional constraints which destroy this nice property, and so binary variables need to remain binary. This particular formulation is still worthwhile though as it gives you a strong base to build the additional modelling structures off.
Since you are a commercial customer I am happy to give you more details of this in a call, so let me know if this interests you and I'll open up a ticket through our Help Center to continue the discussion.
- Riley
0
Please sign in to leave a comment.
Comments
3 comments