Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

Problem: OPL cannot extract expression

  • 1.  Problem: OPL cannot extract expression

    Posted 08/19/15 01:28 AM

    Originally posted by: MinhHo


    I have a problem in my model.

    When I run the model, I got a problem : OPL cannot extract expression. I try to find solution a few days, but it's still not working.

    I attached my model here.

    Please help me.

    Many Thanks


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Problem: OPL cannot extract expression

    Posted 08/22/15 04:10 PM

    Hi,

    N is bigger than N1 so to repair the objective you could write:

    minimize sum(i in N1, j in N1, t in T1: j != i) c[i][j]*x[i][j][t] + sum( t in T1) f[t]*z[t] +
             sum( t in T3) Hp*Ip[t] + sum(i in N1, t in T2) Hc[i]*Ic[i][t];

    Likewise y is not as big as what you expect so

    forall( i in asSet(N1) inter asSet(T), j in asSet(N1) inter asSet(T), t in T1 : j!=i )  
           y[j][i] <= y[i][j] - w[i][t] + D[i][t]*(1-x[i][j][t]); /* (1j) */  
     

    will work better.

    With those 2 changes, no error any more

    regards

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Problem: OPL cannot extract expression

    Posted 08/24/15 03:06 AM

    Originally posted by: MinhHo


    Hi,

    Thanks for your answer.

    I have changed something and no error any more.

    But now I can't find a solution

    I got a problem like this " Row 'c13' infeasible, all entries at implied bounds".

    I check my constraints carefully and tried to change a new data, but this problem I don't understand.

    Please help me.

    Many thanks


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Problem: OPL cannot extract expression

    Posted 08/24/15 05:13 AM

    Hi,

    if you label your constraints :

    subject

     

    to

    {

     

    forall( t in T1)

     

    Ip[t] == Ip[t-1] + p[t] - sum( i in N1) w[i][t]; //(1b)

     

     

    forall( i in N1, t in T1)

     

    Ic[i][t] == Ic[i][t-1] + w[i][t] - q[i][t]; // (1c)

     

     

    forall( t in T1)

     

    ct1d:sum( i in N1) w[i][t] <= Ip[t-1]; // (1d)

     

     

    forall( t in T3)

     

    ct1e:p[t] <= PB[t]*z[t]; // (1e)

     

     

    ct1f:p[0] >= sum(i in N1)( q[i][1] - Ic[i][0]); // (1f)

     

     

    ct1g:forall( i in N1, t in T1)

     

    sum(j in N: j!=i) x[i][j][t] <= 1; // (1g)

     

     

    forall( j in N1, t in T1)

     

    sum(i in N1: j!=i) x[i][j][t] == sum(i in N: j!=i) x[j][i][t]; // (1h)

     

     

    forall( t in T1)

     

    ct1i:sum( i in N1) x[0][i][t] <= Zeta; // (1i)

     

     

    forall( i in N1, j in N1, t in T1 : j!=i)

     

    ct1j:y[j][t] <= y[i][t] - w[i][t] + D[i][t]*(1-x[i][j][t]); // (1j)

     

     

    ct1k:forall( i in N1, t in T1)

     

    w[i][t] <= D[i][t]*sum(j in N1: j!= i) x[i][j][t]; // (1k)

     

     

     

    // bounds for Ip

     

    forall( t in T)

     

    Ip[t] <= IpMax;

     

    Ip[NumPeriods] == 0;

     

     

    // bounds for Ic and y

     

    forall(i in N1, t in T1)

    {

     

    Ic[i][t] <= IcMax[i];

     

    Ic[i][NumPeriods] == 0;

     

    Ic[i][0] == InitC[i];

     

    y[i][t] <= QQ;

     

    y[0][t] == 0;

    }

     

    forall(i in N1, t in T1)

    {

     

    ctyq:y[i][t] >= q[i][t];

    }

     

     

    // bounds for p

     

    p[NumPeriods] == 0;

     

     

    // bounds for w

     

    forall(i in N1)

     

    w[i][0] == 0;

    }

    then in the IDE you ll get in the relaxations and conflicts tabs some info that will help you debug your model.

    regards

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer