Forum Discussion
FICO
5 years agoCommunity Manager
Error 101: Incompatible types in assignment (robustctr := uncertainctr not defined)
I know that this is not possible in its current form, as it fails, but this is what I am trying to do.
I am trying to take an uncertain pricing variable (DAUNC) and multiply it by an uncertain load variable (LOADUNC).
LOADUNC: array(PER) of uncertain
DAUNC: array(PER) of uncertain
RobustDA: robustctr
forall(p in PER) LOADUNC(p) >= LOAD(p) - LOAD(p) * .25
forall(p in PER) LOADUNC(p) <= LOAD(p) + LOAD(p) * .25
forall(p in PER) DAUNC(p) >= DAFCST(p) - DASTD(p) * 2
forall(p in PER) DAUNC(p) <= DAFCST(p) + DASTD(p) * 2
RobustDA := sum(p in PER) LOADUNC(p) * DAUNC(p)
maximize(RobustDA)
Any help would be appreciated to try and get to the ultimate goal of the code.
Thanks!
1 Reply
- FICOCommunity Manager
I'm not entirely sure about the meaning of the quantities LOAD, DAFCST, DASTD, and the uncertains LOADUNC and DAUNC. I will assume that the first three are mpvars. This way, the four constraints are robust constraints (i.e. the variables are constrained with coefficients or, as in this case, a right-hand side that is unknown) while the objective function is a function of uncertain parameters.
The first trouble with the model is precisely in the objective function. LOADUNC and DAUNC are uncertain parameters, i.e., they are not known at the time of solving the problem but, most importantly, they are not decision variables, as you declared them as uncertains. In other words, they are input parameters which are simply unknown, and in addition we do not control them. This is a fundamental notion of robust optimization, and is outlined in the manual on the robust optimization module; it is also explained in much better ways in the robust optimization literature.
Maximizing a function of only uncertain parameters does not have any effect on any of the decision, simply because the objective function does not contain any decision variable, i.e., any mpvars, which are the actual decision variables of the problem, which are unknown but are decisions under our control.
The reason of the error is that Mosel does not accept objective functions that contain uncertain parameters but not mpvars. In general, in order to formulate your model correctly we need to understand the following:
1) are LOAD, DAFCST, and DASTD actual mpvars? In other words, once the problem is solved, do their value correspond to a decision? Does the system you're trying to optimize have a configuration that depends on LOAD, DAFCST, and DASTD, which you can set yourself? Or are these input parameters? In the last case, are they known?
2) most importantly: what are DAUNC and LOADUNC? Are they known before the solve (but I guess they are not)? If they are not known, are they decided by someone else (market, a competitor, supplier, customer)? If so, they are effectively uncertain parameters, but then it doesn't make any sense to maximize their product because they are simply not in our control.
Hope this helps.
Related Content
Related Content
Need help to solve E-101: Incompatible types in assignment ('array of linctr' := 'linctr')
I am trying to solve a simple routing model using Xpress, but I obtain the error message as stated above. The error appears in every constraint where I have declared the constraint as Contraint: arr...6 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum2 unread comments2 unread0Views0likes2CommentsThe assignment target is invalid. You can assign values only to variables, properties and indexed properties
Hi There, When I am comprising enum to enum then getting this error msg. for comprising I am using =, is, and .equals(object) The assignment target is invalid. You can assign values only to varia...0Views0likes1CommentPackages incompatibility
I am trying to run my model with a quadratic objective function and a nonlinear one (for comparison purposes). It does not seem that I can include both mmxnlp and mmquad package in the same file. If ...8 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum1 unread comment1 unread0Views0likes1Comment