Decision Optimization

Decision Optimization

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


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

dexpr circular dependency

  • 1.  dexpr circular dependency

    Posted 06/15/13 10:47 AM

    Originally posted by: Matl_P


    Hello! I'm somewhat new to CPLEX so please excuse me if this is a stupid question, but I hope you can help me. I'm trying to model a problem of the form:

    yk = decision var

    x0 = some starting value

    xk = x(k-1) + yk

    Of course there are further constraints on Y and so on, but this is the general form of the model. It runs a particular set of expression a certain number of times (cycles), whereby the results of the previous cycles are used to determine the constraints of the current cycle. I've tried the following in CPLEX, but I get a circular dependency error for the dexpr:

    range R = 1..cycles;

    dvar int+ Y[R];

    dexpr int X[c in R] = X[c-1] + Y[c];

     

    How can I model something like this? I've gotten the model to work by making the X a decision variable and re-expressing some of the content, but this increases the number of variables too much to be of practical use, because the actual model has very many such constraints and the number of cycles is large (almost 300).


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: dexpr circular dependency

    Posted 07/02/13 12:31 PM

    Hi

     

    have you tried to rewrite into

     

    dvar int X[R]
    dexpr int y[c in R diff first(R)]=X[c]-X[c-1];

     

    ?

     

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer