Search found 19 matches

by mrv_ce
5 years ago
Forum: Syntax
Topic: Index change for constraints
Replies: 4
Views: 4986

Re: Index change for constraints

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.
by mrv_ce
5 years ago
Forum: Syntax
Topic: Index change for constraints
Replies: 4
Views: 4986

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.
by mrv_ce
5 years ago
Forum: Syntax
Topic: Loop for objective function
Replies: 34
Views: 314157

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). ...
by mrv_ce
5 years ago
Forum: Syntax
Topic: Loop for objective function
Replies: 34
Views: 314157

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...
by mrv_ce
5 years ago
Forum: Syntax
Topic: Loop for objective function
Replies: 34
Views: 314157

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...
by mrv_ce
5 years ago
Forum: Syntax
Topic: Unique key use for a closed form constraint
Replies: 2
Views: 4703

Re: Unique key use for a closed form constraint

Thanks a lot. It is very useful for me.
by mrv_ce
5 years ago
Forum: Syntax
Topic: Closed form of a constraint
Replies: 2
Views: 3525

Re: Closed form of a constraint

Thanks a lot. It become very useful for me.
by mrv_ce
5 years ago
Forum: Syntax
Topic: Unique key use for a closed form constraint
Replies: 2
Views: 4703

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...
by mrv_ce
5 years ago
Forum: Syntax
Topic: Closed form of a constraint
Replies: 2
Views: 3525

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...