Method
MFC — Butler-Volmer + Monod single-overpotential snapshot
Two MFC models are in use. The lab MFC tiles use mfc-butler-volmer-monod-v2; /api/ml/predict, the MCP server and the chat assistant use Enhanced_MFC_Experimental. For the same design they can differ. Whether to unify them is an open decision for the maintainers. Enhanced_MFC_Experimental
What it predicts
Areal power and current density, coulombic efficiency and COD removal for an air- or O₂-cathode MFC.
Governing relations
Each relation is transcribed from the implementation. Where the code cites no source, the source line says so.
Anodic Butler-Volmer current Source: Textbook Butler-Volmer relation (calculateButlerVolmer in scientificConstants.ts); predict.ts cites no source for it.
Symbol Meaning Unit anodic current density before substrate and transport limits (code works in A/cm², reports ×10⁴) A/m² exchange current density after the Arrhenius and roughness corrections A/cm² anodic transfer coefficient (catalog value, else 0.5) 1 electrons transferred, fixed at 2 1 Faraday constant, 96 485.332 12 C/mol anode overpotential, a single snapshot at 0.15 V V gas constant, 8.314 462 618 J/(mol·K) temperature K Exchange current: Arrhenius and roughness Source: Arrhenius form with E_a = 25 kJ/mol; roughness form calibrated in-house (Phase B, 2026-04-29); predict.ts cites no source for it.
The roughness factor is a log-scaled heuristic with a floor of 1, not a measured area ratio.
Symbol Meaning Unit catalog exchange current density for the named anode; 5×10⁻⁸ when none is named or the slug is unknown A/cm² activation energy of a mixed-culture biofilm, 25 000 J/mol gas constant, 8.314 (anode-kinetics.ts) J/(mol·K) roughness factor; 1 when the catalog has no BET area 1 specific surface area of the anode from the catalog m²/g Monod substrate saturation Source: Rittmann & McCarty 2001, Environmental Biotechnology (K_s = 120 mg/L, mixed anaerobic culture); other buckets calibrated against the validation-tuple corpus.
Symbol Meaning Unit substrate factor applied to the current 1 influent COD mg/L half-saturation constant from the substrate bucket, or a citation-backed override mg/L Mass-transport ceiling Source: Unsourced engineering default in predict.ts (2026-10 citation audit).
A smooth saturation that bounds the unphysical high edge; it does not model species transport.
Symbol Meaning Unit served current density A/m² substrate-diffusion ceiling A/m² influent COD mg/L temperature K Cell voltage Source: Representative OCV, Gaussian pH factor and linear spacing penalty; predict.ts cites no source for it.
The IR drop is capped at 70 % of the working voltage so pathological inputs cannot drive it negative.
Symbol Meaning Unit operating cell voltage V representative open-circuit voltage of an acetate-fed membraneless MFC V spacing penalty: 1 up to 2 cm, then 0.12 per cm, floor 0.4 1 Gaussian pH factor, optimum 7, σ = 1 1 electrode area-specific resistances from the catalog, else 5 each Ω·cm² served current density A/m² Areal power Source: Definition of electrical power, P = I·V.
Symbol Meaning Unit areal power density mW/m² served current density A/m² operating cell voltage V Worked example
These inputs, passed to the predictor, return the output below. A test re-runs the example on every change, so this number is the one the code produces.
input value unit temperatureC 25 °C ph 7 pH electrodeSpacingCm 2 cm hrtHours 24 h codMgL 1,000 mg/L Output · result.powerDensity = 115 mW/m², within ±0.5 %
By hand · No anode named: i₀ = 5×10⁻⁸ A/cm², f_R = 1, Arrhenius factor = 1 at 25 °C. F·η_a/(R·T) = 96 485.33 × 0.15 / (8.314 46 × 298.15) = 5.838, so j_BV = 5×10⁻⁸ × (e^5.838 − e^−5.838) × 10⁴ = 0.1716 A/m². f_S = 1000/1120 = 0.893, j = 0.1532 A/m² (the transport factor is 1.000). V_cell = 0.75 − 0.1532/10⁴ × 10 = 0.7498 V. P = 0.1532 × 0.7498 × 1000 = 114.9, reported to the nearest whole number as 115 mW/m².
Reproduce · Pinned by libs/shared/electrochemistry/src/predictors/worked-examples.test.ts. Run it from the repository root:
pnpm exec jest -c libs/shared/electrochemistry/jest.config.js worked-examples.test.ts -t "result.powerDensity"
Coulombic efficiency and COD removal Source: Empirical saturation forms; predict.ts cites no source for it.
Heuristic saturation curves, not a substrate mass balance.
Symbol Meaning Unit coulombic efficiency % COD removal % retention-time saturation factor 1 hydraulic retention time h temperature step: 1 above 20 °C, else 0.8 1
Assumptions and constants
- Single anode overpotential snapshot η_anode = 0.15 V — not a polarisation sweep.
- Mixed-culture Monod constant K_M = 120 mg COD/L unless the substrate lookup gives another.
- Arrhenius activation energy E_a = 25 kJ/mol for a mixed-culture biofilm; i₀ normalised to 298 K.
- pH response is a Gaussian around 7.0 with σ = 1.0.
- An anode the catalog cannot resolve, or none, uses i₀ = 5×10⁻⁸ A/cm².
Corrections applied
- Electrode roughness factor on i₀ from the electrode catalog.
- Ohmic penalty from electrode spacing (linear above 2 cm).
- Ohmic IR drop from electrode area-specific resistance (gated by NEXT_PUBLIC_LAB_PHYSICS_OHMIC).
- Mass-transport ceiling on the current (gated by NEXT_PUBLIC_LAB_PHYSICS_MASS_TRANSPORT).
- Biofilm thickness clamped to 0–5 mm.
Not modelled
None stated in the source.
The predictor’s source file declares nothing in this section, so nothing is hidden here. Add it to the registry entry to show it.
Literature anchors in the source
None stated in the source.
The predictor’s source file declares nothing in this section, so nothing is hidden here. Add it to the registry entry to show it.
Implementation
libs/shared/electrochemistry/src/predict.ts
Interval the predictor ships
heuristic_fixed_fraction — A fixed ±25 % placeholder band. It is NOT a calibrated interval; when served through /api/ml/predict it is replaced by the benchmark band below, or withheld. How served intervals are built
Calibration artifacts used when served
- Benchmark out-of-fold residual quantiles: bes-benchmark-v1 · gkf5 · generated 2026-09-09
- Split-conformal calibration: split-conformal · generated 2026-05-21
- Hierarchical-priors v2 trust snapshot: populated · generated 2026-05-16
Benchmark cells for this predictor’s systems
Each row is a stratum with n ≥ 30 residuals at nominal level 90%. Coverage is the cross-validated share of held-out points inside the band.
| target | stratum | n | papers | coverageCV |
|---|---|---|---|---|
| cod_removal | MFC | 602 | 172 | 88.5% |
| cod_removal | MFC|bioremediation | 46 | 8 | 56.5% |
| cod_removal | MFC|power_generation | 134 | 41 | 88.8% |
| cod_removal | MFC|unknown | 53 | 8 | 85.7% |
| cod_removal | MFC|wastewater_treatment | 360 | 113 | 87.8% |
| coulombic_efficiency | MFC | 301 | 97 | 89.7% |
| coulombic_efficiency | MFC|power_generation | 107 | 31 | 86.9% |
| coulombic_efficiency | MFC|unknown | 30 | 10 | 73.7% |
| coulombic_efficiency | MFC|wastewater_treatment | 135 | 48 | 77.0% |
| current_density_areal | MFC | 496 | 134 | 89.3% |
| current_density_areal | MFC|power_generation | 208 | 54 | 88.0% |
| current_density_areal | MFC|unknown | 49 | 14 | 83.7% |
| current_density_areal | MFC|wastewater_treatment | 201 | 57 | 85.6% |
| power_density_areal | MFC | 871 | 245 | 88.9% |
| power_density_areal | MFC|bioremediation | 49 | 9 | 69.4% |
| power_density_areal | MFC|power_generation | 343 | 114 | 89.5% |
| power_density_areal | MFC|unknown | 106 | 24 | 85.8% |
| power_density_areal | MFC|wastewater_treatment | 350 | 91 | 85.4% |
Prior trust by served parameter
The state the lab badge shows for each served parameter and system, from the v2 priors fit.
| parameter | system | state | papers | prior |
|---|---|---|---|---|
| power_density_areal | MFC | curated | 275 | weakly_informative |
| current_density_areal | MFC | curated | 150 | weakly_informative |
| coulombic_efficiency | MFC | curated | 96 | literature |
| cod_removal | MFC | calibrated | 183 | weakly_informative |
Scientific-rigor gates
pnpm verify:science runs these rules over the committed priors and validation artifacts in pre-commit. Known violations are baselined per rule and slug; a new one blocks the commit. Baseline from hierarchical-priors-v2.json@2026-10-26T00:10:47.721880+00:00.
| rule | baselined |
|---|---|
| gate-honestyNo parameter may pass a rounded-threshold gate read while converged=false | 1 |
| support-containmentBounded quantities must have ci95 inside physical support, width <= range | 3 |
| magnitude-sanityNo ci95 bound may exceed the plausibility ceiling (1.0e+6) | 0 |
| slug-uniquenessNo two slugs may share a spelling-independent identity; scale must agree | 2 |
| secondary-source-purityNo fitted prior may carry a REVIEW (secondary-source) stratum | 0 |
| artifact-pairingEach fit must have its own coverage evidence; the served fit must have some | 0 |
| coverage-sharpnessAny coverage figure must ship its interval width alongside | 0 |
| interval-calibrationHeld-out interval coverage per parameter may not newly degrade | 128 |
| effects-gap-completenesseffects.json is schema 2.0; every non-high effect has a gap per archetype; no gap is "high" | 0 |