Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

create_bus

Definition : create_bus(net, vn_kv, name=None, index=None, geodata=None, ty


pe="b", zone=None, in_service=True, max_vm_pu=nan, min_vm_pu=nan, coord
s=None, **entries)

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)]

OUTPUT:

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

EXAMPLE: create_bus(net, name = "bus1")


create_line
Definition : create_line(net, from_bus, to_bus, length_km, std_type, name=Non
e, index=None, geodata=None, df=1., parallel=1, in_service=True, max_loading_
percent=nan, alpha=nan, temperature_degree_celsius=nan, *, preserve_dtypes=
True, **entries)

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_linetypes or

 Customized 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 (array, default None, shape= (,2L)) - The linegeodata 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

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/m2 (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: create_line(net, "line1", from_bus = 0, to_bus = 1, length_km=0.1,


std_type="NAYY 4x50 SE")

create_load
Definition : create_load(net, bus, p_mw, q_mvar=0, const_z_percent=0, const_i
_percent=0, sn_mva=nan, name=None, scaling=1., index=None, in_service=Tru
e, type='wye', max_p_mw=nan, min_p_mw=nan, max_q_mvar=nan, min_q_mv
ar=nan, controllable=nan, **entries)

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

 postive 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 to be set customly.


Multiplys 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.)

create_gen
Definition : create_gen(net, bus, p_mw, vm_pu=1., sn_mva=nan, name=None,
index=None, max_q_mvar=nan, min_q_mvar=nan, min_p_mw=nan, max_p_mw
=nan, min_vm_pu=nan, max_vm_pu=nan, scaling=1., type=None, slack=False,
controllable=nan, vn_kv=nan, xdss_pu=nan, rdss_ohm=nan, cos_phi=nan, pg_p
ercent=nan, power_station_trafo=nan, in_service=True, slack_weight=0.0,**ent
ries)

Adds a generator to the network.

Generators are always modelled as voltage controlled PV nodes, which is why the
input parameter is active power and a voltage set point. If you want to model a
generator as PQ load with fixed reactive power and variable voltage, please use a
static generator instead.

INPUT:

net - The net within this generator should be created

bus (int) - The bus id to which the generator is connected

p_mw (float, default 0) - The active power of the generator (positive for
generation!)

OPTIONAL:

vm_pu (float, default 0) - The voltage set point of the generator.

sn_mva (float, NaN) - Nominal power of the generator

name (string, None) - The name for this generator

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.

scaling (float, 1.0) - scaling factor which for the active power of the
generator

type (string, None) - type variable to classify generators

controllable (bool, NaN) - True: p_mw, q_mvar and vm_pu limits are
enforced for this generator in OPF

False: p_mw and vm_pu setpoints are enforced and limits are ignored.
defaults to True if "controllable" column exists in DataFrame

slack_weight (float, default 0.0) - Contribution factor for distributed slack


power flow calculation (active power balancing)
powerflow

vn_kv (float, NaN) - Rated voltage of the generator for short-circuit


calculation

xdss_pu (float, NaN) - Subtransient generator reactance for short-circuit


calculation

rdss_ohm (float, NaN) - Subtransient generator resistance for short-circuit


calculation

cos_phi (float, NaN) - Rated cosine phi of the generator for short-circuit
calculation

pg_percent (float, NaN) - Rated pg (voltage control range) of the generator


for short-circuit calculation

power_station_trafo (int, None) - Index of the power station transformer


for short-circuit calculation

in_service (bool, True) - True for in_service or False for out of service

max_p_mw (float, default NaN) - Maximum active power injection -


necessary for OPF

min_p_mw (float, default NaN) - Minimum active power injection -


necessary for OPF

max_q_mvar (float, default NaN) - Maximum reactive power injection -


necessary for OPF

min_q_mvar (float, default NaN) - Minimum reactive power injection -


necessary for OPF

min_vm_pu (float, default NaN) - Minimum voltage magnitude. If not


set the bus voltage limit is taken.

 necessary for OPF.

max_vm_pu (float, default NaN) - Maximum voltage magnitude. If


not set the bus voltage limit is taken.

 necessary for OPF

OUTPUT:

index (int) - The unique ID of the created generator


EXAMPLE:

create_gen(net, 1, p_mw = 120, vm_pu = 1.02)

create_sgen
Definition : create_sgen(net, bus, p_mw, q_mvar=0, sn_mva=nan, name=None
, index=None, scaling=1., type='wye', in_service=True, max_p_mw=nan, min_p
_mw=nan, max_q_mvar=nan, min_q_mvar=nan, controllable=nan, k=nan, rx=n
an, current_source=True, generator_type=None, max_ik_ka=nan, kappa=nan, lr
c_pu=nan, **entries)

Adds one static generator in table net["sgen"].

Static generators are modelled as positive and constant PQ power. This element is
used to model generators with a constant active and reactive power feed-in. If you
want to model a voltage controlled generator, use the generator element instead.

gen, sgen and ext_grid in the grid are modelled in the generator system! If you
want to model the generation of power, you have to assign a positive active power
to the generator. Please pay attention to the correct signing of the reactive power
as well (positive for injection and negative for consumption).

INPUT:

net - The net within this static generator should be created

bus (int) - The bus id to which the static generator is connected

p_mw (float) - The active power of the static generator (positive for
generation!)

OPTIONAL:

q_mvar (float, 0) - The reactive power of the sgen

sn_mva (float, None) - Nominal power of the sgen

name (string, None) - The name for this sgen

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.

scaling (float, 1.) - An OPTIONAL scaling factor to be set customly. Multiplys


with p_mw and q_mvar.
type (string, None) - Three phase Connection type of the static generator:
wye/delta

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

max_p_mw (float, NaN) - Maximum active power injection - necessary for


controllable sgens in OPF

min_p_mw (float, NaN) - Minimum active power injection - necessary for


controllable sgens in OPF

max_q_mvar (float, NaN) - Maximum reactive power injection - necessary


for controllable sgens in OPF

min_q_mvar (float, NaN) - Minimum reactive power injection - necessary


for controllable sgens in OPF

controllable (bool, NaN) - Whether this generator is controllable by the


optimal powerflow; defaults to False if "controllable" column exists in
DataFrame

k (float, NaN) - Ratio of nominal current to short circuit current

rx (float, NaN) - R/X ratio for short circuit impedance. Only relevant if type is
specified as motor so that sgen is treated as asynchronous motor. Relevant
for short-circuit calculation for all generator types

generator_type (str, "None") - can be one of "current_source" (full size


converter), "async" (asynchronous generator), or "async_doubly_fed"
(doubly fed asynchronous generator, DFIG). Represents the type of the static
generator in the context of the short-circuit calculations of wind power
station units. If None, other short-circuit-related parameters are not set

lrc_pu (float, nan) - locked rotor current in relation to the rated generator
current. Relevant if the generator_type is "async".

max_ik_ka (float, nan) - the highest instantaneous short-circuit value in


case of a three-phase short-circuit (provided by the manufacturer). Relevant
if the generator_type is "async_doubly_fed".

kappa (float, nan) - the factor for the calculation of the peak short-
circuit current, referred to the high-voltage side (provided by the
manufacturer). Relevant if the generator_type is
"async_doubly_fed".
If the superposition method is used (use_pre_fault_voltage=True), this
parameter is used to pass through the max. current limit of the machine in
p.u.

current_source (bool, True) - Model this sgen as a current source during


short- circuit calculations; useful in some cases, for example the simulation
of full- size converters per IEC 60909-0:2016.

OUTPUT:

index (int) - The unique ID of the created sgen

EXAMPLE:

create_sgen(net, 1, p_mw = -120)

ConstControl
Definition : ConstControl(net, element, variable, element_index, profile_name=N
one, data_source=None, scale_factor=1.0, in_service=True, recycle=True, order
=-1, level=-1, drop_same_existing_ctrl=False, matching_params=None, initial_ru
n=False, *, index=None, overwrite=False, **kwargs)

Class representing a generic time series controller for a specified element and
variable. Control strategy: "No Control" -> updates values of specified elements
according to timeseries input data. If ConstControl is used without timeseries input
data, it will reset the controlled values to the initial values, preserving the initial net
state. The timeseries values are written to net during time_step before the initial
powerflow run and before other controllers' control_step. It is possible to set
attributes of objects that are contained in a net table, e.g. attributes of other
controllers. This can be helpful e.g. if a voltage setpoint of a transformer tap
changer depends on the time step. An attribute of an object in the "object" column
of a table (e.g. net.controller["object"] -> net.controller.object.at[0, "vm_set_pu"]
can be set if the attribute is specified as "object.attribute" (e.g.
"object.vm_set_pu").

INPUT:

net (attrdict) - The net in which the controller resides

element - element table ('sgen', 'load' etc.)

variable - variable ('p_mw', 'q_mvar', 'vm_pu', 'tap_pos' etc.)

element_index (int[]) - IDs of the controlled elements

data_source (obj) - The data source that provides profile data


profile_name (str[]) - The profile names of the elements in the data source

OPTIONAL:

scale_factor (real, 1.0) - Scaling factor for time series input values

in_service (bool, True) - Indicates if the controller is currently in_service

recycle (bool, True) - Re-use of internal-data in a time series loop.

drop_same_existing_ctrl (bool, False) - Indicates if already existing controllers


of the same type and with the same matching parameters (e.g. at same element)
should be dropped

Note

If multiple elements are represented with one controller, the data source must have
integer columns. At the moment, only the DFData format is tested for the multiple
const control.

run_timeseries
Definition : run_timeseries(net, time_steps=None, continue_on_divergence=Fals
e, verbose=True, check_controllers=True, *, run_control_fct=run_control, output
_writer_fct=_call_output_writer, max_iter=30, **kwargs)

Time Series main function

Runs multiple PANDAPOWER AC power flows based on time series which are stored
in a DataSourceinside Controllers. Optionally other functions than the pp power
flow can be called by setting the run function in kwargs

INPUT:

net - The pandapower format network

OPTIONAL:

time_steps (list or tuple, None) - time_steps to calculate as list or tuple


(start, stop) if None, all time steps from provided data source are simulated

continue_on_divergence (bool, False) - If True time series calculation


continues in case of errors.

verbose (bool, True) - prints progress bar or if logger.level == Debug it


prints debug messages
kwargs - Keyword arguments for run_control and runpp. If "run" is in
kwargs the default call to runpp() is replaced by the function kwargs["run"]

create_poly_cost
Definition : create_poly_cost(net, element, et, cp1_eur_per_mw, cp0_eur=0, cq
1_eur_per_mvar=0, cq0_eur=0, cp2_eur_per_mw2=0, cq2_eur_per_mvar2=0, i
ndex=None, check=True, *, preserve_dtypes=True, **entries)

Creates an entry for polynimoal costs for an element. The currently


supported elements are:

 Generator ("gen")
 External Grid ("ext_grid")
 Static Generator ("sgen")
 Load ("load")
 Dcline ("dcline")
 Storage ("storage")

INPUT:

element (int) - ID of the element in the respective element table

et (string) - Type of element ["gen", "sgen", "ext_grid", "load", "dcline",


"storage"] are possible

cp1_eur_per_mw (float) - Linear costs per MW

cp0_eur=0 (float) - Offset active power costs in euro

cq1_eur_per_mvar=0 (float) - Linear costs per Mvar

cq0_eur=0 (float) - Offset reactive power costs in euro

cp2_eur_per_mw2=0 (float) - Quadratic costs per MW

cq2_eur_per_mvar2=0 (float) - Quadratic costs per Mvar

OPTIONAL:

index (int, index) - Force a specified ID if it is available. If None, the index one
higher than the highest already existing index is selected.

check (bool, True) - raises User Warning if costs already exist to this element.

OUTPUT:

index (int) - The unique ID of created cost entry


EXAMPLE:

The polynomial cost function is given by the linear and quadratic cost
coefficients.

create_poly_cost(net, 0, "load", cp1_eur_per_mw = 0.1)

You might also like