Originally posted by: Julia189
Hi everyone!
We are trying to implement these constraints (see attached) into CPLEX but once we run the model, the following error pops up:
"CPLEX (default) cannot extract expression:…"
This is the code referring to 17.1 and 17.2:
forall(i in I, t in T) ct17[i][t]:
ivp[i][t] <=ivp[i][t-1] + sum (c in C) prp[c][i][t] - sum (s in S) tp[s][i][t];
forall(i in I, t in T:t>=pp[i]) ct171[i][t]:
ivp[i][t] >=ivp[i][t-1] + sum (c in C) prp[c][i][t] - sum (s in S) tp[s][i][t] - (ivp[i][t-pp[i]] - sum (s in S, x in t-pp[i]+1..t)tp[s][i][x]);
This code is referring to 18.1 and 18.2:
forall(j in J, s in Sj[j], p in Pj[j], t in T) ct18[j][s][p][t]:
ivs[s][p][t] <=ivs[s][p][t-1] + prs[s][p][t] - sum (m in Mj[j]) ts[s][p][m][t];
forall(j in J, s in Sj[j], p in Pj[j], t in T: t>= ps[p]) ct181[j][s][p][t]:
ivs[s][p][t] >=ivs[s][p][t-1] + prs[s][p][t] - sum (m in Mj[j]) ts[s][p][m][t] -(ivs[s][p][t-ps[p]] - sum (m in Mj[j], y in t-ps[p]+1..t)ts[s][p][m][y]);
We think the problem could be x and respectively y which are auxiliary variables. In case of the 17.2 constraint we need two sums, one summing up over s and one summing up over x. X should have the range from t-pp[i]+1 up to t. We don't have a set for x since it is only an auxiliary variable for this constraint. x should be part of the set T. t is part of the set T and acts as upper bound for our sum. We are not sure if this is correct and if we implemented it correctly.
Does anyone know how to solve this ?
Thanks in advance!
Best,
Julia
#DecisionOptimization#OPLusingCPLEXOptimizer