From Production and Demand to Inventory
Inventory is a stock: it records how much material is on hand at a particular time. Production adds to that stock, while demand removes from it. A useful model therefore begins by identifying the rates of production and demand, the initial inventory, and the rule for what happens if demand exceeds the available stock.
Let \(I(t)\) denote the amount of inventory on hand at time \(t\). Let \(p(t)\) be the production rate and \(d(t)\) the demand rate. Both rates are nonnegative. If inventory is measured in items and time in hours, then \(p(t)\) and \(d(t)\) are measured in items per hour. The inventory itself cannot be negative: a negative value would describe a backlog or deficit, not physical stock on hand.
This model treats production as available to meet demand as it occurs. When inventory is positive, demand is met from production and stock. When inventory is zero and production is below demand, all production can be used immediately, but the remaining demand is unfilled. If instead unfilled orders are carried forward as a backlog, the state variable and its model are different.
The Balance Before Inventory Runs Out
Over a time interval on which inventory stays positive, conservation of stock gives a direct balance. The change in inventory equals the total amount produced minus the total amount demanded. In integral form, if \(I(s)>0\) throughout the interval from \(s\) to \(t\), then
Here the integrals are cumulative amounts: for example, \(\int_s^t p(u)\,du\) is the total production between times \(s\) and \(t\). If the rates are continuous on the interval, the Fundamental Theorem of Calculus gives the differential balance
This equation applies while there is inventory to remove. If its solution reaches zero, continuing the same equation could produce negative values. That continuation would be a backlog model, not an on-hand inventory model.
The boundary rule has a simple interpretation. At zero inventory, if production exceeds demand, the difference becomes new stock. If production is less than or equal to demand, no on-hand stock accumulates. The excess demand is unfilled. The phrase “almost everywhere” allows the rate equation to hold except possibly at isolated transition times where the left and right rates differ.
Constant Rates and the Depletion Time
Suppose production and demand are constant over an operating period, with rates \(p\) and \(d\), and inventory starts at \(I_0>0\). While stock remains positive, the net rate is \(r=p-d\), so the balance is \(I(t)=I_0+rt\), taking the start of the period as time zero. If \(r<0\), this expression reaches zero after \(I_0/(-r)\) time units. If \(r\geq 0\), inventory does not deplete during that period.
Worked Example: Depletion Under Constant Rates
A store begins with \(48\) units. Production supplies \(12\) units per hour, while demand is \(20\) units per hour. Find the time when on-hand inventory reaches zero.
The net rate while inventory is positive is
For elapsed time \(t\) before stockout, the inventory is
Set this expression equal to zero to find the depletion time:
Thus the on-hand inventory decreases at \(8\) units per hour until it reaches zero at \(t=6\) hours. Checking the balance gives \(I(6)=48-8(6)=0\). The rate has units of units per hour, so dividing \(48\) units by \(8\) units per hour gives hours, as required.
Inventory Across Changing Operating Periods
Production and demand often change at scheduled times. In each period, first use the current inventory and the period’s net rate to determine what happens. If the period’s net rate is negative, compare the time needed to deplete the current stock with the length of that period. If stock reaches zero partway through, set inventory to zero for the remainder of any interval in which demand still exceeds production. Do not carry a negative value into the next period.
Worked Example: A Stockout Followed by Replenishment
A store begins with \(30\) units at \(t=0\). Rates are constant in each period:
- From \(t=0\) to \(t=2\) hours, production is \(25\) units per hour and demand is \(15\) units per hour.
- From \(t=2\) to \(t=9\) hours, production is \(8\) units per hour and demand is \(18\) units per hour.
- From \(t=9\) to \(t=12\) hours, production is \(24\) units per hour and demand is \(14\) units per hour.
In the first period, the net rate is \(25-15=10\) units per hour. The inventory at \(t=2\) is
In the second period, the net rate is \(8-18=-10\) units per hour. Starting with \(50\) units at \(t=2\), the time required to deplete them is \(50/10=5\) hours. Therefore stockout occurs at \(t=2+5=7\) hours. The balance on \(2\leq t\leq 7\) is
From \(t=7\) to \(t=9\), production remains \(10\) units per hour below demand. The on-hand inventory stays at zero; it does not become negative. Over those two hours, \(8\) units per hour are unfilled demand, for a total of \(2(10)=20\) unfilled units.
In the final period, the net rate is \(24-14=10\) units per hour. Starting from zero at \(t=9\), inventory grows as
At \(t=12\), this gives \(I(12)=10(3)=30\) units. The piecewise balance is therefore \(30+10t\) on \(0\leq t\leq2\), \(50-10(t-2)\) on \(2\leq t\leq7\), zero on \(7\leq t\leq9\), and \(10(t-9)\) on \(9\leq t\leq12\). The values agree at each endpoint, which checks that inventory is continuous across the operating changes.
At \(t=7\), the left-hand rate of change is \(-10\) units per hour, whereas the right-hand rate is \(0\). Thus \(I'(7)\) does not exist. The boundary rule gives the rate on the interval after stockout; it does not assert a derivative value at the stockout instant itself.
Variable Rates and a Depletion Time
When rates vary continuously, integrate the net rate while inventory remains positive. A convenient way to organize the calculation is to define the cumulative production and cumulative demand from time zero:
Before any stockout, the balance is \(I(t)=I_0+P(t)-D(t)\). To find a candidate depletion time, set this expression equal to zero and solve. Then check that the inventory is positive before that time and that the resulting time lies within the period where the given rates apply.
Worked Example: Depletion with a Time-Varying Production Rate
Suppose a store starts with \(8\) units. For \(0\leq t\leq8\) hours, production is \(p(t)=16-2t\) units per hour and demand is \(d(t)=10\) units per hour. Find the first time inventory reaches zero.
The net rate while inventory is positive is
Integrating from \(0\) to \(t\), and using \(I(0)=8\), gives
Set this expression equal to zero:
The quadratic formula gives \(t=(6\pm\sqrt{36+32})/2=3\pm\sqrt{17}\). The negative root is outside the time domain, so the candidate depletion time is \(t=3+\sqrt{17}\) hours, approximately \(7.123\) hours. It is within the stated interval \(0\leq t\leq8\).
For a check, substitute the exact root into the inventory formula:
The inventory is positive before this root: the other root \(3-\sqrt{17}\) is negative, and the quadratic \(8+6t-t^2\) is positive between its two roots. The net rate becomes negative after \(t=3\), so inventory first grows and then declines to zero. At the depletion time the production rate is \(16-2(3+\sqrt{17})=10-2\sqrt{17}\), which is still positive; the stockout occurs because this rate is below demand, not because production has stopped.
Why the Boundary Rule Is Necessary
The boundary condition can be expressed as a conservation balance that includes unfilled demand. Let \(U(t)\) be the cumulative amount of demand that has not been met by time \(t\). Then
The correction \(U(t)\) is nondecreasing: unfilled demand can accumulate, but it cannot be undone by later production. It increases only when inventory is zero and demand exceeds production. This correction is exactly what prevents the on-hand stock from becoming negative. When inventory remains positive, \(U\) is constant, so the usual production-minus-demand balance applies without modification.
This also explains why an inventory model and a backlog model must not be confused. If orders that cannot be filled are recorded as a negative inventory, the balance \(I_0+P-D\) can continue below zero. That can be appropriate for a backlog variable, but it does not represent the quantity physically on hand. The model must match the meaning of the state variable.
A Common Mistake: Continuing Below Zero
For the constant-rate example, extending the unconstrained expression past the stockout gives \(I(7)=48-8(7)=-8\) units. This is a correct calculation for the unconstrained net balance, but it is not a valid on-hand inventory value. It treats all demand as met even after the available stock has been exhausted.
When calculating a depletion time, also check the direction of the net rate. Solving \(I_0+(p-d)t=0\) gives a positive time only when \(p-d<0\). If production is at least demand, that constant-rate period cannot deplete a positive starting inventory.
Summary
An inventory balance begins with a starting amount and the difference between production and demand. While inventory is positive, integrate that net rate to find the stock. If the balance reaches zero, enforce the nonnegative boundary: excess demand becomes unfilled demand rather than negative on-hand inventory. For changing rates, solve for the first zero of the integrated balance, verify the candidate against the time interval and the inventory path, and treat rate changes and stockouts as possible transition points where a derivative may fail to exist.
Check Your Understanding
Use the inventory interpretation and the rate balance to answer the following questions.
- A store has \(36\) units, production is \(5\) units per hour, and demand is \(11\) units per hour. When does on-hand inventory first reach zero?
- If inventory is zero and production is \(7\) units per hour while demand is \(12\) units per hour, what happens to on-hand inventory and to the unmet demand rate?
- Why is it not valid to report a negative value from the unconstrained balance as physical on-hand inventory?
- For variable rates, what equation gives inventory before stockout in terms of cumulative production and cumulative demand?
- Why may the inventory derivative fail to exist at the instant stockout occurs, even though the rate rule holds almost everywhere?