Economic Order Quantity    Model: QDISCX

The classic EOQ (Economic Order Quantity) inventory model detailed in every introductory operations research text tells us the optimal order quantity of an item given its demand rate, unit holding cost, and fixed order cost. A common situation not handled by the standard EOQ model is quantity discounts. In this model, we extend the EOQ analysis by allowing for quantity discounts.

MODEL:

! Economic order quantity with quantity discounts;

! This model determines the optimal order quantity

 for a product that has quantity discounts;

SETS:

 ! Each order size range has;

 RANGE/1..4/:

  B,   ! An upper breakpoint;

  P,   ! A price/unit over this range;

  H,   ! A holding cost/unit over this range;

  EOQ, ! An EOQ using this ranges H and K;

  Q,   ! An optimal order qty within this range;

  AC;  ! Average cost/year using this range's Q;

ENDSETS

 

DATA:

 D = 40000;  ! The yearly demand;

 K = 90;     ! The fixed cost of an order;

 IRATE = .2; ! Yearly interest rate;

 !The upper break points, B, and price per unit, P:

 Range:   1       2       3       4;

 B =  10000,  20000,  40000,  60000;

 P = .35225, .34525, .34175, .33825;

ENDDATA

 

 ! The model;

 ! Calculate holding cost, H, and EOQ for each

   range;

  @FOR( RANGE:

   H = IRATE * P;

    EOQ = ( 2 * K * D/ H) ^.5;

  );

 

 ! For the first range, the optimal order quantity

   is equal to the EOQ ...;

  Q( 1) = EOQ( 1)

 ! but, if the EOQ is over the first breakpoint,

   lower it;

    - ( EOQ( 1) - B( 1) + 1) *

    ( EOQ( 1) #GE# B( 1));

 

  @FOR( RANGE( J)| J #GT# 1:

 ! Similarly, for the rest of the ranges, Q = EOQ;

   Q( J) = EOQ( J) +

 ! but, if EOQ is below the lower breakpoint,

   raise it up;

    ( B( J-1) - EOQ( J)) *

     ( EOQ( J) #LT# B( J - 1))

 ! or if EOQ is above the upper breakpoint,

   lower it down;

      - ( EOQ( J) - B( J) + 1) *

       ( EOQ( J) #GE# B( J));

  );

 

 ! Calculate average cost per year, AC,

   for each stage;

  @FOR( RANGE: AC = P * D + H * Q/ 2 + K * D/ Q);

 

 ! Find the lowest average cost, ACMIN.;

  ACMIN = @MIN( RANGE: AC);

 

 ! Select the Q that gives the lowest AC per year;

 ! Note: TRUE = 1, FALSE = 0;

  QUSE = @SUM( RANGE: Q * ( AC #EQ# ACMIN));

 

END

Model: QDISCX

An interesting feature to note in this model is the use of logical expressions as in the following:

QUSE = @SUM( RANGE: Q * ( AC #EQ# ACMIN));

In this formula, we have the logical expression:

AC #EQ# ACMIN

Logical expressions will return the value 1 if they evaluate to TRUE or 0 if they evaluate to FALSE. As you know, expressions of this nature are discontinuous and will make it very difficult for the solver to find reliable answers to an optimization model. It turns out in this model, however, that all the variables and formulas are fixed. When a formula is fixed in value, logical expressions contained in the formula do not cause a problem.