Storage

Note

Since storage power values are given in the consumer system, positive power models charging and negative power models discharging.

Create Function

pandapower.create.create_storage(net, bus, p_mw, max_e_mwh, q_mvar=get_default_value('storage', 'q_mvar'), sn_mva=nan, soc_percent=nan, min_e_mwh=get_default_value('storage', 'min_e_mwh'), name=None, index=None, scaling=get_default_value('storage', 'scaling'), type=None, in_service=get_default_value('storage', 'in_service'), max_p_mw=nan, min_p_mw=nan, max_q_mvar=nan, min_q_mvar=nan, controllable=nan, **kwargs)

Adds a storage to the network.

In order to simulate a storage system it is possible to use sgens or loads to model the discharging or charging state. The power of a storage can be positive or negative, so the use of either a sgen or a load is (per definition of the elements) not correct. To overcome this issue, a storage element can be created.

As pandapower is not a time dependent simulation tool and there is no time domain parameter in default power flow calculations, the state of charge (SOC) is not updated during any power flow calculation. The implementation of energy content related parameters in the storage element allows to create customized, time dependent simulations by running several power flow calculations and updating variables manually.

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

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

  • p_mw (float) – The momentary active power of the storage (positive for charging, negative for discharging)

  • max_e_mwh (float) – The maximum energy content of the storage (maximum charge level)

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

  • sn_mva (float) – Nominal power of the storage

  • soc_percent (float) – The state of charge of the storage

  • min_e_mwh (float) – The minimum energy content of the storage (minimum charge level)

  • name (str | None) – The name for this storage

  • 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) – type variable to classify the storage

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

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

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

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

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

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

Returns:

The ID of the created storage

Return type:

int | integer

Example

>>> create_storage(net, 1, p_mw=-30, max_e_mwh=60, soc_percent=1.0, min_e_mwh=5)
pandapower.create.create_storages(net, buses, p_mw, max_e_mwh, q_mvar=get_default_value('storage', 'q_mvar'), sn_mva=nan, soc_percent=nan, min_e_mwh=get_default_value('storage', 'min_e_mwh'), name=None, index=None, scaling=get_default_value('storage', 'scaling'), type=None, in_service=get_default_value('storage', 'in_service'), max_p_mw=nan, min_p_mw=nan, max_q_mvar=nan, min_q_mvar=nan, controllable=nan, **kwargs)

Adds storages to the network.

In order to simulate a storage system it is possible to use sgens or loads to model the discharging or charging state. The power of a storage can be positive or negative, so the use of either a sgen or a load is (per definition of the elements) not correct. To overcome this issue, a storage element can be created.

As pandapower is not a time dependent simulation tool and there is no time domain parameter in default power flow calculations, the state of charge (SOC) is not updated during any power flow calculation. The implementation of energy content related parameters in the storage element allows to create customized, time dependent simulations by running several power flow calculations and updating variables manually.

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

  • buses (Sequence) – The bus ids to which the generators are connected

  • p_mw (float | Iterable[float]) – The momentary active power of the storage (positive for charging, negative for discharging)

  • max_e_mwh (float | Iterable[float]) – The maximum energy content of the storage (maximum charge level)

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

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

  • soc_percent (float | Iterable[float]) – The state of charge of the storage

  • min_e_mwh (float | Iterable[float]) – The minimum energy content of the storage (minimum charge level)

  • name (Iterable[str] | None) – The name for this storage

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

  • type (str | Iterable[str] | None) – type variable to classify the storage

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

  • max_p_mw (float | Iterable[float]) – Maximum active power injection - necessary for a controllable storage in OPF

  • min_p_mw (float | Iterable[float]) – Minimum active power injection - necessary for a controllable storage in OPF

  • max_q_mvar (float | Iterable[float]) – Maximum reactive power injection - necessary for a controllable storage in OPF

  • min_q_mvar (float | Iterable[float]) – Minimum reactive power injection - necessary for a controllable storage in OPF

  • controllable (bool | Iterable[bool] | float) – Whether this storage is controllable by the optimal powerflow; defaults to False if “controllable” column exists in DataFrame

Returns:

The ID of the created storage

Return type:

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

Example

>>> create_storage(net, 1, p_mw=-30, max_e_mwh=60, soc_percent=1.0, min_e_mwh=5)

Table Structure

net.storage

Parameter

Datatype

Value Range

Explanation

nullable

required

optimal power flow

name

Name of the storage unit

✓

bus

int

>=0

Index of connected bus

✓

p_mw

float

Momentary real power of the storage (positive for charging, negative for discharging)

✓

q_mvar

float

Reactive power of the storage [MVar]

✓

sn_mva

float

>0

Nominal power ot the storage [MVA]

✓

✓

scaling

float

Scaling factor for the active and reactive power

✓

max_e_mwh

float

The maximum energy content of the storage (maximum charge level)

✓

min_e_mwh

float

The minimum energy content of the storage (minimum charge level)

✓

max_p_mw

float

Maximum active power

✓

✓

min_p_mw

float

Minimum active power

✓

✓

soc_percent

float

[0, 100]

The state of charge of the storage

✓

max_q_mvar

float

Maximum reactive power [MVar]

✓

✓

min_q_mvar

float

Minimum reactive power [MVar]

✓

✓

controllable

bool

States if sgen is controllable or not, sgen will not be used as a flexibilty if it is not controllable

✓

in_service

bool

Specifies if the generator is in service

✓

type

type variable to classify the storage

✓

Electric Model

Storages 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_{storage} &= p\_mw \cdot scaling \\ Q_{storage} &= q\_mvar \cdot scaling \\ \end{align*}

Note

The apparent power value sn_mva, state of charge soc and storage capacity max_e_mwh are 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_storage

Parameter

Datatype

Explanation

nullable

required

p_mw

float

resulting active power after scaling [MW]

✓

✓

q_mvar

float

resulting reactive power after scaling [MVar]

✓

✓

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