gpf#

gpf solves the steady-state power flow of large electric power systems, and runs the planning, reliability, and market studies that build on it. The model, the solver, and the studies are reachable three ways: a Python API, the gpf command line, and an MCP server that lets an AI assistant load a case and run studies on its own.

Case tooling

RAW, RAWX, MATPOWER, and supported OpenDSS files in; RAW and RAWX out. Buses, branches, generators, and controls are validated, editable objects. Cases compare at the record level and at the solution level, with impact reports and drift checks against a stored snapshot. Case merge, an append-only edit ledger with rollback, and portable project snapshots carry project resources between people and machines.

Power flow

HVDC, switched shunts, tap changers, phase shifters, area interchange, and reactive limits are enforced during the solve. PTDF, LODF, and OTDF factors are taken at the solved AC point, not at a DC approximation of it. Phase-domain power flow supports unbalanced distribution systems. Explicit ports combine transmission and distribution regions in one mixed-system solve.

Reliability studies

N-1 studies defined in a file or a study definition are solved in one batched pass, with the violations rolled up per contingency and judged against criteria. Post-contingency remedies are proposed over a control set and verified on the AC power flow. Interconnection headroom reports how much a candidate point of interconnection can inject before the first violation, ranked across projects.

Markets and economics

DC-OPF, security-constrained economic dispatch over a horizon, and security-constrained OPF with corrective actions each report locational prices. Transfer capability reports how much a source can send to a sink before an element binds, with the limiters ranked and optionally certified on the AC power flow. Transmission rights clear an auction under simultaneous feasibility and value a position against a congestion outcome. Outage, load, and dispatch scenarios are solved together, then costed or valued across the set.

The documentation comes in two volumes.

User Guide

Installation, runnable tutorials, task recipes, connecting an AI assistant, and the modeling reference that defines what the solver does with each device family. Start here.

Reference

The Python API, the gpf command and its subcommands, the support matrix, field-level format conformance, and the case doctor's finding codes. Written to be searched rather than read.