Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

modelling an equation

  • 1.  modelling an equation

    Posted Tue August 26, 2014 01:01 PM

    Originally posted by: ShirinG


    Hi all,
     
    I have a problem in implementing the following expression (attached) in CPLEX optimization studio. In the following expression, the third sum's starting range is dependent on the other sum counters and the value is calculated according to those two values. I am not sure how should I use the forall and sum expressions when my start point in the third sum is variable.  

    I appreciate if I hear from you,

    Shirin


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: modelling an equation

    Posted Wed August 27, 2014 03:47 AM

    Originally posted by: 6950_Stefan_Woerner


    Hi Shirin,

    I would probably construct the inner sum during preprocessing (makes the whole code also easier to read).

    That would be something like the following:

    float data[i in I][s in S][j in A] = sum( d in 1..m[s] : d >= abs(i - j) ) p[s][d] * n[s] * ceil(d / l);

    Best,

    Stefan


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: modelling an equation

    Posted Wed August 27, 2014 02:59 PM

    Originally posted by: ShirinG


     
    Thanks Stefan for your answer. The result for "sum" is one value, right? So how is it possible to fill it in a three dimensional array.
    Please correct me if I'm wrong. 

    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: modelling an equation

    Posted Wed August 27, 2014 05:10 PM

    Originally posted by: 6950_Stefan_Woerner


    Hi Shirin,

    the result of "sum" is one value for every (i, s, j).
    The above notation iterates over every [i in I], [s in S], and [j in A].
    Hence, you get the desired 3-dimensional array.

    Best,

    Stefan


    #DecisionOptimization
    #OPLusingCPLEXOptimizer