Alexanre.ito wrote: ↑3 months ago

I'd like to know

if GAMS undestand this situation

...

n nodes / n1 * n48 /

a(n,n) /..../;

....

alias(n,np,i,j);

...

q(n) - scalar

q(a) - variable

...

eq1(a(i,j)).. q(a(n,np)) =e= sum(q(a(n,np)$(np=i)) + q(n)

GAMS understand :

** eq(i)**

eq(i,j)
but GAMS undestand:

**eq(a(i,j))** ???

my objective is to elaborate an equation that the flow of some arc considering the sum of all arcs that end at the beginning node of the arc that I want to analyse

I found my answer in the GAMS examples: [waterx.gms]

loss(a(n,np))..

h(n) - h(np) =e= [hloss*dist(a)*(qp(a)+qn(a))**(qpow-1)*(qp(a)-qn(a))/d(a)**dpow] $(qpow <> 2) +

[hloss*dist(a)*(qp(a)+qn(a))* (qp(a)-qn(a))/d(a)**dpow] $(qpow = 2);