writing special constraint in GAMS

조회 수: 1 (최근 30일)
fatema saba
fatema saba 2014년 12월 21일
Hi,
I have 3 excel sheets that refer to 3 kinds of a thing (then K=1,2,3). each sheet has 20 rows (i=1,2,...,20) and 10 columns (j=1,2,...,10). in fact each sheet has 20 cells with value from (A1:J20).
also I have 2 kinds of variable X and Y. by counting 3 kinds of thing that I had (I mean k=1,2,3) then I have 9 variables. I called them (X1,X2,X3,X4,Y1,Y2,Y3,Y4)
Now it is my question. how can I write following constraint in gams:
this is one of my constraint. I write something like that in gams but I got error 149:
cons1.. Y1(i,j) =l= sum(X1(i-1,j),X1(i,j-1),X1(i,j-1),X1(i,j+1);
cons2.. Y2(i,j) =l= sum(X2(i-1,j),X2(i,j-1),X2(i,j-1),X2(i,j+1);
cons3.. Y3(i,j) =l= sum(X3(i-1,j),X3(i,j-1),X3(i,j-1),X3(i,j+1);
cons4.. Y4(i,j) =l= sum(X4(i-1,j),X4(i,j-1),X4(i,j-1),X4(i,j+1);

답변 (0개)

카테고리

Help CenterFile Exchange에서 Just for fun에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by