Page **2** of **2**

### Re: problem with syntax of the equation

Posted: **Fri Aug 23, 2019 7:06 pm**

by **Alexanre.ito**

Alexanre.ito wrote: ↑5 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 undestand

eq(i) and

eq(i,j)
but GAMS undestand

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

### Re: problem with syntax of the equation

Posted: **Fri Aug 23, 2019 7:13 pm**

by **Alexanre.ito**

Renger wrote: ↑5 months ago

Hi

It is not clear what you want to do with this equation. My advice: write it down as a proper mathematical expression, read how to use the sum in GAMS as well as the $-sign, and proceed from there.

Cheers

Renger

GAMS understand :

**eq(i)..**

eq(i,j)..
but GAMS undestand:

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

### Re: problem with syntax of the equation

Posted: **Tue Aug 27, 2019 3:12 pm**

by **Alexanre.ito**

Alexanre.ito wrote: ↑5 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);