Goal: reach 0.22–0.40 g/L in 360 s using no more than 320 L.
Decision arrives at 03:05
The surprise inlet may contain dye. Choose one strategy when the run pauses at the decision point.
The science · equations, assumptions & experiments
Learning goal: Predict how a dissolved, non-reacting food-safe tracer changes concentration in a continuously mixed tank, and quantify the water/energy trade-off.
Mass balance (uniform tank, equal inlet/outlet flow):
V · dC/dt = Q · (Cᵢ − C)
V [m³], Q [m³/s], C and Cᵢ [g/L], t [s].
Exact solution during a constant-flow/constant-inlet segment:
C(t+Δt) = Cᵢ + (C(t) − Cᵢ) · exp(−QΔt/V).
For a permanently clean inlet: C(t) = C₀ exp(−Qt/V). The dashed graph is this no-surprise, no-decision baseline, not a prediction after an inlet change.
Water and electricity:
dW/dt = Q [m³/s]; 1 m³ = 1000 L.
P = ΔpQ/η [W]; E = ∫Pdt / 3600 [Wh].
Here Δp = 40,000 Pa and η = 0.60 are assumed constants. The powered carbon filter is assumed to adsorb all incoming dye without saturating and draws 10 W for 120 seconds. Pump and filtration behaviour are approximate.
Assumptions & simplifications: Volume fixed by exactly balancing water entering and leaving; ideal instantaneous mixing, stable temperature, no chemical reaction, absorption, evaporation or pipe delay. Water rendering colour illustrates dye level only; it does not solve molecular diffusion or fluid dynamics. The contaminated inlet lasts from t = 120 to 290 s; the filter removes that inlet dye from t = 185 s onward.
Try this: Keep Q and V constant, double Q, and compare the concentration decay with the dashed curve. Reset, increase V, then test whether the same decision still wins. Try Q = 35 L/min and the filter response.
Independent numerical check: V = 120 L, Q = 30 L/min, C₀ = 1.4 g/L, clean inlet, t = 360 s gives 1.4 exp(−1.5) = 0.312382224 g/L. Run window.__selfTest() in the console to verify the actual physics step routine.