Having Nasty Constraints with for loops

15 views
Skip to first unread message

Ali Najafi

unread,
Mar 19, 2019, 5:10:10 AM3/19/19
to YALMIP
Dear Professor Loftberg,

I have a set of constraints that I have attached with this email in which x(it) and y(t) are decision variables and t|l means t divides l. I am trying to solve this problem with YALMIP. Since I cannot use the same for loops for the first component and the second component of the constraints, I need to save them separately somewhere and while doing so I am getting NaN values for them. It will be very kind of you to help me out with this problem. 

YALMIP.png

Thank you very much in advance.
Ali

Johan Löfberg

unread,
Mar 19, 2019, 8:22:24 AM3/19/19
to YALMIP
so what's wrong with the brutally simple

left = 0;
for i = ...
 
for t = ....
 left
= left +
end
end
Model = [Model,left<= 0]


Reply all
Reply to author
Forward
0 new messages