## Search found 66 matches

- 3 weeks ago
- Forum: Syntax
- Topic: Two Indexex [Maybe Alias problem]
- Replies:
**4** - Views:
**535**

### Re: Two Indexex [Maybe Alias problem]

Hi, the problem is in set k at the end of the equation: ...V_NEG*dm(j,k)/sum(jj,dm(jj,k)); This is the equation exactly like the one in the image: eq_margen_1(j) .. sum(p,is(j,p))+ sum(i,th(j,i)*Y(i,j)) - sum(k,dm(j,k)) =G= sum(jj, sum(p,is(jj,p))+ sum(i,th(jj,i)*Y(i,jj)) - sum(k,dm(jj,k)))*V_NEG*dm...

- 2 months ago
- Forum: Syntax
- Topic: Binary Matrix
- Replies:
**2** - Views:
**148**

### Re: Binary Matrix

Hi, you must specify that MM(i,k) is a binary variable.

Bye

Code: Select all

```
Binary Variable
MM(i,k) ;
```

- 2 months ago
- Forum: Archive Google Group
- Topic: maximum number of repetitions
- Replies:
**2** - Views:
**263**

### Re: maximum number of repetitions

Hi, I think this can work. Maybe it should be modified for a greater generality Bye! set i your set i /1*55/ n number of pattern /p1*p6/ j your set j /40,50,60/ pattern(n,j) pattern definition /p1.40,p2.50,p3.60,p4.40,p4.50,p5.40,p5.60,p6.50,p6.60/ ; table D(i,j) 40 50 60 1 40 50 2 60 3 40 9 50 17 5...

- 2 months ago
- Forum: Syntax
- Topic: controling equations with subsets
- Replies:
**3** - Views:
**211**

### Re: controling equations with subsets

Hi, you must always reference to the original set (i, j) for example: set i /i1*i10/ j /j1*j15/ h /h1*h40/ technology(i,j) subset_of_tech(i,j) ; technology(i,j)= some set definition subset_of_tech(i,j)= some set definition constraint(i,j,h)$(technology(i,j) and subset_of_tech(technology)).. var(i,j,...

- 2 months ago
- Forum: Modeling
- Topic: Linearization problem with three decision variables
- Replies:
**1** - Views:
**113**

### Re: Linearization problem with three decision variables

Hello, do you need the product of three variables? If so, you can linearizing the product of two binary variables (Quality of production and Transportation area); this generate a new binary variable (suppose QT). Finally, you can linearizing the product of a binary and a continuous variable (QT and ...

- 2 months ago
- Forum: Syntax
- Topic: controling equations with subsets
- Replies:
**3** - Views:
**211**

### Re: controling equations with subsets

Hi, I hope this can help you.

Bye

constraint(technology)$subset_of_tech(technology).. var(technology) =g= par(technology);

Bye

constraint(technology)$subset_of_tech(technology).. var(technology) =g= par(technology);

- 3 months ago
- Forum: Modeling
- Topic: To binary or not to binary...
- Replies:
**4** - Views:
**247**

### Re: To binary or not to binary...

Hi, you can use a bounded continuous variable.

positive variable

T

;

T.lo=50;

T.up=150;

This works, except if you need that the variable take integer values.

Bye

positive variable

T

;

T.lo=50;

T.up=150;

This works, except if you need that the variable take integer values.

Bye

- 4 months ago
- Forum: Modeling
- Topic: Xii >= Xij how to code in GAMS
- Replies:
**2** - Views:
**173**

### Re: Xii >= Xij how to code in GAMS

Hi, it's simple

set i warehouse /1*3/;

alias(i,j);

eq(i,j)$(ord(i) ne ord(j)).. X(i,i) =g= X(i,j);

Bye

set i warehouse /1*3/;

alias(i,j);

eq(i,j)$(ord(i) ne ord(j)).. X(i,i) =g= X(i,j);

Bye

- 5 months ago
- Forum: Syntax
- Topic: kind request: Setting two variables equal in GAMS
- Replies:
**1** - Views:
**162**

### Re: kind request: Setting two variables equal in GAMS

Hi,

what is J, K, RJ and KR?

Can you explain what each set means?

An alternative can be:

eq(J,K,RJ,KR)$(sameas(J,RJ) and sameas(K,KR)).. FlowMSAsMEN(J,K) =E= FlowMSAsREG(RJ,KR);

Bye

what is J, K, RJ and KR?

Can you explain what each set means?

An alternative can be:

eq(J,K,RJ,KR)$(sameas(J,RJ) and sameas(K,KR)).. FlowMSAsMEN(J,K) =E= FlowMSAsREG(RJ,KR);

Bye

- 5 months ago
- Forum: Syntax
- Topic: logical equations & binary variables
- Replies:
**13** - Views:
**1216**

### Re: logical equations & binary variables

Hi, I think you can try a simple big-M reformulation. I assume that "HS(j)" is continuous and positive. The new variable TWC_HS(j) correspond to TWC(j)*HS(j) x(j) is a binary variable: x(j)=1 if HS(j) >=1000. x(j)=0 if HS(j) < 1000 eq1(j).. HS(j) =g= 1000*x(j); eq2(j).. TWC_HS(j) =g= 3.21*HS(j) - 3....