Linear Programming Capacity Sensitivity Calculator

Hold the rest of a bounded two-variable model fixed. Explore how a changing resource limit alters feasibility, the best objective and the value of another unit of capacity.

Constraint sensitivity

Find where extra capacity changes the best plan

Two-variable model and capacity window

Maximize the objective over continuous nonnegative x and y. Use a consistent unit for each constraint.

Two values in the order x, y.

Nonnegative x and y.

The two coefficients in ax + by ≤ capacity.

Enter low, high.

Enter a decimal or fraction inside the range.

One row a, b, c per ax + by ≤ c. Enter up to three rows.

3 objective segments in the feasible range.

Allocation and marginal value at the probe

First feasible capacity in range
0
Maximum at probe
8
Marginal value just below
2
Marginal value just above
2

x = 2 · y = 1

Binding rows at this allocation · x upper bound / Swept constraint

Inspect the sensitivity range

Best objective by capacity
Piecewise linear maximum across the capacity range3 objective segments in the feasible range. The maximum at the probe is 8.LowerCapacityUpper
Maximum objective No feasible allocation Probe capacity
View exact sensitivity segments
Endpoint values and marginal objective
Capacity from / throughObjective from / throughShadow price
0
2
0
6
3
2
5
6
12
2
5
6
12
12
0

Export the sensitivity audit

Save all constraints, objective segments and the probe allocation.

View CSV text

How to use this calculator

  1. Enter the two objective coefficients and finite upper bounds for x and y.
  2. Enter the two coefficients for the swept resource constraint, its capacity range and any fixed rows.
  3. Compare the best objective and shadow price profiles. Type a capacity in the probe field for its optimal allocation and one-sided marginal values.
  4. Open the exact segments or download the constraint and allocation ledger.

The Formula

The mathematical logic powering this calculation is:

Maximize px + qy over continuous x and y with lower bounds zero and finite entered upper bounds. Every fixed row has the form ax + by ≤ c. The swept row has the form ux + vy ≤ r, where r varies over the entered closed capacity range.

At any fixed capacity, a nonempty bounded polygon has at least one optimal vertex, even when the feasible set is a line or point. Intersect every pair of nonparallel constraint boundaries. Each intersection has coordinates affine in r. For each candidate, substitute those coordinates into all constraints and intersect the resulting capacity intervals using exact fractions. Discard an intersection if it is infeasible throughout the window.

Each remaining candidate has an affine objective value over its feasible interval. Sort all interval endpoints and every capacity where two feasible candidate objectives cross. Between adjacent cut points, the feasible candidates and their relative order remain the same. Use the best of those affine objectives to describe the full interval. Merge adjacent intervals with the same objective rule. The slope of each interval is the marginal objective value, or shadow price, per extra unit of r. At a breakpoint the slopes just below and above can differ. The probe chooses one optimal vertex and lists the rows binding there.

Enter five pairs or values as shown and up to three fixed constraint rows. All coefficients, bounds, and window limits are decimals of magnitude up to 1,000,000 with six fractional places. The probe can also take a simple fraction inside the window. Slopes are computed only inside this modeled range. Use the full Linear Programming Calculator for larger models, minimization or other relation types.

Worked Example

If you input:

  • Objective coefficients: 3, 2
  • Variable upper bounds: 2, 3
  • Swept constraint coefficients: 1, 1
  • Capacity range: −1 to 6
  • Capacity to inspect: 3

Result:

The first feasible capacity is 0. The shadow price falls from 3 to 2 at capacity 2 and falls to zero at capacity 5. At capacity 3, x = 2 and y = 1 give objective 8.

Frequently Asked Questions

Why does the shadow price change?

A different constraint can become limiting as capacity expands. A breakpoint marks a change in the slope of the maximum objective. A zero slope means extra capacity does not improve the model’s objective on that interval.

Why can there be two shadow prices at a breakpoint?

The objective can gain at one rate as you approach the breakpoint and at another rate after you cross it. The report gives the two one-sided rates separately.

How should I enter a minimum requirement?

Multiply both sides by −1 to convert it to a less-than-or-equal row. For a minimum total x + y of 2, enter −1, −1, −2.

How are multiple optimal allocations handled?

The chart displays the best objective across all feasible allocations. At the probe, the worksheet returns one optimal vertex. Other vertices or points between them can attain the same objective.

Similar Calculators