Found against calculated element percentages of a formula, version 1.0.3
elemental-analysis@1.0.3: 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; closed-form arithmetic against an exact-rational script on CIAAW's published table and a hand-worked case. Reference kind: our own exact-arithmetic script and a hand-worked case.
Not fully recorded, and not independently reviewed. Items marked "Not recorded" are missing from this project's records for the version named. Apart from any worked example shown, the cases and their values are not printed, so a reader cannot re-run these checks. No independent scientist has yet reviewed these methods or checks.
Every version of this method · Every method · What the levels mean
Version 1.0.3
Level: Checked against a reference; closed-form arithmetic against an exact-rational script on CIAAW's published table and a hand-worked case. Reference kind: our own exact-arithmetic script and a hand-worked case. elemental-analysis@1.0.3
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.
Each element's mass percentage 100·n(E)·A(E)/M for a formula with any stated solvates, the found value minus it, and whether the difference lies within the caller's window.
- How results are reported: none: full double precision. The comparison is the method's own definition, not a published rule: inside when |found − calculated| ≤ the caller's window, decided exactly on the decimal inputs; no window is assumed. The difference found − calculated is formed exactly, from the found value as stated and the exact calculated percentage, and converted to a double once (the numerator and denominator each rounded to a double and divided, or, beyond the double range, rounded once: within two units in the last place; the calculated percentage likewise); the within-window decision is made exactly on the same values (G1-a). A formula's empty group, (), contributes nothing (a limit, CHROM-F20: a refusal is preferred at a later version of the shared formula parser). A found value given twice for one element is invalid input, INVALID_STRING; a formula that repeats an element (CH3COOH) is accepted and its counts summed.
- Uncertainty: Atomic weights at CIAAW's abridged values; their own uncertainty and that of the analysis are not propagated.
- Computes through this project's own routines: the formula parser (element counts, groups, hydrate dot); CIAAW's abridged standard atomic weights in 10⁻⁴ g/mol (also the constant A(E)); the table's scale, 10⁴
- Reference, as its record states it: CIAAW's published abridged standard atomic weights 2024; an exact-rational script (Python fractions) and a hand-worked case; the full check of 14 November 2026 (a second implementation, edge cases); molmass 2026.11.1 on the same weights
- Level confirmed by this project's ruling of 25 November 2026
What this page can and cannot show
What was checked
134 cases in 4 files, linked by this exact version.
Run through the tool at build against our own exact-arithmetic script and a hand-worked case: 106 agree within the tolerance the file states, 28 refuse as the case expects, 0 differ, 0 were not run.
File 1, 19 cases
- Where the expected values came from: our own exact-arithmetic script and a hand-worked case
- Recorded on: 2026-11-10
- Reference: Python fractions (exact rational arithmetic) on CIAAW's abridged table as read from ciaaw.org, CPython 3.13.18; licence PSF-2.0
- Tolerance as the file states it: relative 1e-12 (absolute 1e-18 below 1e-6); absolute 1e-12 % on calculated and found fractions and differences, which may be 0; statuses, codes, elements and windows exact
File 2, 39 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: molar masses, calculated and found percentages and differences relative 1e-12 (absolute 1e-24 below 1e-12, in each value's unit); windows, verdicts, statuses and codes exact
File 3, 28 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: molar masses, calculated and found percentages and differences relative 1e-12 (absolute 1e-24 below 1e-12, in each value's unit); windows, verdicts, statuses and codes exact
File 4, 48 cases
- Where the expected values came from: our own exact-arithmetic script and a hand-worked case
- Recorded on: 2026-11-24
- Reference: Python fractions (this lane's script), Python 3.13.18; licence PSF-2.0
- Tolerance as the file states it: relative 1e-12 (absolute 1e-312 below 1e-300 g/mol) on the molar mass; absolute 1e-12 % on calculated and found fractions and differences, which may be 0; statuses, codes, elements and windows exact; stated before the run
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
Isotopically labelled formulas (refused); the conventional values used for interval elements (H, C, N, O, S, Cl and others) are not flagged in the reply at 1.0.0; whether the stated solvate is the one present; any journal's window. A formula starting with a digit (13C8H10N4O2, or 13H2O as a solvate) is refused INVALID_STRING since 1.0.3, through formula-mass 1.3.0, with no case in this method's fixtures; the refusal is covered by stored reference values and unit tests only.
Definition or model
A closed form: the result follows from the inputs by the equations alone.
Equations
Equation 1
w(E) = 100 × n(E) × A(E) / M, M = Σ n(E) × A(E), n(E) the count in the formula plus Σ equivalents × count in each stated solvate
| Symbol | Meaning and unit |
|---|---|
| w(E) | mass fraction of element E, % |
| n(E) | amount of E per formula unit |
| A(E) | standard atomic weight, g/mol |
| M | molar mass, g/mol |
Source: IUPAC, Quantities, Units and Symbols in Physical Chemistry (the IUPAC Green Book), 4th edition, abridged version, eds. Brett CMA, Frey JG, Hinde R, Kuroda Y, Marquardt R, Pavese F, Quack M, Stohner J, Thor AJ, RSC Publishing 2023, p. 44, section §4.10 General chemistry: mass fraction w_B = m_B/Σ m_j, relative atomic mass A_r = m_a/m_u, molar mass M_B = m_B/n_B; the record's derivation: one formula unit's mass is the sum of its atoms' masses, each A_r(E)·m_u, so w(E) = n(E)·A(E)/Σ n·A, and m_u cancels, 4th edition, abridged version (2023): IUPAC's online PDF release of March 2025 (122 pages; PDF created 26 October 2023), not the RSC e-book of record; read in full on 2026-11-24 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning 31e11316dcce. Free to read (free PDF from IUPAC; © IUPAC 2023, reproduction beyond fair dealing needs permission (definitions used, not text)), checked 2026-11-24. No erratum found (searched crossref (10.1039/9781839163180): no update or erratum relation, IUPAC's Green Book page, as the second raising of 17 November 2026 recorded it: no erratum listed for the 4th edition), 2026-11-24.
Equation 2
Definition: the difference between the found and the calculated mass fraction, and its comparison with the caller's window.
Δ(E) = found(E) − w(E)
inside the caller's window when |Δ(E)| ≤ window, decided exactly on the decimal inputs
| Symbol | Meaning and unit |
|---|---|
| Δ(E) | found minus calculated mass fraction of element E, % |
| found(E) | the caller's found mass fraction, % |
| w(E) | the calculated mass fraction, % |
| window | the caller's stated window (never defaulted), % |
Constants
| Constant | Value and unit | Source | Date read |
|---|---|---|---|
| standard atomic weights, CIAAW abridged table, edition on ciaaw.org as read 10 November 2026 (the 2021 values with the 2024 revisions; the suite's own atomic-weights table, all 84 values compared with that page, no difference) (A(E)) | a table of values, part of the method | IUPAC CIAAW, Abridged Standard Atomic Weights, table the abridged table | 2026-11-10 |
Worked example
Worked example: one case of elemental-analysis@1.0.3, 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
- formula = C8H10N4O2
- found[0].element = C
- found[0].massFraction = 49.32 %
- found[1].element = H
- found[1].massFraction = 5.21 %
- found[2].element = N
- found[2].massFraction = 28.71 %
- window = 0.4 %
Steps
- M = 194.194 g/mol, from formula; by equation 1; gives molarMass.
- wC = 49.480416 %, from formula, M; by equation 1; gives elements[0].calculated.
- dC = -0.16041649 %, from found[0].massFraction, wC; by equation 2; gives elements[0].difference.
The working, as the case writes it:
M = 8 x 12.011 + 10 x 1.0080 + 4 x 14.007 + 2 x 15.999 = 96.088 + 10.080 + 56.028 + 31.998 = 194.194
C = 96.088/194.194 = 49.4805 %
H = 10.080/194.194 = 5.1907 %
N = 56.028/194.194 = 28.8516 %
differences -0.1605, +0.0193, -0.1416, all within 0.4.
Answer
molarMass= 194.194 g/molelements[0].calculated= 49.480416 %elements[0].difference= -0.16041649 %
Where these values came from: our own exact-arithmetic script and a hand-worked case; Mass fraction w(E) = n(E) x A(E) / M (IUPAC Green Book, 3rd ed., section 2.10) on CIAAW's abridged standard atomic weights (read 10 November 2026).
At build the tool returned this answer within the tolerance the file states: relative 1e-12 (absolute 1e-18 below 1e-6); absolute 1e-12 % on calculated and found fractions and differences, which may be 0; statuses, codes, elements and windows exact.
Who worked this case: not recorded.
What it refuses, and its input ranges
NO_STANDARD_ATOMIC_WEIGHT: the formula or a found element names an element CIAAW lists with no standard atomic weight (Tc, Pm, Po and the others): the method cannot weigh it Next: No change of input makes this computable on these data.LABELLED_NOT_SUPPORTED: the formula is isotopically labelled (D or T): not supported at this version Next: Give the formula with natural-abundance hydrogen (H), or use a mass-spectrometry tool for a labelled compound.
Changes
2026-11-25-elemental-analysis@1.0.3-1
2026-11-25 · elemental-analysis@1.0.3 · Corrections to our methods
- What was wrong: A number written before the formula or a solvate formula was read as a multiplier. Caffeine with half a water written as the solvate 13H2O at 0.5 equivalents gave a molar mass of 311.2915 g/mol for 203.2015, and a calculated carbon of 30.87 % for 47.29 %, outside the window where the found 47.3 % lies inside it.
- Affected: analyt_elemental_analysis_check at elemental-analysis 1.0.2 and earlier, only where the formula or a solvate formula starts with a digit. Every other output is unchanged.
- What changed: In 1.0.3, through formula-mass 1.3.0, a formula starting with a digit is now refused (INVALID_STRING); every other output is unchanged, and every pinned output hash is the same.
- How it was found: A review of the formula reader's grammar on 24 November 2026 found that no rule or test documented a number at the start of a formula, while the shared reader (formula-mass) applied the adduct multiplier to the first part as well; the scientific review ruled the same day that such a formula is refused. A sweep of the tools' worked examples with 13 written before each formula argument, before and after the fix, found which tools computed on it.
- Cases added: None in the fixtures: no published case starts a formula with a digit, and every pinned output hash is unchanged. The refusal is covered by the formula reader's hand cases and unit tests; the widened sweep records each tool's reply before and after.
Tools that use it
Cite this version
Found against calculated element percentages of a formula. Drybench; elemental-analysis@1.0.3; https://www.drybench.com/methods/m/elemental-analysis/1.0.3 (accessed [date]).