VeraGridEngine.DataStructures packageο
Submodulesο
VeraGridEngine.DataStructures.active_branch_data moduleο
- class VeraGridEngine.DataStructures.active_branch_data.ActiveBranchData(nelm: int, nbus: int)[source]ο
Bases:
objectControllableBranchData
- property any_pf_controlο
- Returns:
- copy() ActiveBranchData[source]ο
- Returns:
- remap(bus_map_arr: ndarray[tuple[Any, ...], dtype[int64]]) None[source]ο
Remapping of the branch-controlled bus indices. :param bus_map_arr: array of old-to-new buses
- slice(elm_idx: ndarray[tuple[Any, ...], dtype[int64]], bus_idx: ndarray[tuple[Any, ...], dtype[int64]], bus_map: ndarray[tuple[Any, ...], dtype[int64]], logger: Logger | None) ActiveBranchData[source]ο
Slice branch data by given indices :param elm_idx: array of branch indices :param bus_idx: array of bus indices :param bus_map: array of bus indices to re index main to island indices :param logger: Logger (optional) :return: new BranchData instance
- property tap: ndarray[tuple[Any, ...], dtype[complex128]]ο
- Returns:
VeraGridEngine.DataStructures.battery_data moduleο
- class VeraGridEngine.DataStructures.battery_data.BatteryData(nelm: int, nbus: int)[source]ο
Bases:
GeneratorDataStructure to host the battery compiled data
- copy() BatteryData[source]ο
Get a deep copy of this object :return: new BatteryData instance
- slice(elm_idx: ndarray[tuple[Any, ...], dtype[int64]], bus_idx: ndarray[tuple[Any, ...], dtype[int64]], bus_map: ndarray[tuple[Any, ...], dtype[int64]]) BatteryData[source]ο
Slice battery data by given indices :param elm_idx: array of element indices :param bus_idx: array of bus indices :param bus_map: map from bus to index :return: new BatteryData instance
VeraGridEngine.DataStructures.branch_parent_data moduleο
- class VeraGridEngine.DataStructures.branch_parent_data.BranchParentData(nelm: int, nbus: int)[source]ο
Bases:
objectStructure to host all branches data for calculation
- property C: csc_matrixο
Branch-bus connectivity matrix :return:
- property Cf: csc_matrixο
Bras-bus from connectivity :return:
- property Ct: csc_matrixο
Bras-bus to connectivity :return:
- copy() BranchParentData[source]ο
Get a deep copy of this object :return: new BranchData instance
- get_contingency_enabled_indices() ndarray[tuple[Any, ...], dtype[int64]][source]ο
Get contingency branch indices :return:
- get_inter_areas(bus_idx_from: ndarray[tuple[Any, ...], dtype[int64]] | Set[int], bus_idx_to: ndarray[tuple[Any, ...], dtype[int64]] | Set[int])[source]ο
Get the Branches that join two areas :param bus_idx_from: Area from :param bus_idx_to: Area to :return: List of (branch index, flow sense w.r.t the area exchange)
- get_monitor_enabled_indices() ndarray[tuple[Any, ...], dtype[int64]][source]ο
Get monitored branch indices :return:
- monitored_Cf(idx) csc_matrix[source]ο
Bras-bus from connectivity for monitored branches :param idx: Monitored branches ids :return:
- monitored_Ct(idx) csc_matrix[source]ο
Bras-bus to connectivity for monitored branches :param idx: Monitored branches ids :return:
- remap(bus_map_arr: ndarray[tuple[Any, ...], dtype[int64]])[source]ο
Remapping of the branch buses :param bus_map_arr: array of old-to-new buses
- slice(elm_idx: ndarray[tuple[Any, ...], dtype[int64]], bus_idx: ndarray[tuple[Any, ...], dtype[int64]], bus_map: ndarray[tuple[Any, ...], dtype[int64]], logger: Logger | None) Tuple[BranchParentData, ndarray[tuple[Any, ...], dtype[int64]]][source]ο
Slice branch data by given indices :param elm_idx: array of branch indices :param bus_idx: array of bus indices :param bus_map: map from bus index to island bus index {int(o): i for i, o in enumerate(bus_idx)} :param logger: Logger :return: new BranchData instance
VeraGridEngine.DataStructures.bus_data moduleο
- class VeraGridEngine.DataStructures.bus_data.BusData[source]ο
Bases:
object- get_idtag_dict() Dict[str, int][source]ο
Get dictionary of bus idtagd related to the island bus index :return:
- get_original_to_island_bus_dict() Dict[int, int][source]ο
Dictionary that relates the original bus index to the island bus index :return: dict[original idx] -> island index
- VeraGridEngine.DataStructures.bus_data.propagate_controls(chosen_idx: int, other_idx: ndarray[tuple[Any, ...], dtype[int64]], bus_types: ndarray[tuple[Any, ...], dtype[int64]], Vbus: ndarray[tuple[Any, ...], dtype[complex128]], is_p_controlled: ndarray[tuple[Any, ...], dtype[bool]], is_q_controlled: ndarray[tuple[Any, ...], dtype[bool]], is_vm_controlled: ndarray[tuple[Any, ...], dtype[bool]], is_va_controlled: ndarray[tuple[Any, ...], dtype[bool]]) None[source]ο
Propagate the strongest control status of a reduced bus cluster to the surviving bus.
The donor bus is chosen from
chosen_idxandother_idxusing the actual control flags, not only the bus type, so VSC/HVDC-added controls are preserved as well. :param chosen_idx: island of the island chosen by the topological reduction process to represent the reduction set :param other_idx: rest of buses in the set that are going to be reduced but may contain important information :param bus_types: :param Vbus: :param is_p_controlled: :param is_q_controlled: :param is_vm_controlled: :param is_va_controlled: :return:
VeraGridEngine.DataStructures.fluid_node_data moduleο
VeraGridEngine.DataStructures.fluid_p2x_data moduleο
- class VeraGridEngine.DataStructures.fluid_p2x_data.FluidP2XData[source]ο
Bases:
FluidTurbineData- copy() FluidP2XData[source]ο
Get deep copy of this structure :return: new FluidP2XData instance
VeraGridEngine.DataStructures.fluid_path_data moduleο
VeraGridEngine.DataStructures.fluid_pump_data moduleο
- class VeraGridEngine.DataStructures.fluid_pump_data.FluidPumpData[source]ο
Bases:
FluidTurbineData- copy() FluidPumpData[source]ο
Get deep copy of this structure :return: new FluidPumpData instance
VeraGridEngine.DataStructures.fluid_turbine_data moduleο
VeraGridEngine.DataStructures.generator_data moduleο
- class VeraGridEngine.DataStructures.generator_data.GeneratorData[source]ο
Bases:
object- dev_per_bus() ndarray[tuple[Any, ...], dtype[int64]][source]ο
Get number of devices per bus :return: array with the number of elements per bus
- get_Yshunt(seq: int = 1) ndarray[tuple[Any, ...], dtype[complex128]][source]ο
Obtain the vector of shunt admittances of a given sequence per bus :param seq: sequence (0, 1 or 2)
- get_array_per_bus(arr: ndarray[tuple[Any, ...], dtype[float64]]) ndarray[tuple[Any, ...], dtype[float64]][source]ο
Get generator array per bus :param arr: :return:
- get_array_per_bus_obj(arr: ndarray[tuple[Any, ...], dtype[float64]]) ndarray[tuple[Any, ...], dtype[float64]][source]ο
Sum per bus in python mode (it can add objects) :param arr: any array of size nelm :return: array of size nbus
- get_bus_indices() ndarray[tuple[Any, ...], dtype[int64]][source]ο
Get the bus indices :return: array with the bus indices
- get_controllable_and_not_controllable_indices() Tuple[ndarray[tuple[Any, ...], dtype[int64]], ndarray[tuple[Any, ...], dtype[int64]]][source]ο
Get the indices of controllable generators :return: idx_controllable, idx_non_controllable
- get_dispatchable_active_indices() ndarray[tuple[Any, ...], dtype[int64]][source]ο
Get the indices of dispatchable generators :return:
- get_dispatchable_indices() ndarray[tuple[Any, ...], dtype[int64]][source]ο
Get the indices of dispatchable generators :return:
- get_dispatchable_per_bus() ndarray[tuple[Any, ...], dtype[bool]][source]ο
Get generator Injections per bus :return:
- get_effective_generation() ndarray[tuple[Any, ...], dtype[float64]][source]ο
Get generator effective power :return:
- get_gen_indices_at_buses(bus_indices: ndarray[tuple[Any, ...], dtype[int64]]) ndarray[tuple[Any, ...], dtype[int64]][source]ο
- get_injections() ndarray[tuple[Any, ...], dtype[complex128]][source]ο
Compute the active and reactive power of non-controlled generators (assuming all) :return:
- get_injections_per_bus() ndarray[tuple[Any, ...], dtype[complex128]][source]ο
Get generator Injections per bus :return:
- get_installed_power_per_bus() ndarray[tuple[Any, ...], dtype[float64]][source]ο
Get generator installed power per bus :return:
- get_non_dispatchable_indices() ndarray[tuple[Any, ...], dtype[int64]][source]ο
Get the indices of dispatchable generators :return:
- get_pf() ndarray[tuple[Any, ...], dtype[float64]][source]ο
Get the array of power factors :return:
- get_pmax_per_bus() ndarray[tuple[Any, ...], dtype[float64]][source]ο
Get generator Pmax per bus :return:
- get_pmin_per_bus() ndarray[tuple[Any, ...], dtype[float64]][source]ο
Get generator Pmin per bus :return:
- get_qmax_per_bus() ndarray[tuple[Any, ...], dtype[float64]][source]ο
Get generator Qmax per bus :return:
- get_qmin_per_bus() ndarray[tuple[Any, ...], dtype[float64]][source]ο
Get generator Qmin per bus :return:
- remap(bus_map_arr: ndarray[tuple[Any, ...], dtype[int64]])[source]ο
Remapping of the elm buses :param bus_map_arr: array of old-to-new buses
- slice(elm_idx: ndarray[tuple[Any, ...], dtype[int64]], bus_idx: ndarray[tuple[Any, ...], dtype[int64]], bus_map: ndarray[tuple[Any, ...], dtype[int64]])[source]ο
Slice generator data by given indices :param elm_idx: array of element indices :param bus_idx: array of bus indices :param bus_map: map from bus index to element index :return: new GeneratorData instance
VeraGridEngine.DataStructures.hvdc_data moduleο
- class VeraGridEngine.DataStructures.hvdc_data.HvdcData[source]ο
Bases:
BranchParentData- get_angle_droop_in_pu_rad(Sbase: float)[source]ο
Get the angle droop in pu/rad :param Sbase: base power :return:
- get_angle_droop_in_pu_rad_at(i: int, Sbase: float)[source]ο
Get the angle droop in pu/rad :param i: index :param Sbase: base power :return:
- get_bus_indices_f() ndarray[tuple[Any, ...], dtype[int64]][source]ο
Get bus indices βfromβ :return:
- get_bus_indices_t() ndarray[tuple[Any, ...], dtype[int64]][source]ο
Get bus indices βtoβ :return:
- get_inter_areas(bus_idx_from: ndarray[tuple[Any, ...], dtype[int64]] | Set[int], bus_idx_to: ndarray[tuple[Any, ...], dtype[int64]] | Set[int])[source]ο
Get the hvdcs that join two areas :param bus_idx_from: Area from :param bus_idx_to: Area to :return: List of (branch index, flow sense w.r.t the area exchange)
- get_power(Sbase: float, theta: ndarray[tuple[Any, ...], dtype[float64]]) Tuple[ndarray[tuple[Any, ...], dtype[float64]], ndarray[tuple[Any, ...], dtype[float64]], ndarray[tuple[Any, ...], dtype[float64]], ndarray[tuple[Any, ...], dtype[float64]], ndarray[tuple[Any, ...], dtype[float64]], int][source]ο
Get hvdc power :param Sbase: base power :param theta: bus angles array :return: Pbus, Losses, Pf, Pt, loading, nfree
- get_qmax_from_per_bus() ndarray[tuple[Any, ...], dtype[float64]][source]ο
Max reactive power in the From Bus :return: (nbus, nt) Qmax From
- get_qmax_to_per_bus() ndarray[tuple[Any, ...], dtype[float64]][source]ο
Max reactive power in the To Bus :return: (nbus, nt) Qmax To
- get_qmin_from_per_bus() ndarray[tuple[Any, ...], dtype[float64]][source]ο
Min reactive power in the From Bus :return: (nbus, nt) Qmin From
- get_qmin_to_per_bus() ndarray[tuple[Any, ...], dtype[float64]][source]ο
Min reactive power in the To Bus :return: (nbus, nt) Qmin To
VeraGridEngine.DataStructures.load_data moduleο
- class VeraGridEngine.DataStructures.load_data.LoadData(nelm: int, nbus: int)[source]ο
Bases:
objectStructure to host the load calculation information
- get_admittance_injections_per_bus() ndarray[tuple[Any, ...], dtype[complex128]][source]ο
Get admittance Injections per bus with sign :return:
- get_array_per_bus(arr: ndarray[tuple[Any, ...], dtype[float64]]) ndarray[tuple[Any, ...], dtype[float64]][source]ο
Get generator array per bus :param arr: :return:
- get_array_per_bus_obj(arr: ndarray[tuple[Any, ...], dtype[float64]]) ndarray[tuple[Any, ...], dtype[float64]][source]ο
Sum per bus in python mode (it can add objects) :param arr: any array of size nelm :return: array of size nbus
- get_bus_indices() ndarray[tuple[Any, ...], dtype[int64]][source]ο
Get the bus indices :return: array with the bus indices
- get_current_injections_per_bus() ndarray[tuple[Any, ...], dtype[complex128]][source]ο
Get current Injections per bus with sign :return:
- get_effective_load() ndarray[tuple[Any, ...], dtype[complex128]][source]ο
Get effective load :return:
- get_injections_per_bus() ndarray[tuple[Any, ...], dtype[complex128]][source]ο
Get Injections per bus with sign :return:
- get_linear_effective_load() ndarray[tuple[Any, ...], dtype[float64]][source]ο
Get effective load :return:
- get_linear_injections_per_bus() ndarray[tuple[Any, ...], dtype[float64]][source]ο
Get Injections per bus with sign :return:
- remap(bus_map_arr: ndarray[tuple[Any, ...], dtype[int64]])[source]ο
Remapping of the elm buses :param bus_map_arr: array of old-to-new buses
- slice(elm_idx: ndarray[tuple[Any, ...], dtype[int64]], bus_idx: ndarray[tuple[Any, ...], dtype[int64]], bus_map: ndarray[tuple[Any, ...], dtype[int64]]) LoadData[source]ο
Slice load data by given indices :param elm_idx: array of branch indices :param bus_idx: array of bus indices :param bus_map: map from bus index to island bus index {int(o): i for i, o in enumerate(bus_idx)} :return: new LoadData instance
VeraGridEngine.DataStructures.numerical_circuit moduleο
- class VeraGridEngine.DataStructures.numerical_circuit.DataStructType(value)[source]ο
Bases:
Enum- BATTERYDATA = 5ο
- BRANCHDATA = 2ο
- BUSDATA = 1ο
- GENERATORDATA = 4ο
- HVDCDATA = 3ο
- LOADDATA = 6ο
- NOSTRUCT = 0ο
- SHUNTDATA = 7ο
- VSCDATA = 8ο
- class VeraGridEngine.DataStructures.numerical_circuit.NumericalCircuit(nbus: int, nbr: int, nhvdc: int, nvsc: int, nload: int, ngen: int, nbatt: int, nshunt: int, nfluidnode: int, nfluidturbine: int, nfluidpump: int, nfluidp2x: int, nfluidpath: int, sbase: float, t_idx: int | None = None)[source]ο
Bases:
objectClass storing the calculation information of the devices
- Sbase: floatο
- active_branch_data: ActiveBranchDataο
- battery_data: BatteryDataο
- compare(nc_2: NumericalCircuit, tol=1e-06) Tuple[bool, Logger][source]ο
Compare this numerical circuit with another numerical circuit :param nc_2: other NumericalCircuit :param tol: tolerance for numerical values :return: all ok?, Logger with the errors and warning events
- compute_adjacency_matrix(consider_hvdc_as_island_links: bool = False) csc_matrix[source]ο
Compute the adjacency matrix :param consider_hvdc_as_island_links: Does the HVDCLine works for the topology as a normal line? :return: csc_matrix
- copy() NumericalCircuit[source]ο
Deep copy of ths object :return: NumericalCircuit instance
- fluid_node_data: FluidNodeDataο
- fluid_p2x_data: FluidP2XDataο
- fluid_path_data: FluidPathDataο
- fluid_pump_data: FluidPumpDataο
- fluid_turbine_data: FluidTurbineDataο
- generator_data: GeneratorDataο
- get_admittance_matrices() AdmittanceMatrices[source]ο
Get Admittance structures :return: Admittance object
- get_connectivity_matrices() ConnectivityMatrices[source]ο
Get connectivity matrices :return:
- get_fast_decoupled_amittances() FastDecoupledAdmittanceMatrices[source]ο
- Returns:
- get_island(bus_idx: ndarray[tuple[Any, ...], dtype[int64]], logger: Logger | None = None) NumericalCircuit[source]ο
Get the island corresponding to the given buses :param bus_idx: array of bus indices :param logger: Logger :return: NumericalCircuit
- get_linear_admittance_matrices(indices: SimulationIndices | None = None) LinearAdmittanceMatrices[source]ο
Get the linear admittances :return:LinearAdmittanceMatrices
- get_power_injections() ndarray[tuple[Any, ...], dtype[complex128]][source]ο
Compute the power :return: return the array of power Injections in MW if normalized is false, in p.u. otherwise
- get_power_injections_pu() ndarray[tuple[Any, ...], dtype[complex128]][source]ο
Compute the power :return: return the array of power Injections in MW if normalized is false, in p.u. otherwise
- get_reactive_power_limits() Tuple[ndarray[tuple[Any, ...], dtype[float64]], ndarray[tuple[Any, ...], dtype[float64]]][source]ο
compute the reactive power limits in place :return: Qmax_bus, Qmin_bus in per unit
- get_reduction_bus_mapping() ndarray[tuple[Any, ...], dtype[int64]][source]ο
Get array is used to keep track of the bus topological reduction :return: IntVec
- get_series_admittance_matrices() SeriesAdmittanceMatrices[source]ο
- Returns:
- get_simulation_indices(Sbus: ndarray[tuple[Any, ...], dtype[complex128]] | None = None, bus_types: ndarray[tuple[Any, ...], dtype[int64]] | None = None, force_only_pq_pv_vd_types=False) SimulationIndices[source]ο
Get the simulation indices :param Sbus: Array of bus powers (optional) :param bus_types: different array of bus_types (optional) :param force_only_pq_pv_vd_types: if true, all bus types are forced into PQ PV or VD,
for certain types of simulations that cannot handle other bus types
- Returns:
SimulationIndices
- get_structural_ntc(bus_a1_idx: ndarray[tuple[Any, ...], dtype[int64]], bus_a2_idx: ndarray[tuple[Any, ...], dtype[int64]]) float[source]ο
Get the structural NTC :param bus_a1_idx: array of bus indices of the area from :param bus_a2_idx: array of bus indices of the area to :return: structural NTC in MVA
- is_dc() Tuple[int, str][source]ο
Check if this island is DC :return: int, str -> 1: all DC, 0: all AC, 2: AC and DC
- nbatt: intο
- nbr: intο
- nbus: intο
- nfluidnode: intο
- nfluidp2x: intο
- nfluidpath: intο
- nfluidpump: intο
- nfluidturbine: intο
- ngen: intο
- nhvdc: intο
- nload: intο
- nshunt: intο
- nvsc: intο
- passive_branch_data: PassiveBranchDataο
- process_reducible_branches() int[source]ο
Process the reducible branches (i.e. reduce branches like the switches) in-place :return: Number of reduced branches
- propagate_bus_result(bus_magnitude: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[Any, ...], dtype[complex128]])[source]ο
This function applies the __bus_map_arr to a calculated magnitude to propagate the calculated nodal result :param bus_magnitude: some array of the size of buses (all) :return: propagated results
- propagate_bus_result_mat(bus_magnitude: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]] | ndarray[tuple[Any, ...], dtype[complex128]])[source]ο
This function applies the __bus_map_arr to a calculated magnitude to propagate the calculated nodal result :param bus_magnitude: some array of the size of buses (all) :return: propagated results
- query_idtag(idtag: str) Tuple[DataStructType, int][source]ο
Query the structure and index where an idtag exists :param idtag: idtag :return: DataStructType, integer position
- set_con_or_ra_status(event_list: List[Contingency | RemedialAction], revert: bool = False) ndarray[tuple[Any, ...], dtype[float64]][source]ο
Set the status of a list of contingencies or remedial actions :param event_list: list of contingencies and or remedial actions :param revert: if false, the contingencies are applied, else they are reversed :return: vector of power injection increments
- set_investments_status(investments_list: List[Investment], status: int) None[source]ο
Set the status of a list of investments :param investments_list: list of investments :param status: status to set in the internal structures
- split_into_islands(ignore_single_node_islands: bool = False, consider_hvdc_as_island_links: bool = False, logger: Logger | None = None) List[NumericalCircuit][source]ο
Split circuit into islands :param ignore_single_node_islands: ignore islands composed of only one bus :param consider_hvdc_as_island_links: Does the HVDCLine works for the topology as a normal line? :param logger: Logger :return: List[NumericCircuit]
- structs_idtag_dict: Dict[str, Tuple[DataStructType, int]]ο
- t_idx: int | Noneο
- property topology_performed: boolο
Flag indicating if topology processing happened here :return:
- VeraGridEngine.DataStructures.numerical_circuit.build_q_limits(nbus: int, Sbase: float, gen_idx, q_min_gen, q_max_gen, active_gen, control_mode_int_gen, batt_idx, q_min_batt, q_max_batt, active_batt, control_mode_int_batt, sh_idx, q_min_sh, q_max_sh, active_sh, control_mode_int_sh, hvdc_f, hvdc_t, q_min_hvdc_f, q_max_hvdc_f, q_min_hvdc_t, q_max_hvdc_t, active_hvdc, v_ctrl_val_gen: int, v_ctrl_val_sh: int)[source]ο
- Parameters:
nbus
Sbase
gen_idx
q_min_gen
q_max_gen
active_gen
control_mode_int_gen
batt_idx
q_min_batt
q_max_batt
active_batt
control_mode_int_batt
sh_idx
q_min_sh
q_max_sh
active_sh
control_mode_int_sh
hvdc_f
hvdc_t
q_min_hvdc_f
q_max_hvdc_f
q_min_hvdc_t
q_max_hvdc_t
active_hvdc
v_ctrl_val_gen
:param v_ctrl_val_sh :return:
- VeraGridEngine.DataStructures.numerical_circuit.check_arr(arr: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[Any, ...], dtype[int64]] | ndarray[tuple[Any, ...], dtype[bool]] | ndarray[tuple[Any, ...], dtype[complex128]], arr_expected: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[Any, ...], dtype[int64]] | ndarray[tuple[Any, ...], dtype[bool]] | ndarray[tuple[Any, ...], dtype[complex128]], tol: float, name: str, test: str, logger: Logger) int[source]ο
- Parameters:
arr
arr_expected
tol
name
test
logger
- Returns:
- VeraGridEngine.DataStructures.numerical_circuit.correct_bus_types(gen_idx: ndarray[tuple[Any, ...], dtype[int64]], control_mode_int: ndarray[tuple[Any, ...], dtype[int64]], gen_controllable_bus_idx: ndarray[tuple[Any, ...], dtype[int64]], bus_types: ndarray[tuple[Any, ...], dtype[int64]], v_ctrl_val: int)[source]ο
Function to Correct bus types because of generators moving around due to the topology processing :param gen_idx: :param control_mode_int: :param gen_controllable_bus_idx: :param bus_types: :param v_ctrl_val: value for GeneratorControlMode.V :return:
VeraGridEngine.DataStructures.passive_branch_data moduleο
- class VeraGridEngine.DataStructures.passive_branch_data.PassiveBranchData(nelm: int, nbus: int)[source]ο
Bases:
BranchParentDataStructure to host all branches data for calculation
- copy() PassiveBranchData[source]ο
Get a deep copy of this object :return: new BranchData instance
- detect_superconductor_at(k) None[source]ο
There is a beyond terrible practice of setting branches with R=0 and X=0 as βsuperconductorββ¦. Those must be reduced of course :param k: index
- get_series_admittance() ndarray[tuple[Any, ...], dtype[complex128]][source]ο
Get the series admittance of the branches :return: complex vector
- slice(elm_idx: ndarray[tuple[Any, ...], dtype[int64]], bus_idx: ndarray[tuple[Any, ...], dtype[int64]], bus_map: ndarray[tuple[Any, ...], dtype[int64]], logger: Logger | None) PassiveBranchData[source]ο
Slice branch data by given indices :param elm_idx: array of branch indices :param bus_idx: array of bus indices :param bus_map: map from bus index to island bus index {int(o): i for i, o in enumerate(bus_idx)} :param logger: Logger :return: new BranchData instance
VeraGridEngine.DataStructures.shunt_data moduleο
- class VeraGridEngine.DataStructures.shunt_data.ShuntData[source]ο
Bases:
object- get_array_per_bus(arr: ndarray[tuple[Any, ...], dtype[float64]]) ndarray[tuple[Any, ...], dtype[float64]][source]ο
Get generator array per bus :param arr: :return:
- get_bus_indices() ndarray[tuple[Any, ...], dtype[int64]][source]ο
Get the bus indices :return: array with the bus indices
- get_controllable_and_not_controllable_indices() Tuple[ndarray[tuple[Any, ...], dtype[int64]], ndarray[tuple[Any, ...], dtype[int64]]][source]ο
Get the indices of controllable generators :return: idx_controllable, idx_non_controllable
- get_fix_injections_per_bus() ndarray[tuple[Any, ...], dtype[complex128]][source]ο
Get fixed Injections per bus :return:
- get_injections_per_bus() ndarray[tuple[Any, ...], dtype[complex128]][source]ο
Get Injections per bus :return:
- get_qmax_per_bus() ndarray[tuple[Any, ...], dtype[float64]][source]ο
Get generator Qmax per bus :return:
- get_qmin_per_bus() ndarray[tuple[Any, ...], dtype[float64]][source]ο
Get generator Qmin per bus :return:
- remap(bus_map_arr: ndarray[tuple[Any, ...], dtype[int64]])[source]ο
Remapping of the elm buses :param bus_map_arr: array of old-to-new buses
- slice(elm_idx: ndarray[tuple[Any, ...], dtype[int64]], bus_idx: ndarray[tuple[Any, ...], dtype[int64]], bus_map: ndarray[tuple[Any, ...], dtype[int64]]) ShuntData[source]ο
Slice shunt data by given indices :param elm_idx: array of branch indices :param bus_idx: array of bus indices :param bus_map: map from bus index to branch index :return: new ShuntData instance
VeraGridEngine.DataStructures.vsc_data moduleο
- class VeraGridEngine.DataStructures.vsc_data.VscData(nelm: int, nbus: int)[source]ο
Bases:
BranchParentDataVscData class provides a structured model for managing data related to Voltage Source Converters (VSC) in power grid simulations.
- slice(elm_idx: ndarray[tuple[Any, ...], dtype[int64]], bus_idx: ndarray[tuple[Any, ...], dtype[int64]], bus_map: ndarray[tuple[Any, ...], dtype[int64]], logger: Logger | None) VscData[source]ο
Slice branch data by given indices :param elm_idx: array of branch indices :param bus_idx: array of bus indices :param bus_map: map from bus index to branch index :param logger: Logger :return: new BranchData instance