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