{ "cells": [ { "cell_type": "markdown", "id": "d3852261", "metadata": {}, "source": [ "# Using power-grid-model for calculations" ] }, { "cell_type": "markdown", "id": "fdc5b02d", "metadata": {}, "source": [ "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. \n", "\n", "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. " ] }, { "cell_type": "markdown", "id": "dbdfef8f", "metadata": {}, "source": [ "## Power flow calculation" ] }, { "cell_type": "markdown", "id": "0513d97e", "metadata": {}, "source": [ "First imports and initialize a basic network" ] }, { "cell_type": "code", "execution_count": 1, "id": "49ae727b", "metadata": {}, "outputs": [], "source": [ "import pandapower as pp\n", "from pandapower.networks import example_simple\n", "\n", "net = example_simple()\n", "# Remove Generator since its not supported yet\n", "net[\"gen\"] = net[\"gen\"].iloc[:0]" ] }, { "cell_type": "markdown", "id": "b3e4879a", "metadata": {}, "source": [ "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()`" ] }, { "cell_type": "code", "execution_count": 2, "id": "456b50b1", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | vm_pu | \n", "va_degree | \n", "p_mw | \n", "q_mvar | \n", "
---|---|---|---|---|
0 | \n", "1.020390 | \n", "50.002110 | \n", "7.776054e-01 | \n", "3.923591e+00 | \n", "
1 | \n", "1.020553 | \n", "50.004272 | \n", "9.659178e-09 | \n", "-5.178393e-08 | \n", "
2 | \n", "1.020553 | \n", "50.004272 | \n", "2.272012e-08 | \n", "-9.998678e-01 | \n", "
3 | \n", "1.007663 | \n", "-99.760602 | \n", "-2.291840e-08 | \n", "-5.021892e-09 | \n", "
4 | \n", "1.007663 | \n", "-99.760602 | \n", "-1.263901e-08 | \n", "2.271646e-08 | \n", "
5 | \n", "1.007687 | \n", "-99.762083 | \n", "7.659661e-14 | \n", "-1.713588e-13 | \n", "
6 | \n", "1.006282 | \n", "-99.606095 | \n", "-8.000000e-01 | \n", "2.900000e+00 | \n", "