Unbounded variable in "implies" condition

63 views
Skip to first unread message

Luis Badesa

unread,
Jan 23, 2018, 8:10:19 AM1/23/18
to YALMIP
I have an issue with an unbounded variable that I use in an "implies" condition. Here is a simplified version of my code:

tol=1;
num_blocks = 2;
num_intervals = 2; 
Constraints1 = [];

a=sdpvar(1);
Bounds = [Bounds, 0 <= a <= 5]; 
 
for k=1:num_blocks
     for i=1:num_intervals
           Bounds = [Bounds,...
                  0 <= Left_term.Block(k).TimeInterval(i) <= 3000]; % Note that "Bounds" already contains some Bounds, more precisely it already 
                                                                                                 % contains bounds on "Left_term.Block(k).TimeInterval(i)". But since I get a warning for unbound variable
                                                                                                 % after using "Left_term.Block(k).TimeInterval(i)" within an "implies" function in the next lines of code,
                                                                                                 % I tried defining again explicit bounds on "Left_term.Block(k).TimeInterval(i)" right before
                                                                                                 % using it in "implies". I still get the warning for unbound variable, as I explain later.
           Constraints1 = [Constraints1,...
                implies(3<=a+tol,...
                Left_term.Block(k).TimeInterval(i) >= 5)];
           constraints = [Bounds, Constraints1];
           optimize(constraints) 
     end
end 

Then I get this warning:  
Warning: You have unbounded variables in an implication
leading to a lousy big-M relaxation.

Note that "Left_term.Block(k).TimeInterval(i)" is a "Linear scalar (real, 3 variables)" that I define previously in the code.

I know for sure that the problem with bounds is due to variable "Left_term.Block(k).TimeInterval(i)", because I have substituted it by a similarly defined variable "Right_term.Block(k).TimeInterval(i)" and the warning in "implies" disappears.

My only guess is that I have not properly defined the bounds on some of the 3 variables contained within "Left_term.Block(k).TimeInterval(i)". But, since I define explicit bounds on "Left_term.Block(k).TimeInterval(i)", I don't understand why this should be an issue.

Johan Löfberg

unread,
Jan 23, 2018, 9:55:44 AM1/23/18
to YALMIP
All variables in Left_term.Block(k).TimeInterval(i) have to be explicitly bounded. Bounds on the expression can not be used when doing the quick bound propagation for the big-M operators

Luis Badesa

unread,
Jan 23, 2018, 12:31:22 PM1/23/18
to YALMIP
Thanks Johan, I solved the problem. The issue was that I was defining a linear combination of decision variables as this:

a = sdpvar(1);
b = sdpvar(1);
DV_sum = sdpvar(1);

(...)

% Then, in a loop that updates DV_sum, I had this:
DV_sum = DV_sum + a + b;

But since I never assigned a variable to DV_sum in the first place, using "DV_sum = DV_sum + a + b" was effectively doing "DV_sum = sdpvar(1) + a + b". Then, that "sdpvar(1)" was unbounded.
Reply all
Reply to author
Forward
0 new messages