mescla.prep.qaqc.charge_balance_error

mescla.prep.qaqc.charge_balance_error(table, convention='sum')[source]

Charge balance error in percent, per sample.

Two conventions are in circulation and they differ by exactly a factor of two, so a CBE is meaningless unless the convention travels with it.

convention="sum" (the default) normalises by the sum of the two sums,

\[\mathrm{CBE} = 100 \, \frac{\sum \mathrm{cations} - \sum \mathrm{anions}} {\sum \mathrm{cations} + \sum \mathrm{anions}}\]

which is Freeze & Cherry (1979) eq. 3.21 and what PHREEQC prints as Percent error, 100*(Cat-|An|)/(Cat+|An|).

convention="mean" normalises by their mean, i.e. the same expression with 200 in place of 100. This is the analytical-laboratory “ion balance percent difference” of APHA Standard Methods 1030E, and the form used by much of the water-quality QA literature.

Neither is wrong; "mean" simply reports twice the number for the same water. The ±5% acceptance rule is quoted for both, which is the real trap: screening at 5% under "mean" is twice as strict as under "sum". Relax to 10% for very dilute waters, where a small absolute error is a large relative one.

A large positive CBE usually means a missing anion (organic acids, nitrate, unmeasured alkalinity); a large negative one, a missing cation.

Parameters:
  • convention ({"sum", "mean"}, default "sum") – Denominator convention, as above.

  • table (Any)

Return type:

ndarray