A pool-pump variable-speed cost calculator + schedule optimizer — part of the APEX Pools / PLA toolset by name, but technically standalone (see below). Entirely client-side: pick a pump, filter, and electricity rate, and it estimates running cost, water turnover, and the cheapest schedule to hit a turnover target. Three tabs:
Live: https://wohara010--9de0ccb6135711f183cd42dde27851f2.web.val.run
Named for and branded to the APEX Pools business, but there's no runtime coupling to PLA — no shared database, no cross-val fetch. Unlike pool-pricing-calculator, this is fully self-contained (a field/customer pump-sizing tool). Its only state is browser localStorage.
main.tsx (http) — the entire app. The handler just returns one big HTML string; all logic is client-side JS inside it. No API routes.Browser localStorage only (key pla-vsp-state-v2): pump, filter, pool volume, head factor, rate/TOU settings, speed programs, recommender target, and the saved comparison list. No server-side storage, no auth, no cross-device sync.
VS — variable-speed pumps, each with a power curve [rpm, gpm, watts].SS — single-speed pumps (watts / gpm / amps / volts).FILTERS — DE / cartridge / sand filters + max GPM (+ custom).SR — per-US-state residential $/kWh (EIA Aug 2025 / NEADA), plus a z2s() ZIP-prefix→state table.These are point-in-time reference data — the rates are dated Aug 2025 and will go stale.
costSegs() is the single source of truth for all $ math. Segments are {watts, hrs}. Flat rate = watts/1000 × hrs × rate. TOU: off-peak hours are a shared daily budget the highest-wattage segments claim first (optimal placement + the app's stated scheduling assumption); hours beyond the off-peak window bill at peak. Per-segment costs always sum to the total.interp() interpolates the pump curve at an RPM; effGPM() = min(rawGPM × headFactor, filterMax) — plumbing derate + filter cap. Over-pumping past the filter max adds cost, not turnover credit (the "over" flag/alerts).recommendSchedule() searches single- and two-speed plans, capped at 16h/day, durations rounded up to 15-min steps, preferring the simpler single-speed unless two-speed saves ≥3%.None.
costSegs(); everything else derives from it.VS / SS / FILTERS / SR (rates are EIA Aug 2025).pla-vsp-state-v2) — no server persistence, no PLA coupling.