How do you correct a batch using stock on hand?
Enter the existing batch mass and measured weight percentage of each tracked component. For each stock, enter the mass available and the percentage of each of those components. The calculator finds the smallest total addition that respects all the stock limits, target percentages and any maximum final mass. If the existing batch already meets the targets, the minimum addition is zero.
Worked example with two stocks
Start with 100 kg containing 10% A and 10% B. Stock X has 60% A and 10% B, with 30 kg available. Stock Y has 10% A and 50% B, with 19 kg available. The targets are exactly 20% A and 15% B.
The exact additions are 800/27 kg of stock X and 500/27 kg of stock Y, about 29.63 kg and 18.52 kg. The resulting mass is 4000/27 kg. Change stock Y's limit to 15 kg and the targets become infeasible. If the stock is available but the scale reads only whole kilograms, the nearest amounts are 30 and 19 kg. Their blend contains about 20.067% A and 15.101% B, which miss both exact targets.
Use Try an example above to load the same inputs. Read the worked example and expected outputs in JSON for a versioned record.
How the calculation works
The final mass is the existing mass plus the sum of stock additions. Each component's final mass is its starting mass plus the amounts contributed by the stocks. Dividing component mass by final mass gives its fraction by weight. A range such as 19% to 21% requires the component mass to lie between 0.19 and 0.21 times final mass. A single exact target uses the same value for both limits.
Stock availability and target ranges form a bounded linear optimization problem. The calculator checks the possible corner solutions with exact arithmetic and selects the one with the smallest total addition. If two plans add the same total mass, a stable stock-order rule selects a result. The SciPy linear programming documentation describes this type of objective and constraint. The browser calculator uses its own exact method for up to four stocks and four components.
Rounding, units and scope
Use percentages by mass. A value such as 10 means 10% of the entry's total mass. The untracked remainder accounts for unlisted material without assuming what it contains. The model assumes total mass and tracked components are conserved during mixing. It does not account for reaction, evaporation, variable composition, density or volume change.
If you enter a scale increment, the calculator checks the nearest step for each addition. It can report that those rounded amounts fail even when an exact blend exists. It does not search every possible combination at your scale's increment. The result is a mathematical check on entered values and does not establish that materials can be mixed safely or that a batch meets manufacturing requirements.
Use Recipe Scaling to resize a recipe while keeping its proportions, Molarity to work with moles per volume, or Density when you need a mass–volume conversion based on a known density.