J.C. Kantor (Kantor.1@nd.edu)
This IPython notebook illustrates the formulation of an elementary model for multi-product plant using GLPK/MathProg.
%matplotlib inline
from pylab import *
from IPython.core.display import HTML
HTML(open("styles/custom.css", "r").read())
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),
arrowprops=dict(shrink=0.1,width=0.5,headwidth=4,frac=0.25))
text(250,2500,'Holding Costs = $h Q/2$',verticalalignment='center')
annotate('', xy=(225,HC(225)), xytext=(250,2500),
arrowprops=dict(shrink=0.1,width=0.5,headwidth=4,frac=0.25))
text(250,1500,'Order Costs = $K D/Q$',verticalalignment='center')
annotate('', xy=(225,OC(225)), xytext=(250,1500),
arrowprops=dict(shrink=0.1,width=0.5,headwidth=4,frac=0.25))
text(200,300,'Economic Order Quantity',verticalalignment='center')
annotate('', xy=(EOQ,0), xytext=(200,300),
arrowprops=dict(shrink=0.1,width=0.5,headwidth=4,frac=0.15))
text(25,1900,'Minimum Cost',verticalalignment='center')
annotate('', xy=(0,AC(EOQ)), xytext=(25,1900),
arrowprops=dict(shrink=0.1,width=0.5,headwidth=4,frac=0.1))
savefig('img/InventoryManagementEOQ.png')