数学模型实验—实验报告6学院:数学与计算机学院专业:电气信息类(计算机类)姓名:王赛赛学号:___2012436138实验时间:__2014年5月实验地点:主楼402一、实验项目:优化问题的软件求解---Lingo二、实验目的和要求a.了解Lingo软件的基本功能b.掌握有关Lingo软件求解优化问题的格式和命令三、实验内容1.通过查询有关Lingo软件的资料,掌握简单模型的求解过程。2.求解奶制品的生产和销售模型,分析输出进行分析,通过调整相关参数,对影子价格、紧约束、目标函数系数的变化范围等进行考察。3.掌握Lingo求解规划问题的基本格式.模型格式:集合段、数据段、数据预处理段、初始段、目标与约束段。有关命令:model:End;sets:Endsets;data:enddata;calc:endcalc;init:endinit@for、@sum、@bin、@gin、@free4.求解自来水输送模型2.决策变量:设每天销售x1kgA1,x2kgA2,x3kgA3,x4kgA4,用x5kgA1加B1,x6kgA2加工B2(增设x5,x6可使下面的模型简单)目标函数:设每天净利润为z,容易写z=24*x1+16*x2+44*x3+32*x4-3*x5-3*x6;约束条件:原料供应:每天生产A1X1+X5kg,用牛奶(x1+x5)/3桶,每天生产A2x2+x6kg,用牛奶(x2+x6)/4桶,二者之和不得超过每天的供应量50桶;劳动时间:每天生产A1,A2的时间分别为4*(x1+x5)和2*(x2+x6),加工B1,B2的时间分别为2*x5和2*x6,二者之和不得超过总的劳动时间480h;设备能力:A1的产量x1+x5不得超过甲类设备每天的加工能力100kg;非负约束:X1,x1,...,x6均为非负。附加约束:1kgA1加工成0.8kgB1,故X3=0.8*X5,类似的X4=0.75*X6。由此得出模型:model:max=24*x1+16*x2+44*x3+32*x4-3*x5-3*x6;[milk](x1+x5)/3+(x2+x6)/4=50;[time]4*(x1+x5)+2*(x2+x6)+2*x5+2*x6=480;[cpct]x1+x5=100;x3=0.8*x5;x4=0.75*x6;endGlobaloptimalsolutionfound.Objectivevalue:3460.800Infeasibilities:0.000000Totalsolveriterations:2VariableValueReducedCostX10.0000001.680000X2168.00000.000000X319.200000.000000X40.0000000.000000X524.000000.000000X60.0000001.520000RowSlackorSurplusDualPrice13460.8001.000000MILK0.00000037.92000TIME0.0000003.260000CPCT76.000000.00000050.00000044.0000060.00000032.00000Rangesinwhichthebasisisunchanged:ObjectiveCoefficientRangesCurrentAllowableAllowableVariableCoefficientIncreaseDecreaseX124.000001.680000INFINITYX216.000008.1500002.100000X344.0000019.750003.166667X432.000002.026667INFINITYX5-3.00000015.800002.533333X6-3.0000001.520000INFINITYRighthandSideRangesRowCurrentAllowableAllowableRHSIncreaseDecreaseMILK50.0000010.0000023.33333TIME480.0000253.333380.00000CPCT100.0000INFINITY76.0000050.0INFINITY19.2000060.0INFINITY0.0最优解为x1=0,x2=168,x3=19.2,x4=0,x5=24,x6=0,最优解z=3460.8,即每天生产销售168kgA2和19.2kgB1(不出售A1,B2),可获净利润3460.8元。为此,需用8桶牛奶加工成A1,42桶牛奶加工成A2,并将得到的24kgA1全部加工成B1。影子价格:1桶牛奶的影子价格为37.92元,1h劳动的影子价格为3.26元,甲设备的影子价格为0,紧约束:milk,timeMilk取27~60之间的任何数,每增加1桶牛奶,总收益增加37.92元Time取400~690之间的任何数,每增加1小时的劳动时间,总收益增加3.26元。第五行的式子每增加1,总收益就增加44元第六行的式子每增加1,总收益就增加32元。4.(1)!watersupply:watershortage(这是说明语句);model:min=160*x11+130*x12+220*x13+170*x14+140*x21+130*x22+190*x23+150*x24+190*x31+200*x32+230*x33;x11+x12+x13+x14=50;x21+x22+x23+x24=60;x31+x32+x33=50;x11+x21+x31=30;x11+x21+x31=80;x12+x22+x32=70;x12+x22+x32=140;x13+x23+x33=10;x13+x23+x33=30;x14+x24=10;x14+x24=50;endGlobaloptimalsolutionfound.Objectivevalue:24400.00Infeasibilities:0.000000Totalsolveriterations:8VariableValueReducedCostX110.00000030.00000X1250.000000.000000X130.00000050.00000X140.00000020.00000X210.00000010.00000X2250.000000.000000X230.00000020.00000X2410.000000.000000X3140.000000.000000X320.00000010.00000X3310.000000.000000RowSlackorSurplusDualPrice124400.00-1.00000020.000000-130.000030.000000-130.000040.000000-190.0000510.000000.000000640.000000.000000730.000000.000000840.000000.00000090.000000-40.000001020.000000.000000110.000000-20.000001240.000000.000000!watersupply:watershortage(这是说明语句);model:max=144000-72000-160*x11-130*x12-220*x13-170*x14-140*x21-130*x22-190*x23-150*x24-190*x31-200*x32-230*x33;x11+x12+x13+x14=50;x21+x22+x23+x24=60;x31+x32+x33=50;x11+x21+x31=30;x11+x21+x31=80;x12+x22+x32=70;x12+x22+x32=140;x13+x23+x33=10;x13+x23+x33=30;x14+x24=10;x14+x24=50;endGlobaloptimalsolutionfound.Objectivevalue:47600.00Infeasibilities:0.000000Totalsolveriterations:8VariableValueReducedCostX110.00000030.00000X1250.000000.000000X130.00000050.00000X140.00000020.00000X210.00000010.00000X2250.000000.000000X230.00000020.00000X2410.000000.000000X3140.000000.000000X320.00000010.00000X3310.000000.000000RowSlackorSurplusDualPrice147600.001.00000020.000000-130.000030.000000-130.000040.000000-190.0000510.000000.000000640.000000.000000730.000000.000000840.000000.00000090.000000-40.000001020.000000.000000110.000000-20.000001240.000000.000000(2)model:max=290*x11+320*x12+230*x13+280*x14+310*x21+320*x22+260*x23+300*x24+260*x31+250*x32+220*x33;x11+x12+x13+x14=100;x21+x22+x23+x24=120;x31+x32+x33=100;x11+x21+x31=30;x11+x21+x31=80;x12+x22+x32=70;x12+x22+x32=140;x13+x23+x33=10;x13+x23+x33=30;x14+x24=10;x14+x24=50;endGlobaloptimalsolutionfound.Objectivevalue:88700.00Infeasibilities:0.000000Totalsolveriterations:7VariableValueReducedCostX110.00000020.00000X12100.00000.000000X130.00000040.00000X140.00000020.00000X2130.000000.000000X2240.000000.000000X230.00000010.00000X2450.000000.000000X3150.000000.000000X320.00000020.00000X3330.000000.000000RowSlackorSurplusDualPrice188700.001.00000020.00000050.0000030.00000050.00000420.000000.000000550.000000.00000060.000000260.0000770.000000.00000080.000000270.0000920.000000.000000100.000000220.00001140.000000.000000120.000000250.0000