某工厂调查了解市场情况,估计在今后四个月内,市场对其产品的需求量如下表所示。
时期(月) |
需要量(产品单位) |
1 |
2 |
2 |
3 |
3 |
2 |
4 |
4 |
已知:对每个月来讲,生产一批产品的固定成本费为3 (千元),若不生产,则为零。每生产单位产品的成本费为1(千元)。同时,在任何一个月内,生产能力所允许的最大生产批量为不超过6个单位。又知每单位产品的库存费用为每月0.5(千元),同时要求在第一个月开始之初, 及在第四个月末,均无产品库存。问:在满足上述条件下,该厂应如何安排各个时期的生产与库存,使所花的总成本费用最低?
设第k月的需求量为Nk(k=1,2,3,4)
状态变量Xk:第k月初的库存量,X1=X5=0,0≤Xk≤Nk+…+N4
决策变量Uk:第k月的生产量,max{0,Nk-Xk}≤Uk≤min{6,Nk+…+N4 - Xk}
状态转移方程:Xk+1 = Uk + Xk – Nk
第k月的成本Vk = 0.5*(Xk - Nk) Uk=0
3 + Uk + 0.5*(Uk + Xk - Nk) Uk≠0
设Fk(Xk)是由第k月初的库存量Xk开始到第4月份结束这段时间的最优成本
则Fk(Xk) = min{Vk + Fk+1(Xk+1)} 1≤k≤4
= min{ 3 + Uk + 0.5*(Uk + Xk - Nk) + Fk+1(Uk+ Xk - Nk) } Uk≠0
min{ 0.5*(Xk - Nk) + Fk+1(Xk - Nk) } Uk=0
F5(X5)=0
四个月内的最优成本为F1(X1)=F1(0)
详细计算步骤如下:
(1)k=4时
0≤X4≤4,max{0,4 - X4}≤U4≤min{6,4-X4}
X4 |
U4 |
X5 |
V4 |
F5(X5) |
V4 + F5(X5) |
0 |
4 |
0 |
7 |
0 |
7=F4(0) |
1 |
3 |
0 |
6 |
0 |
6=F4(1) |
2 |
2 |
0 |
5 |
0 |
5=F4(2) |
3 |
1 |
0 |
4 |
0 |
4=F4(3) |
4 |
0 |
0 |
0 |
0 |
0=F4(4) |
即对于状态X4的每个取值,都有唯一确定的决策变量U4使得F4(X4)最优
(2)k=3时
0≤X3≤6,max{0,2 - X3}≤U3≤min{6,6-X3}
X3 |
U3 |
X4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,4个月的总最优成本为F1(0) = 20.5(千元)
从k=1回溯,可得最优结果中各阶段的状态变量Xk和决策变量Uk如下表:
月份k |
产量Uk |
月初库存量Xk |
需求量Nk |
每月成本Vk |
1 |
5 |
0 |
2 |
9.5 |
2 |
0 |
3 |
3 |
0 |
3 |
6 |
0 |
2 |
11 |
4 |
0 |
4 |
4 |
0 |