pandapower

Pandapower

For powerflow system simulation!

Create an Empty Network

1
pandapower.create.create_empty_network(name='', f_hz=50.0, sn_mva=1, add_stdtypes=True)

This function initializes the pandapower datastructure.

OPTIONAL:
f_hz (float, 50. Default 50hz) - power system frequency in hertz

name (string, None) - name for the network

sn_mva (float, 1e3) - reference apparent power for per unit system

add_stdtypes (boolean, True) - Includes standard types to net

OUTPUT:
net (attrdict) - PANDAPOWER attrdict with empty tables:

EXAMPLE:
net = create_empty_network()

Bus

1
pandapower.create_bus(net, vn_kv, name=None, index=None, geodata=None, type='b', zone=None, in_service=True, max_vm_pu=nan, min_vm_pu=nan, coords=None, **kwargs)

Adds one bus in table net[“bus”].

Busses are the nodes of the network that all other elements connect to.

INPUT:

  • net (pandapowerNet) - The pandapower network in which the element is created
  • vn_kv (float) - The grid voltage level.

OPTIONAL:

  • name (string, default None) - the name for this bus
  • index (int, default None) - Force a specified ID if it is available. If None, the index one higher than the highest already existing index is selected.
  • geodata ((x,y)-tuple, default None) - coordinates used for plotting
  • type (string, default “b”) - Type of the bus. “n” - node, “b” - busbar, “m” - muff
  • zone (string, None) - grid region
  • in_service (boolean) - True for in_service or False for out of service
  • max_vm_pu (float, NAN) - Maximum bus voltage in p.u. - necessary for OPF
  • min_vm_pu (float, NAN) - Minimum bus voltage in p.u. - necessary for OPF
  • coords (list (len=2) of tuples (len=2), default None) - busbar coordinates to plot the bus with multiple points. coords is typically a list of tuples (start and endpoint of the busbar) - Example: [(x1, y1), (x2, y2)]

Electric Model

Result Parameters

net.res_bus

Parameter Datatype Explanation
vm_pu float voltage magnitude [p.u]
va_degree float voltage angle [degree]
p_mw float resulting active power demand [MW]
q_mvar float resulting reactive power demand [Mvar]

net.res_bus_3ph

这是一个dataframe,存储了电力网络中每个三相母线的结果数据。它包含了执行潮流分析(如负载流计算)后的结果,主要用于记录和查看每个目线在网络模拟结束后的电压,相位和其他可能的电气参数。

Parameter Datatype Explanation
vm_a_pu float voltage magnitude:Phase A [p.u]
va_a_degree float voltage angle:Phase A [degree]
vm_b_pu float voltage magnitude:Phase B [p.u]
va_b_degree float voltage angle:Phase B [degree]
vm_c_pu float voltage magnitude:Phase C [p.u]
va_c_degree float voltage angle:Phase C [degree]
p_a_mw float resulting active power demand:Phase A [MW]
q_a_mvar float resulting reactive power demand:Phase A [Mvar]
p_b_mw float resulting active power demand:Phase B [MW]
q_b_mvar float resulting reactive power demand:Phase B [Mvar]
p_c_mw float resulting active power demand:Phase C [MW]
q_c_mvar float resulting reactive power demand:Phase C [Mvar]
unbalance_percent float unbalance in percent defined as the ratio of V0 and V1 according to IEC 6

net.res_bus_est

存储电力网络中母线的状态估计结果。状态估计是电力系统监控和运营中的一种关键技术

The state estimation results are put into net.res_bus_est with the same definition as in net.res_bus.

Parameter Datatype Explanation
vm_pu float voltage magnitude [p.u]
va_degree float voltage angle [degree]
p_mw float resulting active power demand [MW]
q_mvar float resulting reactive power demand [Mvar]

net.res_bus_sc

它存储了电力网络中每个母线的短路分析结果

The short-circuit (SC) results are put into net.res_bus_sc with following definitions:

Parameter Datatype Explanation
ikss_ka float initial short-circuit current value [kA]
skss_mw float initial short-circuit power [MW]
ip_ka float peak value of the short-circuit current [kA]
ith_ka float equivalent thermal short-circuit current [kA]
rk_ohm float resistive part of equiv. (positive/negative sequence) SC impedance [Ohm]
xk_ohm float reactive part of equiv. (positive/negative sequence) SC impedance [Ohm]
rk0_ohm float resistive part of equiv. (zero sequence) SC impedance [Ohm]
xk0_ohm float reactive part of equiv. (zero sequence) SC impedance [Ohm]

Line Creation

1
pandapower.create_line(net, from_bus, to_bus, length_km, std_type, name=None, index=None, geodata=None, df=1.0, parallel=1, in_service=True, max_loading_percent=nan, alpha=nan, temperature_degree_celsius=nan, **kwargs)

Creates a line element in net[“line”] The line parameters are defined through the standard type library.

INPUT:

  • net - The net within this line should be created
  • from_bus (int) - ID of the bus on one side which the line will be connected with
  • to_bus (int) - ID of the bus on the other side which the line will be connected with
  • length_km (float) - The line length in km
  • std_type (string) - Name of a standard linetype :Pre-defined in standard_linetypesorCustomized std_type made using
  • create_std_type()

OPTIONAL:

  • name (string, None) - A custom name for this line
  • index (int, None) - Force a specified ID if it is available. If None, the index one higher than the highest already existing index is selected.
  • geodata (Iterable[Tuple[int, int]|Tuple[float, float]], default None) - The geodata of the line. The first element should be the coordinates of from_bus and the last should be the coordinates of to_bus. The points in the middle represent the bending points of the line
  • in_service (boolean, True) - True for in_service or False for out of service
  • df (float, 1) - derating factor: maximal current of line in relation to nominal current of line (from 0 to 1)
  • parallel (integer, 1) - number of parallel line systems
  • max_loading_percent (float) - maximum current loading (only needed for OPF)
  • alpha (float) - temperature coefficient of resistance: R(T) = R(T_0) * (1 + alpha * (T - T_0)))
  • temperature_degree_celsius (float) - line temperature for which line resistance is adjusted
  • tdpf (bool) - whether the line is considered in the TDPF calculation
  • wind_speed_m_per_s (float) - wind speed at the line in m/s (TDPF)
  • wind_angle_degree (float) - angle of attack between the wind direction and the line (TDPF)
  • conductor_outer_diameter_m (float) - outer diameter of the line conductor in m (TDPF)
  • air_temperature_degree_celsius (float) - ambient temperature in °C (TDPF)
  • reference_temperature_degree_celsius (float) - reference temperature in °C for which r_ohm_per_km for the line is specified (TDPF)
  • solar_radiation_w_per_sq_m (float) - solar radiation on horizontal plane in W/m² (TDPF)
  • solar_absorptivity (float) - Albedo factor for absorptivity of the lines (TDPF)
  • emissivity (float) - Albedo factor for emissivity of the lines (TDPF)
  • r_theta_kelvin_per_mw (float) - thermal resistance of the line (TDPF, only for simplified method)
  • mc_joule_per_m_k (float) - specific mass of the conductor multiplied by the specific thermal capacity of the material (TDPF, only for thermal inertia consideration with tdpf_delay_s parameter)

OUTPUT:

  • index (int) - The unique ID of the created line

EXAMPLE:

1
create_line(net, “line1”, from_bus = 0, to_bus = 1, length_km=0.1, std_type=”NAYY 4x50 SE”)
1
pandapower.create_line_from_parameters(net, from_bus, to_bus, length_km, r_ohm_per_km, x_ohm_per_km, c_nf_per_km, max_i_ka, name=None, index=None, type=None, geodata=None, in_service=True, df=1.0, parallel=1, g_us_per_km=0.0, max_loading_percent=nan, alpha=nan, temperature_degree_celsius=nan, r0_ohm_per_km=nan, x0_ohm_per_km=nan, c0_nf_per_km=nan, g0_us_per_km=0, endtemp_degree=nan, **kwargs)

Creates a line element in net[“line”] from line parameters.

INPUT:

  • net - The net within this line should be created
  • from_bus (int) - ID of the bus on one side which the line will be connected with
  • to_bus (int) - ID of the bus on the other side which the line will be connected with
  • length_km (float) - The line length in km
  • r_ohm_per_km (float) - line resistance in ohm per km
  • x_ohm_per_km (float) - line reactance in ohm per km
  • c_nf_per_km (float) - line capacitance (line-to-earth) in nano Farad per km
  • r0_ohm_per_km (float) - zero sequence line resistance in ohm per km
  • x0_ohm_per_km (float) - zero sequence line reactance in ohm per km
  • c0_nf_per_km (float) - zero sequence line capacitance in nano Farad per km
  • max_i_ka (float) - maximum thermal current in kilo Ampere

OPTIONAL:

  • name (string, None) - A custom name for this line
  • index (int, None) - Force a specified ID if it is available. If None, the index one higher than the highest already existing index is selected.
  • in_service (boolean, True) - True for in_service or False for out of service
  • type (str, None) - type of line (“ol” for overhead line or “cs” for cable system)
  • df (float, 1) - derating factor: maximal current of line in relation to nominal current of line (from 0 to 1)
  • g_us_per_km (float, 0) - dielectric conductance in micro Siemens per km
  • g0_us_per_km (float, 0) - zero sequence dielectric conductance in micro Siemens per km
  • parallel (integer, 1) - number of parallel line systems
  • geodata (array, default None, shape= (,2)) - The geodata of the line. The first row should be the coordinates of bus a and the last should be the coordinates of bus b. The points in the middle represent the bending points of the line
  • max_loading_percent (float) - maximum current loading (only needed for OPF)
  • alpha (float) - temperature coefficient of resistance: R(T) = R(T_0) * (1 + alpha * (T - T_0)))
  • temperature_degree_celsius (float) - line temperature for which line resistance is adjusted
  • tdpf (bool) - whether the line is considered in the TDPF calculation
  • wind_speed_m_per_s (float) - wind speed at the line in m/s (TDPF)
  • wind_angle_degree (float) - angle of attack between the wind direction and the line (TDPF)
  • conductor_outer_diameter_m (float) - outer diameter of the line conductor in m (TDPF)
  • air_temperature_degree_celsius (float) - ambient temperature in °C (TDPF)
  • reference_temperature_degree_celsius (float) - reference temperature in °C for which r_ohm_per_km for the line is specified (TDPF)
  • solar_radiation_w_per_sq_m (float) - solar radiation on horizontal plane in W/m² (TDPF)
  • solar_absorptivity (float) - Albedo factor for absorptivity of the lines (TDPF)
  • emissivity (float) - Albedo factor for emissivity of the lines (TDPF)
  • r_theta_kelvin_per_mw (float) - thermal resistance of the line (TDPF, only for simplified method)
  • mc_joule_per_m_k (float) - specific mass of the conductor multiplied by the specific thermal capacity of the material (TDPF, only for thermal inertia consideration with tdpf_delay_s parameter)

OUTPUT:

  • index (int) - The unique ID of the created line

EXAMPLE:

1
create_line_from_parameters(net, “line1”, from_bus = 0, to_bus = 1, lenght_km=0.1, r_ohm_per_km = .01, x_ohm_per_km = 0.05, c_nf_per_km = 10, max_i_ka = 0.4)

net.line

This is for defining a line with length zero leads to a division by zero in the power flow and is therefore for the same reason.

Parameter Datatype Value Range Explanation
name string name of the line
std_type string standard type which can be used to easily define line parameters with the pandapower standard type library
from_bus* integer Index of bus where the line starts
to_bus* integer Index of bus where the line ends
length_km* float > 0 length of the line [km]
r_ohm_per_km* float ≥ 0 resistance of the line [Ohm per km]
x_ohm_per_km* float ≥ 0 inductance of the line [Ohm per km]
c_nf_per_km* float ≥ 0 capacitance of the line (line-to-earth) [nano Farad per km]
r0_ohm_per_km**** float ≥ 0 zero sequence resistance of the line [Ohm per km]
x0_ohm_per_km**** float ≥ 0 zero sequence inductance of the line [Ohm per km]
c0_nf_per_km**** float ≥ 0 zero sequence capacitance of the line [nano Farad per km]
g_us_per_km* float ≥ 0 dielectric conductance of the line [micro Siemens per km]
max_i_ka* float > 0 maximal thermal current [kilo Ampere]
parallel* integer ≥ 1 number of parallel line systems
df* float 0…1 derating factor (scaling) for max_i_ka
type string Naming conventions:“ol” - overhead line“cs” - underground cable system type of line
max_loading_percent** float > 0 Maximum loading of the line
endtemp_degree*** float > 0 Short-Circuit end temperature of the line
in_service* boolean True / False specifies if the line is in service.

*necessary for executing a balanced power flow calculation
** optimal power flow parameter
***short-circuit calculation parameter
**** necessary for executing a three phase power flow / single phase short circuit .. note:

net.line_geodata

Parameter Datatype Explanation
coords list List of (x,y) tuples that mark the inflexion points of the line

Switch

1
pandapower.create.create_switch(net, bus, element, et, closed=True, type=None, name=None, index=None, z_ohm=0, in_ka=nan, **kwargs)

Adds a switch in the net[“switch”] table.

Switches can be either between two buses (bus-bus switch) or at the end of a line or transformer element (bus-element switch).

Two buses that are connected through a closed bus-bus switches are fused in the power flow if the switch is closed or separated if the switch is open.

An element that is connected to a bus through a bus-element switch is connected to the bus if the switch is closed or disconnected if the switch is open.

INPUT:

  • net (pandapowerNet) - The net within which this switch should be created

  • bus - The bus that the switch is connected to

  • element - index of the element: bus id if et == “b”, line id if et == “l”, trafo id if et == “t”

    • et - (string) element type: “l” = switch between bus and line, “t” = switch between

      bus and transformer, “t3” = switch between bus and transformer3w, “b” = switch between two buses

OPTIONAL:

  • closed (boolean, True) - switch position: False = open, True = closed
  • type (int, None) - indicates the type of switch: “LS” = Load Switch, “CB” = Circuit Breaker, “LBS” = Load Break Switch or “DS” = Disconnecting Switch
    • z_ohm (float, 0) - indicates the resistance of the switch, which has effect only on bus-bus switches, if sets to 0, the buses will be fused like before, if larger than 0 a branch will be created for the switch which has also effects on the bus mapping
  • name (string, default None) - The name for this switch
  • in_ka (float, default None) - maximum current that the switch can carry
    • normal operating conditions without tripping

OUTPUT:

sid - The unique switch_id of the created switch

EXAMPLE:

create_switch(net, bus = 0. element = 1, et = ‘b’, type = ‘LS’, z_ohm = 0.1)

create_switch(net, bus = 0. element = 1, et = ‘I’)

Input Parameters of net.switch

Parameter Datatype Value Range Explanation
bus* integer index of connected bus
name string name of the switch
element* integer index of the element the switch is connected to:- bus index if et = “b”- line index if et = “l”- trafo index if et = “t”
et* string “b” - bus-bus switch“l” - bus-line switch“t” - bus-trafo“t3” - bus-trafo3w switch element type the switch connects to
type string naming conventions:“CB” - circuit breaker“LS” - load switch“LBS” - load break switch“DS” - disconnecting switch type of switch
closed* boolean True / False signals the switching state of the switch
in_ka* float >0 maximum current that the switch can carry under normal operating conditions without tripping

Load

1
pandapower.create_load(net, bus, p_mw, q_mvar=0, const_z_percent=0, const_i_percent=0, sn_mva=nan, name=None, scaling=1.0, index=None, in_service=True, type='wye', max_p_mw=nan, min_p_mw=nan, max_q_mvar=nan, min_q_mvar=nan, controllable=nan, **kwargs)

Adds one load in table net[“load”].

All loads are modelled in the consumer system, meaning load is positive and generation is negative active power. Please pay attention to the correct signing of the reactive power as well.

INPUT:

  • net - The net within this load should be created
  • bus (int) - The bus id to which the load is connected

OPTIONAL:

  • p_mw (float, default 0) - The active power of the load
    • positive value -> load
    • negative value -> generation
  • q_mvar (float, default 0) - The reactive power of the load
  • const_z_percent (float, default 0) - percentage of p_mw and q_mvar that will be associated to constant impedance load at rated voltage
  • const_i_percent (float, default 0) - percentage of p_mw and q_mvar that will be associated to constant current load at rated voltage
  • sn_mva (float, default None) - Nominal power of the load
  • name (string, default None) - The name for this load
  • scaling (float, default 1.) - An OPTIONAL scaling factor. Multiplies with p_mw and q_mvar.
  • type (string, ‘wye’) - type variable to classify the load: wye/delta
  • index (int, None) - Force a specified ID if it is available. If None, the index one higher than the highest already existing index is selected.
  • in_service (boolean) - True for in_service or False for out of service
  • max_p_mw (float, default NaN) - Maximum active power load - necessary for controllable loads in for OPF
  • min_p_mw (float, default NaN) - Minimum active power load - necessary for controllable loads in for OPF
  • max_q_mvar (float, default NaN) - Maximum reactive power load - necessary for controllable loads in for OPF
  • min_q_mvar (float, default NaN) - Minimum reactive power load - necessary for controllable loads in OPF
  • controllable (boolean, default NaN) - States, whether a load is controllable or not. Only respected for OPF; defaults to False if “controllable” column exists in DataFrame

OUTPUT:

  • index (int) - The unique ID of the created element

EXAMPLE:

  • create_load(net, bus=0, p_mw=10., q_mvar=2.)

state:

Action:

Donate
  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
  • Copyrights © 2021-2024 Mingwei Li
  • Visitors: | Views:

Buy me a bottle of beer please~

支付宝
微信