Static Generator

Note

Static generators should always have a positive p_mw value, since all power values are given in the generator convention. If you want to model constant power consumption, it is recommended to use a load element instead of a static generator with negative active power value. If you want to model a voltage controlled generator, use the generator element.

Create Function

pandapower.create.create_sgen(net, bus, p_mw, q_mvar=get_default_value('sgen', 'q_mvar'), sn_mva=nan, name=pd.NA, index=None, scaling=get_default_value('sgen', 'scaling'), type=None, in_service=get_default_value('sgen', 'in_service'), max_p_mw=nan, min_p_mw=nan, max_q_mvar=nan, min_q_mvar=nan, controllable=pd.NA, k=nan, rx=nan, id_q_capability_characteristic=pd.NA, reactive_capability_curve=pd.NA, curve_style=pd.NA, current_source=get_default_value('sgen', 'current_source'), generator_type=pd.NA, max_ik_ka=nan, kappa=nan, lrc_pu=nan, **kwargs)

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

Parameters:
  • net (pandapowerNet) – The net within this static generator should be created

  • bus (int | integer) – The bus id to which the static generator is connected

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

  • q_mvar (float) – The reactive power of the sgen

  • sn_mva (float) – Nominal power of the sgen

  • name (str | NAType) – The name for this sgen

  • index (int | integer | 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) – An optional custom scaling factor. Multiplies with p_mw and q_mvar.

  • type (str | None) – Three phase Connection type of the static generator: wye/delta

  • in_service (bool) – True for in_service or False for out of service

  • max_p_mw (float) – Maximum active power injection - necessary for controllable sgens in OPF

  • min_p_mw (float) – Minimum active power injection - necessary for controllable sgens in OPF

  • max_q_mvar (float) – Maximum reactive power injection - necessary for controllable sgens in OPF

  • min_q_mvar (float) – Minimum reactive power injection - necessary for controllable sgens in OPF

  • controllable (bool | NAType) – Whether this generator is controllable by the optimal powerflow; defaults to False if “controllable” column exists in DataFrame

  • k (float) – Ratio of short circuit current to nominal current

  • rx (float) – 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

  • reactive_capability_curve (bool | NAType) – True if both the id_q_capability_characteristic and the curve style are present in the generator

  • id_q_capability_characteristic (int | NAType) – references the index of the characteristic from the net.q_capability_characteristic table (id_q_capability_curve column)

  • curve_style (str | NAType) – The curve style of the generator represents the relationship between active power (P) and reactive power (Q). It indicates whether the reactive power remains constant as the active power changes or varies dynamically in response to it, e.g. “straightLineYValues” and “constantYValue”

  • generator_type (Literal['current_source', 'async', 'async_doubly_fed'] | ~pandas.api.typing.NAType) –

    can be one of

    • ”current_source” (full size converter)

    • ”async” (asynchronous generator)

    • ”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) – locked rotor current in relation to the rated generator current. Relevant if the generator_type is “async”.

  • max_ik_ka (float) – 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) – 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) – Model this sgen as a current source during short-circuit calculations; useful in some cases, for example the simulation of fullsize converters per IEC 60909-0:2016.

Returns:

The ID of the created sgen

Return type:

int | integer

Example

>>> create_sgen(net, 1, p_mw=120)
pandapower.create.create_sgens(net, buses, p_mw, q_mvar=_q_mvar, sn_mva=nan, name=pd.NA, index=None, scaling=_scaling, type=_type, in_service=_in_service, max_p_mw=nan, min_p_mw=nan, max_q_mvar=nan, min_q_mvar=nan, controllable=pd.NA, k=nan, rx=nan, id_q_capability_characteristic=pd.NA, reactive_capability_curve=pd.NA, curve_style=pd.NA, current_source=_current_source, generator_type=_generator_type, max_ik_ka=nan, kappa=nan, lrc_pu=nan, **kwargs)

Adds a number of sgens 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.

Parameters:
  • net (pandapowerNet) – The net within this load should be created

  • buses (Sequence) – A list of bus ids to which the loads are connected

  • p_mw (float | Iterable[float]) –

    The active power of the sgens

    • positive value -> generation

    • negative value -> load

  • q_mvar (float | Iterable[float]) – The reactive power of the sgens

  • sn_mva (float | Iterable[float]) – Nominal power of the sgens

  • name (Iterable[str] | NAType) – The name for this sgen

  • scaling (float | Iterable[float]) – An OPTIONAL custom scaling factor. Multiplies with p_mw and q_mvar.

  • type (Literal['wye', 'delta']) – type variable to classify the sgen

  • index (int | integer | Iterable[int | integer] | None) – Force a specified ID if it is available. If None, the index is set to a range between one higher than the highest already existing index and the length of sgens that shall be created.

  • in_service (bool | Iterable[bool]) – True for in_service or False for out of service

  • max_p_mw (float | Iterable[float]) – Maximum active power sgen - necessary for controllable sgens in for OPF

  • min_p_mw (float | Iterable[float]) – Minimum active power sgen - necessary for controllable sgens in for OPF

  • max_q_mvar (float | Iterable[float]) – Maximum reactive power sgen - necessary for controllable sgens in for OPF

  • min_q_mvar (float | Iterable[float]) – Minimum reactive power sgen - necessary for controllable sgens in OPF

  • controllable (bool | Iterable[bool] | NAType) – States, whether a sgen is controllable or not. Only respected for OPF. Defaults to False if “controllable” column exists in DataFrame

  • k (float | Iterable[float]) – Ratio of nominal current to short circuit current

  • rx (float) – 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

  • reactive_capability_curve (bool | Iterable[bool] | NAType) – True if both the id_q_capability_characteristic and the curve style are present in the generator.

  • id_q_capability_characteristic (int | integer | Iterable[int | integer] | NAType) – references the index of the characteristic from the lookup table net.q_capability_characteristic e.g. 0, 1, 2, 3

  • curve_style (str | Iterable[str] | NAType) – The curve style of the generator represents the relationship between active power (P) and reactive power (Q). It indicates whether the reactive power remains constant as the active power changes or varies dynamically in response to it. e.g. “straightLineYValues” and “constantYValue”

  • generator_type (Literal['current_source', 'async', 'async_doubly_fed']) – 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

  • lrc_pu (float) – locked rotor current in relation to the rated generator current. Relevant if the generator_type is “async”.

  • max_ik_ka (float) – 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) – 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”.

  • current_source (bool | Iterable[bool]) – Model this sgen as a current source during shortcircuit calculations; useful in some cases, for example the simulation of fullsize converters per IEC 60909-0:2016.

Returns:

The IDs of the created elements

Return type:

ndarray[tuple[Any, …], dtype[int | integer]]

Example

>>> create_sgens(net, buses=[0, 2], p_mw=[10., 5.], q_mvar=[2., 0.])
pandapower.create.create_sgen_from_cosphi(net, bus, sn_mva, cos_phi, mode, **kwargs)

Creates an sgen element from rated power and power factor cos(phi).

Parameters:
  • net (pandapowerNet) – The net within this static generator should be created

  • bus (int | integer) – The bus id to which the static generator is connected

  • sn_mva (float) – rated power of the generator

  • cos_phi (float) – power factor cos_phi

  • mode (Literal['underexcited', 'overexcited']) –

    • “underexcited” (Q absorption, decreases voltage)

    • ”overexcited” (Q injection, increases voltage)

Returns:

The ID of the created sgen

Return type:

int | integer

gen, sgen, and ext_grid are modelled in the generator point of view. Active power will therefore be positive for generation, and reactive power will be negative for underexcited behavior (Q absorption, decreases voltage) and positive for overexcited behavior (Q injection, increases voltage).

Table Structure

net.sgen

Parameter

Datatype

Value Range

Explanation

nullable

required

optimal power flow

short circuit

name

name of the static generator

✓

bus

int

>=0

index of connected bus

✓

p_mw

float

active power of the static generator [MW]

✓

q_mvar

float

reactive power of the static generator [MVAr]

✓

sn_mva

float

>0

rated power ot the static generator [MVA]

✓

scaling

float

>=0

scaling factor for the active and reactive power

✓

min_p_mw

float

maximum active power [MW]

✓

✓

max_p_mw

float

minimum active power [MW]

✓

✓

min_q_mvar

float

maximum reactive power [MVAr]

✓

✓

max_q_mvar

float

minimum reactive power [MVAr]

✓

✓

controllable

bool

states if sgen is controllable or not, sgen will not be used as a flexibility if it is not controllable

k

float

>=0

ratio of short circuit current to nominal current

✓

✓

rx

float

>=0

R/X ratio for short circuit impedance. Only relevant if type is specified as motor so that sgen is treated as asynchronous motor

✓

✓

in_service

bool

specifies if the generator is in service.

✓

id_q_capability_characteristic

int

references the index of the characteristic from the q_capability_characteristic

✓

curve_style

the style of the static generator reactive power capability curve. Naming convention straightLineYValues, constantYValue

✓

reactive_capability_curve

bool

True if static generator has dependency on q characteristic

✓

type

type of generator naming conventions: “PV” - photovoltaic system “WP” - wind power system “CHP” - combined heating and power system

✓

current_source

bool

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.

✓

✓

generator_type

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

locked rotor current in relation to the rated generator current. Relevant if the generator_type is async.

✓

✓

max_ik_ka

float

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

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.

✓

✓

Static Generator Reactive Power Capability Curve Characteristics

The static generator reactive power capability curve characteristics provide a reference framework for determining the reactive power limits (Qmin and Qmax) of static generators based on their active power output. The reactive power capability curve data can be imported into pandapower in a tabular format, populating net.q_capability_curve_table. The characteristics can either be automatically generated via the CIM CGMES to pandapower converter or the PowerFactory to pandapower converter, or they can be created by the user using the pandapower.control.util.create_q_capability_characteristics_object function, provided that the q_capability_curve_table is previously defined in the network case. Q capability curve characteristic objects are then generated from net.q_capability_curve_table, populating net.q_capability_characteristic.

If the variable reactive_capability_curve in net.sgen is set to True, it indicates that pairs of P vs Qmin/Qmax values and the corresponding characteristic are defined in net.q_capability_curve_table and net.q_capability_characteristic respectively. This overrides the default reactive power limits of the static generator when i) a power flow is executed and the enforce_q_lims option is enabled; or ii) an optimal power flow is executed for static generators that have their controllable flag set to True. The variable id_q_capability_characteristic in net.sgen establishes a direct reference to the id_q_capability_curve column in both net.q_capability_curve_table and net.q_capability_characteristic, thereby associating each static generator with its corresponding capability curve.

Below is an example of a q_capability_curve_table populated for two sample static generators.

id_q_capability_curve

p_mw

q_min_mvar

q_max_mvar

0

0

-63.00999832

-10.01000023

18.01000023

1

0

-20

-27.01000023

32.00999832

2

0

-1

-29.01000023

33.00999832

3

0

0

-28.82818222

32.73727036

4

0

10

-27.01000023

30.01000023

5

0

20

-25.01000023

28.01000023

6

0

30

-23.01000023

25.01000023

7

0

38

-21.01000023

23.01000023

8

0

50

-19.01000023

21.01000023

9

0

51.00999832

-18.01000023

20.01000023

10

1

-40.00999832

-5.010000229

5.010000229

11

1

0

-5.010000229

5.010000229

12

1

40.00999832

-5.010000229

5.010000229

The table below illustrates an example of a q_capability_characteristic table populated for two static generators.

id_q_capability_curve

q_max_characteristic

q_min_characteristic

0

0

Characteristic

Characteristic

1

1

Characteristic

Characteristic

Note

  • reactive_capability_curve has to be set to True, and id_q_capability_characteristic and curve_style variables need to be populated in order to consider the reactive power limits of the corresponding characteristic.

  • Each static generator supports only a single reactive_capability_curve.

  • In this version, only two types of generator reactive power capability characteristics are supported: 1. constantYValue: The reactive power values are assumed constant until the next curve point and prior to the first curve point. 2. straightLineYValues: The reactive power values are assumed to be a straight line between values.

  • Linear interpolation is employed to determine Qmin and Qmax based on the given active power dispatch for the above two curve types.

The function pandapower.control.util.q_capability_curve_table_diagnostic is available to perform sanity checks on the generator reactive power capability curve table.

Electric Model

Static Generators are modelled as PQ-buses in the power flow calculation:

alternate Text

The PQ-Values are calculated from the parameter table values as:

\begin{align*} P_{sgen} &= p\_mw \cdot scaling \\ Q_{sgen} &= q\_mvar \cdot scaling \\ \end{align*}

Note

The apparent power value sn_mva is provided as additional information for usage in controller or other applications based on pandapower. It is not considered in the power flow!

Result Table

net.res_sgen

Parameter

Datatype

Explanation

nullable

required

p_mw

float

resulting active power production after scaling [MW]

✓

✓

q_mvar

float

resulting reactive power production after scaling [MVar]

✓

✓

The power values in the net.res_sgen table are equivalent to \(P_{sgen}\) and \(Q_{sgen}\).