Ask Your Question
0

How can the relationship between EOQ and quantity discounts be graphically represented using Python?

asked 2023-05-28 09:53:58 +0000

huitzilopochtli gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-05-28 10:21:02 +0000

qstack gravatar image

The relationship between EOQ and quantity discounts can be graphically represented using Python by creating a plot of the total inventory cost as a function of the order quantity, for different discount levels. The plot will have a U-shaped curve, where the minimum point represents the EOQ. As the discount level increases, the curve will shift down, because the cost per unit decreases.

Here's a Python code snippet that creates such a plot:

import numpy as np
import matplotlib.pyplot as plt

# Define parameters
demand = 600
ordering_cost = 30
holding_cost = 0.5
prices = [100, 95, 90, 85, 80]
quantities = [0, 200, 400, 600, 800, 1000]

# Compute total cost for each order quantity and discount level
def total_cost(quantity, price):
    q = quantity
    tc = (ordering_cost * demand / q) + (holding_cost * q / 2) + (demand * price)
    return tc

costs = np.zeros((len(prices), len(quantities)))
for i in range(len(prices)):
    for j in range(len(quantities)):
        costs[i,j] = total_cost(quantities[j], prices[i])

# Plot total cost as a function of order quantity, for each discount level
plt.figure(figsize=(8,6))
for i in range(len(prices)):
    plt.plot(quantities, costs[i,:], label='Price = {}'.format(prices[i]))
plt.xlabel('Order quantity')
plt.ylabel('Total inventory cost')
plt.legend()
plt.show()

The resulting plot should look like this:

EOQ and quantity discounts plot

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-28 09:53:58 +0000

Seen: 10 times

Last updated: May 28 '23