## problem with syntax of the equation Topic is solved

Problems with syntax of GAMS
Alexanre.ito
User Posts: 10
Joined: 6 months ago

### Re: problem with syntax of the equation

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))??

Alexanre.ito
User Posts: 10
Joined: 6 months ago

### Re: problem with syntax of the equation

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)).. ???

Alexanre.ito
User Posts: 10
Joined: 6 months ago

### Re: problem with syntax of the equation

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);