I have a variable t, and I would like to have the following constraints:
a <= t <= b
and
(c <= t <= d) or (e <= t <= f)
Here is the code I used in Julia:
using JuMP, Cbc, StatsBase
import Random
model = Model(with_optimizer(Cbc.Optimizer));
@variable(model, T, Int);
@constraint(model, 5 <= T <= 1000);
@constraint(model, (100 <= T <= 200) | (1100 <= T <= 1300) );
# which fails with error:
# ERROR: LoadError: In `@constraint(model, (100 <= T[i] <= 200) | (1100 <= T[i] <= 1300))`: Unrecognized sense |
Is there a way to linearize these constraints? Or, alternatively, is there a non-linear solver that can deal with these constraints?