Академический Документы
Профессиональный Документы
Культура Документы
CHAPTER 1: Introduction
excess nor inadequate. A high cost is added to the company because of inventory. At the
same time, the enterprise may face stock-out problems due to insufficient inventory. As
a result, the company may lose customers. Many techniques can be applied to solve the
inventory management problem which are, linear and non-linear programming, network
flow models, queuing, etc. Most of these packages of inventory control depend on
inventory theory. When and how much an order is placed are some important questions
which are solved in Inventory theory. One of the basic concepts of Inventory theory is
EOQ formula which was discovered by Harris (1915). Several studies have been done
in the past on inventory management but all of those have not considered the concept of
Inventories are primarily classified as two types: perishable and non-perishable. Non-
perishable items have an infinite lifetime and so can be used for demand fulfilment for a
long time. But management of perishable items with limited lifetime is a challenge. The
classical inventory management principal work significantly well when we assume that
the demand is deterministic. But in real life situation, the demand is a random variable
and the items are perishable. The study of traditional approaches indicates scope for
techniques.
2
products. Mainly Perishable products are of two categories: one which maintains
constant utility throughout the lifetime, for example, blood has a fixed lifetime of 21
days with constant utility, medicines, etc. And other with exponentially decaying utility,
For stochastic demand when the product lifetime is more than one period, it is difficult
to find an optimal ordering policy. The state vector must be formed by considering the
stock level of each possible category of remaining lifetime because it will not be
possible to get a non-perishing order policy. Let us assume that stock levels are
reviewed periodically and useful lifetime of products is exactly periods. Then the
state vector which gives starting stock levels of each lifetime category is
It is the one period transfer equation which expresses the process dynamics.
levels of stock of each age category one period into the future when y is the quantity of
Then,
And
If excess demand is backlogged
Where,
FIFO (First-In, First-Out) is one of the most widely used method which is used to
calculate the value of inventory on hand at the end of a period and the cost of goods
which are sold during the period. This policy says that the inventory bought or made
first is sold first. The newer ones are kept unsold. For perishable inventory management
perish after i periods. Let , be the total starting stock of all remaining
lifetime categories. So, which products have less remaining life time then other such
products are given first priority for using them for demand fulfilment to minimize
outdating of products.
4
decisions is called Dynamic programming. For each decision and sub problems, the
dynamic programming determines the optimal solution of the original problem from the
solutions of the sub problems. The basis of dynamic programming is optimal policy.
According to this policy, regardless of the initial state and decisions, the remaining
dynamic programming are obtained by working backwards from the end to the initial
To solve a dynamic programming problem, different sub problems which are parts of
the problem are solved and then solutions of each sub problem combined together gives
an overall solution. When more naive methods are used, then the sub problems are to be
solved many times. The dynamic programming approach looks forward to solve each
sub problem only one time which reduces the computational length. The solution to one
sub problem is stored and then simply looked up in the next sub problem. This approach
is a reward function
decisions made so far. In some cases, the state may be the complete sequence,
but in other cases only partial information is sucient; for example, if the set of
all states can be partitioned into equivalence classes, each represented by the last
decision. In some simpler problems, the length of the sequence, also called the
stage at which the next decision is to be made, success. The initial state, which
reects the situation in which no decision has yet been made, will be called the
II. Decision Space: The decision space is the set of possible or eligible
choices for the next decision . It is a function of the state S in which the
III. Objective Function: The objective function which is the optimal profit or cost
of decisions are obtained when the sequence of decisions associated with S are
made, also called as state S. The main aim of a Dynamic Programming problem
IV. Reward Function: The reward function R, a function of S and d, is the prot or
cost that can be attributed to the next decision d made in state S. The reward
must be separable from the prots or costs that are attributed to all other
decisions. The value of the objective function for the goal state is the
(ii) Minimization of cost like holding cost, outdating cost, set-up cost.
like demand, inventory, utility of product and costs associated with the product in order
to order quantity at each ordering point and determine optimal price depending on
problems like what should be the review interval of inventory, when to place a
replenishment order and size of replenishment order. As described by Silver (1979) that
there exists a serious gap between theory and real world problem. Suggestions were
made by him for bridging this gap which study of various problems, objectives and
constraints.
Nahmias (1975), dealt with the problem of computing optimal ordering policies for a
single type of product in order to take perishability into account. So a cost is substituted
reviewed the literature for perishable inventory with fixed life as well as continuous
exponential decay. Both deterministic and stochastic demand is considered for both
single and multiple products. Application of these models to management of blood bank
is also included. Sub-optimal order policies and optimal order policies are reviewed
more tractable problems by working in backward direction from end towards the
periodic demand is known beforehand. Ordering policy for cost minimization may be
Meal Heuristic. In chapter-19 of Winston (2003), the problems in which the cost of
current period and state of next period are random are discussed as probabilistic
Padmanabhan and Vrat (1993) considered more realistic parameters like dependence of
stock on selling rate and perishability. Also, a function of amount of already backlogged
Then following the above work, Kun-Jen Chung et. al. (1999) develops the necessary
and sufficient conditions of existence and uniqueness of the optimal solutions without
and with complete backlogging of the profit per unit timefunctions. It also explains the
Chung-Yuan Dye et. al. (2003) also extends the work of Padmanabhan and Vrat (1993)
theory.
S. Panda et. al. (2007) discusses a single item order level inventory model for a seasonal
algorithm to find the solution to the problem when the shortages are not allowed is
Kuo-Lung Hou(2004) derives an inventory model for deteriorating items with stock-
dependent consumption rate and shortages under inflation and time discounting over a
finite planning horizon. The total cost function is considered to be convex. The results
Pasternack (2008) shows the models to examine return and pricing policies. This
includes those where no returns of goods which are not sold are permitted. It also
involves channel coordination for partial return of goods but it will be a function of
Abad (1996) formulated a generalized model by a reseller of dynamic pricing and lot-
sizing. The assumption is that, for periods of shortage, the reseller can plan for shortage
periods to attain economy. The reseller may be required to backlog demand the goods
which are highly perishable in order to sell it in reasonable price. A simple solution for
A Chande et. al. (2005) describes an integrated framework for inventory management
of perishable products and pricing in a discrete time (periodic review and ordering)
Guillermo Gallego et. al. (1994) investigates the problem of dynamically pricing the
perishable type of inventories when demand is price sensitive and stochastic and the
Poisson distribution of demand functions is considered. Holding costs are incurred and
Chen and Sapra (2013) consider a periodic review model for a perishable product over a
finite horizon, with fixed lifetime of two periods with excess demand backlogged. The
FIFO system is compared with two widely analyzed inventory systems that correspond
management would modify our understanding of the relationship among the three
10
systems. We also find that it is more likely that bigger orders are placed in the FIFO
In this chapter we discuss the development of a mathematical model for the inventory
Programming techniques are used in the model development. We first discuss the
traditional model discussed in the literature where products utility and price of products
is same throughout its life time then discuss the problem statement. Next we discuss a
model where we divide product life time in two parts: First part of the product has more
utility and in second part product utility is decreased and also price is decreased. After
In this model the seasonal products is assumed to have a specific life time. Orders are
placed during predefined points on a time interval. Demand is stochastic. Cost includes
setup cost, holding cost, outdating cost and purchase cost. The model determines the
maximize the total profit. We next introduce the regarding notations and assumption
3.1.1. Notations:
S : Setup cost
Minimum demand
Maximum demand
i.e.
inventory on hand is
3.1.2 Assumptions:
At the beginning of any period, all order are placed and received instantaneously
If product is unsold beyond its life time, then it perishes and has to be discarded
the session.
If then means when we are not ordering product the setup cost
will be zero.
Where,
14
positive non-zero value of the above term is obtained. But in other case when
Where
demand fulfilment.
Where, is the inventory at the beginning of period n which has life time of one
Then, the expected outdating cost for a given period is given by:
Where
As in dynamic programming we start from last period, so the cumulative profit from
inventories will be carried over to next period. When is zero then, the
with remaining lifetime and is to be fulfilled by the inventory which are having
significant amount of products get outdated and wasted if they are not being sold before
the life time ends. When such products are not sold within the products life-time an
additional cost such as outdating cost often occurs. The objective of this study is to
determine an optimal strategy to maximize the total profit. The above traditional model
can be modified by reducing the price of products with lower remaining lifetime. This
will reduce the outdating of products due to increase in demand of products having
lower price.
To achieve this, the life time of products are divided into two parts with different
utilities such that second part has lesser utility with lesser price. Thus in second part,
demand will increase which will result in decreasing our inventory which was about to
perish. Depending on above objective, two decision variables are given as:
i. The price of the left out products with lesser utility in the second portion of
ii. Order quantity at each ordering point depending on demand, holding cost, setup
This is the model developed in this thesis to overcome the limitations of traditional
In this model the lifetime of products is assumed to pass through two phases. If product
life time has t periods then phase one consists of m periods where and phase
From receiving the product to end of period m, products have a higher utility , and
the products decrease after m periods, price are determined once again based on the
remaining inventory.
We next introduce the regarding notations and assumption and discuss the model
development.
3.3.1. Notations:
S : Setup cost
: Random variable which represents the number of units of demand for products
: Random variable which represents the number of units of demand for products
and
and
periods
3.3.2 Assumptions:
At the beginning of any period, all order are placed and received instantaneously
If product is unsold beyond its life time, then it perishes and has to be discarded
session.
If then means when we are not ordering product the setup cost
will be zero.
consumers may shift from buying products with utility to products with
utility
The probability of having a certain units of demand for products with utility
Beginning from period 1 until period when orders are placed only products with
products with utility and would be available, from period is the last
Expected revenue due to products with utility for a given period n is given by:
Where
products with utility is more than the products with utility on hand and so a
positive non-zero value of the above term is obtained. But in other case when
which remains unsatisfied at period for products with utility becomes zero
for products.
23
Expected holding cost due to products with utility U2 for a given period n is given by:
Where and
Where, is the inventory at the beginning of period n which has life time of
Then, the expected outdating cost for a given period n is given by:
24
Where
The expected profit due to products with utility U2 during any period n is given by:
Applying backward induction principal of dynamic programming we start from the last
to period is as
We next discuss two cases with respect to the product with utility . In first case when
products with utility are both available at a same period then the probability
of the demand . In second case when products with utility only available
Case I: When there is change in type of product from utility to from one period to
another, the inventory being carried to next such period will depend on demand of
previous period. So, cumulative profit due to such kind of products will have to be
is satisfied and so the value of demand which remains unsatisfied at period for
utility will decrease from to in next period i.e. such products are given first
priority for using them for demand fulfilment. Then we try to fulfil the remaining
unfulfilled by products whose utility will decrease from to in next period is more
than other products of utility in hand and so a positive non-zero value of the above
represents products
is holding cost of
Case II:
is given by:
34
In this section we illustrate the Modified model with a small example. We have taken
equally divide life time of the product in two parts first part periods product has
utility of U1 and remaining life time of the product t periods has utility of U2
where .
And we will order only first periods because our model on seasonal
product so demand of the product will be decrease at the end of the season and after 6
Period 1
At the beginning of period 1 , initial inventory is zero and Y 1 with life time 4 periods.
So, In period 1 we have products of utility only with lifetime 4 periods. If demand of
period 1 is
Period 2
time 4 periods. So, in period 2 we have products of utility with some with less
remaining lifetime than others. So we should follow FIFO policy to allow the stock
38
from previous period to clear first, i.e. & are with same value of utility
and
Period 3
lifetime 4 periods and this is the last ordering point . In period 3 we have
allow the stock from previous period to clear first, i.e. & are with same
For :
For :
and
Period 4
less remaining lifetime than others. So for product we should follow FIFO policy to
allow the stock from previous period to clear first, i.e. & are with
For :
period.
40
For product
Period 5
stock from previous period to clear first, i.e. & are with same value
U2 is .
period.
41
Period 6
periods.
6 period formulas:
Period 6
42
Period 5
43
Where,
Period 4
44
Where,
Where,
45
Period 3
Where,
46
Where,
Where,
Period 2
47
Where ,
Where ,
Or
Or
48
Period 1
Where
From the illustration above, we can obtain the expected profit of every period (i. e.
From 1 to 6) which is the reward function of dynamic programming. Also it gives the
The next chapter demonstrates the results of the traditional model and modified model
obtained through simulations using VBA (Visual Basic for Applications) programming.
49
example. We obtain solution to the model in the form of evaluating the optimal order at
each period and determining the optimal price for the product with lower utility. The
model is evaluated for various parameter changes comparison with traditional model is
also performed.
In section 4.1 we illustrate the traditional model and section 4.2 we illustrate the model
under study. The model is analyzed for parameter changes. In section 4.3 we compare
We calculated the expected cumulative profit for Traditional model and in this section
we show the changes of expected cumulative profit by changing unit cost, setup cost,
holding cost and outdating cost. Where, total number of observation periods, and
For the purpose of calculating the cumulative profit, we assume the per period demand
is 20). The demand is following Truncated Poisson Distribution. The mean value of
demand depends on selling price of the product i.e. if price of the product increases,
Table 4.1: Probability of having demand as units for Traditional model when unit selling
price
1 0.00847267 11 0.03699328
2 0.02825635 12 0.01992095
3 0.06282328 13 0.01094994
4 0.10475781 14 0.00502629
5 0.13974692 15 0.00223502
6 0.15535199 16 0.00093173
7 0.14802826 17 0.00036557
8 0.12341856 18 0.00013546
9 0.09146687 19 4.7554E-05
10 0.0610084 20 1.5859E-05
Per unit per period holding cost , per unit Outdating cost , per unit
selling price
51
Table 4.2: Total expected cumulative profit with variation of setup cost and unit cost, for
traditional model
Case II: Changing holding cost when setup cost, unit cost and outdating cost is fixed
price
Table 4.3: Variation of total expected cumulative profit with holding cost for traditional
model
1 1242.46067
52
2 1186.41068
3 1133.0327
4 1099.11449
5 1069.80758
6 1040.59608
7 1012.14592
8 986.078454
9 960.010992
10 934.36116
Case III: Changing outdating cost when setup cost, unit cost and holding cost is fixed
Setup cost , unit cost , holding cost , per unit selling price
Table 4.4: Total expected cumulative profit outdating cost for traditional model
1 1188.22116
2 1186.41068
3 1184.60021
4 1182.78973
5 1180.97925
6 1179.16877
7 1177.3583
8 1175.85106
53
9 1174.44866
10 1173.04625
We calculated the expected cumulative profit for modified model and in this section we
show the changes of expected cumulative profit by changing unit cost, setup cost,
holding cost and outdating cost.. We also calculate the order quantities in each ordering
choose the best price out of 75 and 60 for utility type of products depending on
inventory of .
For the purpose of calculating the cumulative profit, we assume the per period demand
is 20) . The demand is following Truncated Poisson Distribution. The mean value of
54
demand depends on selling price of the product i.e. if price of the product increases,
For the purpose of calculating the cumulative profit, we assume the per period demand
is 20). The demand is following Truncated Poisson Distribution. The mean value of
demand depends on selling price of the product i.e. if price of the product increases, the
Table 4.5: Probability of demand for utility type of products when, only products with utility
are available
1 0.00847267 11 0.03699328
2 0.02825635 12 0.01992095
3 0.06282328 13 0.01094994
4 0.10475781 14 0.00502629
5 0.13974692 15 0.00223502
6 0.15535199 16 0.00093173
7 0.14802826 17 0.00036557
8 0.12341856 18 0.00013546
9 0.09146687 19 4.7554E-05
55
10 0.0610084 20 1.5859E-05
Table 4.6: Probability of demand for products with utility when, both products with utility
are available
When, When,
1 0.0170934 0.0258218
2 0.0498808 0.0688926
3 0.0970389 0.122537
4 0.1415858 0.1634643
5 0.165266 0.1744491
6 0.1607556 0.1551434
7 0.13403 0.1182636
8 0.0977791 0.0787818
9 0.063407 0.0467682
10 0.0370059 0.0239555
11 0.0196342 0.0129057
12 0.0089492 0.005483
13 0.004687 0.0022095
14 0.0017872 0.0008421
15 0.0006954 0.0002996
16 0.0002536 9.991E-05
17 8.708E-05 3.136E-05
18 2.823E-05 9.296E-06
56
19 8.673E-06 2.611E-06
20 2.531E-06 6.966E-07
When, When,
1 0.0170934 0.0008251
2 0.0498808 0.0038509
3 0.0970389 0.0119814
4 0.1415858 0.0279586
5 0.165266 0.0521931
6 0.1607556 0.0811951
7 0.13403 0.1082679
8 0.0977791 0.1263216
9 0.063407 0.1310095
10 0.0370059 0.1222843
11 0.0196342 0.1037638
12 0.0089492 0.0807109
13 0.004687 0.0579504
14 0.0017872 0.0386364
15 0.0006954 0.0240421
16 0.0002536 0.0144256
17 8.708E-05 0.0077009
18 2.823E-05 0.0039933
19 8.673E-06 0.0019618
57
20 2.531E-06 0.0009156
Table 4.8: Expected profit for products with utility where, products have remaining lifetime
1 74.99814 59.99931
2 148.50606 119.9392
3 217.66718 179.6018
4 278.3756 238.4018
5 326.75629 295.1888
6 360.75358 348.2178
7 380.76603 395.4008
8 389.2106 434.7885
9 389.15622 465.081
10 383.52326 485.9409
58
11 374.67651 497.9963
12 364.12535 502.5807
13 352.74561 501.3539
14 340.99403 495.9547
15 329.0875 487.7737
16 317.12073 477.8616
17 305.13198 466.9109
18 293.13569 455.4057
19 281.13695 443.613
20 269.13747 431.6791
.
...............
...............
...............
.
78 -426.8453 -264.313
79 -438.845 -276.313
80 -450.8447 -288.313
The Table 4.8 shows expected profit for two prices of products with utility . We can
decide the value of price for different inventories by comparing the expected profit
of the two price of products. Price for which expected profit is higher than the other, is
chosen as price of products with utility for that number of inventory of products with
utility . As we can observe from table that when inventory of products with utility
utility is in range [1,6], is the best option for price and when it is more than 6,
7 6 5 4 3 2 1 0
0
380.766 360.7536 326.7563 278.3756 217.6672 148.5061 74.99814 0
1
390.7406 382.0301 361.6961 327.3682 278.7041 217.8014 148.5403 74.99814
2
392.4115 392.0046 382.9726 362.308 327.6967 278.8383 217.8356 148.5403
3
388.6322 393.6756 392.9472 383.5845 362.6365 327.8309 278.8725 217.8356
4
381.7129 389.8962 394.6181 393.559 383.913 362.7707 327.8651 278.8725
Number of products of
...
.....
8
7
0
8
80 79 78 ............... 14 13 12 11 10 9 8
-450.845 -438.845 -426.845 340.994 352.7456 364.1254 374.6765 383.5233 389.1562 389.2106
-460.844 -448.845 -436.845 331.0853 342.9883 354.7313 366.092 376.604 385.3769 390.8816
-470.844 -458.844 -446.845 321.1177 333.0796 344.974 356.698 368.0195 378.4576 387.1022
-480.844 -468.844 -456.845 311.1287 323.112 335.0653 346.9406 358.6254 369.8731 380.1829
-490.844 -478.844 -466.844 301.1323 313.1229 325.0977 337.0319 348.8681 360.479 371.5984
-500.843 -488.844 -476.844 291.1335 303.1265 315.1086 327.0643 338.9594 350.7217 362.2044
-510.843 -498.843 -486.844 281.1339 293.1277 305.1122 317.0753 328.9918 340.813 352.447
-520.843 -508.843 -496.844 271.1342 283.1282 295.1134 307.0789 319.0027 330.8454 342.5383
-530.843 -518.843 -506.843 261.1344 273.1284 285.1139 297.08 309.0063 320.8563 332.5707
-540.842 -528.843 -516.843 251.1347 263.1287 275.1141 287.0805 299.0075 310.8599 322.5817
-550.842 -538.842 -526.843 241.1349 253.1289 265.1144 277.0808 289.008 300.8611 312.5853
-560.842 -548.842 -536.843 231.1352 243.1292 255.1146 267.081 279.0082 290.8616 302.5865
-570.842 -558.842 -546.842 221.1354 233.1294 245.1149 257.0813 269.0085 280.8618 292.5869
-580.841 -568.842 -556.842 211.1357 223.1296 235.1151 247.0815 259.0087 270.8621 282.5872
-590.841 -578.842 -566.842 201.1359 213.1299 225.1153 237.0818 249.009 260.8623 272.5874
-1230.83 -1218.83 -1206.83 -438.848 -426.854 -414.869 -402.902 -390.975 -379.122 -367.397
-1240.83 -1228.83 -1216.83 -448.848 -436.854 -424.869 -412.902 -400.975 -389.122 -377.396
-1250.82 -1238.83 -1226.83 -458.848 -446.854 -434.868 -422.902 -410.975 -399.121 -387.396
60
Number of products of utility type with remaining lifetime of one period
8 7 6 5 4 3 2 1 0
0
434.7885 395.4008 348.2178 295.1888 238.4018 179.6018 119.9392 59.99931 0
1
465.9062 435.361 395.7568 348.4114 295.278 238.4351 179.6112 119.9409 59.99931
2
487.8533 466.4788 435.717 395.9504 348.5006 295.3113 238.4445 179.6128 119.9409
3
8
7
0
8
where, products have remaining lifetime
80 79 78 .... 14 13 12 11 10 9
-288.313 -276.313 -264.313 495.9547 501.3539 502.5807 497.9963 485.9409 465.081
-298.312 -286.313 -274.313 489.6676 497.7713 503.0546 504.12 499.3281 487.0281
is more than 6,
products with utility
-308.312 -296.312 -284.313 481.6975 491.4842 499.4721 504.594 505.4518 500.4153
-318.312 -306.312 -294.313 472.7176 483.5141 493.1849 501.0114 505.9257 506.539
-328.312 -316.312 -304.312 463.1987 474.5342 485.2148 494.7242 502.3431 507.0129
-338.312 -326.312 -314.312 453.4002 465.0153 476.235 486.7541 496.056 503.4303
-348.312 -336.312 -324.312 443.4644 455.2168 466.716 477.7743 488.0859 497.1432
is in range [1,6],
-358.312 -346.312 -334.312 433.4645 445.281 456.9176 468.2553 479.106 489.1731
-368.312 -356.312 -344.312 423.4646 435.2811 446.9818 458.4569 469.5871 480.1932
-378.312 -366.312 -354.312 413.4648 425.2813 436.9819 448.5211 459.7886 470.6743
-388.311 -376.312 -364.312 403.4649 415.2814 426.982 438.5212 449.8528 460.8758
-398.311 -386.311 -374.312 393.465 405.2815 416.9821 428.5213 439.853 450.94
-408.311 -396.311 -384.311 383.4651 395.2816 406.9822 418.5214 429.8531 440.9402
So from both the cases, Case I and Case II, if we have inventory of products with utility
between 1 to 6 units then and if we have inventory more than 6 units then
Per unit per period holding cost , per unit Outdating cost , per unit
Table 4.11: Total expected cumulative profit changing with setup cost and unit cost for
Modified model
Case II: Changing holding cost when setup cost, unit cost and outdating cost is fixed
price and
Table 4.12: Total expected cumulative profit changing with holding cost for Modified model
1 1905.520394
2 1830.308439
3 1761.046327
4 1694.326037
5 1629.508992
6 1568.274563
7 1512.010873
8 1456.420626
9 1402.989476
10 1349.911998
Case III: Changing outdating cost when setup cost, unit cost and holding cost is fixed
Setup cost , unit cost , holding cost , per unit selling price
and
Table 4.13: Total expected cumulative profit changing with outdating cost for Modified model
1 1835.739206
65
2 1830.308439
3 1824.877672
4 1819.739331
5 1815.075141
6 1810.410951
7 1805.746761
8 1801.409853
9 1797.463625
10 1793.517396
Table 4.14: Decide order quantity at the beginning of period 2 and period 3 depending
Period 2 Period 3
0 10 0 0 22
1 9 0 1 21
66
2 8 0 2 20
3 7 0 3 19
4 6 0 4 to 6 18
5 to 7 5 0 7 or 8 17
8 to 19 0 0 9 16
1 9 16
1 or 2 7 or 8 17
3 7 17
1 or 2 5 or 6 18
3 6 17
4 6 17
3 5 18
4 5 18
5 5 18
1 to 6 0 22
7 to 19 0 21
The order quantity at period 2 will depend on the inventory from period 1. At period 3
both types of utility products at period 3, we get order quantity of period 3 as shown in
Table 4.14. Also, from this table inventory in period 2 will vary from 0 to 19, as
type varying from 0 to19 (as maximum value of ), we get order quantity values
In this section we are comparing Traditional model with modified model by changing
Table 4.15 Expected Cumulative Profit of Traditional model and Modified model for different
model
We can observe from table 4.15, Modified model with is better than
Cumulative Profit for all the combinations of values of unit cost (C), setup cost (S),
5.1. Conclusion
The model developed in this thesis for inventory management of seasonal perishable
products provide scope for improving the overall profit of the firm by varying products
preferences and price over its lifetime. The ordering policy and pricing policy of the
with the traditional model in which products have the same preference and price, we
find that the modified model increase the overall profit. This model also benefits the
customers by providing products at a lower cost. The model takes advantages of lower
The model developed is only for two types of preference level of a product.
Model can be extended to study more levels of products preferences.
The demand is considered as discrete integer value in this model. But to get a
continuous range for demand, continuous real value of demand can be
considered.
This model can be extended to study non seasonal perishable products such as
bread, milk, and so on. This due to the fact that the demand for seasonal
products will stop when as the season ends but for non-seasonal products, the
In the model develop the various level of product preferences are assume to vary
References
14. Chande, A., Dhekane, S., Hemachandra, N., & Rangaraj, N. (2005). Perishable
inventory management and dynamic pricing using RFID technology. Sadhana,30(2-3),
445-462.
15. Chen, L. M., & Sapra, A. (2013). Joint inventory and pricing decisions for perishable
products with twoperiod lifetime. Naval Research Logistics (NRL),60(5), 343-366.
74
APPENDIX A
Sub thesis_work()
Dim m As Double
Dim d_max As Double
Dim d_min As Double
Dim p1 As Double
Dim h As Double
Dim o As Double
Dim p2 As Double
Dim c As Double
Dim dip1 As Double
Dim dip2 As Double
Dim dip3 As Double
Dim dip4 As Double
Dim dip5 As Double
Dim dip6 As Double
Dim dip7 As Double
Dim dip8 As Double
Dim dip12 As Double
Dim dip42 As Double
Dim dip51 As Double
Dim dip61 As Double
Dim dip71 As Double
Dim dip81 As Double
Dim dip32 As Double
Dim r21 As Double
Dim r22 As Double
Dim inv As String
m = life_time.Value
d_max = max_demand.Value
d_min = min_demand.Value
p1 = p1_u1.Value
h = holding_cost.Value
o = outdating_cost.Value
c = p2_change.Value
u_c = unit_cost.Value
s = setup_cost.Value
'************************period 6**************************
'***********************************************************
For i = 0 To m * d_max
dip1 = 0
dip2 = 0
For d = 1 To 20
If i > d Then
dip1 = dip1 + (d * p1 - (i - d) * h - (i - d) * o) * Cells(4 + d, 6).Value
Else
dip2 = dip2 + i * p1 * Cells(4 + d, 6).Value
End If
Cells(i + 3, 11).Value = dip1 + dip2
Next d
Next i
75
For i = 0 To m * d_max
For k = 0 To m * d_max
dip1 = 0
dip2 = 0
dip3 = 0
For d = 1 To 20
If d <= i Then
dip1 = dip1 + (d * p1 - (i + k - d) * h - (i - d) * o) * Cells(d + 4, 6).Value
Else
If d <= (i + k) Then
dip1 = dip1 + (d * p1 - (i + k - d) * h) * Cells(d + 4, 6).Value
Else
dip3 = dip3 + (i + k) * p1 * Cells(d + 4, 6).Value
End If
End If
Next d
Cells(2, 16 + k).Value = k
Cells(2, 16 + k).Interior.Color = RGB(150, 0, 0)
Cells(3 + i, 15).Value = i
Cells(3 + i, 15).Interior.Color = RGB(150, 0, 0)
Cells(i + 3, 16 + k).Value = dip1 + dip2 + dip3
Next k
Next i
'
Max = 0
For i = 0 To m * d_max
For k = 0 To m * d_max
r1 = 0
r2 = 0
r21 = 0
r22 = 0
r23 = 0
r24 = 0
r25 = 0
r26 = 0
r27 = 0
r28 = 0
r29 = 0
f5 = 0
For d = 1 To 20
If d <= i Then
i1 = k
r24 = r24 + Cells(i1 + 3, 11).Value * Cells(d + 4, 6).Value
Else
If d <= i + k Then
i2 = k + i - d
r25 = r25 + Cells(i2 + 3, 11).Value * Cells(d + 4, 6).Value
Else
r26 = r26 + Cells(3, 11).Value * Cells(d + 4, 6).Value
End If
End If
76
Next d
f5 = r21 + r22 + r23 + r24 + r26 + Cells(i + 3, 16 + k).Value
Cells(i + 90, 16 + k).Value = f5
Cells(89, 16 + k).Value = k
Cells(89, 16 + k).Interior.Color = RGB(150, 0, 0)
Cells(90 + i, 15).Value = i
Cells(90 + i, 15).Interior.Color = RGB(150, 0, 0)
Next k
Next i
'****************************************period 4*****************
For i = 0 To m * d_max
For k = 0 To m * d_max
For x = 0 To m * d_max
dip1 = 0
dip2 = 0
dip3 = 0
r41 = 0
For d = 1 To 20
If d <= i Then
dip1 = dip1 + (d * p1 - (i + k + x - d) * h - (i - d) * o) * Cells(d + 4, 6).Value
Else
If d <= (i + k + x) Then
dip2 = dip2 + (d * p1 - (i + k + x - d) * h) * Cells(d + 4, 6).Value
Else
dip3 = dip3 + (i + k + x) * p1 * Cells(d + 4, 6).Value
End If
End If
Next d
r41 = dip1 + dip2 + dip3
For i = 0 To m * d_max
For k = 0 To m * d_max
For x = 0 To m * d_max
f31 = 0
f32 = 0
f33 = 0
f34 = 0
77
f4 = 0
For d = 1 To 20
If d <= i Then
i1 = k
k1 = x
z4 = Cells(i1 + 90, 16 + k1).Value
f31 = f31 + z4 * Cells(4 + d, 6).Value
Else
If d <= (i + k) Then
i1 = i + k - d
k1 = x
z4 = Cells(i1 + 90, 16 + k1).Value
f32 = f32 + z4 * Cells(4 + d, 6).Value
Else
If d <= (i + k + x) Then
i1 = 0
k1 = i + k + x - d
z4 = Cells(i1 + 90, 16 + k1).Value
f33 = f33 + z4 * Cells(4 + d, 6).Value
Else
i1 = 0
k1 = 0
z4 = Cells(i1 + 90, 16 + k1).Value
f34 = f34 + z4 * Cells(4 + d, 6).Value
End If
End If
End If
Next d
f4 = f31 + f32 + f33 + f34 + Cells(180 + i, 16 + x + (m * d_max + 1) * k).Value
Cells(270 + i, 16 + x + (m * d_max + 1) * k).Value = f4
Cells(269, 16 + x + (m * d_max + 1) * k).Value = k & "," & x
Cells(269, 16 + x + (m * d_max + 1) * k).Interior.Color = RGB(150, 0, 0)
Cells(i + 270, 15).Value = i
Cells(270 + i, 15).Interior.Color = RGB(150, 0, 0)
If Max < f4 Then
Max = f4
Cells(275, 10).Value = Max
Cells(275, 11).Value = i
Cells(275, 12).Value = k
Cells(275, 13).Value = x
Else
Max = Max
End If
Next x
Next k
Next i
'****************************************preiod 3'*************************
For k = 0 To m * d_max
For x = 0 To m * d_max
For y = 0 To m * d_max
r31 = 0
r32 = 0
r3 = 0
For d = 1 To 20
If d <= (x + y + k) Then
r31 = r31 + (d * p1 - (x + y + k - d) * h) * Cells(4 + d, 6).Value
Else
78
f31 = 0
f32 = 0
f33 = 0
f34 = 0
f3 = 0
For d = 1 To 20
If d <= k Then
i1 = k - d
k1 = x
x1 = y
z4 = Cells(270 + i1, 16 + x1 + (m * d_max + 1) * k1).Value
f31 = f31 + z4 * Cells(4 + d, 6).Value
Else
If d <= (x + k) Then
i1 = 0
k1 = x + k - d
x1 = y
z4 = Cells(270 + i1, 16 + x1 + (m * d_max + 1) * k1).Value
f32 = f32 + z4 * Cells(4 + d, 6).Value
Else
If d <= (y + k + x) Then
i1 = 0
k1 = 0
x1 = y + k + x - d
z4 = Cells(270 + i1, 16 + x1 + (m * d_max + 1) * k1).Value
f33 = f33 + z4 * Cells(4 + d, 6).Value
Else
i1 = 0
k1 = 0
x1 = 0
z4 = Cells(270 + i1, 16 + x1 + (m * d_max + 1) * k1).Value
f34 = f34 + z4 * Cells(4 + d, 6).Value
End If
End If
End If
Next d
If y > 0 Then
f3 = f31 + f32 + f33 + f34 + Cells(360 + k, 16 + y + (m * d_max + 1) * x).Value - y *
u_c - s
Else
79
'****************************************period2********************************
***********
Max = 0
For y = 0 To m * d_max
For y2 = 0 To m * d_max
For x = 0 To m * d_max
f31 = 0
f32 = 0
f33 = 0
f34 = 0
f2 = 0
For d = 1 To 20
If d <= x Then
k1 = x - d
x1 = y2
y1 = y
z4 = Cells(450 + k1, 16 + y1 + (m * d_max + 1) * x1).Value
f31 = f31 + z4 * Cells(4 + d, 6).Value
Else
If d <= (x + y2) Then
k1 = 0
x1 = y2 + x - d
y1 = y
z4 = Cells(450 + k1, 16 + y1 + (m * d_max + 1) * x1).Value
f32 = f32 + z4 * Cells(4 + d, 6).Value
Else
k1 = 0
x1 = 0
y1 = y
z4 = Cells(450 + k1, 16 + y1 + (m * d_max + 1) * x1).Value
f33 = f33 + z4 * Cells(4 + d, 6).Value
End If
End If
80
Next d
If y2 > 0 Then
f2 = f31 + f32 + f33 + Cells(360, 16 + y2 + (m * d_max + 1) * x).Value - y2 * u_c - s
Else
f2 = f31 + f32 + f33 + Cells(360, 16 + y2 + (m * d_max + 1) * x).Value
End If
Cells(540 + y, 16 + x + (m * d_max + 1) * y2).Value = f2
Cells(539, 16 + x + (m * d_max + 1) * y2).Value = y2 & "," & x
Cells(539, 16 + x + (m * d_max + 1) * y2).Interior.Color = RGB(150, 0, 0)
Cells(y + 540, 15).Value = y
Cells(540 + y, 15).Interior.Color = RGB(150, 0, 0)
If Max < f2 Then
Max = f2
Cells(545, 10).Value = Max
Cells(545, 11).Value = y
Cells(545, 12).Value = y2
Cells(545, 13).Value = x
Else
Max = Max
End If
Next x
Next y2
Next y
'
'****************************************preiod
1*******************************************
'
'*******************************************************************************
************
cat = Cells(1, 3).Value
Max = 0
For y = 0 To m * d_max
For y2 = 0 To m * d_max
For y3 = 0 To m * d_max
f31 = 0
f32 = 0
f1 = 0
For d = 1 To 20
If d <= y3 Then
x1 = y3 - d
y21 = y2
y1 = y
z4 = Cells(540 + y1, 16 + x1 + (m * d_max + 1) * y21).Value
f31 = f31 + z4 * Cells(4 + d, 6).Value
Else
x1 = 0
y21 = y2
y1 = y
z4 = Cells(540 + y1, 16 + x1 + (m * d_max + 1) * y21).Value
f32 = f32 + z4 * Cells(4 + d, 6).Value
End If
Next d
If y3 > 0 Then
f1 = f31 + f32 + Cells(360, 16 + y3).Value - y3 * u_c - s
81
Else
f1 = f31 + f32 + Cells(360, 16 + y3).Value
End If
Cells(630 + y, 16 + y3 + (m * d_max + 1) * y2).Value = f1
Cells(629, 16 + y3 + (m * d_max + 1) * y2).Value = y2 & "," & y3
Cells(629, 16 + y3 + (m * d_max + 1) * y2).Interior.Color = RGB(150, 0, 0)
Cells(y + 630, 15).Value = y
Cells(630 + y, 15).Interior.Color = RGB(150, 0, 0)
If Max < f1 Then
Max = f1
Cells(635, 10).Value = Max
Cells(635, 11).Value = y
Cells(635, 12).Value = y2
Cells(635, 13).Value = y3
End Sub
82
APPENDIX B
Sub thesis_work()
Dim m As Double
Dim d_max As Double
Dim d_min As Double
Dim p1 As Double
Dim p21 As Double
Dim p22 As Double
Dim h As Double
Dim o As Double
Dim p2 As Double
Dim c As Double
Dim dip1 As Double
Dim dip2 As Double
Dim dip3 As Double
Dim dip4 As Double
Dim dip5 As Double
Dim dip6 As Double
Dim dip7 As Double
Dim dip8 As Double
Dim dip12 As Double
Dim dip22 As Double
Dim dip42 As Double
Dim dip51 As Double
Dim dip61 As Double
Dim dip71 As Double
Dim dip81 As Double
Dim dip32 As Double
Dim r21 As Double
Dim r22 As Double
Dim inv As String
m = life_time.Value
d_max = max_demand.Value
d_min = min_demand.Value
p1 = p1_u1.Value
p21 = p21_u2.Value
p22 = p22_u2.Value
h = holding_cost.Value
o = outdating_cost.Value
c = p2_change.Value
u_c = unit_cost.Value
s = setup_cost.Value
'************************period 6**************************
'***********************************************************
For i = 0 To m * d_max
dip1 = 0
dip2 = 0
For d = 1 To 20
If i > d Then
dip1 = dip1 + (d * p21 - (i - d) * h - (i - d) * o) * Cells(4 + d, 7).Value
Else
83
For i = 0 To m * d_max
dip1 = 0
dip2 = 0
For d = 1 To 20
If i > d Then
dip1 = dip1 + (d * p22 - (i - d) * h - (i - d) * o) * Cells(4 + d, 8).Value
Else
dip2 = dip2 + i * p22 * Cells(4 + d, 8).Value
End If
Cells(i + 3, 12).Value = dip1 + dip2
Next d
Next i
'
'*********************period 5*****************************
'**********************************************************
For i = 0 To m * d_max
For k = 0 To m * d_max
dip1 = 0
dip2 = 0
dip3 = 0
For d = 1 To 20
If d <= (i + k) Then
If i > d Then
dip1 = dip1 + (d * p21 - (i + k - d) * h - (i - d) * o) * Cells(4 + d, 7).Value
Else
dip2 = dip2 + (d * p21 - (i + k - d) * h) * Cells(4 + d, 7).Value
End If
Else
dip3 = dip3 + (i + k) * p21 * Cells(4 + d, 7).Value
End If
Cells(2, 16 + k).Value = k
Cells(2, 16 + k).Interior.Color = RGB(150, 0, 0)
Cells(3 + i, 15).Value = i
Cells(3 + i, 15).Interior.Color = RGB(150, 0, 0)
Cells(i + 3, 16 + k).Value = dip1 + dip2 + dip3 '**************************
Next d
Next k
Next i
For i = 0 To m * d_max
For k = 0 To m * d_max
dip1 = 0
dip2 = 0
dip3 = 0
For d = 1 To 20
If d <= (i + k) Then
If i > d Then
dip1 = dip1 + (d * p22 - (i + k - d) * h - (i - d) * o) * Cells(4 + d, 8).Value
Else
dip2 = dip2 + (d * p22 - (i + k - d) * h) * Cells(4 + d, 8).Value
End If
84
Else
dip3 = dip3 + (i + k) * p22 * Cells(4 + d, 8).Value
End If
Cells(89, 16 + k).Value = k
Cells(89, 16 + k).Interior.Color = RGB(150, 0, 0)
Cells(90 + i, 15).Value = i
Cells(90 + i, 15).Interior.Color = RGB(150, 0, 0)
Cells(i + 90, 16 + k).Value = dip1 + dip2 + dip3
'**********************************
Next d
Next k
Next i
'''
''''
'
For i = 0 To m * d_max
For k = 0 To m * d_max
If Cells(i + 3, 16 + k).Value >= Cells(i + 90, 16 + k).Value Then
Cells(i + 180, 16 + k).Value = Cells(i + 3, 16 + k).Value
Cells(i + 180, 16 + k).Interior.Color = RGB(0, 150, 0)
Else
Cells(i + 180, 16 + k).Value = Cells(i + 90, 16 + k).Value
End If
Cells(179, 16 + k).Value = k
Cells(179, 16 + k).Interior.Color = RGB(150, 0, 0)
Cells(180 + i, 15).Value = i
Cells(180 + i, 15).Interior.Color = RGB(150, 0, 0)
Next k
Next i
Max = 0
For i = 0 To m * d_max
For k = 0 To m * d_max
r1 = 0
r2 = 0
r21 = 0
r22 = 0
r23 = 0
r24 = 0
r25 = 0
r26 = 0
r27 = 0
r28 = 0
r29 = 0
f6 = 0
For d = 1 To 20
If (i + k) > c Then
If d <= i Then
i1 = k
r21 = r21 + Cells(i1 + 3, 12).Value * Cells(d + 4, 8).Value
Else
If d <= i + k Then
i2 = k + i - d
r22 = r22 + Cells(i2 + 3, 12).Value * Cells(d + 4, 8).Value
Else
r23 = r23 + Cells(3, 12).Value * Cells(d + 4, 8).Value
End If
End If
Else
If d <= i Then
i1 = k
85
Next k
Next i
''''' '****************************************preiod
4*******************************************
''''''
'*******************************************************************************
************
For x = 0 To m * d_max
r11 = 0
r12 = 0
For d = 1 To 20
If d <= x Then
r11 = r11 + (d * p1 - (x - d) * h) * Cells(d + 29, 7)
Else
r12 = r12 + x * p1 * Cells(d + 29, 7)
End If
Next d
Cells(360, 16 + x).Value = r11 + r12
Cells(359, 16 + x).Value = x
Cells(359, 16 + x).Interior.Color = RGB(150, 0, 0)
Next x
For x = 0 To m * d_max
r11 = 0
r12 = 0
For d = 1 To 20
86
If d <= x Then
r11 = r11 + (d * p1 - (x - d) * h) * Cells(d + 29, 8)
Else
r12 = r12 + x * p1 * Cells(d + 29, 8)
End If
Next d
Cells(365, 16 + x).Value = r11 + r12
Cells(364, 16 + x).Value = x
Cells(364, 16 + x).Interior.Color = RGB(150, 0, 0)
Next x
'
For i = 0 To m * d_max
For k = 0 To m * d_max
dip1 = 0
dip2 = 0
dip3 = 0
dip4 = 0
dip5 = 0
dip6 = 0
dip7 = 0
dip8 = 0
dip9 = 0
dip10 = 0
dip11 = 0
dip12 = 0
r21 = 0
r22 = 0
For d = 1 To 20
If d <= i Then
If (i + k) > c Then
dip1 = dip1 + (d * p22 - (i - d) * h - (i - d) * o) * Cells(4 + d, 8).Value
dip2 = dip2 - k * h * Cells(4 + d, 8).Value
Else
dip3 = dip3 + (d * p21 - (i - d) * h - (i - d) * o) * Cells(4 + d, 7).Value
dip4 = dip4 - k * h * Cells(4 + d, 7).Value
End If
Else
If d < (i + k) Then
If (i + k) > c Then
dip5 = dip5 + i * p22 * Cells(4 + d, 8).Value
dip6 = dip6 + ((d - i) * p22 - (k + i - d) * h) * Cells(4 + d, 8).Value
Else
dip7 = dip7 + i * p21 * Cells(4 + d, 7).Value
dip8 = dip8 + ((d - i) * p21 - (k + i - d) * h) * Cells(4 + d, 7).Value
End If
Else
If (i + k) > c Then
dip9 = dip9 + i * p22 * Cells(4 + d, 8).Value
dip10 = dip10 + k * p22 * Cells(4 + d, 8).Value
87
Else
dip11 = dip11 + i * p21 * Cells(4 + d, 7).Value
dip12 = dip12 + k * p21 * Cells(4 + d, 7).Value
End If
End If
End If
Next d
f31 = 0
f32 = 0
f33 = 0
f34 = 0
f35 = 0
f36 = 0
f37 = 0
f38 = 0
f39 = 0
f40 = 0
f41 = 0
f42 = 0
f4 = 0
For d = 1 To 20
If (i + k) > c Then
If d <= i Then
i1 = k
If d <= x Then
k1 = x - d
i1 = i + k - d
If d <= x Then
k1 = x - d
Else
k1 = 0
z4 = Cells(i1 + 270, 16 + k1).Value
d4 = Cells(i1 + 370, 16 + k1).Value
f40 = f40 + (z4 - d4) * Cells(29 + d, 7).Value + d4 * Cells(4 + d,
7).Value
End If
Else
i1 = 0
If d <= x Then
k1 = x - d
For i = 0 To 0
For k = 0 To m * d_max
90
For x = 0 To m * d_max
For y = 0 To m * d_max
r11 = 0
r12 = 0
For d = 1 To 20
If d <= (x + y) Then
r11 = r11 + (d * p1 - (x + y - d) * h) * Cells(d + 29, 7)
Else
r12 = r12 + (x + y) * p1 * Cells(d + 29, 7)
End If
Next d
Cells(650 + x, 16 + y).Value = r11 + r12
Cells(649, 16 + y).Value = y
Cells(649, 16 + y).Interior.Color = RGB(150, 0, 0)
Cells(650 + x, 15).Value = x
Cells(650 + x, 15).Interior.Color = RGB(150, 0, 0)
Next y
Next x
For x = 0 To m * d_max
For y = 0 To m * d_max
r11 = 0
r12 = 0
For d = 1 To 20
If d <= (x + y) Then
r11 = r11 + (d * p1 - (x + y - d) * h) * Cells(d + 29, 8)
Else
r12 = r12 + (x + y) * p1 * Cells(d + 29, 8)
End If
Next d
Cells(740 + x, 16 + y).Value = r11 + r12
Cells(739, 16 + y).Value = y
Cells(739, 16 + y).Interior.Color = RGB(150, 0, 0)
Cells(740 + x, 15).Value = x
Cells(740 + x, 15).Interior.Color = RGB(150, 0, 0)
Next y
Next x
Max = 0
For y = 0 To m * d_max
For x = 0 To m * d_max
For k = 0 To m * d_max
f31 = 0
f32 = 0
f33 = 0
f34 = 0
f35 = 0
f36 = 0
f37 = 0
f38 = 0
f39 = 0
f40 = 0
91
f41 = 0
f42 = 0
f3 = 0
For d = 1 To 20
If k > c Then
If d <= k Then
i1 = k - d
If d <= x Then
k1 = x - d
x1 = y
z3 = Cells(550 + x1, 16 + i1 + (m * d_max + 1) * k1).Value
d3 = Cells(i1 + 370, 16 + k1).Value
f31 = f31 + (z3 - d3) * Cells(29 + d, 8).Value + d3 * Cells(4 + d, 8).Value
Else
If d <= (x + y) Then
k1 = 0
x1 = y + x - d
z3 = Cells(550 + x1, 16 + i1 + (m * d_max + 1) * k1).Value
d3 = Cells(i1 + 370, 16 + k1).Value
f32 = f32 + (z3 - d3) * Cells(29 + d, 8).Value + d3 * Cells(4 + d, 8).Value
Else
k1 = 0
x1 = 0
z3 = Cells(550 + x1, 16 + i1 + (m * d_max + 1) * k1).Value
d3 = Cells(i1 + 370, 16 + k1).Value
f33 = f33 + (z3 - d3) * Cells(29 + d, 8).Value + d3 * Cells(4 + d, 8).Value
End If
End If
Else
i1 = 0
If d <= x Then
k1 = x - d
x1 = y
z3 = Cells(550 + x1, 16 + i1 + (m * d_max + 1) * k1).Value
d3 = Cells(i1 + 370, 16 + k1).Value
f34 = f34 + (z3 - d3) * Cells(29 + d, 8).Value + d3 * Cells(4 + d, 8).Value
Else
If d <= (x + y) Then
k1 = 0
x1 = y + x - d
z3 = Cells(550 + x1, 16 + i1 + (m * d_max + 1) * k1).Value
d3 = Cells(i1 + 370, 16 + k1).Value
f35 = f35 + (z3 - d3) * Cells(29 + d, 8).Value + d3 * Cells(4 + d, 8).Value
Else
k1 = 0
x1 = 0
z3 = Cells(550 + x1, 16 + i1 + (m * d_max + 1) * k1).Value
d3 = Cells(i1 + 370, 16 + k1).Value
f36 = f36 + (z3 - d3) * Cells(29 + d, 8).Value + d3 * Cells(4 + d, 8).Value
End If
End If
End If
Else
If d <= k Then
i1 = k - d
If d <= x Then
k1 = x - d
x1 = y
z3 = Cells(550 + x1, 16 + i1 + (m * d_max + 1) * k1).Value
d3 = Cells(i1 + 370, 16 + k1).Value
92
Next d
If (i + k) > c Then
If y > 0 Then
f3 = Cells(740 + x, 16 + y).Value + Cells(640, 16 + k).Value _
+ f31 + f32 + f33 + f34 + f35 + f36 + f37 + f38 + f39 + f40 + f41 + f42 - y * u_c - s
Else
f3 = Cells(740 + x, 16 + y).Value + Cells(640, 16 + k).Value _
+ f61 + f62 + f63 + f64 + f65 + f66 + f67 + f68 + f69 + f70 + f71 + f72
End If
Else
If y > 0 Then
f3 = Cells(650 + x, 16 + y).Value + Cells(640, 16 + k).Value _
+ f31 + f32 + f33 + f34 + f35 + f36 + f37 + f38 + f39 + f40 + f41 + f42 - y * u_c - s
Else
93
End If
End If
Max = 0
For y2 = 0 To m * d_max
For y = 0 To m * d_max
For x = 0 To m * d_max
f21 = 0
94
f22 = 0
f23 = 0
f2 = 0
For d = 1 To 20
If d <= x Then
k1 = x - d
x1 = y2
y1 = y
z2 = Cells(830 + k1, 16 + x1 + (m * d_max + 1) * y1).Value
f21 = f21 + z2 * Cells(4 + d, 6).Value
Else
If d <= (y2 + x) Then
k1 = 0
x1 = y2 + x - d
y1 = y
z2 = Cells(830 + k1, 16 + x1 + (m * d_max + 1) * y1).Value
f22 = f22 + z2 * Cells(4 + d, 6).Value
Else
k1 = 0
x1 = 0
y1 = y
z2 = Cells(830 + k1, 16 + x1 + (m * d_max + 1) * y1).Value
f23 = f23 + z2 * Cells(4 + d, 6).Value
End If
End If
Next d
If y2 > 0 Then
f2 = f21 + f22 + f23 + Cells(920 + x, 16 + y2).Value - y2 * u_c - s
Else
f2 = f21 + f22 + f23 + Cells(920 + x, 16 + y2).Value
End If
Cells(1010 + y2, 16 + x + (m * d_max + 1) * y).Value = f2
Cells(1009, 16 + x + (m * d_max + 1) * y).Value = y & "," & x
Cells(1009, 16 + x + (m * d_max + 1) * y).Interior.Color = RGB(150, 0, 0)
Cells(y2 + 1010, 15).Value = y2
Cells(1010 + y2, 15).Interior.Color = RGB(150, 0, 0)
If Max <= f2 Then
Max = f2
Cells(1015, 10).Value = Max
Cells(1015, 11).Value = y2
Cells(1015, 12).Value = y
Cells(1015, 13).Value = x
Else
Max = Max
End If
Next x
Next y
Next y2
'
'
''****************************************preiod
1*******************************************
''
'*******************************************************************************
************
cat = Cells(1, 3).Value
95
Max = 0
For y3 = 0 To m * d_max
For y2 = 0 To m * d_max
For y = 0 To m * d_max
f11 = 0
f12 = 0
f2 = 0
For d = 1 To 20
If d <= y3 Then
x1 = y3 - d
y21 = y2
y1 = y
z1 = Cells(1010 + y21, 16 + x1 + (m * d_max + 1) * y1).Value
f11 = f11 + z1 * Cells(4 + d, 6).Value
Else
x1 = 0
y21 = y2
y1 = y
z1 = Cells(1010 + y21, 16 + x1 + (m * d_max + 1) * y1).Value
f12 = f12 + z1 * Cells(4 + d, 6).Value
End If
Next d
If y3 > 0 Then
f1 = f11 + f12 + Cells(920, 16 + y3).Value - y3 * u_c - s
Else
f1 = f11 + f12 + Cells(920, 16 + y3).Value
End If
Cells(1100 + y3, 16 + y + (m * d_max + 1) * y2).Value = f1
Cells(1099, 16 + y + (m * d_max + 1) * y2).Value = y2 & "," & y
Cells(1099, 16 + y + (m * d_max + 1) * y2).Interior.Color = RGB(150, 0, 0)
Cells(y3 + 1100, 15).Value = y3
Cells(1100 + y, 15).Interior.Color = RGB(150, 0, 0)
If Max <= f1 Then
Max = f1
Cells(1105, 10).Value = Max
Cells(1105, 11).Value = y3
Cells(1105, 12).Value = y2
Cells(1105, 13).Value = y
Else
Max = Max
End If
Next y
Next y2
Next y3
End Sub