数学模型实验—实验报告7学院:数学与计算机学院专业:电气信息类(计算机类)姓名:王赛赛学号:___2012436138实验时间:__2014年5月实验地点:主楼402一、实验项目:Lingo编程求解有关模型二、实验目的和要求a)熟练掌握Lingo语言b)通过Lingo编程求解模型三、实验内容1、Lingo编程求解“原油采购与加工”模型(应用第三种解法)2、Lingo编程求解“饮料的生产批量问题”模型3、Lingo编程求解“钢管下料”问题(2)要求:1)对每行命令进行注解;2)分析输出结果model:max=4.8*(x11+x21)+5.6*(x12+x22)-5000*z2-9000*z3-12000*z4;x11+x12=500+x;x21+x22=1000;x=1500;x11/(x11+x21)=0.5;x12/(x12+x22)=0.6;z1=y1;z2=y1+y2;z3=y2+y3;z4=y3;z1+z2+z3+z4=1;y1+y2+y3=1;@bin(y1);@bin(y2);@bin(y2);x=500*z2+1000*z3+1500*z4;endLocaloptimalsolutionfound.Objectivevalue:4800.000Objectivebound:4800.000Infeasibilities:0.1136868E-14Extendedsolversteps:2Totalsolveriterations:313VariableValueX110.000000X210.000000X122000.000X221000.000Z20.000000Z30.000000Z41.000000X1500.000Z10.000000Y10.000000Y20.000000Y31.000000RowSlackorSurplus14800.00020.00000030.00000040.00000050.00000060.6666667E-0170.00000080.00000091.000000100.000000110.000000120.000000130.000000sets:periods/1..4/:s,c,h,d,m,x,y,w;endsetsdata:s=8888;!每次生产准备费用;c=5.05.15.45.5;!每件生产费用;h=0.20.20.20.2;!单件生产库存费用;d=15253525;!产品需求数量;m=30404520;!生产能力;enddatamin=@sum(periods:s*w+c*x+h*y);x(1)-d(1)=y(1);@for(periods(t)|t#gt#1:y(t-1)+x(t)-d(t)=y(t));@for(periods:xm*w;@bin(w););Globaloptimalsolutionfound.Objectivevalue:554.0000Objectivebound:554.0000Infeasibilities:0.000000Extendedsolversteps:0Totalsolveriterations:0VariableValueReducedCostS(1)8.0000000.000000S(2)8.0000000.000000S(3)8.0000000.000000S(4)8.0000000.000000C(1)5.0000000.000000C(2)5.1000000.000000C(3)5.4000000.000000C(4)5.5000000.000000H(1)0.20000000.000000H(2)0.20000000.000000H(3)0.20000000.000000H(4)0.20000000.000000D(1)15.000000.000000D(2)25.000000.000000D(3)35.000000.000000D(4)25.000000.000000M(1)30.000000.000000M(2)40.000000.000000M(3)45.000000.000000M(4)20.000000.000000X(1)30.000000.000000X(2)40.000000.000000X(3)30.000000.000000X(4)0.0000000.000000Y(1)15.000000.000000Y(2)30.000000.000000Y(3)25.000000.000000Y(4)0.0000005.800000W(1)1.0000008.000000W(2)1.0000004.000000W(3)1.0000008.000000W(4)0.0000006.000000RowSlackorSurplusDualPrice1554.0000-1.00000020.000000-5.00000030.000000-5.20000040.000000-5.40000050.000000-5.60000060.0000000.00000070.0000000.1000000815.000000.00000090.0000000.1000000model:!给模型取一个名字;titlecutting-stockproblem;sets:!定义基本集合needs及其属性length,num;needs/1..4/:length,num;!定义基本集合cuts及其属性x;cuts/1..3/:x;!定义派生集合patterns(这是一个稠密集合)及其属性r;patterns(needs,cuts):r;endsetsdata:length=4568;num=50102015;capacity=19;enddatamin=@sum(cuts(i):x(i));!满足需求的约束;@for(needs(i):@sum(cuts(j):x(j)*r(i,j))num(i));!合理切割模式的约束;@for(cuts(j):@sum(needs(i):length(i)*r(i,j))capacity);@for(cuts(j):@sum(needs(i):length(i)*r(i,j))capacity-@min(needs:length));!人为增加的约束;@sum(cuts:x)26;@sum(cuts:x)31;@for(cuts(i)|i#lt#@size(cuts):x(i)x(i+1));@for(cuts:@gin(x););@for(patterns:@gin(r););endLocaloptimalsolutionfound.Objectivevalue:28.00000Objectivebound:28.00000Infeasibilities:0.000000Extendedsolversteps:175Totalsolveriterations:7771ModelTitle:cutting-stockproblemVariableValueCAPACITY19.00000LENGTH(1)4.000000LENGTH(2)5.000000LENGTH(3)6.000000LENGTH(4)8.000000NUM(1)50.00000NUM(2)10.00000NUM(3)20.00000NUM(4)15.00000X(1)10.00000X(2)10.00000X(3)8.000000R(1,1)2.000000R(1,2)3.000000R(1,3)0.000000R(2,1)1.000000R(2,2)0.000000R(2,3)0.000000R(3,1)1.000000R(3,2)1.000000R(3,3)0.000000R(4,1)0.000000R(4,2)0.000000R(4,3)2.000000RowSlackorSurplus128.0000020.00000030.00000040.00000051.00000060.00000071.00000083.00000094.000000103.000000111.000000122.000000133.000000140.000000152.000000