Bicarbonate needed for a target medium pH at a set CO2
cell_bicarbonate_for_ph
Works out the bicarbonate a culture medium needs for a target pH at a set incubator CO2, by Michl 2019.
- Runs
- On the server
- Level
- Checked against a reference: the source's own measured pH read backwards (Fig. 1c, Supplementary Data 2) within the stated prediction error, and 50-digit arithmetic of the inverse with a hand-worked case
What it is
Returns the bicarbonate a culture medium needs for a target pH at a set incubator CO2, by the inverse of Michl et al. 2019 Eq. 1. Use when formulating a bicarbonate-buffered medium for a CO2 incubator. Not for the pH a medium will reach: use `cell_bicarbonate_co2_ph`. Not for HEPES, phosphate or another closed buffer: use `calc_buffer_recipe`. Not for blood, plasma or any patient sample. Refuses CO2 outside 5 to 10 %, added buffers and a result outside 11 to 44 mM.
What it does
You give
targetPh(required): The medium pH wanted at equilibrium in the incubator.co2(required): The incubator's CO2 setting as a percentage of the gas. Must be at least 0 % and at most 100 %.mediumBuffers(required): Whether the medium's only buffer is bicarbonate, or a non-volatile buffer (HEPES, PIPES, MES) is also added.
No request is recorded for this tool.
Limits
- Research arithmetic on counts and records the caller read; not for diagnosis, treatment decisions or product release, and no susceptibility, sterility or safety interpretation.
- Medium arithmetic for a bicarbonate-buffered culture medium in a CO2 incubator, checked against one published medium; not for blood, plasma or any patient sample, and not a clinical or diagnostic authority.
- Every computed number a reply returns, other than an integer or an exact decimal, is rounded once to 12 significant figures: to the nearest, a change of at most 5 × 10⁻¹² of its value, except that a lower bound is rounded down and an upper bound up, a change of less than 1 × 10⁻¹¹; the method computes, and decides any pass or fail, on the unrounded value.
It will not answer when
- the CO2 percentage is outside the levels at which the equation was checked against measured pH.
- the medium contains a non-volatile buffer such as HEPES, PIPES or MES, where the source shows the two-buffer system is not predicted by this equation.
- the bicarbonate the target needs is outside the range at which the equation was checked against measured pH.
Every input, with its units3 inputs
targetPh(required): The medium pH wanted at equilibrium in the incubator.co2(required): The incubator's CO2 setting as a percentage of the gas. Must be at least 0 % and at most 100 %.mediumBuffers(required): Whether the medium's only buffer is bicarbonate, or a non-volatile buffer (HEPES, PIPES, MES) is also added.
Every refusal, with its code3 refusals
| Code | When |
|---|---|
CO2_OUTSIDE_CHECKED_RANGE | the CO2 percentage is outside the levels at which the equation was checked against measured pH. |
NON_VOLATILE_BUFFER_PRESENT | the medium contains a non-volatile buffer such as HEPES, PIPES or MES, where the source shows the two-buffer system is not predicted by this equation. |
BICARBONATE_OUTSIDE_CHECKED_RANGE | the bicarbonate the target needs is outside the range at which the equation was checked against measured pH. |
The calculation
The method's equations, constants and worked example.
Equation 1
[CO2] = s·x·p0, s = 0.024 M/atm, x the CO2 fraction, p0 one atmosphere
| Symbol | Meaning |
|---|---|
[CO2] | dissolved CO2 concentration, mM |
s | CO2 solubility, M/atm |
x | the incubator's CO2 fraction, % |
p0 | one standard atmosphere, atm |
Source 1.
Equation 2
| Symbol | Meaning |
|---|---|
[HCO3⁻] | bicarbonate concentration needed, mM |
[CO2] | dissolved CO2 concentration, mM |
pH | target medium pH, pH |
pK | apparent pK of CO2/HCO3⁻, pH |
Source 1.
Two readings: source 1 can be read as Eq. 1 solved for bicarbonate or as Eq. 3 with the intrinsic buffering term. This project takes Eq. 1 solved for bicarbonate. Taking Eq. 3 with the intrinsic buffering term would give a different result.
| Constant | Value | From |
|---|---|---|
apparent pK of the CO2/HCO3⁻ buffer pK | 6.15 pH | Source 1 |
CO2 solubility in the medium s | 0.024 M/atm | Source 1 |
Conventions
- CO2_PERCENT_BASIS = x of one standard atmosphere: Fixed by the method; not an argument. A CO2 percentage is taken as that fraction of one standard atmosphere, with no correction for water vapour or barometric pressure, as Michl et al. did.
- TEMPERATURE = the incubation temperature of the measured check: Fixed by the method; not an argument. The constants are used at the incubation temperature of the measured check; the source does not state the temperature of the constants.
A model of nature: it predicts a measurement and can be wrong for your sample. Prediction error: Against measured pH in one published medium (Michl et al. 2019, Fig. 1c and Supplementary Data 2), read backwards: at the conditions whose answer falls inside the checked bicarbonate range, the bicarbonate given for the mean measured pH differed from what the medium held by at most the value given. The same residuals on the pH scale are the prediction error of medium-ph-bicarbonate. Below the checked range Eq. 1 underestimated pH, as the source reports for low bicarbonate. No other medium, serum level or added buffer was checked.
Worked example
Worked example: one case of bicarbonate-for-medium-ph@1.0.0, 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
- targetPh = 7.4 pH
- co2 = 5 %
- mediumBuffers = bicarbonateOnly
Steps
- co2 = 1.2 mM, from co2; by equation 1; gives dissolvedCo2.
- bic = 21.339353 mM, from targetPh, co2; by equation 2; gives bicarbonate.
The working, as the case writes it:
[CO2] = 1.2 mM
10^(7.4 − 6.15) = 10^1.25 = 17.782794
1.2 × 17.782794 = 21.339353 mM.
Answer
dissolvedCo2 = 1.2 mM
bicarbonate = 21.339353 mM
Where these values came from: our own exact-arithmetic script and a hand-worked case; The inverse of Michl's Eq. 1 in 50-digit decimal arithmetic.
At build the tool returned this answer within the tolerance the file states: Bicarbonate and dissolved CO2 relative 1e-12 with a floor of 1e-15 mM below 1e-3 mM; statuses and codes exact.
Sources
Michl J, Park KC, Swietach P. Evidence-based guidelines for controlling pH in mammalian live-cell culture systems. Commun Biol 2019;2:144
Used for: Bicarbonate for a target culture medium pH at a set incubator CO2. At: section Setting medium pH by pCO2 and [HCO3-]: "CO2 solubility 0.024 M atm-1, i.e. 1.2 mM in 5%"; equation 1, section Introduction (printed in general form, pH = pKa + log [B]/[HB]); applied to CO2 and bicarbonate in "Setting medium pH by pCO2 and [HCO3-]"; section Introduction and "Setting medium pH by pCO2 and [HCO3-]" (citing the source's ref. 7, not read); section Setting medium pH by pCO2 and [HCO3-] (citing the source's ref. 7, not read).
Read in full, 11 November 2026
How it is checked
- Level
Checked against a reference.
- Checked against
Our own exact-arithmetic script and a hand-worked case; a published dataset, Michl et al. 2019 Supplementary Data 2 (measured pH), CPython 3.13.18, decimal at 50 digits; openpyxl 3.1.5.
- Cases
No case set is linked to this version.
- Not checked
The inverse is checked against the same eight measured conditions as the forward equation, read backwards. Everything the forward method does not check applies here, and Eq.
What was not checked, in fullfrom the method records
- The inverse is checked against the same eight measured conditions as the forward equation, read backwards.
- Everything the forward method does not check applies here, and Eq.
- 3 with a caller-stated intrinsic buffering is not built.
Changes to its methods0 changes
No change is logged for these method versions.