pydynamicestimator.devices.device ================================= .. py:module:: pydynamicestimator.devices.device Attributes ---------- .. autoapisummary:: pydynamicestimator.devices.device.sin pydynamicestimator.devices.device.cos pydynamicestimator.devices.device.sqrt pydynamicestimator.devices.device.BusUnknown Classes ------- .. autoapisummary:: pydynamicestimator.devices.device.Element pydynamicestimator.devices.device.BusInit pydynamicestimator.devices.device.Disturbance pydynamicestimator.devices.device.Line pydynamicestimator.devices.device.DeviceRect Module Contents --------------- .. py:data:: sin .. py:data:: cos .. py:data:: sqrt .. py:class:: Element Metaclass to be used for all elements to be added .. py:attribute:: n :type: int :value: 0 .. py:attribute:: u :type: list[bool] :value: [] .. py:attribute:: name :type: list[str] :value: [] .. py:attribute:: _type :type: Optional[str] :value: None .. py:attribute:: _name :type: Optional[str] :value: None .. py:attribute:: int :type: dict[str, Union[str, int]] .. py:attribute:: _data :type: dict[str, Any] .. py:attribute:: _params :type: dict[str, float] .. py:attribute:: _setpoints :type: dict[str, float] .. py:attribute:: _descr :type: dict[str, str] .. py:attribute:: _mand :type: list[str] :value: [] .. py:attribute:: properties :type: dict[str, bool] .. py:method:: add(idx: Optional[str] = None, name: Optional[str] = None, **kwargs) -> None 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. .. py:class:: BusInit Bases: :py:obj:`Element` Metaclass to be used for all elements to be added .. py:attribute:: _type :value: 'Bus_init_or_unknwon' .. py:attribute:: _name :value: 'Bus_init_or_unknown' .. py:attribute:: bus :type: list[Optional[str]] :value: [] .. py:attribute:: p :type: list[float] :value: [] .. py:attribute:: q :type: list[float] :value: [] .. py:attribute:: v :type: list[float] :value: [] .. py:attribute:: type :type: list[Optional[str]] :value: [] .. py:data:: BusUnknown .. py:class:: Disturbance Bases: :py:obj:`Element` Metaclass to be used for all elements to be added .. py:attribute:: _type :value: 'Disturbance' .. py:attribute:: _name :value: 'Disturbance' .. py:attribute:: type .. py:attribute:: time .. py:attribute:: bus_i .. py:attribute:: bus_j .. py:attribute:: y :type: numpy.ndarray .. py:attribute:: bus .. py:attribute:: p_delta .. py:attribute:: q_delta .. py:method:: sort_chrono() .. py:class:: Line Bases: :py:obj:`Element` :param r: Series resistance value in per unit (p.u.). :type r: ndarray[float] :param x: Series reactance value in per unit (p.u.). :type x: ndarray[float] :param g: Total shunt conductance value in per unit (p.u.). :type g: ndarray[float] :param b: Total shunt susceptance value in per unit (p.u.). :type b: ndarray[float] :param trafo: Off-nominal line transformer ratio. :type trafo: ndarray[float] :param bus_i: Name of the sending-end bus. :type bus_i: ndarray[str] :param bus_j: Name of the receiving-end bus. :type bus_j: ndarray[str] .. py:attribute:: _type :value: 'Transmission_line' .. py:attribute:: _name :value: 'Transmission_line' .. py:attribute:: r .. py:attribute:: x .. py:attribute:: g .. py:attribute:: b .. py:attribute:: trafo .. py:attribute:: bus_i .. py:attribute:: bus_j .. py:class:: DeviceRect Bases: :py:obj:`Element` Dynamic or static device modeled in rectangular coordinates. Used as a parent class for all devices modeled in rectangular coordinates. .. attribute:: properties Flags for method calls (e.g., 'gcall', 'fcall'). :type: dict[str, bool] .. attribute:: xf Final state results for simulation/estimation. :type: dict[str, np.ndarray] .. attribute:: xinit Initial state values for all devices of the instance. :type: dict[State, list[float]] .. attribute:: xmin Minimum limited state value. :type: list[float] .. attribute:: xmax Maximum limited state value. :type: list[float] .. attribute:: _params Device parameters, such as rated voltage, power, and frequency and internal parameters. :type: dict[str, float] .. attribute:: _data Additional data which will be used in a list, one entry for each device of this object instance. :type: dict[str, str] .. attribute:: bus Buses where the device is connected. Each device has an entry in the list. :type: list[Optional[str]] .. attribute:: states State variables. :type: list[States] .. attribute:: units Units of state variables. :type: list[States] .. attribute:: ns Total number of states in the model. :type: float .. attribute:: _states_noise Noise for each state variable. :type: dict[States, float] .. attribute:: _states_init_error Initial error for each state variable. :type: dict[States, float] .. attribute:: vre Order of the real voltage value for each device in the overall DAE model. :type: list[float] .. attribute:: vim Order of the real voltage value for each device in the overall DAE model. :type: list[float] .. attribute:: _algebs Algebraic variables ('vre', 'vim'). :type: list[str] .. attribute:: _descr Descriptions for key parameters. :type: dict[str, str] .. py:attribute:: xf :type: dict[str, numpy.ndarray] .. py:attribute:: xinit :type: dict[str, list[float]] .. py:attribute:: xmin :type: list[float] :value: [] .. py:attribute:: xmax :type: list[float] :value: [] .. py:attribute:: Vn .. py:attribute:: fn .. py:attribute:: Sn .. py:attribute:: bus :type: list[Optional[str]] :value: [] .. py:attribute:: states :type: list[str] :value: [] .. py:attribute:: units :type: list[str] :value: [] .. py:attribute:: ns :type: int :value: 0 .. py:attribute:: _states_noise :type: dict[str, float] .. py:attribute:: _states_init_error :type: dict[str, float] .. py:attribute:: _algebs :type: list[str] :value: ['vre', 'vim'] .. py:attribute:: vre .. py:attribute:: vim .. py:attribute:: _x0 :type: dict[str, float] .. py:attribute:: _descr .. py:method:: __init_subclass__(**kwargs) :classmethod: .. py:method:: _init_data() -> None .. py:method:: xy_index(dae: pydynamicestimator.system.Dae, grid: pydynamicestimator.system.Grid) -> None Initializes indices for states, algebraic variables, unknown inputs, and switches. :param dae: Object managing differential-algebraic equations. :type dae: Dae :param grid: Object managing the electrical grid and node indices. :type grid: Grid .. py:method:: add(idx=None, name=None, **kwargs) -> None 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. .. py:method:: init_from_simulation(device_sim: DeviceRect, idx: str, dae: pydynamicestimator.system.DaeEst, dae_sim: pydynamicestimator.system.DaeSim) -> None Initialize the device state estimation based on simulation results. :param device_sim: The device simulation object containing simulation results. :type device_sim: DeviceRect :param idx: unique index of the device :type idx: str :param dae: The DAE object responsible for managing the estimation of the system. :type dae: DaeEst :param dae_sim: The simulation object providing timing information. :type dae_sim: DaeSim .. py:method:: save_data(dae: pydynamicestimator.system.Dae) -> None .. py:method:: finit(dae: pydynamicestimator.system.Dae) -> None 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 .. py:method:: fgcall(dae: pydynamicestimator.system.Dae) -> None A method that executes the differential and algebraic equations of the model and adds them to the appropriate places in the Dae class :param dae: an instance of a class Dae :type dae: :return: None :rtype: None .. py:method:: qcall(dae: pydynamicestimator.system.DaeEst) -> None