教程:《数学模型》第三版姜启源
实验目的:熟悉建立线性规划模型的技巧,学会使用Lindo软件。
实验要求:(1)建立模型;(2)写出程序运行的主要结果;(3)回答相关问题。
实验内容:教材 P130 第一大题和第三大题
一. P130—T1
(1)建立模型:
设投资证券A,B,C,D,E的金额分别为x1,x2,x3,x4,x5(百万元),按照规定.限制和1000万元资金约束,模型为:
Max z=0.043x1+0.027x2+0.025x3+0.022x4+0.045x5
s.t. x2+x3+x4>= 4
x1+x2+x3+x4+x5=<10
(2x1+2x2+x3+x4+5x5)/(x1+x2+x3+x4+x5)=< 1.4 即 6x1+6x2-4x3-4x4+36x5<0
(9x1+15x2+4x3+3x4+2x5)/(x1+x2+x3+x4+x5)=<5 即4x1+10x2-x3-2x4-3x5<0 x1,x2,x3,x4,x5>=0
Lindo输入文件:
Max 0.043x1+0.027x2+0.025x3+0.022x4+0.045x5
s.t. x2+x3+x4>4
x1+x2+x3+x4+x5<10
6x1+6x2-4x3-4x4+36x5<0
4x1+10x2-x3-2x4-3x5<0 x1,x2,x3,x4,x5>=0
end
(2).程序运行结果:
LP OPTIMUM FOUND AT STEP 5
OBJECTIVE FUNCTION VALUE
1) 0.2983637
VARIABLE VALUE REDUCED COST
X1 2.181818 0.000000
X2 0.000000 0.030182
X3 7.363636 0.000000
X4 0.000000 0.000636
X5 0.454545 0.000000
ROW SLACK OR SURPLUS DUAL PRICES
2) 3.363636 0.000000
3) 0.000000 0.029836
4) 0.000000 0.000618
5) 0.000000 0.002364
NO. ITERATIONS= 5
RANGES IN WHICH THE BASIS IS UNCHANGED:
OBJ COEFFICIENT RANGES
VARIABLE CURRENT ALLOWABLE ALLOWABLE
COEF INCREASE DECREASE
X1 0.043000 0.003500 0.013000
X2 0.027000 0.030182 INFINITY
X3 0.025000 0.017333 0.000560
X4 0.022000 0.000636 INFINITY
X5 0.045000 0.052000 0.014000
RIGHTHAND SIDE RANGES
ROW CURRENT ALLOWABLE ALLOWABLE
RHS INCREASE DECREASE
2 4.000000 3.363636 INFINITY
3 10.000000 INFINITY 4.567901
4 0.000000 105.714287 20.000000
5 0.000000 10.000000 12.000000
(3).回答问题:
1) .证券A投2.181818万元,C投资7.363636万元,E投资0.454545万元。最大收益为0.2983637万元。
2) .由1)的结果中影子价格可知,若资金增加100万元,收益可增加0.0298百万元,大于以2.75%的利率借到100万元资金的利息,所以应借贷,投资方案需将上面模型第二个约束右端改为11,求解得到:证券A,C,E分别投资2.40百万元,8.10百万元,0.50百万元,最大税后收益为0.3007百万元。
3) .由(1)的结果中目标函数系数的允许范围(最优解不变)可知,证券A的税前收益可增0.35%,故若证券A的税前收益增加为4.5%,投资不应该改变;证券C的税前收益可减0.112%(注意按50%的税率纳税),故若证券C的税前收益减少为4.8%,投资应该改变。
二. P130—T3
(1)建立模型:
设储蓄所每天雇佣的全时服务员中以12:00~1:00为午餐时间的有x1名,以1:00~2:00为午餐时间的有x2名;半时服务员中从9:00,10:00,11:00,12:00,1:00开始工作的分别为y1,y2,y3,y4,y5名,列出模型
Min z=100x1+100x2+40y1+40y2+40y3+40y4+40y5
s.t. x1+x2+y1>=4
x1+x2+y1+y2>=3
x1+x2+y1+y2+y3>=4
x2+y1+y2+y3+y4>=6
x1+y2+y3+y4+y5>=5
x1+x2+y3+y4+y5>=6
x1+x2+y4+y5>=8
x1+x2+y5>=8
y1+y2+y3+y4+y5=<3
x1,x2,y1,y2,y3,y4,y5>=0且为整数
Lindo输入文件:
Min 100x1+100x2+40y1+40y2+40y3+40y4+40y5
s.t. x1+x2+y1>4
x1+x2+y1+y2>3
x1+x2+y1+y2+y3>4
x2+y1+y2+y3+y4>6
x1+y2+y3+y4+y5>5
x1+x2+y3+y4+y5>6
x1+x2+y4+y5>8
x1+x2+y5>8
y1+y2+y3+y4+y5<3
end
gin 7
(2).程序运行结果:
LP OPTIMUM FOUND AT STEP 6
OBJECTIVE VALUE = 770.000000
FIX ALL VARS.( 3) WITH RC > 0.000000E+00
SET Y5 TO >= 2 AT 1, BND= -820.0 TWIN= -800.0 14
NEW INTEGER SOLUTION OF 820.000000 AT BRANCH 1 PIVOT 14
BOUND ON OPTIMUM: 770.0000
FLIP Y5 TO <= 1 AT 1 WITH BND= -800.00000
SET Y5 TO >= 1 AT 2, BND= -800.0 TWIN=-0.1000E+31 14
SET Y4 TO <= 1 AT 3, BND= -880.0 TWIN= -820.0 17
DELETE Y4 AT LEVEL 3
DELETE Y5 AT LEVEL 2
DELETE Y5 AT LEVEL 1
RELEASE FIXED VARIABLES
FIX ALL VARS.( 2) WITH RC > 0.000000E+00
SET Y4 TO <= 0 AT 1, BND= -770.0 TWIN= -820.0 27
SET Y5 TO <= 1 AT 2, BND= -800.0 TWIN= -820.0 30
SET Y5 TO >= 1 AT 3, BND= -800.0 TWIN=-0.1000E+31 30
SET Y3 TO <= 1 AT 4, BND= -880.0 TWIN= -820.0 33
DELETE Y3 AT LEVEL 4
DELETE Y5 AT LEVEL 3
DELETE Y5 AT LEVEL 2
DELETE Y4 AT LEVEL 1
RELEASE FIXED VARIABLES
FIX ALL VARS.( 3) WITH RC > 0.000000E+00
SET Y5 TO <= 1 AT 1, BND= -800.0 TWIN= -820.0 43
SET Y5 TO >= 1 AT 2, BND= -800.0 TWIN=-0.1000E+31 43
SET Y2 TO <= 1 AT 3, BND= -880.0 TWIN= -820.0 46
DELETE Y2 AT LEVEL 3
DELETE Y5 AT LEVEL 2
DELETE Y5 AT LEVEL 1
RELEASE FIXED VARIABLES
ENUMERATION COMPLETE. BRANCHES= 7 PIVOTS= 57
LAST INTEGER SOLUTION IS THE BEST FOUND
RE-INSTALLING BEST SOLUTION...
OBJECTIVE FUNCTION VALUE
1) 820.0000
VARIABLE VALUE REDUCED COST
X1 2.000000 100.000000
X2 5.000000 100.000000
Y1 0.000000 40.000000
Y2 0.000000 40.000000
Y3 0.000000 40.000000
Y4 1.000000 40.000000
Y5 2.000000 40.000000
ROW SLACK OR SURPLUS DUAL PRICES
2) 3.000000 0.000000
3) 4.000000 0.000000
4) 3.000000 0.000000
5) 0.000000 0.000000
6) 0.000000 0.000000
7) 4.000000 0.000000
8) 2.000000 0.000000
9) 1.000000 0.000000
10) 0.000000 0.000000
NO. ITERATIONS= 57
BRANCHES= 7 DETERM.= 1.000E 0
(3).回答问题:
求解得到的最优解x1=3,x2=4,y1=0,y2=0,y3=0,y4=2,y5=1。最小费用为820元。
如果不能雇佣半时服务员,则最优解为x1=5,x2=6,y1=0,y2=0,y3=0,y4=0,y5=0,最小费用为1100元,即每天至少增加1100-820=280元。
如果不能雇佣半时服务员,则最优解为x1=0,x2=0,y1=4,y2=0,y3=0,y4=2,y5=8,最小费用为560元,即每天至少增加820-560=260元。
—————————————————————————
【版权申明】
如非注明,本站文章均为 数据小雄 原创,转载请注明出处:数据小雄博客,并附带本文链接,谢谢合作!
本文地址:http://zhangzhengxiong.com/?id=47。
—————————————————————————
流泪
0人
打酱油
0人
开心
3人
鼓掌
0人
恐怖
0人
发表评论
额 本文暂时没人评论 来添加一个吧