数学建模课后作业第五章文档格式.docx
《数学建模课后作业第五章文档格式.docx》由会员分享,可在线阅读,更多相关《数学建模课后作业第五章文档格式.docx(41页珍藏版)》请在冰豆网上搜索。
(4)x15=4.2;
由以上的结果可知最少的支出费用为
x13+x35=1.7+2.0=3.7万元;
x12+x23+x35=0.8+0.9+2=3.7万元;
x12+x25=0.8+2.9=3.7万元;
2.生产计划与库存管理
(1)设x1、x2、x3、x4为第一、二、三、四季度生产量,则可以得出第第一、二、三、四季度支出费用为
第一季度费用z1:
5*x1+(x1-10);
第二季度费用z2:
5*x2+(x1+x2-24);
第三季度费用z3:
6*x3+(x1+x2+x3-44);
第四季度费用z4:
6*x4+(x1+x2+x3+x4-52);
总的支出费用为:
Z=z1+z2+z3+z4=9x1+8x2+8x3+7x4-130;
约束条件为:
x1+x2+x3+x4=52;
x1<
=14;
x1>
=10;
x2<
=15;
x1+x2>
=24;
x3<
x1+x2+x3>
=44;
x4<
=13;
可以得出lingo程序如下:
min=9*x1+8*x2+8*x3+7*x4-130;
运行程序后可得:
Globaloptimalsolutionfound.
Objectivevalue:
292.0000
Infeasibilities:
0.000000
Totalsolveriterations:
0
ModelClass:
LP
Totalvariables:
4
Nonlinearvariables:
Integervariables:
Totalconstraints:
9
Nonlinearconstraints:
Totalnonzeros:
18
Nonlinearnonzeros:
VariableValueReducedCost
X114.000000.000000
X215.000000.000000
X315.000000.000000
X48.0000000.000000
RowSlackorSurplusDualPrice
1292.0000-1.000000
20.000000-7.000000
30.0000000.000000
44.0000000.000000
50.0000001.000000
65.0000000.000000
70.0000001.000000
80.000000-2.000000
95.0000000.000000则可得x1=14,x2=15,x3=15,x4=8;
即第一季度生产14万盒,
第二季度生产15万盒,
第三季度15万盒,
第四季度为8万盒。
总的支出费用为292万元。
(2)由题目可得新的lingo程序:
min=7*x1+6*x2+6*x3+6*x4-31;
=43;
运行程序之后可得:
294.0000
X113.000000.000000
X49.0000000.000000
1294.0000-1.000000
20.000000-6.000000
43.0000000.000000
64.0000000.000000
80.000000-1.000000
94.0000000.000000
可得x1=13,x2=15,x3=15,x4=9;
即第一季度生产13万盒,
第四季度为9万盒。
总的支出费用为294万元。
(3)设第一季度加班生产的产品为x11盒,
第一季度加班生产的产品为x21盒,
第一季度加班生产的产品为x31盒,
第一季度加班生产的产品为x41盒,
则可以得到新的lingo程序:
min=8*x1+9*x11+7*x2+8*x21+7*x3+8.2*x31+6*x4+7.2*x41-78;
x1+x11+x2+x21+x3+x31+x4+x41=52;
x1+x11>
x1+x2+x11+x21>
x1+x2+x3+x11+x21+x31>
运行程序可得:
2
8
32
X110.0000001.000000
X211.0000000.000000
X310.0000000.2000000
X410.0000001.200000
95.0000000.000000
则可以得出新的生产方案为:
则可得x1=13,x21=1,x2=15,x3=15,x4=8;
第二季度加班生产的产品为1万盒,
(4)设第一季度加班生产的产品为x11盒,
可以得到新的lingo程序:
min=8*x1+9*x11+7*x2+8*x21+7*x3+8.2*x31+6*x4+7.2*x41-77;
293.0000
1293.0000-1.000000
3.指派问题
由此转换问题的解决方案分别为
(1)甲(worker1)(worker5)完成两项任务,乙(worker2)丙(worker3)丁(worker4)各完成一项任务;
可以得出如下的lingo程序:
model:
sets:
worker/w1..w5/;
job/j1..j5/;
links(worker,job):
c,x;
endsets
data:
c=2529314237
3938262033
3427284032
2442362345
2529314237;
enddata
min=@sum(links:
c*x);
@for(worker(i):
@sum(job(j):
x(i,j))=1);
@for(job(j):
@sum(worker(i):
@for(links:
@bin(x));
End
135.0000
Objectivebound:
Extendedsolversteps:
PILP
25
11
75
C(W1,J1)25.000000.000000
C(W1,J2)29.000000.000000
C(W1,J3)31.000000.000000
C(W1,J4)42.000000.000000
C(W1,J5)37.000000.000000
C(W2,J1)39.000000.000000
C(W2,J2)38.000000.000000
C(W2,J3)26.000000.000000
C(W2,J4)20.000000.000000
C(W2,J5)33.000000.000000
C(W3,J1)34.000000.000000
C(W3,J2)27.000000.000000
C(W3,J3)28.000000.000000
C(W3,J4)40.000000.000000
C(W3,J5)32.000000.000000
C(W4,J1)24.000000.000000
C(W4,J2)42.000000.000000
C(W4,J3)36.000000.000000
C(W4,J4)23.000000.000000
C(W4,J5)45.000000.000000
C(W5,J1)25.000000.000000
C(W5,J2)29.000000.000000
C(W5,J3)31.000000.000000
C(W5,J4)42.000000.000000
C(W5,J5)37.000000.000000
X(W1,J1)0.00000025.00000
X(W1,J2)1.00000029.00000
X(W1,J3)0.00000031.00000
X(W1,J4)0.00000042.00000
X(W1,J5)0.00000037.00000
X(W2,J1)0.00000039.00000
X(W2,J2)0.00000038.00000
X(W2,J3)1.00000026.00000
X(W2,J4)0.00000020.00000
X(W2,J5)0.00000033.00000
X(W3,J1)0.00000034.00000
X(W3,J2)0.00000027.00000
X(W3,J3)0.00000028.00000
X(W3,J4)0.00000040.00000
X(W3,J5)1.00000032.00000
X(W4,J1)0.00000024.00000
X(W4,J2)0.00000042.00000
X(W4,J3)0.00000036.00000
X(W4,J4)1.00000023.00000
X(W4,J5)0.00000045.00000
X(W5,J1)1.00000025.00000
X(W5,J2)0.00000029.00000
X(W5,J3)0.00000031.00000
X(W5,J4)0.00000042.00000
X(W5,J5)0.00000037.00000
1135.0000-1.000000
20.0000000.000000
40.0000000.000000
50.0000000.000000
60.0000000.000000
70.0000000.000000
80.0000000.000000
90.0000000.000000
100.0000000.000000
110.0000000.000000
可以得出:
甲完成A、B两个任务,乙完成C任务,丙完成E任务,丁完成D任务,花费的时间最短时间为135。
(2)乙(worker2)(worker5)完成两项任务,甲(worker1)丙(worker3)丁(worker4)各完成一项任务;
3938262033;
运行程序可以得出:
131.0000
C(W5,J1)39.000000.000000
C(W5,J2)38.000000.000000
C(W5,J3)26.000000.000000
C(W5,J4)20.000000.000000
C(W5,J5)33.000000.000000
X(W4,J1)1.00000024.00000
X(W4,