I have established a JuMP model (gurobi optimizer) and one constraint seems to be not respected:
@constraint(obj,OP_t == sum(sum(sum(((opex_trans[i,1,k,1]*Nsh[i,1,k,t]) + (opex_trans[i,1,k,2]*Np[i,1,k,t])) for i in 1:I) for k in 1:K) for t in 1:T))
with Nsh and Np two variables of shape [1:I,1:J,1:K, 1:T] and opex_trans a parameter of shape [1:I,1:J,1:K, 1:L, 1:T] and
@objective(obj, Min, CAP_p+OP_p+CAP_t+OP_t+CAP_r+OP_r) as objective function.
After optimization, OP_t is 0 while all parameters and variables are non null and non negative.
However, if I add a dummy variable to my model, the contraint is respected and OP_t is non null.
I do not understand how this variable that is never used “fix my code” and why JuMP do not seem to respect the constraint otherwise.
Thanks in advance for your help and do not hesitate to ask for more clarification.