JuliaCon 2025

PowerAnalytics.jl: User-Centric Power Systems Analysis in Julia
2025-07-24 , Main Room 1 (Main stage)

The National Renewable Energy Lab just released version 1 of PowerAnalytics.jl, an analysis module for the outputs of its popular open-source electrical power systems modeling platform Sienna. It features an extensible framework to process results in the Sienna style while keeping the interface as simple as possible for non-Julia experts. I’ll present on how I harnessed user-oriented design and Julia features to create such a package and what we might learn from its design and implementation.


Sienna is a state-of-the-art, open-source platform for multi-timescale electrical power systems modeling developed at the National Renewable Energy Laboratory (NREL). It consists of a suite of Julia packages, including InfrastructureSystems.jl and PowerSystems.jl, which together define data structures to flexibly represent a power system, its components, and associated parameters and time series data; and PowerSimulations.jl, which interfaces with JuMP to facilitate the creation of operational optimization problems and manage simulation workflows. While PowerSystems.jl manages inputs and PowerSimulations.jl handles simulation, PowerAnalytics.jl operates at the end of the workflow, serving as an output analysis tool accessible to the typical energy analyst, who can write simple scripts in Julia but is not an expert programmer.

PowerAnalytics version 1 (source at https://github.com/NREL-Sienna/PowerAnalytics.jl, docs under construction at https://nrel-sienna.github.io/PowerAnalytics.jl/stable/) is a completely novel approach to operational simulation results post-processing that takes full advantage of Julia features to present the simplest interface possible to the Sienna user without sacrificing performance. The design begins with the ComponentSelector, a set of types that represent lazy, grouped collections of components. With a core interface similar to existing PowerSystems.jl API, they let the user reapply their existing Sienna knowledge; with grouping semantics similar to SQL’s GROUP BY, they enable sophisticated analytics queries; and through the magic of multiple dispatch, new ComponentSelector types can be added completely invisibly to the user. The other main concept is the Metric, a (typically time series) quantity calculated on the groups of a ComponentSelector given a particular set of simulation results. Metrics encapsulate arbitrary code to enable sophisticated analytics while harnessing Julia’s inherent speed to make this performant even on simulations of an entire power grid; support intelligent default aggregation behavior; and through a functor pattern appear to the casual user just like functions. PowerAnalytics.jl provides a library of pre-built Metrics; users can also take advantage of multiple dispatch to define new Metrics either from scratch or by composition from other Metrics via a functional programming interface. The output of a Metric is a DataFrames.jl DataFrame, chosen to minimize the number of new types the user must wrangle, while details about the computation are embedded in the DataFrame’s metadata to support further processing and plotting.

The design of PowerAnalytics 1 was centered on the Sienna user’s needs at every step of the process, resulting in a package that allows one to leverage the full expressivity of the Sienna data model to accomplish a broad array of analytics tasks, while working completely within the ComponentSelector-Metric framework that simplifies code and eliminates places for bugs to hide. Taking a real-world analytics script written manually by an NREL power systems researcher and rewriting it using PowerAnalytics 1, the number of lines of code was reduced by two thirds and several subtle bugs were eliminated. Already, PowerAnalytics 1 has been used to support power system studies within NREL, and with its recent official release, we expect to see fast adoption outside the lab by users in state institutions and internationally to improve results communication and stakeholder engagement.

In this talk, I will cover how PowerAnalytics fits into the general Sienna platform; describe the user-centered design, software engineering, and Julia language techniques employed to create a powerful yet approachable domain specific analytics package in the Sienna style; discuss how the package is being used, and conclude with some lessons that might be applied to the design of other Julia packages.

Hello, world! I’m Gabriel, a computational renewable energy researcher from Minneapolis, Minnesota. I’m currently full time at the National Renewable Energy Laboratory (NREL) near Golden, Colorado, where I work in the Grid Planning and Analysis Center developing software models to help create more climate-friendly electrical grids. I’m passionate about applying theoretical computer science for concrete societal benefit. I spend my free time hiking, camping, discussing philosophy, and exploring Wikipedia. You can see some of my projects on my personal website at https://www.gabrielks.com .

This speaker also appears in: