Using same identifier twice in variable. Topic is solved

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

Using same identifier twice in variable.

Post by daniel93 » 5 months ago

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: 221
Joined: 2 years ago

Re: Using same identifier twice in variable.

Post by Renger » 5 months ago

Hi
Use an alias and define the parameter like this

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

cheers
Renger

daniel93
User
User
Posts: 3
Joined: 5 months ago

Re: Using same identifier twice in variable.

Post by daniel93 » 5 months ago

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

Post Reply