Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Setting brackets in OPL

    Posted 03/08/10 04:04 AM

    Originally posted by: Brummel


    Hello everybody,

    I have a problem concerning calculating with brackets.

    I have a restriction like the following:

    forall ( i in Plants, m in Products, t in Periods )
    ctbracket:
    a[i][m][t] / ( c[i] + b[i][m]t-1 * c[i] ) - d[i] <= e[i][m][t];

    However, when solving my model I receive an error message containing:
    CPLEX(default) cannot extract expression: a[i](m)(t)/(c[i]+b[i](m)(t+(-1))*c[i])

    I guess I used the wrong expression for the brackets (which I displayed in bold in this thread) but I couldn't find any hints in the manual.

    Can somebody help me?

    Thanks in advance,

    Sven
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Setting brackets in OPL

    Posted 03/09/10 08:38 AM

    Originally posted by: SystemAdmin


    Hi Sven,

    a few quick questions:
    What are the variables?
    What are data-elements?
    How are a,b,c,d,e declared?
    Regards
    Norbert
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Setting brackets in OPL

    Posted 03/15/10 06:27 AM

    Originally posted by: Brummel


    Hello Norbert,

    thanks for your response. I digged a little deeper and apparently it is not the brackets that causes me problems.
    What I try to do is to implement stepwise linear cost. However, I do not want to use the piecewise function since it does not really suit my needs. The piecewise function should depend partly on a constant and partly on a decision variable (production quantity from the previous period).

    Indizes are the following:
    i = plants
    m = products
    t = periods

    forall ( i in Plants, m in Products, t in Periods )
    ctPiecewiseUP:
    productionUP[i][m][t] / ( KA[i] + production[i][m]t-1 * SA[i] ) - TOL[i] <= piecewiseUP[i][m][t];

    Decision variables are the following:
    productionUP = variable that shows the amount of added production quantity from t-1 to t
    production t-1 = production quantity in the previous period
    piecewiseUP = positive integer variable which shows the number of piecewise units if production quantity has been raised

    Data-elements are the following:
    SA = percentage
    KA = constant
    TOL = tolerance parameter

    I guess the error occurs since I cannot divide a decision variable by a decision variable. Is that right?
    Can I somehow solve this problem another way or is this doable at all in OPL respectively?

    Many thanks in advance,

    Sven
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Setting brackets in OPL

    Posted 03/15/10 01:23 PM

    Originally posted by: SystemAdmin


    Dear Sven,

    you are right - the division of decison variables in nonlinear
    and cannot be modelled in OPL/CPLEX (as far as I know - maybe
    one of the experts have more infos on this).
    That completely explains your error.

    Thus you should rethink your modelling. From your description it
    is not completely clear what you want to achieve.
    But does an extra variable that holds the
    difference in production from period t-1 to t do the same job?

    Best regards
    Norbert

    Best regards
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: Setting brackets in OPL

    Posted 03/17/10 04:06 AM

    Originally posted by: Brummel


    Hello Norbert,

    thanks, I already feared that this was going to be the problem. Therefore, I should think of remodeling.

    Well, you are right. An extra variable that holds the differnce in production from period t-1 to t will do the same job and is actually what I'm looking for.
    However, as for now, I split this variable into an increasing amount and a decreasing amount (I just showed the restriction for the increasing amount since the one with the decreasing amount is similar) because I'm not sure whether there is a difference between them regarding the cost (efforts to adapt to changing production quantities).

    Best regards

    Sven
    #DecisionOptimization
    #OPLusingCPLEXOptimizer