Forum Discussion

FICO's avatar
FICO
Community Manager
5 years ago

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 have applied box constraints already but this equates to a further relaxation of a corresponding Linear Programming problem. I have included these in the attachment but I have commented them out.

I have attempted to replace these upper and lower bounds with one confidence ellipsoid containing all uncertain realizations contained in the aforementioned box (this would hence replace the upper/lower bound constraints on P23UNCERTAIN(t)) and that prevents all uncertain parameters from being at an extreme of the box.

My attempt returns an error saying I am dividing by zero, so I introduced a nominal value of 0.00001 to try to avoid this. But this isn't working. Any help would be greatly appreciated.

Thanks,

Will

4 Replies

  • FICO's avatar
    FICO
    Community 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) <= 1

    In 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)) <= 1

    Note 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))) <= 1

    Changing 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-do

    The 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.

  • FICO's avatar
    FICO
    Community Manager

    Hi Pietro,

    Thank you so much for such a detailed and considered response. The issue is much clearer now. Should I try set the right hand side of the ellipsoidal constraint as the upper limit of the uncertainty set?

    Thanks again,

    Will

  • FICO's avatar
    FICO
    Community Manager

    Hi Will,

    yes, the right hand side of the ellipsoidal constraint above is what determines the uncertainty: the smaller, the less uncertainty and the better the robust solution. Larger values of the right hand side imply more uncertainty, possibly resulting in an infeasible model.

    Pietro

  • FICO's avatar
    FICO
    Community Manager

    Excellent, thanks again Pietro. That was really helpful.