一个LINGO程序的找错~程序代码如下:model:sets:part/1..7/:x,f,cost,ub,lb;end

一个LINGO程序的找错~
程序代码如下:
model:
sets:
part/1..7/:x,f,cost,ub,lb;
endsets
data:
cost=25 20 20 50 50 10 25;
ub=0.125 0.375 0.125 0.125 1.875 20 0.935;
lb=0.075 0.225 0.075 0.075 1.125 12 0.5625;
enddata
calc:
f(1)=(8721*(-x(3)/(x(1)-x(2)))^(17/20)*(-((131*(x(4)/x(2))^(29/25)*(1-9/(25*(x(4)/x(2))^(14/25)))^(3/2))/50-1)/(x(6)*x(7)))^(1/2))/(50*x(5))+(148257*x(1)*x(3)*(-((131*(x(4)/x(2))^(29/25)*(1-9/(25*(x(4)/x(2))^(14/25)))^(3/2))/50-1)/(x(6)*x(7)))^(1/2))/(1000*x(5)*(x(1)-x(2))^2*(-x(3)/(x(1)-x(2)))^(3/20));
f(2)=(8721*x(1)*((24759*x(4)*(1 - 9/(25*(x(4)/x(2))^(14/25)))^(1/2))/(31250*x(2)^2*(x(4)/x(2))^(2/5)) + (3799*x(4)*(x(4)/x(2))^(4/25)*(1 - 9/(25*(x(4)/x(2))^(14/25)))^(3/2))/(1250*x(2)^2))*(-x(3)/(x(1) - x(2)))^(17/20))/(100*x(5)*x(6)*x(7)*(-((131*(x(4)/x(2))^(29/25)*(1 - 9/(25*(x(4)/x(2))^(14/25)))^(3/2))/50 - 1)/(x(6)*x(7)))^(1/2)) - (148257*x(1)*x(3)*(-((131*(x(4)/x(2))^(29/25)*(1 - 9/(25*(x(4)/x(2))^(14/25)))^(3/2))/50 - 1)/(x(6)*x(7)))^(1/2))/(1000*x(5)*(x(1) - x(2))^2*(-x(3)/(x(1) - x(2)))^(3/20));
f(3)=-(148257*x(1)*(-((131*(x(4)/x(2))^(29/25)*(1 - 9/(25*(x(4)/x(2))^(14/25)))^(3/2))/50 - 1)/(x(6)*x(7)))^(1/2))/(1000*x(5)*(x(1) - x(2))*(-x(3)/(x(1) - x(2)))^(3/20));
f(4)=-(8721*x(1)*((24759*(1 - 9/(25*(x(4)/x(2))^(14/25)))^(1/2))/(31250*x(2)*(x(4)/x(2))^(2/5)) + (3799*(x(4)/x(2))^(4/25)*(1 - 9/(25*(x(4)/x(2))^(14/25)))^(3/2))/(1250*x(2)))*(-x(3)/(x(1) - x(2)))^(17/20))/(100*x(5)*x(6)*x(7)*(-((131*(x(4)/x(2))^(29/25)*(1 - 9/(25*(x(4)/x(2))^(14/25)))^(3/2))/50 - 1)/(x(6)*x(7)))^(1/2));
f(5)=-(8721*x(1)*(-x(3)/(x(1) - x(2)))^(17/20)*(-((131*(x(4)/x(2))^(29/25)*(1 - 9/(25*(x(4)/x(2))^(14/25)))^(3/2))/50 - 1)/(x(6)*x(7)))^(1/2))/(50*x(5)^2);
f(6)=(8721*x(1)*(-x(3)/(x(1) - x(2)))^(17/20)*((131*(x(4)/x(2))^(29/25)*(1 - 9/(25*(x(4)/x(2))^(14/25)))^(3/2))/50 - 1))/(100*x(5)*x(6)^2*x(7)*(-((131*(x(4)/x(2))^(29/25)*(1 - 9/(25*(x(4)/x(2))^(14/25)))^(3/2))/50 - 1)/(x(6)*x(7)))^(1/2));
f(7)=(8721*x(1)*(-x(3)/(x(1) - x(2)))^(17/20)*((131*(x(4)/x(2))^(29/25)*(1 - 9/(25*(x(4)/x(2))^(14/25)))^(3/2))/50 - 1))/(100*x(5)*x(6)*x(7)^2*(-((131*(x(4)/x(2))^(29/25)*(1 - 9/(25*(x(4)/x(2))^(14/25)))^(3/2))/50 - 1)/(x(6)*x(7)))^(1/2));
y=174.42*(x(1)/x(5))*(x(3)/(x(2)-x(1)))^0.85*@sqrt((1-2.62*(1-0.36*(x(4)/x(2))^(-0.56))^1.5*(x(4)/x(2))^1.16)/(x(6)*x(7)));
endcalc
min=100000*(y-1.5)^2+100000/9*@sum(part(i):(diff(i)*x(i)*cost(i))^2); 目标函数;
@for(part:@bnd(lb,x,ub));
@for(part(i):@free(diff(i)));
end
目标函数中diff改为f
很奇怪,把calc段去掉以后程序就可以运行,只是没有可行解.可能我模型建错了
myangel007 1年前 已收到1个回答 举报

蒋寻雷 幼苗

共回答了26个问题采纳率:92.3% 举报

主要是你calc段里面的问题 具体是什么需要给我表达式看看
问题在于calc是预处理段 就是为你预先算出某些数据而不用你在其它地方算 这个需要你在里面使用的量都是赋值过的 但是你的x没有赋值 所以无法处理
至于为何没有可行解就不知道了 是不是f也需要解除非负限制

1年前

2
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 16 q. 0.017 s. - webmaster@yulucn.com