hynet.expansion package¶
Submodules¶
hynet.expansion.conversion module¶
Utilities for the conversion of AC lines and transformers to DC operation.
-
hynet.expansion.conversion.convert_ac_line_to_hvdc_system(scenario, branch_id, loss_fwd, loss_bwd, q_to_p_ratio, base_kv_map=None, capacity_factor=nan, amalgamate=True)[source]¶ Convert the specified AC line to an HVDC system.
This function models the conversion of an AC line to DC operation by introducing AC/DC converters at the line’s terminals and updating the branch parameters. If
amalgamateisTrue(default) and there is already an (appropriate) HVDC system connected to either or both terminals of the line, the converted line is connected to this DC subgrid (to reduce the number of converters). Otherwise, always a point-to-point HVDC system is implemented. The branch parameters are updated by retaining only the series resistance and line rating, where both are updated according to the change of the base voltage. For the latter, the uprating may also be specified explicitly viacapacity_factor. The introduced DC buses inherit the voltage limits (in p.u.) and zone from the respective AC bus. Please note that this is a simplified representation of such a conversion process for use in system-level studies, while the actual conversion of an AC line to DC operation involves extensive and case-specific considerations dependent on the present line configuration, see e.g. [1] for more details.Parameters: - scenario (Scenario) – Scenario that shall be modified.
- branch_id (hynet_id_) – ID of the branch that shall be converted.
- loss_fwd (float) – Loss factor in percent for the forward flow of active power of the introduced converters.
- loss_bwd (float) – Loss factor in percent for the backward flow of active power of the introduced converters.
- q_to_p_ratio (float) – Ratio of the Q-capability of the introduced converters w.r.t. their P-capability.
- base_kv_map (dict[hynet_float_, hynet_float_,], optional) – Dictionary that maps the AC base voltage (in kV) to the DC base
voltage (in kV). By default, a mapping
x -> floor(sqrt(2) * x)is used. - capacity_factor (float, optional) – Capacity factor for the conversion, i.e., the branch rating and the converter P-capability is set to the current branch rating times the capacity factor. By default, the capacity factor is set to the uprating due to the change of the base voltage.
- amalgamate (bool, optional) – If
True(default), the converted line is amalgamated with an adjacent HVDC system if possible. Otherwise, always a point-to-point HVDC system is implemented. By convention, only AC/DC converters with the source terminal at the AC side are considered in the detection of and amalgamation with adjacent HVDC systems. The converters introduced by this function adhere to this convention.
Returns: - converter_id_src (.hynet_id_) – ID of the AC/DC converter at the source terminal of the converted line.
- converter_id_dst (.hynet_id_) – ID of the AC/DC converter at the destination terminal of the converted line.
- amalgamated (tuple(bool, bool)) – Named tuple
('src', 'dst')with a Boolean flag for the source and destination terminal of the line that isTrueif that terminal was amalgamated with an existing HVDC system andFalseotherwise.
References
[1] CIGRE Working Group B2.41, “Guide to the Conversion of Existing AC Lines to DC Operation,” CIGRE Brochure 583, May 2014.
-
hynet.expansion.conversion.convert_transformer_to_b2b_converter(scenario, branch_id, loss_dyn, q_to_p_ratio, capacity_factor=1.0, amalgamate=True, annotation_separator=', ')[source]¶ Replace the specified transformer (or AC branch) by an AC/AC converter.
This function models the conversion of a transformer to DC operation by replacing the branch with an AC/AC (back-to-back) converter. Please note that this is a simplified representation of such a conversion process for use in system-level studies.
Parameters: - scenario (Scenario) – Scenario that shall be modified.
- branch_id (hynet_id_) – ID of the branch that shall be converted.
- loss_dyn (float) – Loss factor in percent for the forward and backward conversion losses of the introduced converter.
- q_to_p_ratio (float) – Ratio of the Q-capability of the introduced converter w.r.t. its P-capability.
- capacity_factor (float, optional) – Capacity factor for the conversion (default
1.0): The P-capability is set to the branch rating times the capacity factor. - amalgamate (bool, optional) – If
True(default) and there exists an AC/AC converter between the source and destination bus of the branch, this converter is uprated accordingly. Otherwise, always a new converter is added. - annotation_separator (str, optional) – If not
None(default', '), the branch annotation is copied to the converter annotation and, if the latter is not empty, this separator string is employed to separate the annotations.
Returns: - converter_id (.hynet_id_) – ID of the AC/AC converter that replaces the branch.
- amalgamated (bool) –
Trueif amalgamated andFalseotherwise.
hynet.expansion.selection module¶
Utilities for the selection of branches for an AC to DC conversion.
-
hynet.expansion.selection.get_branches_outside_mst(scenario, branch_weights)[source]¶ Return an array of branch IDs that reside outside the minimum spanning tree.
The branch weights associate a weight with (selected) branches of the scenario and all corridors defined by these branches are considered as edges of the graph. Please note that converters are not considered, i.e., the function operates on (selected) branches of the subgrids. This function returns the IDs of the branches that reside outside the corridors of the minimum spanning tree.
Parameters: - scenario (Scenario) – Scenario that shall be considered.
- branch_weights (pandas.Series) – Branch weights indexed by the branch ID.
Returns: index – Pandas index with the branch IDs of those branches that reside outside the corridors of the minimum spanning tree.
Return type: pandas.Index
See also
-
hynet.expansion.selection.get_islanding_branches(scenario, show_progress=True)[source]¶ Return the branch IDs for all corridors whose removal leads to islanding.
Branches which are part of all spanning trees of (the corridors of) a grid are of particular interest, because their congestion can directly lead to infeasibility of the optimal power flow as there are no alternative power flow routes. This function identifies the corridors that are part of all spanning trees and returns the IDs of the branches that reside in these corridors.
Parameters: - scenario (Scenario) – Scenario that shall be evaluated.
- show_progress (bool, optional) – If
True(default), the progress is reported to the standard output.
Returns: Index with the ID of all branches that reside in corridors whose removal leads to islanding.
Return type: pandas.Index
-
hynet.expansion.selection.get_mst_branches(scenario, branch_weights)[source]¶ Return an array of branch IDs that are part of the minimum spanning tree.
The branch weights associate a weight with (selected) branches of the scenario and all corridors defined by these branches are considered as edges of the graph. Please note that converters are not considered, i.e., the function operates on (selected) branches of the subgrids. This function returns the IDs of the branches that reside in the corridors of the minimum spanning tree.
Parameters: - scenario (Scenario) – Scenario that shall be considered.
- branch_weights (pandas.Series) – Branch weights indexed by the branch ID.
Returns: index – Pandas index with the branch IDs of those branches that reside in the corridors of the minimum spanning tree.
Return type: pandas.Index
See also
-
hynet.expansion.selection.get_series_resistance_weights(scenario, prefer_transformers=False)[source]¶ Return a pandas Series of branch weights based on their series resistance in p.u.
Parameters: - scenario (Scenario) – Scenario for which the branch weights shall be created.
- prefer_transformers (bool, optional) – If
True(defaultFalse), the weight of transformer branches is increased by the maximum series resistance in the system to prefer their conversion to DC operation.
Returns: branch_weights – Branch weights indexed by the branch ID.
Return type: pandas.Series
See also
Module contents¶
Collection of utilities for grid expansion measures.