例加工奶制品的生产计划1桶牛奶3公斤A112小时8小时4公斤A2或获利24元/公斤获利16元/公斤50桶牛奶时间480小时至多加工100公斤A1制订生产计划,使每天获利最大•35元可买到1桶牛奶,买吗?若买,每天最多买多少?•可聘用临时工人,付出的工资最多是每小时几元?•A1的获利增加到30元/公斤,应否改变生产计划?每天:1桶牛奶3公斤A112小时8小时4公斤A2或获利24元/公斤获利16元/公斤x1桶牛奶生产A1x2桶牛奶生产A2获利24×3x1获利16×4x2原料供应5021xx劳动时间48081221xx加工能力10031x决策变量目标函数216472xxzMax每天获利约束条件非负约束0,21xx线性规划模型(LP)时间480小时至多加工100公斤A150桶牛奶每天模型求解图解法x1x20ABCDl1l2l3l4l55021xx48081221xx10031x0,21xx约束条件50:211xxl480812:212xxl1003:13xl0:,0:2514xlxl216472xxzMax目标函数Z=0Z=2400Z=3600z=c(常数)~等值线c在B(20,30)点得到最优解目标函数和约束条件是线性函数可行域为直线段围成的凸多边形目标函数的等值线为直线最优解一定在凸多边形的某个顶点取得。模型求解软件实现LINGO9.0max=72*x1+64*x2;x1+x250;12*x1+8*x2480;3*x1100;Globaloptimalsolutionfound.Objectivevalue:3360.000Totalsolveriterations:2VariableValueReducedCost(变量)(取值)(检验系数)X120.000000.000000X230.000000.000000RowSlackorSurplusDualPrice(行)(松弛或剩余变量取值)(对偶或影子价格)13360.0001.00000020.00000048.0000030.0000002.000000440.000000.000000DORANGE(SENSITIVITY)ANALYSIS?No20桶牛奶生产A1,30桶生产A2,利润3360元。结果解释Globaloptimalsolutionfound.Objectivevalue:3360.000Totalsolveriterations:2VariableValueReducedCost(变量)(取值)(检验系数)X120.000000.000000X230.000000.000000RowSlackorSurplusDualPrice(行)(松弛或剩余变量取值)(对偶或影子价格)13360.0001.00000020.00000048.0000030.0000002.000000440.000000.000000原料无剩余时间无剩余加工能力剩余40max=72*x1+64*x2;x1+x250;12*x1+8*x2480;3*x1100;三种资源“资源”剩余为零的约束为紧约束(有效约束)结果解释Globaloptimalsolutionfound.Objectivevalue:3360.000Totalsolveriterations:2VariableValueReducedCostX120.000000.000000X230.000000.000000RowSlackorSurplusDualPrice13360.0001.00000020.00000048.0000030.0000002.000000440.000000.000000最优解下“资源”增加1单位时“效益”的增量原料增加1单位,利润增长48时间增加1单位,利润增长2加工能力增长不影响利润影子价格•35元可买到1桶牛奶,要买吗?3548,应该买!•聘用临时工人付出的工资最多每小时几元?2元!Rangesinwhichthebasisisunchanged:ObjectiveCoefficientRanges:(价值系数范围)CurrentAllowableAllowableVariableCoefficientIncreaseDecreaseX172.0000024.000008.000000X264.000008.00000016.00000RighthandSideRanges:(右端项范围)CurrentAllowableAllowableRowRHSIncreaseDecrease250.0000010.000006.6666673480.000053.3333380.000004100.0000INFINITY40.00000最优解不变时目标函数系数允许变化范围DORANGE(SENSITIVITY)ANALYSIS?Yesx1系数范围(64,96)x2系数范围(48,72)•A1获利增加到30元/千克,应否改变生产计划x1系数由243=72增加为303=90,在允许范围内不变!(约束条件不变)结果解释Rangesinwhichthebasisisunchanged:ObjectiveCoefficientRanges:CurrentAllowableAllowableVariableCoefficientIncreaseDecreaseX172.0000024.000008.000000X264.000008.00000016.00000RighthandSideRanges:CurrentAllowableAllowableRowRHSIncreaseDecrease250.0000010.000006.6666673480.000053.3333380.000004100.0000INFINITY40.00000影子价格有意义时约束右端的允许变化范围原料最多增加10时间最多增加53•35元可买到1桶牛奶,每天最多买多少?最多买10桶!(目标函数不变)例2奶制品的生产销售计划在例1基础上深加工1桶牛奶3千克A112小时8小时4公斤A2或获利24元/公斤获利16元/公斤0.8千克B12小时,3元1千克获利44元/千克0.75千克B22小时,3元1千克获利32元/千克制订生产计划,使每天净利润最大•30元可增加1桶牛奶,3元可增加1小时时间,应否投资?现投资150元,可赚回多少?50桶牛奶,480小时至多100公斤A1•B1,B2的获利经常有10%的波动,对计划有无影响?1桶牛奶3千克A112小时8小时4千克A2或获利24元/千克获利16元/kg0.8千克B12小时,3元1千克获利44元/千克0.75千克B22小时,3元1千克获利32元/千克出售x1千克A1,x2千克A2,x3千克B1,x4千克B2原料供应劳动时间加工能力决策变量目标函数利润约束条件非负约束0,61xxx5千克A1加工B1,x6千克A2加工B26543213332441624xxxxxxzMax50436251xxxx48022)(2)(4656251xxxxxx10051xx附加约束5380x.x64750x.x模型求解软件实现LINGO9.05043)26251xxxx48022)(2)(4)3656251xxxxxxOBJECTIVEFUNCTIONVALUE1)3460.800VARIABLEVALUEREDUCEDCOSTX10.0000001.680000X2168.0000000.000000X319.2000010.000000X40.0000000.000000X524.0000000.000000X60.0000001.520000ROWSLACKORSURPLUSDUALPRICES2)0.0000003.1600003)0.0000003.2600004)76.0000000.0000005)0.00000044.0000006)0.00000032.000000NO.ITERATIONS=2600334)26521xxxx44804624)36521xxxxDORANGE(SENSITIVITY)ANALYSIS?NoOBJECTIVEFUNCTIONVALUE1)3460.800VARIABLEVALUEREDUCEDCOSTX10.0000001.680000X2168.0000000.000000X319.2000010.000000X40.0000000.000000X524.0000000.000000X60.0000001.520000ROWSLACKORSURPLUSDUALPRICES2)0.0000003.1600003)0.0000003.2600004)76.0000000.0000005)0.00000044.0000006)0.00000032.000000NO.ITERATIONS=2结果解释每天销售168千克A2和19.2千克B1,利润3460.8(元)8桶牛奶加工成A1,42桶牛奶加工成A2,将得到的24千克A1全部加工成B1除加工能力外均为紧约束结果解释OBJECTIVEFUNCTIONVALUE1)3460.800VARIABLEVALUEREDUCEDCOSTX10.0000001.680000X2168.0000000.000000X319.2000010.000000X40.0000000.000000X524.0000000.000000X60.0000001.520000ROWSLACKORSURPLUSDUALPRICES2)0.0000003.1600003)0.0000003.2600004)76.0000000.0000005)0.00000044.0000006)0.00000032.000000增加1桶牛奶使利润增长3.16×12=37.925043)26251xxxx600334)26521xxxx4增加1小时时间使利润增长3.2630元可增加1桶牛奶,3元可增加1小时时间,应否投资?现投资150元,可赚回多少?投资150元增加5桶牛奶,可赚回189.6元。(大于增加时间的利润增长)结果解释B1,B2的获利有10%的波动,对计划有无影响RANGESINWHICHTHEBASISISUNCHANGED:OBJCOEFFICIENTRANGESVARIABLECURRENTALLOWABLEALLOWABLECOEFINCREASEDECREASEX124.0000001.680000INFINITYX216.0000008.1500002.100000X344.00000019.7500023.166667X432.0000002.026667INFINITYX5-3.00000015.8000002.533334X6-3.0000001.520000INFINITY…………DORANGE(SENSITIVITY)ANALYSIS?YesB1获利下降10%,超出X3系数允许范围B2获利上升10%,超出X4系数允许范围波动对计划有影响生产计划应重新制订:如将x3的系数改为39.6计算,会发现结果有很大变化。