x(i,j),y(i,j)都是3*4的矩阵,z是4*4矩阵,怎么用lingo表示约束条件:x(i,j)+z(i-1,j)=y(i,j)+z(i,j)

问题描述:

x(i,j),y(i,j)都是3*4的矩阵,z是4*4矩阵,怎么用lingo表示约束条件:x(i,j)+z(i-1,j)=y(i,j)+z(i,j)
x(i,j),y(i,j)都是3*4的矩阵,z是4*4矩阵 z(0,j)=0;
怎么用lingo表示约束条件:x(i,j)+z(i-1,j)=y(i,j)+z(i,j) (i=1,2,3,j=1,2,3,4)
主要就是如何解决z超出范围的问题,谢了~

SETS:
r/1..3/:;
c/1..4/:;
link(r,c):x,y,z;
ENDSETS
@for(r(i):x(i,j)+@if(i#eq#1,0,z(i-1,j))=y(i,j)+z(i,j));