writing special constraint in GAMS
조회 수: 1 (최근 30일)
이전 댓글 표시
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/146552/image.png)
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Assembly에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!