Page 1 of 1

Using same identifier twice in variable.

Posted: Fri Jul 13, 2018 6:49 am
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?

Re: Using same identifier twice in variable.

Posted: Fri Jul 13, 2018 5:25 pm
by Renger
Hi
Use an alias and define the parameter like this

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

cheers
Renger

Re: Using same identifier twice in variable.

Posted: Mon Jul 16, 2018 10:33 am
by daniel93
thank you very much! I just learned the 'alias' function. It opens so many possibilities in formulation :) :)