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

get_steps() List[int][source]

Get variations list of strings

name = 'Available transfer capacity'
opf_results: OptimalPowerFlowResults | None
options
run() None[source]

Run thread

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)

get_steps()[source]
Returns:

make_report(threshold: float = 0.0)[source]
Returns:

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_driver.get_proportional_deltas_sensed(P, idx, dP=1.0)[source]
Parameters:
  • P – all power Injections

  • idx – bus indices of the sending region

  • dP – Power amount

Returns:

VeraGridEngine.Simulations.ATC.available_transfer_capacity_driver.scale_proportional_sensed(P, idx1, idx2, dT=1.0)[source]
Parameters:
  • P – Power vector

  • idx1 – indices of sending region

  • idx2 – indices of receiving region

  • dT – Exchange amount

Returns:

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: OptionsTemplate

Available 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

cancel()[source]

Cancel the simulation

get_steps() List[str][source]

Get time steps list of strings

name = 'Available transfer capacity time series'
options
run() None[source]

Run thread

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
clear()[source]

Crear the results :return:

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)

make_report(threshold: float = 0.0)[source]
Returns:

mdl(result_type: ResultTypes) ResultsTable[source]

Plot the results :param result_type: :return:

rates
raw_report
report
report_headers: StrVec
report_indices: IntVec

Module contents