Help with Equation using Tables

Hello,

I am very new to GAMS so I still have a lot to learn. I was hoping
someone could help me with this problem.
I have a table S(i,j) and I want this table multiplied by V(j) to
equal to 0 for each i. so far I have;
sum((i,j),S(i,j)*V(j))=e=0
however this sums all i’s. Below is my actual code, as I mentioned, I
am very new so it may be a little weak.

Overall, the goal is to solve

max each Vj individually

Sum(Sij*Vj) = 0
j

Sum(Gij*Vj) < 0
j

Any help would be very much appreciated!

Rance


Sets i metabolites / Amet, Bmet /
j reactions / upA, AB1, AB2, exB /
e efm / efm1, efm2 /

Table S(i,j) Stoichiometry
upA AB1 AB2 exB
Amet 1 -1 -1 0
Bmet 0 1 1 -1 ;

Table G(e,j) Elementary
upA AB1 AB2 exB
efm1 -1 -1 -1 -1
efm2 -1 -1 -1 -1 ;

Parameter U(j)
/upA = 100
AB1 = 100
AB2 = 100
exB = 100/;

Parameter L(j)
/upA = -100
AB1 = -100
AB2 = -100
exB = -100/;

Parameter O(j)
/upA = 1
AB1 = 0
AB2 = 0
exB = 0/;

Variable obje, V(j);
v.up[j] = U(j); v.lo[j] = L(j);

Equation Stoke, Mode, goal;
Stoke…sum((i,j),S(i,j)*V(j))=e=0;
Mode…sum((e,j),G(e,j)*V(j))=l=0;
goal…sum((j),O(j)*V(j))=e=obje;

Model flux /all/;
solve flux maximize obje using LP;

\

I think what you are after is the following change to the Stoke
equation:

Equation Stoke(i)

Stoke(i)…sum((j),S(i,j)*V(j))=e=0;


This sets S(i,j)*V(j) = 0 for each and every individual i element.


HTH
AndyC



On Apr 8, 3:27 am, Rance wrote:

Hello,

I am very new to GAMS so I still have a lot to learn. I was hoping
someone could help me with this problem.
I have a table S(i,j) and I want this table multiplied by V(j) to
equal to 0 for each i. so far I have;
sum((i,j),S(i,j)*V(j))=e=0
however this sums all i’s. Below is my actual code, as I mentioned, I
am very new so it may be a little weak.

Overall, the goal is to solve

max each Vj individually

Sum(Sij*Vj) = 0
j

Sum(Gij*Vj) > j

Any help would be very much appreciated!

Rance

Sets i metabolites / Amet, Bmet /
j reactions / upA, AB1, AB2, exB /
e efm / efm1, efm2 /

Table S(i,j) Stoichiometry
upA AB1 AB2 exB
Amet 1 -1 -1 0
Bmet 0 1 1 -1 ;

Table G(e,j) Elementary
upA AB1 AB2 exB
efm1 -1 -1 -1 -1
efm2 -1 -1 -1 -1 ;

Parameter U(j)
/upA = 100
AB1 = 100
AB2 = 100
exB = 100/;

Parameter L(j)
/upA = -100
AB1 = -100
AB2 = -100
exB = -100/;

Parameter O(j)
/upA = 1
AB1 = 0
AB2 = 0
exB = 0/;

Variable obje, V(j);
v.up[j] = U(j); v.lo[j] = L(j);

Equation Stoke, Mode, goal;
Stoke…sum((i,j),S(i,j)*V(j))=e=0;
Mode…sum((e,j),G(e,j)*V(j))=l=0;
goal…sum((j),O(j)*V(j))=e=obje;

Model flux /all/;
solve flux maximize obje using LP;

\