I have an optimization problem where I in the objective function want to add a * param1 that if an event a is fulfilled so that a = 1 then we have 1 * param1. a is defined as binary.
The condition is that the sum of 4 units of a variable b are active simoultaneously at time t. However, I seem to formulate the constraint in a way that causes it to say that either all 4 units of b are active or none of them are, but what I want to formulate is a constraint that forces a to take the value 1 if 4 units of b are active, not that there are 4 or 0 units.
Could someone help me formulate such a constraint, or another solution that can help me achieve this?
I tried: 4 * a[u,t] = (sum for all u) b[u,t], which means that I also cause variable b to be 0 or 4,
and the same but with the <= instead, but in this case even it the sum of b at time t is 4, variable a does not necessarilly take on the value of 1, but that is what I want it to do.
Any help is appreciated :)