一段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
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 16:21:33
一段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程序 老提示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;
endsets
DATA:
y=4.5 960 20 1.4 1.5 10 540 167;
p=4.5;!n=960;!u0=20;!kh=1.4; kf=1.5; l=10; flagh=540; flagf=167;
Pi=3.1415926536;
ze=189.8;
enddata
s(1)=0.5*d(4)*@sum(vec1:d);
s(2)=Pi*d(4)^2/16;
s(3)=(d(1)+d(2))^2/8;
s(4)=(d(3)+d(4))*(d(2)+d(4))/8;
d(1)=m(1)*z(1)/@cos(j(1));
d(2)=m(1)*z(2)/@cos(j(1));
d(3)=m(2)*z(3)/@cos(j(2));
d(4)=m(2)*z(4)/@cos(j(2));
zv(1)=z(1)/(@cos(j(1)))^3;
zv(2)=z(3)/(@cos(j(2)))^3;
u(1)=z(2)/z(1);
u(2)=z(4)/z(3);
y(3)=u(1)*u(2);
@for(vec2:zh(i)=2.27235*((@cos(j(i)))^2+0.1325)^(3/4)/(@cos(j(i)))^0.5);
@for(vec2:zr(i)=0.75354/((0.5875-1/z(i)-1/z(i+1))*@cos(j(i)))^0.5);
t(1)=950000*y(1)/y(2);
t(2)=0.97*u(1)*t(1);
@for(vec2:yr(i)=zr(i)^2);
@for(vec2:yb(i)=1-j(i)/140);
@for(vec2:yfs(i)=@if(zv(i)#le#23,8.16-1.276*@log(zv(i)),@if(zv(i)#le#60,4.85-0.224*@log(zv(i)),@if(zv(i)#le#100,3.952-0.00607*@log(zv(i)),3.658+0.0577*@log(zv(i))))));
MIN=(@sum(vec2:b(i))+y(6))*@sum(vec1:s(i));
@for(vec2:m(i)-1.5>=0);
@for(vec2:zv(i)>=17);
@for(vec2:@bnd(8*Pi/180,j(i),15*Pi/180));
@bnd(1.1,u(1)/u(2),1.5);
@bnd(0.6,b(1)/d(1),1.2);
@bnd(0.6,b(2)/d(3),1.2);
ze*zh(1)*zr(1)*(0.475*y(4)*t(1)*(u(1)+1)/(u(1)*b(1)*d(1)*d(1)))^0.5
我参考你的修改 现在可以运行了 而且有可行解 但相对个别目标变量取整 @gin(),但就提示无可行解了。怎么办?
我增加了 x1=m(1);x2=m(3);x3=z(1);x4=z(2);x5=z(3);x6=@cos(j(1));x7=@cos(j(2));x8=b(1);x9=b(3);
@gin(x3);@gin(x4);@gin(x5);
另外,这是一道二级斜齿轮减速器的最小体积优化问题。
谢谢再次前来指导!前面是没出现X,我的想法是题目的独立设计变量是m(1) m(3) z(1) z(2) z(3);@cos(j(1));@cos(j(2));b(1);b(3); 我想把他们9个显示集中到一块 这样看结果也就方便多了,呵呵。那我就把x1~等去掉。但我的问题依然存在:其中z是指齿数啊 应该整数化 所以在后面加一句@for(vec1(i):@gin(z(i)));吧,语法上行的通的吧 但就是没可行解。
一段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
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;
endsets
DATA:
y=4.5 960 20 1.4 1.5 10 540 167;
!p=4.5;!n=960;!u0=20;!kh=1.4; !kf=1.5; !l=10; !flagh=540; !flagf=167;
Pi=3.1415926536;
ze=189.8;
enddata
s(1)=0.5*d(4)*@sum(vec1:d);
s(2)=Pi*d(4)^2/16;
s(3)=(d(1)+d(2))^2/8;
s(4)=(d(3)+d(4))*(d(2)+d(4))/8;
d(1)=m(1)*z(1)/@cos(j(1));
d(2)=m(1)*z(2)/@cos(j(1));
d(3)=m(2)*z(3)/@cos(j(2));
d(4)=m(2)*z(4)/@cos(j(2));
zv(1)=z(1)/(@cos(j(1)))^3;
zv(2)=z(3)/(@cos(j(2)))^3;
u(1)=z(2)/z(1);
u(2)=z(4)/z(3);
y(3)=u(1)*u(2);
@for(vec2(i):zh(i)=2.27235*((@cos(j(i)))^2+0.1325)^(3/4)/(@cos(j(i)))^0.5);
@for(vec2(i):(zr(i))^2*((0.5875-1/z(i)-1/z(i+1))*@cos(j(i)))=0.75354^2);
t(1)=950000*y(1)/y(2);
t(2)=0.97*u(1)*t(1);
@for(vec2(i):yr(i)=zr(i)^2);
@for(vec2(i):yb(i)=1-j(i)/140);
@for(vec2(i):yfs(i)=@if(zv(i)#le#23,8.16-1.276*@log(zv(i)),@if(zv(i)#le#60,4.85-0.224*@log(zv(i)),@if(zv(i)#le#100,3.952-0.00607*@log(zv(i)),3.658+0.0577*@log(zv(i))))));
MIN=(@sum(vec2(i):b(i))+y(6))*@sum(vec1(i):s(i));
@for(vec2:m-1.5>=0);
@for(vec2:zv>=17);
@for(vec2:@bnd(8*Pi/180,j,15*Pi/180));
u(1)=1.1*u(1);
b(1)=0.6*d(1);
b(2)=0.6*d(3);
ze*zh(1)*zr(1)*(0.475*y(4)*t(1)*(u(1)+1)/(u(1)*b(1)*d(1)*d(1)))^0.5