The classical economic order quantity model
DefinitionInventoryControl_eoqThe model underlying the classical economic order quantity (EOQ) formula, in the notation of Axsäter, Inventory Control, Sect. 4.1.
A single item faces constant, continuous demand at rate units per time unit. Stock is replenished in batches of a fixed size ; each order costs a fixed ordering (setup) cost regardless of its size, and carrying one unit for one time unit costs the holding cost . Shortages are not allowed, the whole batch arrives at once, and need not be an integer. Because a batch is delivered exactly when the previous one runs out, the stock level is a sawtooth between and , so the average stock on hand is and orders are placed at the average rate . The cost per time unit is therefore
which is eoqCost A d h Q. The economic order quantity
is eoq A d h.
The second pair of definitions is the finite production rate variant of Sect. 4.2. There the batch is not delivered all at once but produced continuously at rate , so stock builds at rate for a time and then drains at rate . The peak stock is and the average stock , giving
which are eoqCostFinite A d h p Q and eoqFinite A d h p. Letting recovers
the classical model.
These four definitions are the shared vocabulary of the whole Inventory Control series: the
cost-ratio identity built on eoqCost reappears in the analysis of powers-of-two policies and
in Roundy's approximation for multi-echelon systems.
Formalization Note All four are plain real-valued functions of real parameters, with no
positivity built in; each theorem states the hypotheses (, and where
relevant) it needs. Division in Lean is total, so eoqCost A d h 0 evaluates to 0 rather
than being undefined — every statement below quantifies over explicitly.
import Mathlib namespace InventoryControl /-- Cost per time unit of ordering in batches of size `Q`, for a single item facing constant continuous demand `d`, with ordering cost `A` and holding cost `h` per unit and time unit. Axsäter, *Inventory Control*, Eq. (4.1): the average stock `Q / 2` times `h`, plus the average number of orders per time unit `d / Q` times `A`. -/ noncomputable def eoqCost (A d h Q : ℝ) : ℝ := Q / 2 * h + d / Q * A /-- The economic order quantity `√(2Ad/h)`. Axsäter, *Inventory Control*, Eq. (4.3). -/ noncomputable def eoq (A d h : ℝ) : ℝ := Real.sqrt (2 * A * d / h) /-- Cost per time unit when the batch is produced continuously at the finite rate `p > d` instead of being delivered all at once: the average stock is `Q * (1 - d / p) / 2`. Axsäter, *Inventory Control*, Eq. (4.6). -/ noncomputable def eoqCostFinite (A d h p Q : ℝ) : ℝ := Q * (1 - d / p) / 2 * h + d / Q * A /-- The optimal batch quantity under a finite production rate `p > d`, `√(2Ad / (h(1 - d/p)))`. Axsäter, *Inventory Control*, Eq. (4.7). -/ noncomputable def eoqFinite (A d h p : ℝ) : ℝ := Real.sqrt (2 * A * d / (h * (1 - d / p))) end InventoryControl