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,
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/28 12:37:04
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 非线性规划
哪位高手能用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;
endsets
data:
demand=1200,1400,1550,1500,1600,1500;
enddata
init:
x(0)=1;
s(0)=400;
endinit
min=@sum(12*168*(12+e(i)-f(i)))+@sum(18*h(i)*(12+e(i)-f(i)))+@sum(50*e(i)+100*f(i))+@sum(100*(168+h(i))/1.6+200)+@sum((30*x(i)-20)*(2*x(i-1)-1)*(p(i)+s(i-1)-d(i));
@for(s(i)=x(i-1)*(p(i)+s(i-1)-d(i))+(1-x(i-1))*(p(i)-s(i-1)-d(i)));
@for(p(i)=(168+h(i))/1.6+w(i));
@sum(p(i)=8350);
s(6)=0;
@for(h(i)
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,
帮你改好了:
model:
sets:
hr/1..6/:empoly,fire,jh,prov,wb,demand,storage,x;
endsets
data:
demand=1200,1400,1550,1500,1600,1500;
enddata
x(1)=1;
storage(1)=400;
storage(6)=0;
calc:
@for(hr(i)|i#ge#2 #and# i#lt#6:storage(i)=x(i-1)*(prov(i)+storage(i-1)-demand(i))+(1-x(i-1))*(prov(i)-storage(i-1)-demand(i)));
@for(hr(i):prov(i)=(168+jh(i))/1.6+wb(i));
endcalc
min=@sum(hr(i):12*168*(12+empoly(i)-fire(i)))+@sum(hr(i):18*jh(i)*(12+empoly(i)-fire(i)))+@sum(hr(i):50*empoly(i)+100*fire(i))+@sum(hr(i):100*(168+jh(i))/1.6+200)+@sum(hr(i)|i#ge#2:(30*x(i)-20)*(2*x(i-1)-1)*(prov(i)+storage(i-1)-demand(i)));
@sum(hr(i):prov(i))=8350;
@for(hr(i):jh(i)<=10);
@for(hr:@gin(empoly));
@for(hr:@gin(fire));
@for(hr:@gin(wb));
@for(hr:@gin(storage));
@for(hr:@bin(x));
end
程序运行以后没有错,就是找不到可行解,你再看看表达式或者数据有没有错改一下就行了.