All projects

3-Phase Panel Optimizer

Creator

Jun 2026

Personal Project

A constraint solver that auto-generates a house's electrical panels and balances the three phases, so I don't have to do it by hand.

  • TypeScript
  • Bun
  • React 19
  • TanStack Router
  • Vite
  • Tailwind CSS v4
  • Biome
Phase Imbalance Target
< 15%
Architecture
Zero-dep domain core

I’m renovating a house down to the studs, including the electrical work, and doing part of it myself. French residential wiring is governed by NF C 15-100: sound engineering in places (wire gauges matched to breaker ratings, residual-current protection split across devices), bureaucratic sprawl in others (minimum socket counts per room by floor area, mandatory reserve slots). My property spans a main dwelling, a workshop, and a barn, which means a main panel feeding multiple sub-panels, each with its own breakers and compliance rules. Planning that by hand while staying compliant and cheap is exactly the kind of fiddly combinatorial problem I’d rather hand to a computer.

So I built tableau-elec: model each room, sub-panel, and piece of equipment, then auto-generate a draft panel layout that groups circuits under residual-current devices, sizes breakers and cable, and balances the load across the three phases.

The interesting part is the optimizer. On a three-phase supply, every single-phase circuit rides one of three lines, and the norm requires the load spread between the busiest and idlest phase to stay under 15%. Minimizing cost (fewer, cheaper differentials) and maximizing balance pull in opposite directions. The solver handles this with a greedy LPT seed followed by an exact, symmetry-broken depth-first search over phase assignment, wrapped in a branch-and-bound layer that decides when promoting a single-phase sub-panel to three-phase is worth the extra cost. The domain logic (the norm as data, the panel model, the optimizer) is a zero-dependency TypeScript core, deliberately isolated from the UI so it could later back a desktop build without dragging React along.

It’s an early POC, and not a substitute for a certified electrician, but the optimizer core is real and it’s what actually plans my panels today.

My role: sole creator, from domain modelling of the norm to the optimizer and the UI.

Articles about this project

Working on something similar?

Happy to go through the technical details, or look at the same problem in your system.

Book a call