#!/usr/bin/env python # coding: utf-8 # # Using power-grid-model for calculations # power-grid-model is a Python library for steady-state distribution power system analysis. The core of the library is written in C++. Using it for calculation can give a significant boost to performance, especially for asymmetric calculations. # # Currently power-grid-model supports limited components hence some of components or features are not supported. You can find the complete details about them [here](https://power-grid-model-io.readthedocs.io/en/stable/converters/pandapower_converter.html). An exception will be raised for them. # ## Power flow calculation # First imports and initialize a basic network # In[1]: import pandapower as pp from pandapower.networks import example_simple net = example_simple() # Remove Generator since its not supported yet net["gen"] = net["gen"].iloc[:0] # A powerflow can be run using power-grid-model for calculation by using the `pp.runpp_pgm` function. The function has its own arguments different from `pp.runpp()` # In[2]: pp.runpp_pgm(net) net.res_bus # To know more about the library, refer to [power-grid-model](https://github.com/alliander-opensource/power-grid-model) and repository and [power-grid-model documentation](https://power-grid-model.readthedocs.io/en/stable/). The conversion from pandapower net to and from power-grid-model is handled by [power-grid-model-io](https://github.com/alliander-opensource/power-grid-model-io) ([power-grid-model-io documentation](https://power-grid-model-io.readthedocs.io/en/stable/)). # # The user however would usually not have to concern with these as power-grid-model is integrated into pandapower powerflow functions directly.