Using same identifier twice in variable. Topic is solved

Problems with modeling
Post Reply
daniel93
User
User
Posts: 3
Joined: 5 years ago

Using same identifier twice in variable.

Post by daniel93 »

Hi. I'd like to implement model look like this.

Set
i

Variables
a(i)
b(i)
mult(i,i)

and mult(i1,i2) = a(i1) * a(i2) where i1, i2 are different or same elements of i.

How can i express this equation in GAMS?
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: Using same identifier twice in variable.

Post by Renger »

Hi
Use an alias and define the parameter like this

alias(i,j);
mult(i,j) = a(i) * a(j);

cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
daniel93
User
User
Posts: 3
Joined: 5 years ago

Re: Using same identifier twice in variable.

Post by daniel93 »

thank you very much! I just learned the 'alias' function. It opens so many possibilities in formulation :) :)
Post Reply