fix: realistic sinus + continuous pump control + dead zone elimination
Some checks failed
CI / lint-and-test (push) Has been cancelled

Sinus inflow: 54-270 m³/h (base 0.015 + amplitude 0.06 m³/s), 4 min
period. Peak needs 1-2 pumps, never all 3 = realistic headroom.

PS control: continuous proportional demand when level > stopLevel, not
just when > startLevel && filling. Pumps now ramp down smoothly as
basin drains toward stopLevel instead of staying stuck at last setpoint.

pumpingStation e8dd657: dead zone elimination
build_flow.py: sinus tuned for gradual pump scaling visibility

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
znetsixe
2026-04-14 13:42:55 +02:00
parent c8f149e204
commit 732b5a3380
3 changed files with 12 additions and 5 deletions

View File

@@ -1239,9 +1239,16 @@ def build_drivers_tab():
nodes.append(function_node(
"sinus_fn", TAB_DRIVERS, LANE_X[1] + 220, y + 40,
"sinus inflow (m³/s)",
"const base = 0.02; // m³/s (~72 m³/h always)\n"
"const amplitude = 0.10; // m³/s (~360 m³/h peak)\n"
"const period = 120; // seconds per full cycle\n"
"// Realistic wastewater inflow profile:\n"
"// base = minimum dry-weather flow (always present)\n"
"// amplitude = peak wet-weather swing on top of base\n"
"// range = base → base+amplitude = 54 → 270 m³/h\n"
"// 1 pump handles up to ~223 m³/h, so peak needs 2 pumps.\n"
"// 3 pumps (669 m³/h) are never needed = realistic headroom.\n"
"// period = 240s (4 min) — slow enough to see pump ramp on dash.\n"
"const base = 0.015; // m³/s (~54 m³/h dry weather)\n"
"const amplitude = 0.06; // m³/s (~216 m³/h peak swing)\n"
"const period = 240; // seconds per full cycle\n"
"const t = Date.now() / 1000; // seconds since epoch\n"
"const q = base + amplitude * (1 + Math.sin(2 * Math.PI * t / period)) / 2;\n"
"return { topic: 'q_in', payload: q, unit: 'm3/s', timestamp: Date.now() };",