Forum Discussion
FICO
5 years agoCommunity Manager
Replace box constraints with Ellipsoid robust constraint
Hi I am attempting a robust optimisation problem using the knapsack example 1.2.1 in the robust doc as a template. I calculate the possible % deviation for each variable in the model (P23PERCENT). I...
FICO
5 years agoCommunity Manager
Hello.
I'll comment on the ellipsoidal constraints first and then on other parts of the model. First, note that due to a parenthesis misplacement the 0.00001 is outside of the denominator. The original constraint is
PEAK23MODE := sum(t in VARIABLES1) ((P23UNCERTAIN(t) / ((abs(PEAK23COEFF(t)) * P23PERCENT(t)))**2)+0.00001) <= 1In order for the 0.00001 to remedy the division-by-zero error, you should write instead
PEAK23MODE := sum(t in VARIABLES1) (P23UNCERTAIN(t) / ((abs(PEAK23COEFF(t)) * P23PERCENT(t))**2+0.00001)) <= 1Note that this only fixes the zero denominator, but does not make the uncertainty set ellipsoidal, since P23UNCERTAIN is still linear. To make it an ellipsoidal uncertainty set, you should use P23UNCERTAIN(t) squared.
Also, due to a limitation in the robust optimization module, ellipsoidal constraints should have squared uncertains multiplied rather than divided by constant. Below is the final version of the constraint (note that you should replace "**" with the hat accent (power sign) which is not allowed in this forum):
PEAK23MODE := sum(t in VARIABLES1) (P23UNCERTAIN(t)**2 * (1 / ((abs(PEAK23COEFF(t)) * P23PERCENT(t))**2+0.00001))) <= 1Changing to this constraint will give you an ellipsoidal uncertain constraint with no division-by-zero issues. Below are a few more comments on the model itself.
First, as you know a robust optimization problem can contain uncertain constraints and robust constraints. The former define the uncertainty set, i.e. set of values that the uncertain parameters can take, and they are either linear or quadratic constraints containing uncertains and Mosel parameters, but no mpvar. The latter can contain mpvars and uncertains, both added and multiplied.
If you wish to use ellipsoidal uncertainty, every uncertain parameter can be included in at most one uncertain constraint. Therefore the uncertain constraint below cannot be used with the above ellipsoidal constraint:
! Peak 23 Robust Constraint
! forall(t in VARIABLES1) do
P23UNCERTAIN(t) <= P23PERCENT(t)*abs(PEAK23COEFF(t)) ! The upper variance of the coefficient allowed by the percentage uncertainty
P23UNCERTAIN(t) >= - P23PERCENT(t)*abs(PEAK23COEFF(t)) ! The lower variance of the coefficient allowed by the percentage uncertainty
! end-doThe same holds for the second set of such constraints with P7UNCERTAIN, P7PERCENT, etc., and for the corresponding ellipsoidal constraint. This is not the case for linear uncertain constraints, which can be in any number. The reason for only one ellipsoidal constraint is that we cannot otherwise implicitly establish the optimal uncertain values and cannot therefore provide a robust solution.
I commented out the sets of linear uncertain constraints. This time the robust optimization problem is created, but it is infeasible as none of the constraints PEAK7MOD1L, PEAK7MOD1H, PEAK23MOD1L, and PEAK23MOD1H can be satisfied. This is due to the ellipsoidal constraints (there are two, on disjoint sets of uncertain parameters) being too loose.
If I change the right-hand side of the four aforementioned constraints to a smaller value like 1e-3, I obtain a robust solution. My suggestion is to check the parameters and/or the definition of the uncertain constraints and robust constraints. It might just be that the uncertainty set needs to be reduced.
I hope this helps. Please let me know if anything is unclear.
Related Content
Related Content
Xpress range constraint
Using the latest Xpress interface I can add a constraint x_i + y_i <= UB_i for all i like this: xprsProb.addConstraints(nrNodes, i -> sum(x+y).leq(UB)); How can I add a range constraint like: LB_i...1 year agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum1 unread comment1 unread0Views0likes1CommentLazy constraints on LP problems
Dear all, I have an LP problem (no integer constraints) where a large number of constraints can in most cases be avoided in most cases just as for Lazy Constraints. However, lazy constraints seem ...3 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum1 unread comment1 unread0Views0likes1CommentI have an optimization model where setting certain variables can lead to constraint violations. Is there a way to identify and remove all infeasible constraints before solving the model?
1 year agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum2 unread comments2 unread0Views0likes2Comments