A Compositional Semantics for Power Flow in Active Distribution Networks: Structured Cospans, Fibred Microgrid Models, and the Locality of Topological Updates
DOI:
https://doi.org/10.56947/jmer.v7.3Keywords:
Applied category theory, compositional modelling, power flow analysis, distributed energy resources, microgrids, Grothendieck construction, Kron reduction, nested dissectionAbstract
Distributed energy resources have turned passive radial feeders into active networks whose topology and control configuration change on operational timescales. Each such change invalidates the global algebraic objects on which conventional power flow analysis rests, and the analyst is left without a principled account of which parts of a previously computed solution remain valid. This paper supplies that account. We give a compositional semantics for the steady-state AC power flow problem in which open subnetworks are the morphisms of a hypergraph category built by structured cospans, and the observable behaviour of a subnetwork is the set of boundary voltage and power pairs extensible to an interior solution. We prove that this assignment is a symmetric monoidal hypergraph functor, so that interconnection of subnetworks corresponds exactly to composition of behaviours; that boundary behaviours are semialgebraic and effectively computable, with a singly exponential bound in the number of interior variables; and that on the linear subcategory the functor specialises to Kron reduction, with functoriality equivalent to the quotient property of Schur complements. Heterogeneous microgrid configurations are organised as the fibres of an indexed category over a base category of grid regions, and the monoidal Grothendieck construction assembles them into a single symmetric monoidal total category in which islanding and mode switching are vertical morphisms and restriction to a subregion is a Cartesian lift. Evaluating a composite behaviour along a composition tree of width w costs (nw³), and we prove a locality theorem: an edit confined to one leaf invalidates only the behaviours on the root path, so the update cost is (w³ depth) and is independent of network size. A reference implementation on a DER-augmented IEEE 33-bus feeder and on replicated multi-feeder systems of up to 2112 buses confirms the theory. The recomputed arithmetic after a local edit is constant at 1.90e3 flops across a 32-fold increase in network size, against a global cost that grows linearly from 2.12e4 to 7.12e5 flops; measured update times are 17 to 21 times faster than global refactorisation for islanding, resynchronisation and dispatch events, and the updated factorisation is bitwise identical to the globally recomputed one. We also show where the approach does not help: the exact nonlinear black-box is intractable in general, the advantage is governed by tree-width rather than by network size, and against a compiled sparse direct solver the absolute wall-clock advantage appears only in the update regime.