Tutorials › Calculus I › Inventory Under Production And Demand

Calculus-Based Model Construction · Tutorial 1468 of 1495

Inventory Under Production And Demand

Learn to construct an inventory balance from production and demand, track stock through changing operating periods, and identify when on-hand inventory reaches zero.

Advanced 10 min read

What You'll Learn

  • Define production and demand rates with consistent units and signs.
  • Build an inventory balance that accounts for starting inventory.
  • Calculate when a positive inventory is depleted under constant rates.
  • Model zero inventory without allowing physical stock to become negative.
  • Interpret unmet demand and distinguish it from a backorder.
  • Find depletion time when production and demand vary with time.

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.

Definition: An inventory balance with production, demand, and starting inventory \(I_0\) describes how the on-hand amount \(I(t)\) changes from \(I(0)=I_0\). While inventory is positive, its rate of change is production minus demand. When inventory is zero, unmet demand does not make the on-hand inventory negative.

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

$$ I(t)=I(s)+\int_s^t p(u)\,du-\int_s^t d(u)\,du. $$

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

$$ I'(t)=p(t)-d(t). $$

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.

Key rule: For piecewise-continuous production and demand rates, the constrained inventory satisfies $$ I'(t)= \begin{cases} p(t)-d(t), & I(t)>0,\\ \max\{p(t)-d(t),0\}, & I(t)=0 \end{cases} $$ almost everywhere in time. At transition instants, including stockout, the derivative may not exist. The equation is applied on the intervals between such instants, not asserted as a pointwise derivative rule at every time.

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

$$ r=p-d=12-20=-8\ \text{units per hour}. $$

For elapsed time \(t\) before stockout, the inventory is

$$ I(t)=48+(-8)t=48-8t. $$

Set this expression equal to zero to find the depletion time:

$$ 48-8t=0,\qquad 8t=48,\qquad t=6\ \text{hours}. $$

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

$$ I(2)=30+(10)(2)=50\ \text{units}. $$

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

$$ I(t)=50-10(t-2),\qquad I(7)=50-10(5)=0. $$

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

$$ I(t)=10(t-9),\qquad 9\leq t\leq12. $$

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:

$$ P(t)=\int_0^t p(u)\,du,\qquad D(t)=\int_0^t d(u)\,du. $$

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

$$ p(t)-d(t)=(16-2t)-10=6-2t. $$

Integrating from \(0\) to \(t\), and using \(I(0)=8\), gives

$$ I(t)=8+\int_0^t(6-2u)\,du =8+\left[6u-u^2\right]_0^t =8+6t-t^2. $$

Set this expression equal to zero:

$$ 8+6t-t^2=0,\qquad t^2-6t-8=0. $$

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:

$$ I(3+\sqrt{17}) =8+6(3+\sqrt{17})-(3+\sqrt{17})^2 =26+6\sqrt{17}-(26+6\sqrt{17}) =0. $$

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

$$ I(t)=I_0+P(t)-D(t)+U(t). $$

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.

Correction: The inventory reaches zero at \(t=6\) hours and stays at zero while demand exceeds production. From hour \(6\) to hour \(7\), the \(8\)-unit-per-hour deficit is unfilled demand, not negative physical stock.

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.

  1. 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?
  2. 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?
  3. Why is it not valid to report a negative value from the unconstrained balance as physical on-hand inventory?
  4. For variable rates, what equation gives inventory before stockout in terms of cumulative production and cumulative demand?
  5. Why may the inventory derivative fail to exist at the instant stockout occurs, even though the rate rule holds almost everywhere?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon