急求LINGO大神,帮忙看一下这个LINGO程序哪里出错,烦请修改一下,本人菜鸟一个。。。
MODEL:SETS:D/1..20/:s1,s2,l,x,y;!定义集合,即每个棍子;ENDSETSdata:h=53;r=25;lenth=120;a=2.5;end...
MODEL:
SETS:
D/1..20/:s1,s2,l,x,y; !定义集合,即每个棍子;
ENDSETS
data:
h=53;
r=25;
lenth=120;
a=2.5;
enddata
@FOR(D(i):x(i)=r-a*(i-1)+a/2);
@FOR(D(i):y(i)=@sqrt(r^2-x(i)^2));
@FOR(D(i):l(i)=lenth/2-y(i));
theta=@asin(h/l(1));
@FOR(D(i):s1(i)=y(1)+l(1)/2-y(i));
m=y(1)+k*y(1)*@cos(theta);
!k为变量;
@FOR(D(i):s2(i)=@sqrt((k*l(1)*@cos(theta)+y(1)-y(i))^2+(k*l(1)*@sin(theta))^2));
@FOR(D:s2<l);
m>r;
m<lenth;
min=@SUM(D:s2-s1);
END
错误提示:
改了一下程序,这个有点结果,但好像还是不对
MODEL:
SETS:
D/1..20/:s1,s2,l,x,y; !定义集合,即每个棍子;
ENDSETS
data:
h=53;
r=25;
lenth=120;
a=2.5;
enddata
@FOR(D(i):x(i)=r+r-(a*(i-1)+a/2));
@FOR(D(i):y(i)=@sqrt(r^2-(x(i)-r)^2));
@FOR(D(i):l(i)=lenth/2-y(i));
theta=@asin(h/l(1));
@FOR(D(i):s1(i)=y(1)+l(1)/2-y(i));
m=y(1)+k*y(1)*@cos(theta);
!k为变量;
@FOR(D(i):s2(i)=@sqrt((k*l(1)*@cos(theta)+y(1)-y(i))^2+(k*l(1)*@sin(theta))^2));
@FOR(D:s2<l);
m>r;
m<lenth;
min=@SUM(D:s2-s1);
END 展开
SETS:
D/1..20/:s1,s2,l,x,y; !定义集合,即每个棍子;
ENDSETS
data:
h=53;
r=25;
lenth=120;
a=2.5;
enddata
@FOR(D(i):x(i)=r-a*(i-1)+a/2);
@FOR(D(i):y(i)=@sqrt(r^2-x(i)^2));
@FOR(D(i):l(i)=lenth/2-y(i));
theta=@asin(h/l(1));
@FOR(D(i):s1(i)=y(1)+l(1)/2-y(i));
m=y(1)+k*y(1)*@cos(theta);
!k为变量;
@FOR(D(i):s2(i)=@sqrt((k*l(1)*@cos(theta)+y(1)-y(i))^2+(k*l(1)*@sin(theta))^2));
@FOR(D:s2<l);
m>r;
m<lenth;
min=@SUM(D:s2-s1);
END
错误提示:
改了一下程序,这个有点结果,但好像还是不对
MODEL:
SETS:
D/1..20/:s1,s2,l,x,y; !定义集合,即每个棍子;
ENDSETS
data:
h=53;
r=25;
lenth=120;
a=2.5;
enddata
@FOR(D(i):x(i)=r+r-(a*(i-1)+a/2));
@FOR(D(i):y(i)=@sqrt(r^2-(x(i)-r)^2));
@FOR(D(i):l(i)=lenth/2-y(i));
theta=@asin(h/l(1));
@FOR(D(i):s1(i)=y(1)+l(1)/2-y(i));
m=y(1)+k*y(1)*@cos(theta);
!k为变量;
@FOR(D(i):s2(i)=@sqrt((k*l(1)*@cos(theta)+y(1)-y(i))^2+(k*l(1)*@sin(theta))^2));
@FOR(D:s2<l);
m>r;
m<lenth;
min=@SUM(D:s2-s1);
END 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询