Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Sum over specific range

    Posted 11/11/18 11:45 AM

    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


  • 2.  Re: Sum over specific range

    Posted 11/11/18 12:10 PM


  • 3.  Re: Sum over specific range

    Posted 11/11/18 12:27 PM

    Originally posted by: Julia189


    Hi Alex,

     

    we just removed the ct labels and have less erros now. Thanks!  

    Still we suppose there is a problem in this section: 

    sum (s in S, x in t-pp[i]+1..t)tp[s][i][x]);

    Can you tell us whether this is the corret way to implement this range of the sum? Meaning that x is part of the set T and should refer to t (which is also of big T) for the upper and lower bound of the sum. 

     

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Sum over specific range

    Posted 11/11/18 01:10 PM

    Hi,

    Maybe you could attach .mod and .dat so that other users  could try.

    regards

    https://www.linkedin.com/pulse/which-aml-gpl-do-you-use-call-cplex-alex-fleischer/


    #DecisionOptimization
    #OPLusingCPLEXOptimizer