Originally posted by: TimTC
Hello, thanks for reading a potentially really silly question. I have a machine that turns on (1) and off (0) throughout the day. I want to penalize the switching, while still fulfilling a total amount of output (amongst other constraints).
What I thought of so far:
Subtract the state of the machine by the previous state and store that in a set of cplex variables, so that machine states (0 1 1 1 0) become switching states (1 0 0 0 -1).
Now there's a 1 or -1 everytime the machine turns on or off. I would like to penalize these values, but I'm not sure how to deal with the negative sign. One solution I thought of was to square the variable using a quadratic constraint so that I can just multiply the variables with the switching cost, but this generates many huge matrices that only contain one value and makes cplex really slow.
Is there a more efficient way of doing this? Am I missing something? =(
Thank you!
#CPLEXOptimizers#DecisionOptimization