VeraGridEngine.Simulations.ATC packageο
Submodulesο
VeraGridEngine.Simulations.ATC.available_transfer_capacity_driver moduleο
- class VeraGridEngine.Simulations.ATC.available_transfer_capacity_driver.AvailableTransferCapacityDriver(grid: MultiCircuit, options: AvailableTransferCapacityOptions | None, opf_results: OptimalPowerFlowResults | None = None, t_idx: int | None = None)[source]ο
Bases:
DriverTemplate- name = 'Available transfer capacity'ο
- opf_results: OptimalPowerFlowResults | Noneο
- optionsο
- t_idx: int | Noneο
- tpe = 'Available transfer capacity'ο
- class VeraGridEngine.Simulations.ATC.available_transfer_capacity_driver.AvailableTransferCapacityResults(br_names, bus_names, rates, contingency_rates: Vec, clustering_results: ClusteringResults | None)[source]ο
Bases:
ResultsTemplate- CLASS_DATA_VARIABLES = {}ο
- CLASS_RESULTS_DECLARATIONS = ()ο
- LOCAL_RESULTS_DECLARATIONS = ()ο
- base_exchangeο
- branch_namesο
- bus_namesο
- contingency_ratesο
- get_dict()[source]ο
Returns a dictionary with the results sorted in a dictionary :return: dictionary of 2D numpy arrays (probably of complex numbers)
- mdl(result_type: ResultTypes) ResultsTable[source]ο
Plot the results :param result_type: :return:
- ratesο
- raw_reportο
- reportο
- report_headersο
- report_indicesο
- VeraGridEngine.Simulations.ATC.available_transfer_capacity_driver.compute_alpha(ptdf: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], dP: ndarray[tuple[Any, ...], dtype[float64]], dT: float = 1.0) ndarray[tuple[Any, ...], dtype[float64]][source]ο
Compute line sensitivity to power transfer :param ptdf: Power transfer distribution factors (n-branch, n-bus) :param dP: Vector of power increments to used for the power exchange :param dT: Exchange amount (MW) usually a unitary increment is sufficient :return: Exchange sensitivity vector for all the lines
- VeraGridEngine.Simulations.ATC.available_transfer_capacity_driver.compute_alpha_n1(ptdf: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], lodf: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], dP: ndarray[tuple[Any, ...], dtype[float64]], alpha: ndarray[tuple[Any, ...], dtype[float64]], dT=1.0) ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]][source]ο
- Parameters:
ptdf β Power transfer distribution factors (n-branch, n-bus)
lodf
dP
alpha
dT
- Returns:
- VeraGridEngine.Simulations.ATC.available_transfer_capacity_driver.compute_atc_list(br_idx: ndarray[tuple[Any, ...], dtype[int64]], contingency_br_idx: ndarray[tuple[Any, ...], dtype[int64]], lodf: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], alpha: ndarray[tuple[Any, ...], dtype[float64]], flows: ndarray[tuple[Any, ...], dtype[float64]], rates: ndarray[tuple[Any, ...], dtype[float64]], contingency_rates: ndarray[tuple[Any, ...], dtype[float64]], base_exchange: float, threshold: float, time_idx: int) List[Tuple[int, int, int, float, float, float, float, float, float, float, float, float, float, float, float]][source]ο
Compute all linesβ available transfer capacity (ATC) :param br_idx: array of branch indices to analyze :param contingency_br_idx: array of branch indices to fail :param lodf: Line outage distribution factors (n-branch, n-outage branch) :param alpha: Branch sensitivities to the exchange [p.u.] :param flows: Branches power injected at the βfromβ side [MW] :param rates: all Branches rates vector :param contingency_rates: all Branches contingency rates vector :param base_exchange: amount already exchanges between areas :param threshold: value that determines if a line is studied for the ATC calculation :param time_idx: time index of the calculation :return: List of:
time_idx, # 0 monitored index, # 1 contingency index, # 2 alpha of branch m, # 3 beta, # 4 lodf[m, c], # 5 atc_n, # 6 atc_mc, # 7 final_atc, # 8 ntc, # 9 flows[m], # 10 contingency_flow, # 11 loading, # 12 contingency loading, # 13 base_exchange #14
- VeraGridEngine.Simulations.ATC.available_transfer_capacity_driver.compute_dP(P0: ndarray[tuple[Any, ...], dtype[float64]], Pgen: ndarray[tuple[Any, ...], dtype[float64]], P_installed: ndarray[tuple[Any, ...], dtype[float64]], Pload: ndarray[tuple[Any, ...], dtype[float64]], bus_a1_idx: ndarray[tuple[Any, ...], dtype[int64]], bus_a2_idx: ndarray[tuple[Any, ...], dtype[int64]], dT: float = 1.0, mode: int = 0) ndarray[tuple[Any, ...], dtype[float64]][source]ο
Compute power injections to compute the inter-area sensitivities :param P0: all bus Injections [p.u.] :param Pgen: bus generation current power [p.u.] :param P_installed: bus generation installed power [p.u.] :param Pload: bus load power [p.u.] :param bus_a1_idx: bus indices of the sending region :param bus_a2_idx: bus indices of the receiving region :param dT: Exchange amount (MW) usually a unitary increment is sufficient :param mode: Type of power shift
0: shift generation based on the current generated power 1: shift generation based on the installed power 2: shift load 3 (or else): shift using generation and load
- Returns:
Exchange sensitivity vector for all the lines
VeraGridEngine.Simulations.ATC.available_transfer_capacity_options moduleο
- class VeraGridEngine.Simulations.ATC.available_transfer_capacity_options.AvailableTransferCapacityOptions(distributed_slack: bool = True, correct_values: bool = True, use_provided_flows: bool = False, bus_idx_from: None | ndarray[tuple[Any, ...], dtype[int64]] = None, bus_idx_to: None | ndarray[tuple[Any, ...], dtype[int64]] = None, idx_br: None | ndarray[tuple[Any, ...], dtype[int64]] = None, sense_br: None | ndarray[tuple[Any, ...], dtype[float64]] = None, Pf: None | ndarray[tuple[Any, ...], dtype[float64]] = None, idx_hvdc_br: None | ndarray[tuple[Any, ...], dtype[int64]] = None, sense_hvdc_br: None | ndarray[tuple[Any, ...], dtype[float64]] = None, Pf_hvdc: None | ndarray[tuple[Any, ...], dtype[float64]] = None, dT: float = 100.0, threshold: float = 0.02, mode: AvailableTransferMode = Generation, max_report_elements: int = -1, use_clustering: bool = False, cluster_number: int = 200)[source]ο
Bases:
OptionsTemplateAvailable Transfer Capacity Options
- CLASS_NON_EDITABLE_PROPERTIES: Tuple[str, ...] = ('idtag', 'selected_to_merge', 'diff_changes')ο
- CLASS_PROPERTIES_WITH_PROFILE: Dict[str, str] = {}ο
- CLASS_PROPERTY_DECLARATIONS: Tuple[GCProp, ...] = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:selected_to_merge, prop:comment, prop:diff_changes, prop:distributed_slack, prop:correct_values, prop:use_provided_flows, prop:bus_idx_from, prop:bus_idx_to, prop:inter_area_branch_idx, prop:inter_area_branch_sense, prop:Pf, prop:idx_hvdc_br, prop:inter_area_hvdc_branch_sense, prop:Pf_hvdc, prop:dT, prop:threshold, prop:mode, prop:max_report_elements, prop:use_clustering, prop:cluster_number)ο
- CLASS_PROPERTY_LIST: Tuple[GCProp, ...] = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:selected_to_merge, prop:comment, prop:diff_changes, prop:distributed_slack, prop:correct_values, prop:use_provided_flows, prop:bus_idx_from, prop:bus_idx_to, prop:inter_area_branch_idx, prop:inter_area_branch_sense, prop:Pf, prop:idx_hvdc_br, prop:inter_area_hvdc_branch_sense, prop:Pf_hvdc, prop:dT, prop:threshold, prop:mode, prop:max_report_elements, prop:use_clustering, prop:cluster_number)ο
- CLASS_REGISTERED_PROPERTIES: Dict[str, GCProp] = {'Pf': prop:Pf, 'Pf_hvdc': prop:Pf_hvdc, 'action': prop:action, 'bus_idx_from': prop:bus_idx_from, 'bus_idx_to': prop:bus_idx_to, 'cluster_number': prop:cluster_number, 'code': prop:code, 'comment': prop:comment, 'correct_values': prop:correct_values, 'dT': prop:dT, 'diff_changes': prop:diff_changes, 'distributed_slack': prop:distributed_slack, 'idtag': prop:idtag, 'idx_hvdc_br': prop:idx_hvdc_br, 'inter_area_branch_idx': prop:inter_area_branch_idx, 'inter_area_branch_sense': prop:inter_area_branch_sense, 'inter_area_hvdc_branch_sense': prop:inter_area_hvdc_branch_sense, 'max_report_elements': prop:max_report_elements, 'mode': prop:mode, 'name': prop:name, 'rdfid': prop:rdfid, 'selected_to_merge': prop:selected_to_merge, 'threshold': prop:threshold, 'use_clustering': prop:use_clustering, 'use_provided_flows': prop:use_provided_flows}ο
- LOCAL_PROPERTY_DECLARATIONS: Tuple[GCProp, ...] = (prop:distributed_slack, prop:correct_values, prop:use_provided_flows, prop:bus_idx_from, prop:bus_idx_to, prop:inter_area_branch_idx, prop:inter_area_branch_sense, prop:Pf, prop:idx_hvdc_br, prop:inter_area_hvdc_branch_sense, prop:Pf_hvdc, prop:dT, prop:threshold, prop:mode, prop:max_report_elements, prop:use_clustering, prop:cluster_number)ο
- action: ActionTypeο
- comment: strο
- device_type: DeviceTypeο
- diff_changesο
- selected_to_mergeο
VeraGridEngine.Simulations.ATC.available_transfer_capacity_ts_driver moduleο
- class VeraGridEngine.Simulations.ATC.available_transfer_capacity_ts_driver.AvailableTransferCapacityTimeSeriesDriver(grid: MultiCircuit, options: AvailableTransferCapacityOptions | None, time_indices: ndarray[tuple[Any, ...], dtype[int64]], clustering_results: ClusteringResults | None = None)[source]ο
Bases:
TimeSeriesDriverTemplate- name = 'Available transfer capacity time series'ο
- optionsο
- tpe = 'Available transfer capacity time series'ο
- class VeraGridEngine.Simulations.ATC.available_transfer_capacity_ts_driver.AvailableTransferCapacityTimeSeriesResults[source]ο
Bases:
ResultsTemplate- CLASS_DATA_VARIABLES = {}ο
- CLASS_RESULTS_DECLARATIONS = ()ο
- LOCAL_RESULTS_DECLARATIONS = ()ο
- base_exchangeο
- branch_namesο
- bus_namesο
- contingency_ratesο
- get_dict()[source]ο
Returns a dictionary with the results sorted in a dictionary :return: dictionary of 2D numpy arrays (probably of complex numbers)
- mdl(result_type: ResultTypes) ResultsTable[source]ο
Plot the results :param result_type: :return:
- ratesο
- raw_reportο
- reportο
- report_headers: StrVecο
- report_indices: IntVecο