这个lingo程序运行时系统报错说最后的@bnd函数使用错误。但我检查了很久都没看出来,求大神帮忙

这个lingo程序运行时系统报错说最后的@bnd函数使用错误。但我检查了很久都没看出来,求大神帮忙!

model:
sets:
mgnum/1..26/:y,r;
endsets
data:
D=80
h=70;
!d=3;
y=-38.5000000000000 -35.4200000000000 -32.3400000000000 -29.2600000000000
-26.1800000000000 -23.1000000000000 -20.0200000000000 -16.9400000000000
-13.8600000000000 -10.7800000000000 -7.70000000000000 -4.62000000000000
-1.54000000000000 1.54000000000000 4.62000000000000 7.70000000000000
10.7800000000000 13.8600000000000 16.9400000000000 20.0200000000000
23.1000000000000 26.1800000000000 29.2600000000000 32.3400000000000
35.4200000000000 38.5000000000000;
enddata
seta=@atan((h*2/D)-a);
L=h/@sin(seta);
@for(mgnum(i):r(i)=@sqrt((D/2)^2-y(i)^2));
@for(mgnum(i)|i#eq#1:a=r(i));
min=@sum(mgnum(i):@sqrt((k-a)^2+(r(i)-a)^2-
2*(k-a)*(r(i)-a)*@cos(seta))-k+r(i));
@for(mgnum(i)|i#lt#n-2:@sqrt((k-a)^2+(r(i+1)-a)^2-
2*(k-a)*(r(i+1)-a)*@cos(seta))-k+r(i+1)<0);
@for(mgnum(i)|i#lt#n-2:@sqrt((k-a)^2+(r(i+1)-a)^2-
2*(k-a)*(r(i+1)-a)*@cos(seta))+r(i+1)-a-L<0);
lb=L/4+a;
ub=2*L/3+a;
@bnd(lb,k,ub);
end

那就别写@bnd
k>=lb;k<=ub;追问

非常感谢!

温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答