Title: | Functions for Planning and Managing Inventories in a Supply Chain |
---|---|
Description: | Implements different inventory models, the bullwhip effect and other supply chain performance variables. Marchena Marlene (2010) <arXiv:1009.3977>. |
Authors: | Marlene Marchena |
Maintainer: | Marlene Marchena <[email protected]> |
License: | GPL-3 |
Version: | 1.1.1 |
Built: | 2025-02-19 05:14:06 UTC |
Source: | https://github.com/msmarchena/scperf |
This function finds the optimal order policy in the classical Economic Order Quantity (EOQ) model and the EOQ model with planned shortages.
EOQ(d, k, h, b = 0)
EOQ(d, k, h, b = 0)
d |
Demand per unit time. |
k |
Ordering or fixed cost per order. |
h |
Holding cost per unit of product. |
b |
Shortage penalty cost per unit (default:0) |
The EOQ model, also called Lot-Sizing model, considers that demand is uniform and deterministic. Lead time, the time between the placement of an order and its receipt, is equal to zero.
The optimal order policy in the classical EOQ model minimizes the total cost associated with the ordering
and holding costs while meeting all demand (without shortage). When shortages are allowed ()
we have the EOQ model with backorders or planned shortages.
A list containing:
T |
Time between orders (cycle length) |
S |
Maximum backorders in units. Displayed when b > 0 |
TVC |
Total variable cost. |
- Hillier, F. and Lieberman, G. (2001). Introduction to operational research. New York: McGraw-Hill, 7th.
EPQ, newsboy, WW
## Not run: #Classical EOQ model #Given demand d=8000 items per year; set up cost k=12000; and holding cost h=0.3 #per unit we find that the optimal solution is to order 25298 units every 3.2 #months with a total variable cost of $7589.5 ## End(Not run) EOQ(8000,12000,0.3) ## Not run: #EOQ model with planned shortages #Consider now that backorders are allowed with a backorder cost b=1.1 per #unit and year. Then the optimal solution is to order 28540 units every 3.6 months. #The total variable cost is $6727.3 and the maximum shortage is 6116 units. ## End(Not run) EOQ(8000,12000,0.3,1.1)
## Not run: #Classical EOQ model #Given demand d=8000 items per year; set up cost k=12000; and holding cost h=0.3 #per unit we find that the optimal solution is to order 25298 units every 3.2 #months with a total variable cost of $7589.5 ## End(Not run) EOQ(8000,12000,0.3) ## Not run: #EOQ model with planned shortages #Consider now that backorders are allowed with a backorder cost b=1.1 per #unit and year. Then the optimal solution is to order 28540 units every 3.6 months. #The total variable cost is $6727.3 and the maximum shortage is 6116 units. ## End(Not run) EOQ(8000,12000,0.3,1.1)
Implements the Economic Production Quantity (EPQ) model.
EPQ(d, p, k, h, b = 0)
EPQ(d, p, k, h, b = 0)
d |
Deterministic demant per time unit |
p |
Production rate |
k |
Ordering or fixed cost per order. |
h |
Holding cost per unit of product. |
b |
Shortage penalty cost per unit (default:0). |
The EPQ model is an extension of the EOQ
model. It considers
finite production rate, that is, the inventory is replenished
gradually as the order is produced. Note that this assumption
requires the production rate to be greater than the demand rate (p>d)
otherwise there would be no inventory at any time.
The model considers that a new order is produced incrementally when the
inventory reaches zero. During the time that production run,
, inventory is accumulated at rate
, which
implies that when the production of the batch Q is finished the
inventory will reach its maximum level I.
EPQ()
returns a list containing:
Q |
Order quantity |
t |
Time required to produce the batch quantity |
T |
Time between orders (cycle length or time) |
I |
Maximum inventory level |
TC |
Total cost |
- Gallego, G. "IEOR4000: Production Management" (Lecture 2), Columbia (2004).
EOQ, newsboy, WW
## Not run: #Suppose k = 100, h = 5, d = 200, p = 1000. Then the production run at #t=0.1, the optimal order interval is T = 0.5, the optimal order quantity #is Q = 100, the maximum inventory level is I=80 and the total cost is #TC = $400. ## End(Not run) EPQ(d=200,p=1000,k=100,h=5)
## Not run: #Suppose k = 100, h = 5, d = 200, p = 1000. Then the production run at #t=0.1, the optimal order interval is T = 0.5, the optimal order quantity #is Q = 100, the maximum inventory level is I=80 and the total cost is #TC = $400. ## End(Not run) EPQ(d=200,p=1000,k=100,h=5)
Implements the newsboy (or newsvendor) model with normal demand.
Newsboy(m, sd, p, c, s = 0)
Newsboy(m, sd, p, c, s = 0)
m |
Mean demand during the period |
sd |
Standard deviation of demand during the period |
p |
The selling price, where p > c |
c |
Uhe unit cost |
s |
The salvage value (default:0), where s < c |
When the demand is a random variable with normal distribution,
the optimal stocking quantity that minimize the expected cost is:
, where z is known as the safety factor and
is known as the safety stock.
'Note that the newsboy problem is not formulated in terms of per unit holding cost
and penalty cost
.
A list containing:
Q |
Optimal order-up-to quantity |
SS |
Safety stock |
ExpC |
Expected cost |
ExpP |
Expected profit |
CV |
Coefficient of variation of the demand |
FR |
Fill rate, the fraction of demand served from stock |
z |
Safety factor |
- Porteus E. L. (2002) Foundations of Stochastic Inventory Theory, Stanford University Press, Stanford, CA.
- Gallego G. (1995) Newsvendor Problem. IEOR 4000 Production Management.
- Ayhan, Hayriye, Dai, Jim, Foley, R. D., Wu, Joe, (2004): Newsvendor Notes, ISyE 3232 Stochastic Manufacturing & Service Systems.
EOQ, EPQ, WW, SS
## Not run: # Example Porteus # # Suppose demand is normally distributed with mean 100 and standard # deviation 30. If p = 4 and c = 1, then CR = 0.75 and Q=120.23. # Note that the order is for 20.23 units (safety stock) more than the # mean. Note also that ExpC(120.23) = 38.13 and ExpP(120.23)=261.87, # with FR=0.96. ## End(Not run) Newsboy(100,30,4,1) ## Not run: # Example Gallego # # Suppose demand is normal with mean 100 and standard deviation 20. The # unit cost is 5, the holding and penalty cost are 1 and 3 # respectively. From the definition of the holding and penalty # cost we find that p=4, then CR = 0.75 and Q = 113.49. Notice that the # order is for 13.49 units (safety stock) more than the mean, # ExpC(113.49) = 25.42 and ExpP(113.49) = 274.58, with fill rate of # 97 percent. ## End(Not run) Newsboy(100,20,4,1)
## Not run: # Example Porteus # # Suppose demand is normally distributed with mean 100 and standard # deviation 30. If p = 4 and c = 1, then CR = 0.75 and Q=120.23. # Note that the order is for 20.23 units (safety stock) more than the # mean. Note also that ExpC(120.23) = 38.13 and ExpP(120.23)=261.87, # with FR=0.96. ## End(Not run) Newsboy(100,30,4,1) ## Not run: # Example Gallego # # Suppose demand is normal with mean 100 and standard deviation 20. The # unit cost is 5, the holding and penalty cost are 1 and 3 # respectively. From the definition of the holding and penalty # cost we find that p=4, then CR = 0.75 and Q = 113.49. Notice that the # order is for 13.49 units (safety stock) more than the mean, # ExpC(113.49) = 25.42 and ExpP(113.49) = 274.58, with fill rate of # 97 percent. ## End(Not run) Newsboy(100,20,4,1)
ROP
computes the reorder point level of inventory. When inventory falls to this amount, a new order must be made.
ROP(SL, md, sd, L = 1)
ROP(SL, md, sd, L = 1)
SL |
Service level, a value between 0 and 1 |
md |
Mean demand |
sd |
Standart deviation of the demand |
L |
A positive lead-time |
Reorder point level
ROP(0.9,2500,500,6)
ROP(0.9,2500,500,6)
SS
computes the safety stock level over lead-time
SS(SL, sd, L = 1)
SS(SL, sd, L = 1)
SL |
Service level, a value between 0 and 1 |
sd |
Standart deviation of the demand |
L |
A positive lead-time |
Safety stock level over lead-time
SS(0.95,0.7,2)
SS(0.95,0.7,2)
WW
implements the Wagner-Whitin algorithm. Considering time-varying demand, the algorithm builds production
plans that minimizes the total setup and holding costs in a finite horizon of time, assuming zero starting inventory
and no backlogging
WW(x, a, h, method = c("backward", "forward"))
WW(x, a, h, method = c("backward", "forward"))
x |
A numeric vector containing the demand per unit time |
a |
A numeric number for the set-up cost per unit and period |
h |
A numeric number for the holding cost per unit and period |
method |
Character string specifing which algorithm to use: "backward" (default) or "forward" |
EOQ, EPQ, newsboy
## Not run: # Example from Hiller, p.952, reproduced bellow: # An airplane manufacturer specializes in producing small airplanes. It has just received # an order from a major corporation for 10 customized executive jet airplanes for the use of # the corporation's upper management. The order calls for three of the airplanes to be delivered # (and paid for) during the upcoming winter months (period 1), two more to be delivered during # the spring (period 2), three more during the summer (period 3), and the final two during the fall # (period 4). Setting up the production facilities to meet the corporation's specifications for # these airplanes requires a setup cost of $2 million. # The manufacturer has the capacity to produce all 10 airplanes within a couple of months, when the # winter season will be under way. However, this would necessitate holding seven of the airplanes in # inventory, at a cost of $200,000 per airplane per period, until their scheduled delivery times # (...) Management would like to determine theleast costly production schedule for filling # this order. ## End(Not run) x <- c(3,2,3,2) a <- 2 h <- 0.2 WW(x,a,h,method="backward") ## Not run: # The total variable cost is $4.8 million (minimum value in the first raw). Since we have two # minimun values in the first raw (positions 2 and 4), we have the following solutions: # Solution 1: Produce to cover demand until period 2, 5 airplanes. In period 3, new decision, # minimun value 2.4 in period 4 (third raw). Then in period 3 produce to cover demand until # period 4, 5 airplanes. # Solution 2: Produce to cover demand until period 4, 10 airplanes. ## End(Not run) WW(x,a,h,method="forward") ## Not run: #The total variable cost is $4.8 million (minimum value in the last raw). Since we have two minimun # values in columns 1 and 3, the solutions are: # Solution 1: Produce in period 1 to cover demand until period 4, 10 airplanes. # Solution 2: Produce in period 3 to cover demand until period 4, 5 airplanes.In period 2, new # decision, minimun value 2.4 in raw 3. Then in period 1 produce to cover demand until # period 2, 5 airplanes. ## End(Not run)
## Not run: # Example from Hiller, p.952, reproduced bellow: # An airplane manufacturer specializes in producing small airplanes. It has just received # an order from a major corporation for 10 customized executive jet airplanes for the use of # the corporation's upper management. The order calls for three of the airplanes to be delivered # (and paid for) during the upcoming winter months (period 1), two more to be delivered during # the spring (period 2), three more during the summer (period 3), and the final two during the fall # (period 4). Setting up the production facilities to meet the corporation's specifications for # these airplanes requires a setup cost of $2 million. # The manufacturer has the capacity to produce all 10 airplanes within a couple of months, when the # winter season will be under way. However, this would necessitate holding seven of the airplanes in # inventory, at a cost of $200,000 per airplane per period, until their scheduled delivery times # (...) Management would like to determine theleast costly production schedule for filling # this order. ## End(Not run) x <- c(3,2,3,2) a <- 2 h <- 0.2 WW(x,a,h,method="backward") ## Not run: # The total variable cost is $4.8 million (minimum value in the first raw). Since we have two # minimun values in the first raw (positions 2 and 4), we have the following solutions: # Solution 1: Produce to cover demand until period 2, 5 airplanes. In period 3, new decision, # minimun value 2.4 in period 4 (third raw). Then in period 3 produce to cover demand until # period 4, 5 airplanes. # Solution 2: Produce to cover demand until period 4, 10 airplanes. ## End(Not run) WW(x,a,h,method="forward") ## Not run: #The total variable cost is $4.8 million (minimum value in the last raw). Since we have two minimun # values in columns 1 and 3, the solutions are: # Solution 1: Produce in period 1 to cover demand until period 4, 10 airplanes. # Solution 2: Produce in period 3 to cover demand until period 4, 5 airplanes.In period 2, new # decision, minimun value 2.4 in raw 3. Then in period 1 produce to cover demand until # period 2, 5 airplanes. ## End(Not run)