problem with syntax of the equation Topic is solved

Problems with syntax of GAMS
Alexanre.ito
User
User
Posts: 8
Joined: 1 month ago

Re: problem with syntax of the equation

Post by Alexanre.ito » 3 weeks ago

Alexanre.ito wrote:
3 weeks 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
User
Posts: 8
Joined: 1 month ago

Re: problem with syntax of the equation

Post by Alexanre.ito » 3 weeks ago

Renger wrote:
3 weeks 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
User
Posts: 8
Joined: 1 month ago

Re: problem with syntax of the equation

Post by Alexanre.ito » 3 weeks ago

Alexanre.ito wrote:
3 weeks 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);

Post Reply