How can I connect two indexs (i1,i2) and then put it in GAMS coding?

:smiley:

  1. Use an alias (https://www.gams.com/latest/docs/UG_SetDefinition.html#UG_SetDefinition_TheAliasStatementMultipleNamesForASet): alias (i,i1,i2). Declare everything with i and use it in the algebra as needed.
  2. Use not sameas(i1,i2) (https://www.gams.com/latest/docs/UG_CondExpr.html#UG_CondExpr_keywdSameas) in a condition (https://www.gams.com/latest/docs/UG_CondExpr.html#UG_CondExpr_TheDollarCondition): sum((j,i1,i2)(not sameas(i1,i2)), …)

-Michael

Thank a lot :innocent: