lingo语法问题sets:u/1..6/;r/1..6/;endsetsmax=s1+s2+s3+s4;s1=0.5*r2*r1*@sin(u2-u1);s2=0.5*r3*r2*@sin(u3-u2);s3=0.5*r4*r3*@sin(u4-u3);s4=0.5*r5*r4*@sin(u5-u4);s5=0.5*r6*r5*@sin(u6-u5);@for(r(i)|i#ne#6:u(i)

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/16 01:27:21
lingo语法问题sets:u/1..6/;r/1..6/;endsetsmax=s1+s2+s3+s4;s1=0.5*r2*r1*@sin(u2-u1);s2=0.5*r3*r2*@sin(u3-u2);s3=0.5*r4*r3*@sin(u4-u3);s4=0.5*r5*r4*@sin(u5-u4);s5=0.5*r6*r5*@sin(u6-u5);@for(r(i)|i#ne#6:u(i)
xݒn0_%nVi$ŒT}UcvtMemRjbBdF_v:ynsxVq1/&n!T*o3x/|,C mR-f):l*2u4XI`dL[GIPՑ@U3 U5^6憳X= =0&{w" L>EЬlRX"ےy$-A}l)m-A_o

lingo语法问题sets:u/1..6/;r/1..6/;endsetsmax=s1+s2+s3+s4;s1=0.5*r2*r1*@sin(u2-u1);s2=0.5*r3*r2*@sin(u3-u2);s3=0.5*r4*r3*@sin(u4-u3);s4=0.5*r5*r4*@sin(u5-u4);s5=0.5*r6*r5*@sin(u6-u5);@for(r(i)|i#ne#6:u(i)
lingo语法问题
sets:
u/1..6/;
r/1..6/;
endsets
max=s1+s2+s3+s4;
s1=0.5*r2*r1*@sin(u2-u1);
s2=0.5*r3*r2*@sin(u3-u2);
s3=0.5*r4*r3*@sin(u4-u3);
s4=0.5*r5*r4*@sin(u5-u4);
s5=0.5*r6*r5*@sin(u6-u5);
@for(r(i)|i#ne#6:u(i)u6=@acos(-1);
u(i)<=@acos(-1);
r(6)=0;
@smax(r(i))=1;

lingo语法问题sets:u/1..6/;r/1..6/;endsetsmax=s1+s2+s3+s4;s1=0.5*r2*r1*@sin(u2-u1);s2=0.5*r3*r2*@sin(u3-u2);s3=0.5*r4*r3*@sin(u4-u3);s4=0.5*r5*r4*@sin(u5-u4);s5=0.5*r6*r5*@sin(u6-u5);@for(r(i)|i#ne#6:u(i)
集定义完全不对 你搞清楚哪个是集 哪个是变量 这是不同的概念 而且集中变量带下标的话下标必须有括号 我不知道你的u1和u(1)是不是一个东西
建议你找个教程仔细去读集这一部分 读懂才可能写出来

lingo语法问题sets:u/1..6/;r/1..6/;endsetsmax=s1+s2+s3+s4;s1=0.5*r2*r1*@sin(u2-u1);s2=0.5*r3*r2*@sin(u3-u2);s3=0.5*r4*r3*@sin(u4-u3);s4=0.5*r5*r4*@sin(u5-u4);s5=0.5*r6*r5*@sin(u6-u5);@for(r(i)|i#ne#6:u(i) lingo 编程时出现错误,希望让各位大大看看出了什么问题,是语法还是方程本身的问题.model:sets:project/1..8/:u,p;year/1..5/:c,d;link(year,project):a,b;endsets目标函数;max=@sum(year :d);第i年末利润di的计算;@for(y lingo中sets是什么? lingo 非线性规划哪位高手能用lingo或matlab解这个问题?我把意思写出来了,可能不符合语法,model:sets:empoly/1..6/:e;fire/1..6/:f;jh/1..6/:h;prov/1..6/:p;wb/1..6/:w;demand/1..6/:d;storage/1..6/:s;endsetsdata:demand=1200,1400, 一段LINGO程序 老提示conflicting bounds on variable,(一直LINGO菜鸟)model:sets:vec0/1..8/:y;vec1/1..4/:d,z,s;vec2/1..2/:m,b,j,u,t,zv,zh,zr,yr,yb,yfs;vec5(vec2,vec2)/1,4/:m/@cos(j);vec6(vec1,vec2)/1,6/:b/d;endsetsDATA:y=4.5 960 20 1.4 1.5 LINGO语法问题sets:V/1..36/;E/1..198/:x,q;B/1..12/:A;matrix(V,E):H; 36x198的矩阵;endsetsdata:A=0 1 2 3 4 5 6 7 8 9 10 11;H=...;enddata怎样实现H中每3行(前三行开始)与x向量的乘机之和为3,并且对应与H矩阵乘积的x向量 LINGO求解优化路线问题垃圾处理问题:已知38个点的坐标(x,y),以及每个点的垃圾量m,求设置两个处理中心,使路线最优.model:SETS:place/1..38/:d,l,k,m,x,y,u;endsetsdata:m= ;x= ;y= ;enddatad(i)=111.12*@ACOS(1.0/((@SIN( lingo求解TSP问题中,资金限定求解能去几个城市的问题model:sets:city/1..11/:u;link(city,city):cost,r;endsetsdata:cost=1000 336 374 273 306 311 473 199 345 402 427176 1000 524 352 401 411 427 390 451 422 367184 494 1000 315 322 454 100 lingo中的语法问题程序如下sets:r/1..2/:a;e/1..4/:b;link(r,e):c,x;endsetsmin=@sum(link(i,j):c(i,j)*x(i,j));ST@for(r(i): @sum(e(j):x(i,j))=a(i));@for(e(j): @sum(r(i):x(i,j))=b(j));end错误如截图: lingo中tsp问题求解,运行时提示有语法错误,迷惑中...MODEL:SETS:CITY / 1..10/:U; LINK( CITY,CITY):DIST,X;ENDSETSDATA:DIST=0 22.3 22.7 24.5 22.7 22 22.1 26.5 27.3 24.222.3 0 1.8 5.1 3.3 2.5 3.6 9.2 10 6.122.7 1.8 0 3.5 5.1 2.6 1.8 7.4 8. lingo下标的问题比如:sets:product/0,1,2,3,4,5,6,7/:m;endsets那么我在调用 m(0)为什么说我下标越界? 一个lingo lingo中约束条件之间是 ‘或’ 的关系,应该如何表示?Lingo中是否允许?代码如下,就是最后一个循环出错,去掉后可以执行,最后一句错在哪?P是火车票价格;model:sets:citys/1..10/:;city/1..11/:u,t lingo错误代码11.貌似是定义集的语法问题. 我在使用lingo 9.0的时候,出现错误代码1017.还有Unexpected Jacobian overflow原程序如下model:sets:city/1..5/:u; link(city,city):distance,x;endsetsdata:distance=0 14 12 7 1014 0 9 13 5 12 9 0 6 8 7 13 6 0 1110 5 8 11 0;enddatan=@size(c 帮我运行个lingo的程序,我这边运行不了程序如下:model:sets:cities/1..6/:u; link(cities,cities):dist,x;endsetsn=@size(cities);data:dist=0 5600 3500 2100 5100 60005600 0 2100 5700 7800 70003500 2100 0 3600 6800 68002100 5700 3600 0 51 lingo改错,为什么运行不出来?,求各位大师帮忙.MODEL: SETS: chsh/1..6/; links(chsh,cash)/1,2 1,3 2,3 2,4 3,5 4,3 4,6 5,4 5,6 6,1/:C,U,F; !6,1是虚拟弧,U为流量限制,C为费用,F为实际流量;ENDSETSDATA: U=8,7,5,9,9,2,5,6,10,1 lingo模型定义出错问题model: sets: center/1..3/:u; addr/1..7/:v; w(center,addr):x,y;endsets data: y=36 24 49 21 81 72 4530 20 56 24 99 88 5536 24 63 27 90 80 50 ;enddatamin=@sum(w:x(i,j)*y(i,j));@sum(addr:x(1,j))=3;@sum(addr:x(2,j))=2;@sum(a 为啥运行LINGO时会出现错误代码11,MODEL:SETS:CHSH/1..6/;LINKS(CHSH,CHSH)/1,2 1,3 2,3 2,4 3,5 4,3 4,6 5,4 5,6 6,1/:C,U,F;ENDSETSDATA:U=8,7,5,9,9,2,5,6,10,15;C=2,8,5,2,3,1,6,4,7,8;ENDDATDN= @SIZE(CHSH);F(6,1)=14;MIN= @MIN( LINKS(I,J)|I#LT#N:C