pydynamicestimator.devices.device

Attributes

sin

cos

sqrt

BusUnknown

Classes

Element

Metaclass to be used for all elements to be added

BusInit

Metaclass to be used for all elements to be added

Disturbance

Metaclass to be used for all elements to be added

Line

DeviceRect

Dynamic or static device modeled in rectangular coordinates. Used as a parent class

Module Contents

pydynamicestimator.devices.device.sin
pydynamicestimator.devices.device.cos
pydynamicestimator.devices.device.sqrt
class pydynamicestimator.devices.device.Element[source]

Metaclass to be used for all elements to be added

n: int = 0
u: list[bool] = []
name: list[str] = []
_type: str | None = None
_name: str | None = None
int: dict[str, str | int]
_data: dict[str, Any]
_params: dict[str, float]
_setpoints: dict[str, float]
_descr: dict[str, str]
_mand: list[str] = []
properties: dict[str, bool]
add(idx: str | None = None, name: str | None = None, **kwargs) None[source]

Add an element device

Args: idx (str, optional): Unique identifier for the device. Generated if not provided. name (str, optional): Name of the device. Generated if not provided. **kwargs: Custom parameters to overwrite defaults.

Parameters:
  • idx (Optional[str])

  • name (Optional[str])

Return type:

None

class pydynamicestimator.devices.device.BusInit[source]

Bases: Element

Metaclass to be used for all elements to be added

_type = 'Bus_init_or_unknwon'
_name = 'Bus_init_or_unknown'
bus: list[str | None] = []
p: list[float] = []
q: list[float] = []
v: list[float] = []
type: list[str | None] = []
pydynamicestimator.devices.device.BusUnknown
class pydynamicestimator.devices.device.Disturbance[source]

Bases: Element

Metaclass to be used for all elements to be added

_type = 'Disturbance'
_name = 'Disturbance'
type
time
bus_i
bus_j
y: numpy.ndarray
bus
p_delta
q_delta
sort_chrono()[source]
class pydynamicestimator.devices.device.Line[source]

Bases: Element

Parameters:
  • r (ndarray[float]) – Series resistance value in per unit (p.u.).

  • x (ndarray[float]) – Series reactance value in per unit (p.u.).

  • g (ndarray[float]) – Total shunt conductance value in per unit (p.u.).

  • b (ndarray[float]) – Total shunt susceptance value in per unit (p.u.).

  • trafo (ndarray[float]) – Off-nominal line transformer ratio.

  • bus_i (ndarray[str]) – Name of the sending-end bus.

  • bus_j (ndarray[str]) – Name of the receiving-end bus.

_type = 'Transmission_line'
_name = 'Transmission_line'
r
x
g
b
trafo
bus_i
bus_j
class pydynamicestimator.devices.device.DeviceRect[source]

Bases: Element

Dynamic or static device modeled in rectangular coordinates. Used as a parent class for all devices modeled in rectangular coordinates.

properties

Flags for method calls (e.g., ‘gcall’, ‘fcall’).

Type:

dict[str, bool]

xf

Final state results for simulation/estimation.

Type:

dict[str, np.ndarray]

xinit

Initial state values for all devices of the instance.

Type:

dict[State, list[float]]

xmin

Minimum limited state value.

Type:

list[float]

xmax

Maximum limited state value.

Type:

list[float]

_params

Device parameters, such as rated voltage, power, and frequency and internal parameters.

Type:

dict[str, float]

_data

Additional data which will be used in a list, one entry for each device of this object instance.

Type:

dict[str, str]

bus

Buses where the device is connected. Each device has an entry in the list.

Type:

list[Optional[str]]

states

State variables.

Type:

list[States]

units

Units of state variables.

Type:

list[States]

ns

Total number of states in the model.

Type:

float

_states_noise

Noise for each state variable.

Type:

dict[States, float]

_states_init_error

Initial error for each state variable.

Type:

dict[States, float]

vre

Order of the real voltage value for each device in the overall DAE model.

Type:

list[float]

vim

Order of the real voltage value for each device in the overall DAE model.

Type:

list[float]

_algebs

Algebraic variables (‘vre’, ‘vim’).

Type:

list[str]

_descr

Descriptions for key parameters.

Type:

dict[str, str]

xf: dict[str, numpy.ndarray]
xinit: dict[str, list[float]]
xmin: list[float] = []
xmax: list[float] = []
Vn
fn
Sn
bus: list[str | None] = []
states: list[str] = []
units: list[str] = []
ns: int = 0
_states_noise: dict[str, float]
_states_init_error: dict[str, float]
_algebs: list[str] = ['vre', 'vim']
vre
vim
_x0: dict[str, float]
_descr
classmethod __init_subclass__(**kwargs)[source]
_init_data() None[source]
Return type:

None

xy_index(dae: pydynamicestimator.system.Dae, grid: pydynamicestimator.system.Grid) None[source]

Initializes indices for states, algebraic variables, unknown inputs, and switches.

Parameters:
  • dae (Dae) – Object managing differential-algebraic equations.

  • grid (Grid) – Object managing the electrical grid and node indices.

Return type:

None

add(idx=None, name=None, **kwargs) None[source]

Add an element device

Args: idx (str, optional): Unique identifier for the device. Generated if not provided. name (str, optional): Name of the device. Generated if not provided. **kwargs: Custom parameters to overwrite defaults.

Return type:

None

init_from_simulation(device_sim: DeviceRect, idx: str, dae: pydynamicestimator.system.DaeEst, dae_sim: pydynamicestimator.system.DaeSim) None[source]

Initialize the device state estimation based on simulation results.

Parameters:
  • device_sim (DeviceRect) – The device simulation object containing simulation results.

  • idx (str) – unique index of the device

  • dae (DaeEst) – The DAE object responsible for managing the estimation of the system.

  • dae_sim (DaeSim) – The simulation object providing timing information.

Return type:

None

save_data(dae: pydynamicestimator.system.Dae) None[source]
Parameters:

dae (pydynamicestimator.system.Dae)

Return type:

None

finit(dae: pydynamicestimator.system.Dae) None[source]

Initialize the device by setting up setpoints, initial states based on the power flow solution. :param dae: The DAE object used to simulate the system. :type dae: Dae

Parameters:

dae (pydynamicestimator.system.Dae)

Return type:

None

fgcall(dae: pydynamicestimator.system.Dae) None[source]

A method that executes the differential and algebraic equations of the model and adds them to the appropriate places in the Dae class

Parameters:

dae – an instance of a class Dae

Returns:

None

Return type:

None

qcall(dae: pydynamicestimator.system.DaeEst) None[source]
Parameters:

dae (pydynamicestimator.system.DaeEst)

Return type:

None