External Grid

Create Function

pandapower.create_ext_grid(net, bus, vm_pu=1.0, va_degree=0., name=None, in_service=True, s_sc_max_mva=nan, s_sc_min_mva=nan, rx_max=nan, rx_min=nan, max_p_kw=nan, min_p_kw=nan, max_q_kvar=nan, min_q_kvar=nan, index=None)

Creates an external grid connection.

External grids represent the higher level power grid connection and are modelled as the slack bus in the power flow calculation.


net - pandapower network

bus (int) - bus where the slack is connected


vm_pu (float, default 1.0) - voltage at the slack node in per unit

va_degree (float, default 0.) - voltage angle at the slack node in degrees*

name (string, default None) - name of of the external grid

in_service (boolean) - True for in_service or False for out of service

Sk_max - maximal short circuit apparent power **

SK_min - maximal short circuit apparent power **

RX_max - maximal R/X-ratio **

RK_min - minimal R/X-ratio **

* only considered in loadflow if calculate_voltage_angles = True

** only needed for short circuit calculations

create_ext_grid(net, 1, voltage = 1.03)

Input Parameters


Parameter Datatype Value Range Explanation
name string   name of the external grid
bus* integer   index of connected bus
vm_pu* float \(>\) 0 voltage set point [p.u]
va_degree* float   angle set point [degree]
max_p_kw** float   Maximum active power
min_p_kw** float   Minimum active power
max_q_kvar** float   Maximum reactive power
min_q_kvar** float   Minimum reactive power
s_sc_max_mva*** float \(>\) 0 maximum short circuit power provision [MVA]
s_sc_min_mva*** float \(>\) 0 minimum short circuit power provision [MVA]
rx_max*** float 0...1 maxium R/X ratio of short-circuit impedance
rx_min*** float 0...1 minimum R/X ratio of short-circuit impedance
in_service* boolean True / False specifies if the external grid is in service.

*necessary for executing a power flow calculation
**optimal power flow parameter
***short-circuit calculation parameter

Electric Model

The external grid is modelled as a voltage source in the power flow calculation, which means the node the grid is connected to is treated as a slack node:

alternate Text


\begin{align*} \underline{v}_{bus} &= vm\_pu \cdot e^{j \cdot \theta} \\ \theta &= shift\_degree \cdot \frac{\pi}{180} \end{align*}

Result Parameters


Parameter Datatype Explanation
p_kw float active power supply at the external grid [kW]
q_kvar float reactive power supply at the external grid [kVar]

Active and reactive power feed-in / consumption at the slack node is a result of the power flow:

\begin{align*} p\_kw &= P_{eg} \\ q\_kvar &= Q_{eg} \end{align*}


All power values are given in the consumer system, therefore p_kw is positive if the external grid is absorbing power and negative if it is supplying power.