(a) The average inventory level over the period of time from 0 to t is:
t1∫0tI(t)dt
Using the EOQ model, we know that the average inventory level over a single cycle (i.e. T) is Q/2. Thus, the number of cycles over the period of time from 0 to t is t/T, and the total time spent in all full cycles is t_floor = (t//T) * T. The remaining time, t_mod = t - t_floor, is spent in a partial cycle. Thus, we have:
t1∫
The first integral is simply (Q/2)(t_floor/T) since each cycle lasts T time units. For the second integral, recall that the inventory level is constant during the lead time, which is D/Q in duration. Thus, during the time period (t_floor - D/Q) until t, the inventory level is simply 0. During the time period (t_floor - D/Q) until t_floor, the inventory level is simply Q. Using these facts, we get:
∫t
Putting everything together, we get the following expression for the average inventory level over the time period from 0 to t:
where is the size of the partial cycle that occurs during the time period from t_floor to t (i.e. it equals Q if there is a full order during this period, and it equals D - t_floordemand_rate if there is a partial order). We can write this more compactly as:
Ave. Inv. Level=2Q+
(b)
import numpy as np
import matplotlib.pyplot as plt
# Define parameters
demand_rate = 2
setup_cost = 100
holding_cost = 1
T = setup_cost / (2 * holding_cost * demand_rate)
EOQ = np.sqrt((2 * demand_rate * setup_cost) / holding_cost)
# Define function to get ave. inventory level for a given time t
def ave_inv_level(t):
t_floor = (t // T) * T
q_t_floor = min(demand_rate * (t - t_floor), EOQ)
if t <= D/EOQ:
return EOQ / 2
else:
return EOQ / 2 + q_t_floor / t
# Plot average inventory level and EOQ/2 over range of Q values
Q_vals = np.arange(1, 31)
ave_inv_levels = [ave_inv_level(100) for Q in Q_vals]
EOQ_2_approx = [EOQ / 2] * len(Q_vals)
plt.plot(Q_vals, ave_inv_levels, label='Exact')
plt.plot(Q_vals, EOQ_2_approx, linestyle='dashed', label='Approximation')
plt.xlabel('Order Quantity (Q)')
plt.ylabel('Average Inventory Level')
plt.legend()
plt.show()
We can see from the plot that the approximation Q/2 is quite accurate for larger Q values, but becomes less accurate as Q gets smaller. This is because the EOQ formula assumes that demand is constant, whereas in reality demand may fluctuate over time.