###### The latest version of this IPython notebook is available at http://github.com/jckantor/ESTM60203 for noncommercial use under terms of the Creative Commons Attribution Noncommericial ShareAlike License (CC BY-NC-SA 4.0).¶

J.C. Kantor ([email protected])

# Inventory Management¶

This IPython notebook illustrates the formulation of an elementary model for multi-product plant using GLPK/MathProg.

### Initializations¶

In [1]:
%matplotlib inline
from pylab import *

from IPython.core.display import HTML

Out[1]:

## Economic Order Quantity (EOQ)¶

In [83]:
K = 200.00      # Cost to place an order
D = 1200.       # Annual Demand
h = 25.00       # Cost of holding an item for one year

HC = lambda Q: Q*h/2.0
OC = lambda Q: K*D/Q
AC = lambda Q: OC(Q) + HC(Q)

EOQ = sqrt(2.0*D*K/h)

Q = linspace(50,400)
plot(Q,AC(Q),lw=2)
xlim(0,400)
ylim(0,ylim()[1])

hold(True)
plot(Q,HC(Q),'r',lw = 2)
plot(Q,OC(Q),'g',lw = 2)
plot([EOQ,EOQ,0],[0,AC(EOQ),AC(EOQ)],'k--')
hold(False)

xlabel('Q: Order Quantity')
ylabel('Annual Cost')
title('Variable Costs of Maintaining Inventory')

text(240,4600,'Total Inventory Costs',horizontalalignment='right')
annotate('', xy=(275,AC(275)), xytext=(240,4600),

text(250,2500,'Holding Costs = $h Q/2$',verticalalignment='center')
annotate('', xy=(225,HC(225)), xytext=(250,2500),

text(250,1500,'Order Costs = $K D/Q$',verticalalignment='center')
annotate('', xy=(225,OC(225)), xytext=(250,1500),