数学建模实验六一、上机用Lindo软件解决货机装运问题。某架货机有三个货仓:前仓、中仓、后仓。三个货舱所能装载的货物的最大重量和体积都有限,如表所示,并且,为了保持飞机的平衡,货舱中实际装载货物的重量必须与其最大容许重量成正比例前仓中仓后仓重量限制(吨)10168体积限制(米3)680087005300三个货舱装载货物的最大容许重量和体积现有四类货物供该货机本次飞行装运,其有关信息如表,最后一列指装运后所得的利润重量(吨)空间(米3/吨)利润(元/吨)货物1184803100货物2156503800货物3235803500货物4123902850四类装运货物的信息应如何安排装运,使该货机本次飞行获利最大?解答过程:模型建立:决策变量:用xij表示第i种货物装入第j个货舱的重量(吨),货舱j=1、2、3分别表示前仓、中仓、后仓。决策目标是最大化总利润,即MaxZ=3100(x11+x12+x13)+3800(x21+x22+x23)+3500(x31+x32+x33)+2850(x41+x42+x43)约束条件为:1)共装载的四种货物的总重量约束,即x11+x12+x13=18x21+x22+x23=15x31+x32+x33=23x41+x42+x43=122)三个货舱的重量限制,即x11+x21+x31+x41=10x12+x22+x32+x42=16x13+x23+x33+x43=83)三个货舱的空间限制,即480x11+650x21+580x31+390x41=6800480x12+650x22+580x32+390x42=8700480x13+650x23+580x33+390x43=53004)三个货舱装入重量的平衡约束,即84333231316423222121041312111xxxxxxxxxxxx模型求解将以上模型输入LINDO求解程序如下:max3100x11+3100x12+3100x13+3800x21+3800x22+3800x23+3500x31+3500x32+3500x33+2850x41+2850x42+2850x43stx11+x12+x13=18x21+x22+x23=15x31+x32+x33=23x41+x42+x43=12x11+x21+x31+x41=10x12+x22+x32+x42=16x13+x23+x33+x43=8480x11+650x21+580x31+390x41=6800480x12+650x22+580x32+390x42=8700480x13+650x23+580x33+390x43=53008x11+8x21+8x31+8x41-5x12-5x22-5x32-5x42=0x12+x22+x32+x42-2x13-2x23-2x33-2x43=0end得到结果如下:LPOPTIMUMFOUNDATSTEP7OBJECTIVEFUNCTIONVALUE1)121515.8VARIABLEVALUEREDUCEDCOSTX110.000000400.000000X120.00000057.894737X130.000000400.000000X2110.0000000.000000X220.000000239.473679X235.0000000.000000X310.0000000.000000X3212.9473690.000000X333.0000000.000000X410.000000650.000000X423.0526320.000000X430.000000650.000000ROWSLACKORSURPLUSDUALPRICES2)18.0000000.0000003)0.000000300.0000004)7.0526310.0000005)8.9473690.0000006)0.0000000.0000007)0.0000005453.2895518)0.0000000.0000009)300.0000000.00000010)0.0000003.42105311)310.0000000.00000012)0.000000437.50000013)0.000000-1750.000000NO.ITERATIONS=7RANGESINWHICHTHEBASISISUNCHANGED:OBJCOEFFICIENTRANGESVARIABLECURRENTALLOWABLEALLOWABLECOEFINCREASEDECREASEX113100.000000400.000000INFINITYX123100.00000057.894844INFINITYX133100.000000400.000000INFINITYX213800.000000INFINITY0.000000X223800.000000239.473801INFINITYX233800.0000000.000000239.473801X313500.0000000.000000INFINITYX323500.0000002656.730713122.222427X333500.000000239.4738010.000000X412850.000000650.000000INFINITYX422850.000000650.000000110.000221X432850.000000650.000000INFINITYRIGHTHANDSIDERANGESROWCURRENTALLOWABLEALLOWABLERHSINCREASEDECREASE218.000000INFINITY18.000000315.0000003.0000005.000000423.000000INFINITY7.052631512.000000INFINITY8.947369610.000000INFINITY0.000000716.0000000.0000001.00000088.000000INFINITY0.00000096800.000000INFINITY300.000000108700.000000580.0000001700.000000115300.000000INFINITY310.000000120.0000000.00000024.000000130.0000006.0000000.000000结果分析:结果显示最优解为:货物2装入前仓10吨,装入后仓5吨;货物3装入中仓12.947369吨,装入后仓3吨;货物4装入中仓3吨。最大利润约为121515.8元。二、某储蓄所每天的营业时间是上午9:00到下午5:00.根据经验,每天不同的时间段所需要的服务员数量如下:时间段(时)9~1010~1111~1212~11~22~33~44~5服务员数量43465688储蓄所可以雇佣全时和半时两类服务员。全时服务员每天的报酬为100元,从上午9点到下午5点工做,但中午12点到下午2点之间必须安排1小时的午餐时间。储蓄所每天可以雇佣不超过3名的半时服务员,每个半时服务员必须连续工作4小时,报酬40元。问该储蓄所应如何雇佣全时和半时两类服务员?如果不能雇佣半时服务员,每天至少增加多少费用?如果雇佣半时服务员的数量没有限制每天可以减少多少费用。解答过程:模型建立决策变量:全时工作者中以12:00~1:00为休息时间的人数为x1,以1:00~2:00为休息时间的人数为x2;半时工作者中从9点,10点,11点,12点,1点开始工作的人数分别为y1,y2,y3,y4,y5决策目标是:使储蓄所付出的工资最小化MinZ=100(x1+x2)+40(y1+y2+y3+y4+y5)约束条件:x1+x2+y1=4x1+x2+y1+y2=3x1+x2+y1+y2+y3=4x2+y1+y2+y3+y4=6x1+y2+y3+y4+y5=5x1+x2+y3+y4+y5=6x1+x2+y4+y5=8x1+x2+y5=8y1+y2+y3+y4+y5=3x1、x2、y1、y2、y3、y4、y5=0,且均为整数模型求解用LINDO软件来作,其程序如下Min100x1+100x2+40y1+40y2+40y3+40y4+40y5s.t.x1+x2+y1=4x1+x2+y1+y2=3x1+x2+y1+y2+y3=4x2+y1+y2+y3+y4=6x1+y2+y3+y4+y5=5x1+x2+y3+y4+y5=6x1+x2+y4+y5=8x1+x2+y5=8y1+y2+y3+y4+y5=3end其结果如下所示:LPOPTIMUMFOUNDATSTEP8OBJECTIVEFUNCTIONVALUE1)770.0000VARIABLEVALUEREDUCEDCOSTX12.0000000.000000X24.5000000.000000Y10.00000050.000000Y20.0000000.000000Y30.0000000.000000Y41.5000000.000000Y51.5000000.000000得出结果是:x1=2,x2=5,y1=0,y2=0,y3=0,y4=2,y5=1最小费用为:820元如果不能雇佣半时服务员,则最优解为x1=5,x2=6;费用z=1100元,增加了280元如果雇佣半时服务员没有限制,则最优解为x1=0,x2=0,y1=6,y2=0,y3=0,y4=0,y5=8;费用z=280元,减少了540元。