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( nodes.append(function_node(
"sinus_fn", TAB_DRIVERS, LANE_X[1] + 220, y + 40, "sinus_fn", TAB_DRIVERS, LANE_X[1] + 220, y + 40,
"sinus inflow (m³/s)", "sinus inflow (m³/s)",
"const base = 0.02; // m³/s (~72 m³/h always)\n" "// Realistic wastewater inflow profile:\n"
"const amplitude = 0.10; // m³/s (~360 m³/h peak)\n" "// base = minimum dry-weather flow (always present)\n"
"const period = 120; // seconds per full cycle\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 t = Date.now() / 1000; // seconds since epoch\n"
"const q = base + amplitude * (1 + Math.sin(2 * Math.PI * t / period)) / 2;\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() };", "return { topic: 'q_in', payload: q, unit: 'm3/s', timestamp: Date.now() };",

View File

@@ -3939,7 +3939,7 @@
"type": "function", "type": "function",
"z": "tab_drivers", "z": "tab_drivers",
"name": "sinus inflow (m\u00b3/s)", "name": "sinus inflow (m\u00b3/s)",
"func": "const base = 0.02; // m\u00b3/s (~72 m\u00b3/h always)\nconst amplitude = 0.10; // m\u00b3/s (~360 m\u00b3/h peak)\nconst period = 120; // seconds per full cycle\nconst t = Date.now() / 1000; // seconds since epoch\nconst q = base + amplitude * (1 + Math.sin(2 * Math.PI * t / period)) / 2;\nreturn { topic: 'q_in', payload: q, unit: 'm3/s', timestamp: Date.now() };", "func": "// 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 \u2192 base+amplitude = 54 \u2192 270 m\u00b3/h\n// 1 pump handles up to ~223 m\u00b3/h, so peak needs 2 pumps.\n// 3 pumps (669 m\u00b3/h) are never needed = realistic headroom.\n// period = 240s (4 min) \u2014 slow enough to see pump ramp on dash.\nconst base = 0.015; // m\u00b3/s (~54 m\u00b3/h dry weather)\nconst amplitude = 0.06; // m\u00b3/s (~216 m\u00b3/h peak swing)\nconst period = 240; // seconds per full cycle\nconst t = Date.now() / 1000; // seconds since epoch\nconst q = base + amplitude * (1 + Math.sin(2 * Math.PI * t / period)) / 2;\nreturn { topic: 'q_in', payload: q, unit: 'm3/s', timestamp: Date.now() };",
"outputs": 1, "outputs": 1,
"noerr": 0, "noerr": 0,
"initialize": "", "initialize": "",