## Search found 37 matches

- 5 days ago
- Forum: Modeling
- Topic: Modeling the absolute value
- Replies:
**21** - Views:
**615**

### Re: Modeling the absolute value

Hi, the dollar command is used to manipulate the sets. For example, if the restrictions eq1, eq2, eq3 and eq4 does not apply to the last "t": eq1(n,m,t)$(ord(t) ne card(t)).. 1 - z(n,m,t) + z(n,m,t+1) + absvalue(n,m,t) =g= 1; eq2(n,m,t)$(ord(t) ne card(t)).. 1 - z(n,m,t) + 1-z(n,m,t+1) + 1...

- 6 days ago
- Forum: Modeling
- Topic: Modeling the absolute value
- Replies:
**21** - Views:
**615**

### Re: Modeling the absolute value

Hi, this constraints are equivalent to "sum((n,m,t),abs(z(n,m,t) - z(n,m,t+1)) =l= 2*j" With the command "$" you must decide what happens with the last t eq1(n,m,t).. 1 - z(n,m,t) + z(n,m,t+1) + absvalue(n,m,t) =g= 1; eq2(n,m,t).. 1 - z(n,m,t) + 1-z(n,m,t+1) + 1-absvalue(n,m,t) =...

- 1 week ago
- Forum: Modeling
- Topic: Modeling the absolute value
- Replies:
**21** - Views:
**615**

- 1 week ago
- Forum: Modeling
- Topic: Modeling the absolute value
- Replies:
**21** - Views:
**615**

### Re: Modeling the absolute value

Hi again PeterBe, I think this can works x(t) and c(t) are continuous variables p(t) are binary variables M is a sufficiently large number (BigM parameter) if "p=1", by "eq3" (x-c) is greater than 0 so by "eq1" and "eq2" absvalue = x-c (the rest of equation ar...

- 1 month ago
- Forum: Modeling
- Topic: Maximizing the difference in the order of binary variables
- Replies:
**20** - Views:
**394**

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

HI, I think that the first approximation generate a smaller model that require lower memory. But i don't know how much memory will consume.

I don't know if there are any way to estimate how much memory the model needs

Best regard

I don't know if there are any way to estimate how much memory the model needs

Best regard

- 1 month ago
- Forum: Modeling
- Topic: Maximizing the difference in the order of binary variables
- Replies:
**20** - Views:
**394**

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

Yes, this BigM formulation generates a very large model...

- 1 month ago
- Forum: Modeling
- Topic: Maximizing the difference in the order of binary variables
- Replies:
**20** - Views:
**394**

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

Hi Peter, no, for bigM reformultation you don't have to use thousands of equations. The model that I showed was complete, but when is expanded is very bigger. As i say previously, if you could found a compact way to express the first formulation of the problem the model will result more small and ea...

- 1 month ago
- Forum: Modeling
- Topic: Maximizing the difference in the order of binary variables
- Replies:
**20** - Views:
**394**

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

Hi, 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? You have to propose the maximum number of time in which x=1, this is an upper bound. You don't has to know the number of time in wh...

- 1 month ago
- Forum: Modeling
- Topic: Maximizing the difference in the order of binary variables
- Replies:
**20** - Views:
**394**

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

I think that the first formulation of the problem is better than the BigM. In the first approximation you must to type more equation but the final size is lower. Maybe, if you could found a compact way to express the first formulation the model will result small an easy to implement. If an upper bou...

- 1 month ago
- Forum: Modeling
- Topic: Maximizing the difference in the order of binary variables
- Replies:
**20** - Views:
**394**

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

Hi Peter, I forgot to define the variables because I wrote them fast in the browser without checking them in GAMS. xpos(tp,t) and ypos(tp,t) are binary variable For example, if xpos('1','4')=1 this mean thats the first time of x it happen in the fouth order (tp=1 and t=4) if xpos('2','10')=1 this me...