ferment.js

Simulating the art of fermentation.

Solving microbial metabolism and population ecology mathematically. A browser-native biochemical simulation engine.

Philosophy & Motivation

Loving the slow, unhurried ripening process —
without rushing to conclusions.

Kamos embraces "fermentative thinking" — cherishing the deliberate, unhurried deepening of thought rather than optimizing solely for immediate speed.

This is far more than a poetic metaphor. It is rooted in deep reverence for natural fermentation: where microscopic life dialogues with matter, communities of organisms collaborate and compete, and rich aromas and flavors unfold across time.

We built a mathematical, browser-native biochemical engine to simulate this real-world phenomenon faithfully. That engine is ferment.js.

Under the Hood

Three Core Computation Engines

Far beyond superficial animation — rigorous algorithms in biochemistry, mathematical ecology, and chemoinformatics work in seamless harmony.

01 / Metabolic Balance

Flux Balance Analysis

Metabolic Stoichiometry (FBA)

Under intracellular stoichiometric constraints (S cdot v = 0), sugar catabolism into ethanol and organic acids is solved using Linear Programming (Two-Phase Simplex). Mass conservation is strictly preserved at the molecular level.

max cᵀv  s.t.  S·v = 0, v_lb ≤ v ≤ v_ub
02 / Microbial Dynamics

Generalized Lotka-Volterra

Community Ecology (gLV)

Koji enzyme secretion, yeast proliferation, and lactic acid bacterial barriers. Multi-species symbiosis and competitive exclusion are numerically integrated using 4th-order Runge-Kutta (RK4).

dxᵢ/dt = xᵢ (rᵢ + ∑ Aᵢⱼ xⱼ)
03 / Sensory Projection

Chemoinformatics

Sensory Mapping & OAV

Synthesized aroma compounds (ethyl caproate, isoamyl acetate) and organic acids are projected against human sensory thresholds (OAV) into perceptual coordinates: "Green Apple", "Umami", and "Crispness".

OAV = [Compound] / DetectionThreshold
Interactive Studio

Inspecting 21 Days of Ripening

Adjust the timeline to see all three engines recalculate in real time, shifting broth clarity, color, and sensory notes.

TIMELINE : 21 DAYS Day 1 (Initial Mash)
Culture Vessel Turbid Mash (Nigori)
Sugar: 24.5°Bx
➔ Metabolism ➔
ABV: 0.0%
Microbial Share (gLV) Koji Dominant (68.2%)
State Narrative

Rice and brewing water have blended. Koji enzymes begin breaking down starches into glucose.

Live Mathematical Inspection
01 / FBA Flux Optimal (S·v = 0)

Glucose consumption ➔ Ethanol production flux: 14.2 mmol/gDW/h

02 / gLV Microbial RK4 Integrator

Yeast share: 78% | Lactic barrier (pH 3.4)

03 / Chemoinformatics OAV Active

Ethyl caproate 0.85ppm (4.2x sensory threshold) ➔ Green apple notes

Alcohol by Volume (ABV) 0.0%
Tasting Impression

"Sweet unfermented rice juice. Anticipating yeast activation in coming days."

API & Code

Scripting Fermentation

ferment.js
// Define vessel, substrate, and microbial strains to execute fermentation
const vessel = new FERMENT.Bioreactor({ material: 'Cedar' });
vessel.setSubstrate(new FERMENT.Substrate({ type: 'RiceMash' }));
vessel.add(new FERMENT.SaccharomycesCerevisiae());

const solver = new FERMENT.MetabolicSolver();
const assay = new FERMENT.Assay();

solver.step(vessel, 24); // 24-hour fermentation step
const observation = assay.read(vessel); // Assay & Sensory Evaluation

console.log(observation.metrics.abv); // Alcohol by Volume
console.log(observation.sensory.tastingNote); // Sensory Profile

ferment.js

Bringing microbial metabolism and the passage of ripening time to your web environment.

MIT License • Kosuke Kato (加藤康祐) • Zero Dependencies