Data structures in Julia to enable power systems analysis. Part of the Scalable Integrated Infrastructure Planning Initiative at the National Renewable Energy Lab.
From time to time, issues come up relating to confusion about the various units systems PowerSystems uses — natural units (which may perhaps be subdivided into mega- vs. kilo-, etc.), device base units, and system base units; where in the latter two cases the units are defined in reference to a per-device or per-system reference quantity. Some of these issues are:
To be thorough, the units issue can be broken down into a few parts:
What units are used when creating components, before the component is attached to a system?
What units are used when calling setters on components?
What units are used when interpreting data from getters?
What units are used in the various built-in printout formats?
What units are used internally (for numerical stability and such)?
In theory, most of these issues can be eliminated by forcing the user to specify units as a keyword argument all over the place, or by having sensible, well-documented defaults and allowing the user to specify units if they want something different. I think a more robust solution, which would put all the units logic in a single place and automatically provide a consistent interface wherever units appear, is something along the lines of Unitful.jl that attaches units directly to quantities themselves. In either case, a significant refactor is required. I'm hoping that for the next major release of PowerSystems, we can solve this problem holistically and give the user a simple mental model of how PowerSystems deals with units systems. Let's use this issue to track our progress.
From time to time, issues come up relating to confusion about the various units systems PowerSystems uses — natural units (which may perhaps be subdivided into mega- vs. kilo-, etc.), device base units, and system base units; where in the latter two cases the units are defined in reference to a per-device or per-system reference quantity. Some of these issues are:
To be thorough, the units issue can be broken down into a few parts:
In theory, most of these issues can be eliminated by forcing the user to specify units as a keyword argument all over the place, or by having sensible, well-documented defaults and allowing the user to specify units if they want something different. I think a more robust solution, which would put all the units logic in a single place and automatically provide a consistent interface wherever units appear, is something along the lines of Unitful.jl that attaches units directly to quantities themselves. In either case, a significant refactor is required. I'm hoping that for the next major release of PowerSystems, we can solve this problem holistically and give the user a simple mental model of how PowerSystems deals with units systems. Let's use this issue to track our progress.