Inspiration

Every summer in my city, I watch our colony go dark during peak demand hours — not because there isn't enough electricity being generated somewhere across the grid, but because the distribution network cannot route it efficiently to where it is actually needed. India loses approximately 22% of all generated electricity as Aggregate Technical and Commercial (AT&C) losses, against a global benchmark of around 6% in developed grid systems. That is not a generation failure. That is a routing failure.

The answer came from an unlikely place — a botany textbook.

I then was reading about the Münch Pressure-Flow Hypothesis, the mechanism by which plants transport photosynthate (sucrose) through their phloem vascular network across distances of metres, sometimes tens of metres, without a single motor or pump. High-pressure source nodes — the photosynthesising leaves — push sap toward low-pressure sink nodes — the roots, fruits, and growing tissue — with the network dynamically redistributing flow in real time as demand shifts. When a new fruit develops, it becomes a strong sink and the network re-routes toward it automatically. No centralised controller. No wasted energy on active pumping. Just elegant, self-regulating pressure-driven adaptation refined over 400 million years. The question that kept me up that night: what if we ran our power distribution grids the same way a tree runs its veins?

That question became PhloSync.

What it does

PhloSync is an AI-powered smart grid optimisation system that models electrical distribution networks as phloem vascular networks. Every substation, feeder node, and renewable generation point is classified in real time as either a source (generation surplus) or a sink (demand deficit), exactly as plant phloem classifies leaf tissue and root tissue. A biologically-inspired pressure differential — computed as: ΔP=πsource−πsink\Delta P = \pi_{\text{source}} - \pi_{\text{sink}}ΔP=πsource​−πsink​ — drives the flow routing algorithm, directly mimicking the Münch osmotic pressure gradient that governs bulk flow in plant phloem.

Concretely, PhloSync does four things:

1.Demand Forecasting — A LightGBM + LSTM ensemble predicts per-node load demand at 15-minute intervals, using features including time-of-day, temperature, day type, and historical consumption. Each node is classified as source (surplus) or sink (deficit) every cycle.

2.Phloem Graph Construction — A live NetworkX directed graph models the distribution topology. Node attributes encode osmotic potential (supply/demand ratio) and turgor pressure (voltage headroom). Edge weights encode line impedance and current phloem-pressure differential.

3.Adaptive Rerouting — Google OR-Tools' minimum-cost flow solver runs on the phloem graph each cycle, minimising total transmission loss — modelled as a function of flow magnitude on each edge — subject to the phloem pressure constraints. This replaces static load-flow equations with a biologically-motivated adaptive solver that self-corrects toward equilibrium.

4.Real-Time Dashboard — A Streamlit interface with Plotly live maps visualises the entire grid: colour-coded nodes (green = source, red = high-demand sink, yellow = transitioning), flow volumes, AT&C loss trend charts, and a full rerouting event log.

Projected impact on a Hyderabad-scale city, DISCOM (population: 7.6 million, peak demand ~4,800 MW): approximately 18% reduction in AT&C losses, translating to ₹8,400 crore in annual savings if scaled nationally, and avoidance of 4.2 million metric tonnes of CO₂ per year — calculated at India's current grid emissions intensity of 0.82 kg CO₂/kWh.

How we built it

Phase 1 — Translating Biology into Mathematics We spent the first week not writing a single line of code. Instead, we worked through the original Münch (1930) pressure-flow equations and mapped each biological variable to a grid-theoretic equivalent. Osmotic potential π\pi π became the ratio of nodal generation surplus to local demand. Turgor pressure PP P became available voltage headroom on the feeder. The pressure differential ΔP\Delta P ΔP between adjacent nodes became the edge weight governing allowed flow volume in the optimisation graph. Getting this translation right was the foundation everything else rested on.

Phase 2 — Building the ML Core The LightGBM model handles feature-rich tabular forecasting across nodes — it is fast, interpretable, and handles the non-linear relationship between temperature and peak load well. The LSTM layer on top captures temporal autocorrelation across 96-step (24-hour) windows, handling the periodicity that tree-based models miss. The ensemble output — a per-node demand forecast and source/sink classification — feeds directly into the phloem graph every 15 minutes.

Phase 3 — The Phloem Optimiser OR-Tools' SimpleMinCostFlow solver runs on the phloem graph. The objective is to minimise total weighted transmission loss across all active edges, subject to: (a) flow conservation at every node, (b) capacity constraints on each line, and (c) the phloem pressure constraint that flow on edge (u,v)(u, v) (u,v) is proportional to ΔPuv\Delta P_{uv} ΔPuv​. The solver converges in under 400ms on networks up to 300 nodes.

Phase 4 — Dashboard and Integration Pipeline Streamlit ties the full pipeline together into a single-file deployable application. Plotly Express renders the grid map with live node states. A background scheduler (APScheduler) triggers the 15-minute forecast-and-reroute cycle. All rerouting decisions are logged to a structured CSV for audit and post-hoc analysis.

Challenges we ran into

The biology-to-engineering translation. Phloem pressure-flow is a continuous osmotic process operating across living membrane interfaces. Electrical grids are discrete, impedance-governed systems with hard capacity constraints. Bridging these two domains — specifically, formulating osmotic potential in a way that produced physically meaningful and stable flow distributions on a grid graph — took three failed formulations before we landed on the supply/demand ratio approach. Each failure taught us something about where the analogy breaks down and where it holds.

Solver performance at scale. OR-Tools' min-cost flow is extremely fast, but rebuilding the full phloem graph from scratch every 15 minutes on a 500-node network introduced unacceptable latency (12–15 seconds per cycle). We solved this with an incremental update strategy — only recomputing edge weights for nodes whose source/sink classification changed between cycles — bringing cycle time down to under 2 seconds on the same network.

Accomplishments that we're proud of

1.Successfully translating a 95-year-old plant physiology paper into a functional, real-time graph optimisation algorithm — and having it actually work.

2.Achieving an ensemble demand forecast MAPE of 4.7% on our synthetic test grid — competitive with commercial SCADA forecasting benchmarks in published literature.

3.The entire system is 100% offline-first: no external API dependency, no cloud requirement, deployable on commodity hardware. A Raspberry Pi 4 cluster running 3 nodes handles a 50-substation simulation in real time.

4.End-to-end pipeline latency from raw meter CSV to rerouting decision: under 3 seconds per cycle on a 200-node graph.

5.Formulating a mathematically grounded analogy between osmotic potential and nodal supply/demand ratio that preserves the stability properties of the Münch model — specifically, its tendency to self-correct toward pressure equilibrium without penalty terms or convergence heuristics.

What we learned

We learned that nature is not a metaphor — it is a literal engineering specification. The phloem network is not "like" a distribution system in some poetic sense. It is a distribution system, one that has been solving the exact same optimisation problem — route limited supply to variable demand across a constrained network, minimising energy overhead — for 400 million years. Once we stopped treating the biology as inspiration and started treating it as a blueprint, every design decision became cleaner and more principled.

We also learned that the hardest problems in the energy transition are not about generation. Solar panel efficiency is improving year over year. Wind capacity is scaling. The bottleneck is distribution — the last mile — and that problem is fundamentally algorithmic, not physical.

Mathematically, the Münch model taught us that pressure-driven flow systems have inherent stability properties that standard DC load-flow solvers lack. Because flow is proportional to pressure differential rather than being independently assigned, the system naturally pushes toward equilibrium. This eliminated an entire class of oscillation bugs we expected to encounter and never did.

Finally, we learned to be humble about the gap between a working simulation and a deployable grid tool. The regulatory, safety, and integration challenges of putting any novel algorithm near live electrical infrastructure are enormous — and rightly so. Our next step is not deployment; it is validation with real data under controlled conditions.

What's next for PhloSync

1.TSSPDCL Pilot Partnership — Engage Hyderabad's DISCOM for access to anonymised real feeder telemetry to validate the phloem model against actual AT&C loss figures and stress-test the solver on real topology.

2.IoT and SCADA Integration — Replace the CSV batch ingestion pipeline with live MQTT streaming from smart meters and SCADA RTUs, enabling true real-time rerouting rather than 15-minute batch cycles.

3.Domain Generalisation — The phloem pressure-flow model is domain-agnostic. Water distribution networks, district heating grids, and urban fibre networks all share the same source-sink flow structure. All three are on the roadmap.

Built With

Share this project:

Updates