Researchers have developed and verified ESFEX, an open-source energy-system optimization and flexibility analysis framework unifying automated network construction, multi-decade capacity planning, and power flow calculations within a single environment. Benchmarked against eight independent codebases across ten IEEE and PEGASE power grids ranging from 9 to 13,659 busses, the platform reproduced the inter-implementation median consensus with high precision. In direct-current optimal power flow tests on the HiGHS solver, the framework matched consensus costs to within eight parts in ten billion for networks up to 9,241 busses, with voltage angles aligning within nine parts in a billion degrees. In alternating-current evaluations, the software matched consensus generation costs within five parts in ten million and solved the 13,659-bus benchmark in 97.8 seconds.
The software addresses computational compromises that historically limited energy transition planning as power systems integrate unprecedented renewable shares. National decarbonization pathways, including the Danish 100 percent renewable pathway, Japanese flexibility scenarios, and European industrial roadmaps, require resource coordination across multiple physical domains. Planners must secure operational flexibility through generator ramping, reserves, and commitment schedules, while deploying structural flexibility through storage and transmission corridors. To contain problem size, traditional capacity-expansion models aggregate calendar years into representative periods. Although time aggregation limits dimensionality, losing hourly chronology distorts the operational value of storage and flexible resources. Nowadays, several open-source frameworks solve full hourly years, leaving operational and supply-chain simplifications as the primary gap. Electricity cannot be assessed in isolation from heat, transport, and fuels, since omitting primary-energy supply chains overstates feasibility.
While the open-source modeling landscape is mature, existing tools specialize in isolated capabilities rather than offering a unified pipeline. PyPSA provides linear optimal power flow and expansion planning, EnergyPLAN simulates smart-energy systems hourly, and OSeMOSYS supports long-term planning. Switch 2.0 targets high-renewable expansion with operational detail, Calliope emphasizes near-optimal exploration, and the Sienna ecosystem delivers unit commitment and dispatch simulation. Additionally, HOPE provides policy formulations, while oemof and Temoa address energy graphs and technology-explicit planning. Network extraction from OpenStreetMap is established through SciGRID, GridTool, PyPSA-Eur, and PyPSA-Earth. However, capability evaluations indicate that no single framework previously combined automated OpenStreetMap network building, interactive graphical modeling, stochastic expansion, mixed-integer unit commitment, alternating-current optimal power flow, N-1 security, and sector coupling into one integrated distribution.
The architecture of ESFEX is organized as a modular Python application linked to a high-performance Julia optimization back-end. Python manages configuration, data processing, the graphical interface, orchestration, and post-processing, communicating with Julia through the juliacall interface. Core optimization models are formulated in Julia using JuMP, leveraging efficient algebraic abstractions and fast numerical solvers. The software is released under the Apache License 2.0, versioned via git, documented through ReadTheDocs, and archived on Zenodo, requiring Python 3.10 or higher and Julia 1.9 or higher. To ensure reliability and guard against numerical regressions, each push triggers a continuous-integration pipeline. This automated workflow executes the Python test suite across Python versions 3.10 through 3.12 while running native Julia tests that solve small benchmark instances with known optimal values, including direct-current and alternating-current optimal power flow.
To make spatial infrastructure modeling accessible beyond scripting, ESFEX includes an interactive Studio built with PySide6 and Qt featuring an embedded web map, elements tree, and attribute panels. Its Grid Builder constructs georeferenced networks from open data, inferring busses, lines, transformers, and generators while estimating electrical parameters. Because OpenStreetMap is more complete for transmission than distribution, analysts can set voltage scopes and combine map data with power-plant registries and predicted routes. The automated pipeline repairs topology by merging line segments, splitting lines at substations, inferring missing voltages, and auditing connectivity. When parameters are absent, default resistance, reactance, susceptance, and thermal ratings are assigned from nominal voltage, scaled by route length and circuit counts. Networks can also be written in YAML, drawn manually, or imported from GeoJSON, Shapefile, KML, and GeoPackage files.
The operational dispatch core co-optimizes generation, storage, and flows at least cost while enforcing physical grid constraints. The hourly nodal balance equates net power injection to the difference between generation, storage discharge, electric-vehicle grid injections, sectoral demand, storage charging, electric-vehicle charging, electrolyzer consumption, and curtailed energy. The dispatch module operates in three modes: continuous development, fixed-fleet economic dispatch, and mixed-integer unit commitment with minimum up and down times. Network physics can be evaluated using linearized direct-current optimal power flow or alternating-current formulations offering four representations. Direct-current solutions can be verified with alternating-current power flows, enforcing N-1 security in both modes. To screen post-contingency frequency stability, the framework includes a center-of-inertia screening model, while machine-learning workflows estimate spatial demand from socio-economic proxies and generate hourly renewable availability profiles from atmospheric reanalysis data.
Energy storage and operational flexibility mechanisms are formulated with explicit physical dynamics rather than generalized aggregations. Battery systems and pumped-hydro storage are governed by coupled power and energy variables tracking an intertemporal state-of-charge balance that incorporates charging and discharging efficiencies alongside duration bounds. Demand response is explicitly disaggregated by sector, with each nodal component assigned a criticality weight and a bounded deferrable share shiftable within an intra-day window at constant daily energy. Unserved electrical loads are charged at a criticality-weighted value of lost load. The framework quantifies flexibility metrics directly from optimized dispatch schedules, reporting requirements like net-load ramps, provisions including generator ramping, operating reserves, storage state of charge, and vehicle-to-grid power, and shortfalls including reserve deficits, center-of-inertia frequency metrics, curtailment, and unserved energy across alternative scenarios.
For multi-decade planning, ESFEX formulates a two-stage stochastic master problem minimizing total discounted system costs across planning years under probability-weighted scenarios. First-stage variables optimize investment in generation, storage, and transmission, accounting for annualized capital charges, fixed operating costs, and residual retirement values. Asset decommissioning is an endogenous decision evaluated via age-based and net-present-value criteria. Second-stage operational subproblems are linear programs with continuous commitment, keeping stochastic formulations within solvable bounds. The accepted capacity portfolio is re-evaluated year by year in a chronological dispatch that may enforce mixed-integer unit commitment. This ex-post evaluation isolates integer commitment effects without introducing binaries into stochastic subproblems, recording supply shortfalls as unserved energy priced at the value of lost load. Near-optimal exploration uses modeling-to-generate-alternatives and SPORES, while global Sobol analysis propagates uncertainty.
Sector coupling is an extensible, data-driven formulation avoiding hardcoded technology sets. Any electrical, thermal, or chemical end use can be declared as a demand with specific profiles, criticality, and conversion links, allowing power-to-X pathways to be optimized without core code changes. Multi-product facilities such as refineries are modeled as nodes consuming electricity and fuels while delivering non-electric commodities, exposing flexible operating ranges to dispatch without simulating internal chemical kinetics. The fuel model balances supply, imports, transport with losses, storage, strategic reserves, and sectoral non-electric consumption per node and period. Trajectories are directed toward decarbonization goals via policy constraints, including carbon dioxide budgets, technology limits, and minimum renewable requirements. Minimum renewable fraction constraints mandate that renewable generation plus rooftop photovoltaics meet specified annual proportions of total power, with penalized soft slacks quantifying shortfalls.
The numerical correctness of the optimal power-flow core was verified through benchmarking against eight independent open-source tools: PowerModels.jl, Egret, PyPSA, pandapower, PYPOWER, Sienna, GridCal, and SciPy. Testing evaluated ten IEEE and PEGASE networks from 9 to 13,659 busses across twenty-five repetitions against median consensus values. In direct-current benchmarks sharing the HiGHS backend, all nine implementations converged across all systems. For networks up to 9,241 busses, ESFEX matched consensus costs within 8 × 10⁻¹⁰ percent, voltage angles within 9 × 10⁻⁹ degrees, and branch flows within 0.011 megawatts. In alternating-current benchmarks across seven frameworks, three implementations failed on the 13,659-bus system, and GridCal failed on PEGASE 2869 and 9241. ESFEX converged across all cases, matching consensus cost within 5 × 10⁻⁷ percent up to 9,241 busses and 1.5 × 10⁻⁵ percent on the 13,659-bus case, tracking bus voltage magnitudes within 1.1 × 10⁻³ per-unit values.
Computational benchmark trials on an Intel Xeon Gold 6230 workstation with 128 gigabytes of RAM under Ubuntu 22.04 demonstrated significant speed advantages. In direct-current evaluations, ESFEX was the fastest implementation across all ten test cases, solving the 13,659-bus PEGASE system in 12.7 seconds with peak memory below 33 megabytes, compared to 1,211 seconds for the slowest framework. Its runtime share inside HiGHS rose from 22 percent on the 9-bus system to 92 percent on 9,241 busses, showing that model translation ceases to be the computational bottleneck as network size grows. In alternating-current evaluations with Ipopt, ESFEX was fastest on the eight smallest test systems and completed the 13,659-bus case in 97.8 seconds, closely following PowerModels at 89.0 seconds. Fitted power-law scaling exponents reached 1.21 in direct-current and 1.34 in alternating-current formulations.
The benchmarks also highlighted structural phenomena bounding comparisons across tools. Where generators share marginal costs, linear programs admit continuous sets of optimal solutions, causing implementations to terminate at different vertices at identical cost. On IEEE systems, all nine direct-current implementations agreed on dispatch within 4 × 10⁻⁹ megawatts, but on PEGASE 2869 and 9241, dispatch differences reached 420 megawatts at matching costs. On the 13,659-bus system, objective costs split into distinct groups by up to 0.14 percent due to data interpretation differences rather than solver errors. Extrapolating runtimes to a 25-year rolling-horizon study with weekly windows, solving 1,300 operational subproblems requires roughly 24 minutes in ESFEX at the 2,869-bus scale, compared to over two days for slower tools. Full hourly chronology with mixed-integer commitment and alternating-current power flow is tractable for regional grids, while continental networks require representative periods or linearizations.
Subject of Research: Open-source power system optimization and energy flexibility modeling framework
Article Title: ESFEX: an open-source framework for multi-model power-system optimization and energy-flexibility analysis
Article References: Soto Calvo, M., & Lee, H. S. (2026). ESFEX: an open-source framework for multi-model power-system optimization and energy-flexibility analysis. SoftwareX, 36, Article 103244. https://doi.org/10.1016/j.softx.2026.103244
Image Credits: AI Generated
DOI: 10.1016/j.softx.2026.103244
Keywords: ESFEX, power system optimization, optimal power flow, unit commitment, capacity expansion planning, energy flexibility, sector coupling, stochastic programming, JuMP, HiGHS solver, Ipopt, OpenStreetMap, PEGASE test cases, IEEE test systems, primary energy modeling, demand response, N-1 security
Cite Scienmag News
Faith Mcneil. (November 22, 2026). Open-Source Framework ESFEX Matches Benchmark Consensus Across Ten Power Grid Systems. Scienmag. https://scienmag.com/open-source-framework-esfex-matches-benchmark-consensus-across-ten-power-grid-systems/
Faith Mcneil. "Open-Source Framework ESFEX Matches Benchmark Consensus Across Ten Power Grid Systems." Scienmag, 22 November 2026, https://scienmag.com/open-source-framework-esfex-matches-benchmark-consensus-across-ten-power-grid-systems/. Accessed 22 November 2026.
Faith Mcneil. "Open-Source Framework ESFEX Matches Benchmark Consensus Across Ten Power Grid Systems." Scienmag. November 22, 2026. https://scienmag.com/open-source-framework-esfex-matches-benchmark-consensus-across-ten-power-grid-systems/








