pypowsybl Interface#

"PowSyBl (Power System Blocks) is an open source framework written in Java, dedicated to electrical grid modelling and simulation, licensed under the Mozilla Public License version 2.0. It is part of LF Energy, an open source foundation focused on the power systems sector, hosted within The Linux Foundation."

pypowsybl is the Python interface to PowSybl. For more information, please visit:

https://www.powsybl.org/pages/overview/

ANDES provides a simple interface to pypowsybl. The main goal is to leverage pypowsybl for drawing single-line diagrams and area diagrams for systems loaded in ANDES.

Imports#

import andes
import pypowsybl as pp

from andes.interop.pypowsybl import to_pypowsybl
ss = andes.load(andes.get_case("ieee14/ieee14_linetrip.xlsx"))

Conversion#

Convert to a pypowsybl network:

n = to_pypowsybl(ss)

Run power flow in pypowsybl:

results = pp.loadflow.run_ac(n)

Diagrams#

pypowsybl provides two functions to draw diagrams:

  • get_network_area_diagram(VOLTAGE_LEVEL_ID = None, DEPTH = 0)

  • get_single_line_diagram(CONTAINER_ID)

These function names are self explanatory. To draw the diagram for the whole network, do

n.get_network_area_diagram()
../_images/5648b06b46cd02cefc1dc1e723aaf493ec665e94683d3dd3da04f16cfaf6219c.svg

To draw the SLD for bus 6, do

n.get_single_line_diagram("VL6")
../_images/2cdab1d970579d96bee4c79d51d817870a564e7ca4086225d9898f6185ea890b.svg

where VL6 is the voltage level container created for Bus 6. Voltage level container is named as VL + bus idx.

To find out how to work with pypowsybl, visit its documentation at https://pypowsybl.readthedocs.io