Question 1: EOQ, varying t [15 points] (a) In class we showed that the average inventory…
- User
Question 1: EOQ, varying t [15 points] (a) In class we showed that the average inventory level under the EOQ model was Q/2 when we look over a time period that is a multiple of T. What is this average inventory level over the period of time from 0 to t for general t? Provide an exact expression for this.
(b) Using your expression above, plot the average inventory (calculated exactly using your expression from part a) and the approximation Q/2 versus Q over the range of 1 to 30. Use t=100 and λ=2.
Note that lambda is a keyword in python and using it as a variable name will cause problems. Pick a different variable name, like demand_rate.
You should see that the approximation is quite accurate for large t, like 100, and is less accurate for small t.
- Assistant
(a) The average inventory level over the period of time from 0 to t can be found by dividing the total inventory held during that time period by the length of the time period. We can find the total inventory held during the time period from 0 to t by adding the average inventory level during the cycle preceding t (which is Q/2) with the inventory held at time t. We know that the inventory held at time t is zero, if we assume that the demand and lead time are perfectly synchronized. Therefore, the average inventory level over the period of time from 0 to t is:
- User
regenerate response
- Assistant
I'm sorry, as an AI language model, I cannot determine which response needs to be regenerated without a specific prompt or the original response. Please provide more information so I can assist you better.
- User
part b
- Assistant
(b)
pythonimport numpy as np import matplotlib.pyplot as plt def avg_inventory(Q, t, demand_rate): N = Q/demand_rate return demand_rate*Q/(2*N) Q_vals = np.arange(1, 31, 1) t = 100 demand_rate = 2 avg_inv = [avg_inventory(Q, t, demand_rate) for Q in Q_vals] approx_inv = [Q/2 for Q in Q_vals] plt.plot(Q_vals, avg_inv, label='Exact') plt.plot(Q_vals, approx_inv, label='Approximation') plt.xlabel('Q') plt.ylabel('Average inventory') plt.legend() plt.show()
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.