## Search found 62 matches

11 months ago
Forum: Modeling
Topic: Maximizing the difference in the order of binary variables
Replies: 28
Views: 2984

### Re: Maximizing the difference in the order of binary variables

Thanks Manassaldi for your answer and your effort :-) Hi, x(tp) is the sum of the product between a binary variable and its position, so I suppose that is an integer variable (not binary). Anyway, I think it's better to define it as a continuous variable. I think I am getting confused. Let's have a ...
11 months ago
Forum: Modeling
Topic: Maximizing the difference in the order of binary variables
Replies: 28
Views: 2984

### Re: Maximizing the difference in the order of binary variables

Thanks for your answer Manassaldi eq01(tp).. x(tp) =e= sum(t,xpos(tp,t)*ord(tp)) eq02(tp).. c(tp) =e= sum(t,ypos(tp,t)*ord(tp))}); eq1(tp).. absvalue(tp) =l= x(tp) - c(tp) + (1-p(tp))*M; eq2(tp).. absvalue(tp) =g= x(tp) - c(tp) - (1-p(tp))*M; eq3(tp).. x(tp) - c(tp) =g= -(1-p(tp))*M eq4(tp).. absval...
1 year ago
Forum: Modeling
Topic: Maximizing the difference in the order of binary variables
Replies: 28
Views: 2984

### Re: Maximizing the difference in the order of binary variables

Hi I'm back again :-) and I have a question regarding the BigM formulation: The objective function looks like this : sum(tp, sum (t,xpos(tp,t)*ord(tp)) - sum(t,ypos(tp,t)*ord(tp))); How can I model the absolute value of the inner sum? Meaning: sum(tp, ABS{sum (t,xpos(tp,t)*ord(tp)) - sum(t,ypos(tp,t...
1 year ago
Forum: Modeling
Topic: Modeling the absolute value
Replies: 21
Views: 3826

### Re: Modeling the absolute value

Hi guys, does nobody have a clue? I just want incoorporate the absolute value of: abs( (sum(t, x(t))) - (sum(t, y(t))) (with x(t) and y(t) being binary variables) Manassaldi suggest the following for binary variables: eq1(t).. 1 - x(t) + c(t) + absvalue(t) =g= 1; eq2(t).. 1 - x(t) + 1-c(t) + 1-absva...
1 year ago
Forum: Modeling
Topic: Modeling the absolute value
Replies: 21
Views: 3826

### Re: Modeling the absolute value

Hi guys, I have a further question: I still have not fully understood how to modell the absolute value of a difference in GAMS. I have used the following equations for binary variables for modelling: abs(x(t) - y(t)): eq_z_firstCondition(t).. z(t) =l= 2 - x(t) - y(t); eq_z_secondCondition(t).. z(t) ...
1 year ago
Forum: Modeling
Topic: Maximizing the difference in the order of binary variables
Replies: 28
Views: 2984

### Re: Maximizing the difference in the order of binary variables

Yes, this BigM formulation generates a very large model... Two question regarding this: 1) Does the first approximation generate a smaller model which does not need to much memory? Or do you know any other way how to reduce the required memory size? 2) Is there a way to roughly estimate how much me...
1 year ago
Forum: Modeling
Topic: Maximizing the difference in the order of binary variables
Replies: 28
Views: 2984

### Re: Maximizing the difference in the order of binary variables

Hi Manassaldi, i tried to execute the BigM-Relaxation approach of my model. However my computer was out of memory. The workspace was more than 27.000 Mb and then GAMS stopped with the message "Out of memory". I think by memory GAMS is referring to RAM and not to harddrive. Because on my harddrive th...
1 year ago
Forum: Modeling
Topic: Maximizing the difference in the order of binary variables
Replies: 28
Views: 2984

### Re: Maximizing the difference in the order of binary variables

Hi Manassaldi, So, if this upper bound is equal to 50 you have to insert 50 equation for x and 50 for y. I don't really have an upper bound. The only upper bound I have is the number of timeslots,which is 1440. So I have to insert 1440 *2= 2880 equations when using the first approximation? What abou...
1 year ago
Forum: Modeling
Topic: Maximizing the difference in the order of binary variables
Replies: 28
Views: 2984

### Re: Maximizing the difference in the order of binary variables

Hi Manassaldi, Thank you for your answers I still have questions: 1) In your first formulation I think you have to insert equations for all timeslots and the number of time in which x is has to be know in advance. Is that correct? eqfirstx(t).. 1 - x(t) + sum(tp\$(ord(tp) lt ord(t)),x(tp)) + xfirst(t...
1 year ago
Forum: Modeling
Topic: Maximizing the difference in the order of binary variables
Replies: 28
Views: 2984

### Re: Maximizing the difference in the order of binary variables

Thanks Manassaldi for your answer, but I do nor understand your code: set t /1*1440/ ; alias(t,tp,tpp); binary variable x(t) y(t) ; variable z ; equation eq1,eq2,eq3,eq4,eq5,eq6,eqobj ; eq1(t,tp).. sum(tpp\$(ord(tpp) le ord(t)),x(tpp)) =l= ord(tp) + (1-xpos(tp,t))*1440; eq2(t,tp).. sum(tpp\$(ord(tpp) ...