# Stock to add to a solution already holding the solute, or two stocks blended, to reach a target concentration, version 1.0.1

calc-mix-to-target\@1.0.1: this version's equations with their symbols, each constant's value, their sources and whether each was read, a worked example where the record holds one, its level and what it was checked against, the number of cases, and what was not checked. This version's record is not rewritten; a correction is added under Changes.

## What this page can and cannot show

**Level: Checked against a reference; one solute; concentrations all amount per volume or all mass per volume; volumes additive. Reference kind: our own exact-arithmetic script and a hand-worked case.**

Checked by this project, not independently reviewed. Every method on this page has its equations, constants, sources and cases on record, and its cases agree with the stated reference within the stated tolerance. A reader can follow each method's worked example by hand; that shows the stated method gives the stated answer for one set of inputs, and does not test the code. The other cases and their values are not printed, so a reader cannot re-run these checks. No independent scientist has yet reviewed them.

[Every version of this method](https://www.drybench.com/methods/m/calc-mix-to-target) · [Every method](https://www.drybench.com/methods/m) · [What the levels mean](https://www.drybench.com/methods/levels)

## Version 1.0.1

**Level: Checked against a reference; one solute; concentrations all amount per volume or all mass per volume; volumes additive. Reference kind: our own exact-arithmetic script and a hand-worked case.** `calc-mix-to-target@1.0.1`

Built, not hosted. Generated from a snapshot of the library's records taken on 2026-11-25, as committed on 2026-11-25. A later snapshot replaces this one, so these records and this page can change.

The volume of a stock to add to a solution that already holds the solute so that it reaches a target concentration, or the volumes of two stocks that blend to a target at a stated final volume, from the conservation of amount (or mass) with volumes taken as additive.

- **How results are reported:** Inputs as their shortest decimals, converted exactly and rounded once; bounds decided on that value, ends included unless stated as above or below; the note VOLUMES\_ADDITIVE on every computed reply; none: the nearest double to each exact rational. A volume whose exact value is not zero but rounds to zero, or that lies beyond the double range, refuses the whole call as RESULT\_OUTSIDE\_DOUBLE\_RANGE; an exact zero (Ct = C0) is reported as 0.
- **Uncertainty:** Exact arithmetic on the stated volumes and concentrations; no uncertainty is propagated, and the error from non-additive volumes is not estimated.
- **Reference, as its record states it:** exact rational arithmetic, against a second implementation in Python by a separate agent of the same model family
- **Level confirmed by this project's ruling of** 14 November 2026

[What this page can and cannot show](#what-this-page-can-and-cannot-show)

### What was checked

83 cases in 2 files, linked by this exact version.

Run through the tool at build against our own exact-arithmetic script and a hand-worked case: 63 agree within the tolerance the file states, 20 refuse as the case expects, 0 differ, 0 were not run.

- **File 1, 28 cases**
  - **Where the expected values came from:** our own exact-arithmetic script and a hand-worked case
  - **Recorded on:** 2026-11-11
  - **Reference:** Python fractions: the mass balance with additive volumes, CPython 3.13.18; licence PSF-2.0
  - **Tolerance as the file states it:** relative 1e-15 on every number (absolute 1e-21 below 1e-6, in its own unit); statuses, codes, units and the basis exact

- **File 2, 55 cases**
  - **Where the expected values came from:** our own exact-arithmetic script and a hand-worked case
  - **Recorded on:** 2026-11-14
  - **Reference:** second implementation (Python 3.13), 2026-11-14; licence BSD-3-Clause
  - **Tolerance as the file states it:** every number relative 1e-12 (absolute 1e-15 below 1e-3, in each value's unit); strings, notes, statuses and codes exact

Apart from the worked example, the cases and their values are not printed here. This shows agreement with this project's recorded cases. It does not show that a method suits your work, and it is not a qualification.

### What was not checked

Volume change on mixing (Drybench's convention takes volumes as additive); molality, w/w, v/v and bare percent concentrations (not accepted); more than one solute; dilution to a mark.

### Definition or model

A closed form: the result follows from the inputs by the equations alone.

### Equations

**Equation 1**

```equation
C0·V0 + Cs·Vs = Ct·(V0 + Vs), so Vs = V0·(Ct − C0)/(Cs − Ct)
final volume Vt = V0 + Vs
volumes in mL (L × 1000)
the concentrations in any one unit of one basis, the ratio being unit-free, and the final concentration given in M or g/L
Ct in the closed interval from C0 to Cs, Ct ≠ Cs and C0 ≠ Cs, else TARGET_NOT_REACHABLE
Vs = 0 at Ct = C0
the volume fits a stated vessel when Vt ≤ its capacity
the final concentration is recomputed as (C0·V0 + Cs·Vs)/Vt
```

| Symbol | Meaning and unit |
| --- | --- |
| C0 | concentration of the solution already present; M (amount) or g/L (mass), by every concentration in a call is on the same basis, the one the caller gives |
| Cs | concentration of the stock added; M (amount) or g/L (mass), by every concentration in a call is on the same basis, the one the caller gives |
| Ct | target concentration; M (amount) or g/L (mass), by every concentration in a call is on the same basis, the one the caller gives |
| V0 | volume of the solution already present, mL |
| Vs | volume of stock to add, mL |

Source: Cohen ER et al. Quantities, Units and Symbols in Physical Chemistry (the IUPAC Green Book), IUPAC and RSC, section §2.10, printed p. 48: c\_B = n\_B/V and γ\_B = m\_B/V. The balance is Drybench's algebra on these definitions, with the amount (or mass) of B conserved and the volumes additive (VOLUME\_ADDITIVE); the Green Book does not print it., 3rd edition (2007), 2nd printing, December 2012 searchable PDF from iupac.org; read in full on 2026-11-11 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning dc9cf52d6cf3. Free to read (free PDF from IUPAC; all rights reserved), checked 2026-11-11. Erratum: An English erratum list (February 2010, ed. J. Stohner), known only through AIST NMIJ's December 2010 Japanese-translation errata; neither read (host refused the connection, 11 November 2026). The copy read is taken as uncorrected; whether any entry falls in §2.10 is unknown. (2026-11-11).

**Equation 2**

```equation
Va + Vb = Vt and Ca·Va + Cb·Vb = Ct·Vt, so Va = Vt·(Cb − Ct)/(Cb − Ca) and Vb = Vt − Va
Ct in the closed interval from Ca to Cb, Ca ≠ Cb
Va = 0 at Ct = Cb and Vb = 0 at Ct = Ca
capacity as for add-stock
the final concentration is recomputed as (Ca·Va + Cb·Vb)/Vt
```

| Symbol | Meaning and unit |
| --- | --- |
| Ca | concentration of stock A; M (amount) or g/L (mass), by every concentration in a call is on the same basis, the one the caller gives |
| Cb | concentration of stock B; M (amount) or g/L (mass), by every concentration in a call is on the same basis, the one the caller gives |
| Ct | target concentration; M (amount) or g/L (mass), by every concentration in a call is on the same basis, the one the caller gives |
| Vt | final volume, mL |
| Va | volume of stock A, mL |
| Vb | volume of stock B, mL |

Source: Cohen ER et al. Quantities, Units and Symbols in Physical Chemistry (the IUPAC Green Book), IUPAC and RSC, section §2.10, printed p. 48: c\_B = n\_B/V and γ\_B = m\_B/V. The balance is Drybench's algebra on these definitions, with the amount (or mass) of B conserved and the volumes additive (VOLUME\_ADDITIVE); the Green Book does not print it., 3rd edition (2007), 2nd printing, December 2012 searchable PDF from iupac.org; read in full on 2026-11-11 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning dc9cf52d6cf3. Free to read (free PDF from IUPAC; all rights reserved), checked 2026-11-11. Erratum: An English erratum list (February 2010, ed. J. Stohner), known only through AIST NMIJ's December 2010 Japanese-translation errata; neither read (host refused the connection, 11 November 2026). The copy read is taken as uncorrected; whether any entry falls in §2.10 is unknown. (2026-11-11).

### Conventions

- `VOLUME_ADDITIVE` = volumes additive: Fixed by the method; not an argument. The final volume is the sum of the volumes mixed (Drybench's ruling); a final volume made up to the mark is calc\_c1v1's.

### Constants

Constants: none used.

### Worked example

Worked example: one case of calc-mix-to-target\@1.0.1, from its inputs through each step to the answer. Values are written as a person writes them; the working carries more digits, so your own figure may differ in the last digit shown.

**Inputs**

- task = addStock
- initialVolume = 1 L
- initialConcentration = 2 mM
- stockConcentration = 200 mM
- targetConcentration = 5 mM

**Steps**

1. Vs = 15.384615 mL, from initialVolume, initialConcentration, stockConcentration, targetConcentration; by equation 1; gives stockVolume.
2. Vt = 1015.3846 mL, from initialVolume, Vs; by equation 1; gives finalVolume.

The working, as the case writes it:

```equation
Vs = V0·(Ct − C0)/(Cs − Ct) = 1000 mL × (5 − 2) mM / (200 − 5) mM = 3000/195 = 200/13 mL = 15.38462 mL
check: (2 mmol + 0.2 M × 200/13 mL) / (13200/13 mL) = 5 mM.
```

**Answer**

- `stockVolume` = **15.384615 mL**
- `finalVolume` = **1015.3846 mL**

Where these values came from: our own exact-arithmetic script and a hand-worked case; worked by hand, and in exact rationals.

At build the tool returned this answer within the tolerance the file states: relative 1e-15 on every number (absolute 1e-21 below 1e-6, in its own unit); statuses, codes, units and the basis exact.

Who worked this case: not recorded.

### What it refuses, and its input ranges

- `TARGET_NOT_REACHABLE`: the target does not lie between the two concentrations mixed, equals the stock added, or the two concentrations are equal Next: Choose a target between the two concentrations and different from the stock added, or a stock on the far side of the target; two equal concentrations cannot be mixed to a new one.
- `VESSEL_CAPACITY_EXCEEDED`: the final volume would exceed the stated vessel capacity Next: Use a larger vessel, a smaller starting volume, or a more concentrated stock.
- `MIXED_BASIS` (invalid input): the concentrations are not all amount per volume or all mass per volume; the tool holds no molar mass to convert between them
- `TASK_ARGUMENTS` (invalid input): addStock needs initialVolume, initialConcentration and stockConcentration; blendStocks needs stockAConcentration, stockBConcentration and finalVolume; both need targetConcentration and may take vesselCapacity; an argument of the other task is refused

### Flags and notes a reply may carry

A note a reply may carry:

- `VOLUMES_ADDITIVE`: Volumes are taken as additive: the final volume is the sum of the volumes mixed. This fails for ethanol and water, for concentrated salts and acids, and wherever mixing contracts or expands the solution; make up to a measured volume where it matters.

### Changes

#### 2026-11-14-calc-mix-to-target\@1.0.1-1

2026-11-14 · [`calc-mix-to-target@1.0.1`](https://www.drybench.com/methods/m/calc-mix-to-target) · Corrections to our methods

- **What was wrong:** A stock volume whose exact value is not zero but is smaller than the smallest double was reported as 0 mL: 1e-300 L at 2 mM spiked with a 1e300 mM stock to 5 mM needs about 3e-301 mL, and 1.0.0 said 0.
- **Affected:** Calls in version 1.0.0 whose stock, blend or final volume rounds to zero though it is not zero, in the assistant tool calc\_mix\_to\_target; and calls whose volume lies beyond the double range, which the tool reported unchecked before the kit's refusal of such results. Every other call was unaffected.
- **What changed:** In 1.0.1 such a call is refused whole as RESULT\_OUTSIDE\_DOUBLE\_RANGE, naming the volume; an exact zero (a target equal to the starting concentration) is still reported as 0. No published case's number moved.
- **How it was found:** A second implementation in Python by a separate agent of the same model family, in the raising run's full check of 14 November 2026 (finding SOL-F11); the CSO's W5.
- **Cases added:** None yet: the cases enter with the -2 fixture from a fresh agent's program (the CSO's MX7 and S29).

## Tools that use it

- [`calc_mix_to_target`](https://www.drybench.com/methods/tools/calc-mix-to-target)

## Cite this version

Stock to add to a solution already holding the solute, or two stocks blended, to reach a target concentration. Drybench; calc-mix-to-target\@1.0.1; [https://www.drybench.com/methods/m/calc-mix-to-target/1.0.1](https://www.drybench.com/methods/m/calc-mix-to-target/1.0.1) (accessed \[date\]).
