Hi,

T is continuous and positive variable.

Constraint has equality.

In gams code is like " eq(i).. T(i) =g= T(i-1)"

However for the i-1 case it can not run.

Thanks.

## Search found 19 matches

- 9 months ago
- Forum: Syntax
- Topic: Index change for constraints
- Replies:
**4** - Views:
**513**

- 9 months ago
- Forum: Syntax
- Topic: Index change for constraints
- Replies:
**4** - Views:
**513**

### Index change for constraints

Hello everybody,

I need to write an equation for my model.

I m trying to write T(i) > T(i-1) for every i .

T is decision variable and i is index for T variable.

i is a set which includes 1,2,3,...,N. N is very big integer.

Can you help me please?

Thanks a lot.

I need to write an equation for my model.

I m trying to write T(i) > T(i-1) for every i .

T is decision variable and i is index for T variable.

i is a set which includes 1,2,3,...,N. N is very big integer.

Can you help me please?

Thanks a lot.

- 1 year ago
- Forum: Syntax
- Topic: Loop for objective function
- Replies:
**5** - Views:
**2533**

### Re: Loop for objective function

Hi, In the example, x is defined. Is this equal to " sum(q,(w(q)**n)*(abs(pj(q)-c('1',q)))**n))**in " equation or x is something new? And one more question, parameter p(j) Parameter defined over j, pj Scalar to be used in the loop to replace p; These are defined and we also defined pj(q). pj(q) and ...

- 1 year ago
- Forum: Syntax
- Topic: Loop for objective function
- Replies:
**5** - Views:
**2533**

### Re: Loop for objective function

Hi, Actually L(j,'1') is distance function. And I coded like below sum(q,(w(q)**n)*(abs(p(j,q)-c('1',q)))**n))**in q and j are sets. n and in are scalars. I need the results for every j. I could not understand how can I remove j from the objective function and save it to a parameter? My objective fu...

- 1 year ago
- Forum: Syntax
- Topic: Loop for objective function
- Replies:
**5** - Views:
**2533**

### Loop for objective function

Hello everybody, In my work, I need to write a loop for my objective function. In my objective function, I use one set which is coded with j. And I need the model results for every j values. I write an loop but I obtained "ERROR 149: Uncontrolled set entered as constant." My code like this below; Se...

- 1 year ago
- Forum: Syntax
- Topic: Unique key use for a closed form constraint
- Replies:
**2** - Views:
**1604**

### Re: Unique key use for a closed form constraint

Thanks a lot. It is very useful for me.

- 1 year ago
- Forum: Syntax
- Topic: Closed form of a constraint
- Replies:
**2** - Views:
**1229**

- 1 year ago
- Forum: Syntax
- Topic: Unique key use for a closed form constraint
- Replies:
**2** - Views:
**1604**

### Unique key use for a closed form constraint

Hello everybody, I'm conducting a research and I need to write a constraint for my model in GAMS. Can you help me? L(A(i),C(m)) +e =l= L(A(i),C(k))-r In this constraint L is distance function it calculates the distance between A(i) and C(m). i is alternative set. m is class set. The constraint compa...

- 1 year ago
- Forum: Syntax
- Topic: Closed form of a constraint
- Replies:
**2** - Views:
**1229**

### Closed form of a constraint

Hello everybody, I'm conducting a research and I need to write this constraint to the GAMS in my model. Can you help me? L(A(i),C(m)) +e =l= L(A(i),C(k))-r the constraint will work for every i and m not equal to k set. e is error decision variable. r is very small constant value to get rid of equali...