hynet.reduction.large_scale package

Submodules

hynet.reduction.large_scale.combination module

Combined network reduction strategy.

hynet.reduction.large_scale.combination.reduce_system(scenario, solver=None, max_island_size=None, rel_impedance_thres=0.05, feature_depth=5, critical_mw_diff=None, max_price_diff=0.0, show_evaluation=False, return_bus_id_map=False, preserve_aggregation=False)[source]

Apply a feature- and structure-preserving network reduction.

This function applies the feature- and structure-preserving network reduction described in [1] to the scenario. It comprises a topology-based, electrical coupling-based, and market-based reduction stage, which identifies and aggregates appropriate subgrids that do not contain any features and exhibit a minor impact on the overall behavior of the system. Features are defined by a Boolean-valued column feature of the bus and branch data frame of the scenario. If these columns are not present upon the call of this function, the standard features described in Section III in [1] are added.

Depending on the parameterization, this function performs an extensive model analysis and several OPF computations, due to which its execution may take quite some time. To track the progress, the logging of info messages may be activated via

>>> import logging
>>> logging.basicConfig(level=logging.INFO)

With a corresponding parameterization, the individual reduction stages can be activated or deactivated in this combined reduction strategy. However, in case the need arises, the individual reduction stages as well as their evaluation may also be performed “manually” to customize the reduction process, please refer to the “See Also” section for directions to the respective modules.

Parameters:
  • scenario (Scenario) – Scenario that shall be processed.
  • solver (SolverInterface, optional) – Solver for the OPF problems. The default selects the most appropriate QCQP solver among those installed.
  • max_island_size (int, optional) – Maximum size of an “island” in terms of its number of buses. By default, it is set to approximately 1% of the total number of buses. Set this parameter to 0 to disable the reduction of “islands”, i.e., only single buses and lines of buses are reduced, or to -1 to disable the entire topology-based reduction, i.e., the reduction of single buses, lines of buses, and “islands”.
  • rel_impedance_thres (float, optional) – Relative threshold \(\tau\) w.r.t. the maximum series impedance modulus that defines a strong coupling of buses (see equation (3) in [1]). Default is 0.05 (5%). Set this parameter to 0 to disable the electrical coupling-based reduction.
  • feature_depth (int, optional) – Depth \(\vartheta\) for which buses in the vicinity of a critical injector are declared as features, i.e., these buses can be reached from the terminal bus of a critical injector by traversing a maximum of \(\vartheta\) branches. Default is 5. Set this parameter to 0 to disable the feature refinement.
  • critical_mw_diff (float, optional) – Absolute threshold in MW on the active power dispatch difference of an injector to consider it as critical. The default is 0.02% of the total active power load.
  • max_price_diff (float, optional) – Threshold \(\delta\) in $/MW on fluctuations of the nodal price (LMP) from the center of a price cluster to consider the respective buses to be part of the cluster (cf. equation (4) in [1]). Set this parameter to 0 to disable the marked-based reduction.
  • show_evaluation (bool, optional) – If True (default is False), the evaluation of the individual reduction stages is visualized.
  • return_bus_id_map (bool, optional) – If True (default is False), a mapping from the buses of the original system to the buses of the reduced system is returned.
  • preserve_aggregation (bool, optional) – If True (default is False), the information on aggregated buses in the column aggregation of the bus data frame is copied to the bus annotation to preserve it when storing the reduced system to a grid database. After loading from the grid database, the column can be restored via restore_aggregation_info.
Returns:

  • evaluation (pandas.DataFrame) – Data frame with information on the extent and accuracy of the reduction in the individual reduction stages. This data frame is indexed by the name of the reduction stage, with the original system named '', and comprises the following columns:

    bus_reduction: (hynet_float_)

    Ratio of the number of reduced buses w.r.t. the total number of buses before the reduction.

    branch_reduction: (hynet_float_)

    Ratio of the number of reduced branches w.r.t. the total number of branches before the reduction.

    cycle_reduction: (hynet_float_)

    Ratio of the number of reduced cycles w.r.t. the total number of cycles before the reduction.

    error_disp: (hynet_float_)

    Contribution-weighted mean relative active power dispatch error as defined in equation (1) in [1].

    error_disp_s: (hynet_float_)

    Contribution-weighted mean relative apparent power dispatch error.

    error_flow: (hynet_float_)

    Contribution-weighted mean relative active power branch flow error as defined in equation (2) in [1].

    error_flow_s: (hynet_float_)

    Contribution-weighted mean relative apparent power branch flow error.

    opf: (hynet.OPFResult)

    OPF result for the respective scenario.

  • bus_id_map (pandas.Series) – Only returned if return_bus_id_map is True. This series is indexed by the bus IDs before network reduction, while the values are the bus IDs after network reduction, i.e., it maps the buses of the original system to the buses in the reduced system.

See also

hynet.reduction.large_scale.features()
Specification of features.
hynet.reduction.large_scale.topology()
Topology-based network reduction.
hynet.reduction.large_scale.coupling()
Electrical coupling-based network reduction.
hynet.reduction.large_scale.market()
Market-based network reduction.
hynet.reduction.large_scale.evaluation()
Evaluation of the extent and accuracy of a reduction.
hynet.reduction.large_scale.sweep()
Parameter sweeps to support the configuration process.

References

[1](1, 2, 3, 4, 5, 6) J. Sistermanns, M. Hotz, D. Hewes, R. Witzmann, and W. Utschick, “Feature- and Structure-Preserving Network Reduction for Large-Scale Transmission Grids,” 13th IEEE PES PowerTech Conference, Milano, Italy, Jun. 2019.

hynet.reduction.large_scale.coupling module

Electrical coupling-based subgrid selection and reduction.

hynet.reduction.large_scale.coupling.get_critical_injector_features(opf_reference, opf_reduction, feature_depth, critical_mw_diff=None)[source]

Determine bus features to mitigate the reduction error at critical injectors.

It has been observed that the majority of the dispatch error induced by the electrical coupling-based reduction is often due to a comparably small number of injectors. This effect may be mitigated by declaring the buses in the vicinity of critical injectors as features, see also Section V-A in [1]. This function identifies these buses and returns their IDs.

Parameters:
  • opf_reference (OPFResult) – OPF result of the scenario before the reduction.
  • opf_reduction (OPFResult) – OPF result of the scenario after the reduction.
  • feature_depth (int) – Depth \(\vartheta\) for which buses in the vicinity of a critical injector are declared as features, i.e., these buses can be reached from the terminal bus of a critical injector by traversing a maximum of \(\vartheta\) branches.
  • critical_mw_diff (float, optional) – Absolute threshold in MW on the active power dispatch difference of an injector to consider it as critical. The default is 0.02% of the total active power load.
Returns:

critical_buses – Array of bus IDs that should be marked as a feature.

Return type:

numpy.ndarray[hynet_id_]

References

[1]J. Sistermanns, M. Hotz, D. Hewes, R. Witzmann, and W. Utschick, “Feature- and Structure-Preserving Network Reduction for Large-Scale Transmission Grids,” 13th IEEE PES PowerTech Conference, Milano, Italy, Jun. 2019.
hynet.reduction.large_scale.coupling.reduce_by_coupling(scenario, rel_impedance_thres=0.05)[source]

Apply an electrical coupling-based network reduction to the scenario.

This function performs the electrical coupling-based network reduction described in Section IV-C in [1].

Parameters:
  • scenario (hynet.Scenario) – Scenario that shall be processed.
  • rel_impedance_thres (float, optional) – Relative threshold \(\tau\) w.r.t. the maximum series impedance modulus that defines a strong coupling of buses (see equation (3) in [1]). Default is 0.05 (5%).
Returns:

Number of buses that were reduced.

Return type:

int

References

[1](1, 2) J. Sistermanns, M. Hotz, D. Hewes, R. Witzmann, and W. Utschick, “Feature- and Structure-Preserving Network Reduction for Large-Scale Transmission Grids,” 13th IEEE PES PowerTech Conference, Milano, Italy, Jun. 2019.

hynet.reduction.large_scale.evaluation module

Evaluation of the network reduction accuracy.

hynet.reduction.large_scale.evaluation.evaluate_reduction(opf_reference, opf_reduction, name=None)[source]

Return an evaluation of the extent and accuracy of the reduction.

Parameters:
  • opf_reference (OPFResult) – OPF result of the scenario before the reduction.
  • opf_reduction (OPFResult) – OPF result of the scenario after the reduction.
  • name (object, optional) – Name of the returned series. This may be set, e.g., to the name of the reduction stage or characteristic parameter value.
Returns:

evaluation – Series with information on the extent and accuracy of the reduction with the following entries:

bus_reduction: (hynet_float_)

Ratio of the number of reduced buses w.r.t. the total number of buses before the reduction.

branch_reduction: (hynet_float_)

Ratio of the number of reduced branches w.r.t. the total number of branches before the reduction.

cycle_reduction: (hynet_float_)

Ratio of the number of reduced cycles w.r.t. the total number of cycles before the reduction.

error_disp: (hynet_float_)

Contribution-weighted mean relative active power dispatch error as defined in equation (1) in [1].

error_disp_s: (hynet_float_)

Contribution-weighted mean relative apparent power dispatch error.

error_flow: (hynet_float_)

Contribution-weighted mean relative active power branch flow error as defined in equation (2) in [1].

error_flow_s: (hynet_float_)

Contribution-weighted mean relative apparent power branch flow error.

Return type:

pandas.Series

References

[1](1, 2) J. Sistermanns, M. Hotz, D. Hewes, R. Witzmann, and W. Utschick, “Feature- and Structure-Preserving Network Reduction for Large-Scale Transmission Grids,” 13th IEEE PES PowerTech Conference, Milano, Italy, Jun. 2019.
hynet.reduction.large_scale.evaluation.show_reduction_evaluation(evaluation)[source]

Show the evaluation of a series of reduction stages or a parameter sweep.

Parameters:evaluation (pandas.DataFrame) –

Data frame with information on the extent and accuracy of the individual reduction stages or parameters. This data frame must be indexed by the stage names / parameter values and comprise the following columns:

bus_reduction: (hynet_float_)
Ratio of the number of reduced buses w.r.t. the total number of buses before the reduction.
branch_reduction: (hynet_float_)
Ratio of the number of reduced branches w.r.t. the total number of branches before the reduction.
cycle_reduction: (hynet_float_)
Ratio of the number of reduced cycles w.r.t. the total number of cycles before the reduction.
error_disp: (hynet_float_)
Contribution-weighted mean relative active power dispatch error as defined in equation (1) in [1].
error_flow: (hynet_float_)
Contribution-weighted mean relative active power branch flow error as defined in equation (2) in [1].
Returns:fig
Return type:matplotlib.figure.Figure

References

[1](1, 2) J. Sistermanns, M. Hotz, D. Hewes, R. Witzmann, and W. Utschick, “Feature- and Structure-Preserving Network Reduction for Large-Scale Transmission Grids,” 13th IEEE PES PowerTech Conference, Milano, Italy, Jun. 2019.

hynet.reduction.large_scale.features module

Declaration of features for the network reduction.

hynet.reduction.large_scale.features.add_branch_features(scenario, length_threshold)[source]

Add the standard branch-related features.

The transformers as well as long branches are marked as features.

Parameters:
  • scenario (Scenario) – Scenario that shall be processed.
  • length_threshold (float) – Threshold in kilometers on the length of a branch to consider it as long.
hynet.reduction.large_scale.features.add_bus_features(scenario)[source]

Add the standard bus-related features.

The terminal buses of conventional generators as well as all reference buses are marked as features.

Parameters:scenario (Scenario) – Scenario that shall be processed.
hynet.reduction.large_scale.features.add_congestion_features(scenario, result, loading_threshold, dv_threshold)[source]

Add the standard congestion-related features.

Branches that are highly loaded or that exhibit binding constraints are marked as features.

Parameters:
  • scenario (Scenario) – Scenario that shall be processed.
  • result (OPFResult) – OPF result of the scenario.
  • loading_threshold (float) – Relative threshold on the branch flow w.r.t. its effective rating to consider it as highly loaded.
  • dv_threshold (float) – Threshold on the dual variables of the ampacity and angle difference constraint.
hynet.reduction.large_scale.features.add_converter_features(scenario)[source]

Add the standard converter-related features.

The terminal buses of converters are marked as features.

Parameters:scenario (Scenario) – Scenario that shall be processed.
hynet.reduction.large_scale.features.add_feature_columns(scenario)[source]

Ensure that the provided scenario contains the feature columns.

For the network reduction, buses and branches of particular interest can be marked as features of the system to prevent their reduction. This function adds the respective columns to the data frames of the scenario, in case that they do no exist already.

Parameters:scenario (Scenario) – Scenario that should contain the feature columns.
Returns:False if one or more feature columns already existed (i.e., feature information is present) and True otherwise.
Return type:bool
hynet.reduction.large_scale.features.add_standard_features(scenario, result, length_threshold=50, loading_threshold=0.8, dv_threshold=1.0)[source]

Add the standard features for feature-preserving network reduction.

The feature-preserving network reduction permits the preservation of certain entities of particular importance. This function marks the entities described in Section III in [1] as features, i.e., it adds the standard bus-, branch-, converter- and injector-related features to the scenario.

Parameters:
  • scenario (Scenario) – Scenario that shall be processed.
  • result (OPFResult) – OPF result of the scenario.
  • length_threshold (float, optional) – Threshold in kilometers on the length of a branch to consider it as long (default is 50km).
  • loading_threshold (float, optional) – Relative threshold on the branch flow w.r.t. its effective rating to consider it as highly loaded (default is 0.8, i.e., 80% utilization).
  • dv_threshold (float, optional) – Threshold on the dual variables of the ampacity and angle difference constraint (default is 1.0).

See also

hynet.reduction.large_scale.features.add_feature_columns()
Add the feature columns to the scenario.
hynet.reduction.large_scale.features.add_bus_features()
Add the standard bus-related features.
hynet.reduction.large_scale.features.add_converter_features()
Add the standard converter-related features.
hynet.reduction.large_scale.features.add_branch_features()
Add the standard branch-related features.
hynet.reduction.large_scale.features.add_congestion_features()
Add the standard congestion-related features.

References

[1]J. Sistermanns, M. Hotz, D. Hewes, R. Witzmann, and W. Utschick, “Feature- and Structure-Preserving Network Reduction for Large-Scale Transmission Grids,” 13th IEEE PES PowerTech Conference, Milano, Italy, Jun. 2019.
hynet.reduction.large_scale.features.count_features(scenario)[source]

Return the number of features of the scenario.

Parameters:scenario (Scenario) – Scenario that shall be processed.
Returns:The number of bus and branch features.
Return type:int
hynet.reduction.large_scale.features.has_branch_features(scenario, subgrid)[source]

Return True if the subgrid contains any branch features.

Parameters:
  • scenario (Scenario) – Scenario that contains the subgrid.
  • subgrid (list[hynet_id_]) – List with the bus IDs of the subgrid.
Returns:

True if the subgrid contains any branch features and False otherwise.

Return type:

bool

hynet.reduction.large_scale.features.has_bus_features(scenario, subgrid)[source]

Return True if the subgrid contains any bus features.

Parameters:
  • scenario (Scenario) – Scenario that contains the subgrid.
  • subgrid (list[hynet_id_]) – List with the bus IDs of the subgrid.
Returns:

True if the subgrid contains any bus features and False otherwise.

Return type:

bool

hynet.reduction.large_scale.features.has_features(scenario, subgrid)[source]

Return True if the subgrid contains any bus or branch features.

Parameters:
  • scenario (Scenario) – Scenario that contains the subgrid.
  • subgrid (list[hynet_id_]) – List with the bus IDs of the subgrid.
Returns:

True if the subgrid contains any bus or branch features and False otherwise.

Return type:

bool

hynet.reduction.large_scale.market module

Market-based subgrid selection and reduction.

hynet.reduction.large_scale.market.combine_overlapping_clusters(candidates)[source]

Combine any overlapping clusters to a single cluster.

hynet.reduction.large_scale.market.identify_price_clusters(opf_result, max_price_diff)[source]

Identify clusters of buses that exhibit a similar nodal price.

The dual variable of the active power balance constraint is considered as the nodal price (i.e., the locational marginal price if the OPF problem exhibits strong duality). After the price clusters were identified, overlapping clusters are combined, such that a bus of the system may only be part of one cluster.

Parameters:
  • opf_result (OPFResult) – OPF result based on which price clusters shall be identified.
  • max_price_diff (float) – Threshold \(\delta\) in $/MW on fluctuations of the nodal price (LMP) from the center of a price cluster to consider the respective buses to be part of the cluster.
Returns:

clusters – Data frame with information on the price clusters, whose index consists of the bus ID of the cluster centers and the following columns:

cluster: (hynet_int_)

Number of cycles in the subgrid.

price_ref: (.hynet_float_)

Reference price for the cluster. Note that, due to the combining of overlapping clusters, the price difference within a cluster may exceed the threshold on the price fluctuations.

Return type:

pandas.DataFrame

hynet.reduction.large_scale.market.reduce_by_market(scenario, opf_result, max_price_diff)[source]

Apply a market-based network reduction to the scenario.

This function performs the marked-based network reduction described in Section IV-D in [1].

Parameters:
  • scenario (Scenario) – Scenario that shall be processed.
  • opf_result (OPFResult) – OPF result of the provided scenario.
  • max_price_diff (float) – Threshold \(\delta\) in $/MW on fluctuations of the nodal price (LMP) from the center of a price cluster to consider the respective buses to be part of the cluster (cf. equation (4) in [1]).
Returns:

Number of buses that were reduced.

Return type:

int

References

[1](1, 2) J. Sistermanns, M. Hotz, D. Hewes, R. Witzmann, and W. Utschick, “Feature- and Structure-Preserving Network Reduction for Large-Scale Transmission Grids,” 13th IEEE PES PowerTech Conference, Milano, Italy, Jun. 2019.

hynet.reduction.large_scale.subgrid module

Subgrid reduction: Aggregate the buses of a subgrid to the representative bus.

hynet.reduction.large_scale.subgrid.create_bus_id_map(scenario)[source]

Create a mapping from the original buses to the reduced buses.

During the network reduction, certain buses are aggregated at other buses. This function creates a mapping from the buses of the original system to the buses of the reduced system.

Parameters:scenario (Scenario) – Scenario that was subject to network reduction.
Returns:bus_id_map – This series is indexed by the bus IDs before network reduction, while the values are the bus IDs after network reduction, i.e., it maps the buses of the original system to the buses in the reduced system.
Return type:pandas.Series
hynet.reduction.large_scale.subgrid.preserve_aggregation_info(scenario)[source]

Copy the information on aggregated buses to the bus annotation.

During the network reduction, certain buses are aggregated at other buses, where the aggregated buses are documented in the column aggregation. As this is an extension to hynet’s scenario format, it is not stored to the grid database upon saving. To this end, this information is preserved using the bus annotation.

Parameters:scenario (Scenario) – Scenario that was subject to network reduction.
hynet.reduction.large_scale.subgrid.reduce_subgrid(scenario, representative_bus, subgrid)[source]

Reduce the subgrid buses to the representative bus, if it contains no features.

If the subgrid does not contain any features, it is reduced to the representative bus as described in Section IV-A in [1]. In case of the latter, a column aggregation is added/updated in the bus data frame that contains a list with the bus ID of all buses that were aggregated to the respective bus.

Parameters:
  • scenario (Scenario) – Scenario that shall be processed.
  • representative_bus (hynet_id_) – Bus ID of the representative bus.
  • subgrid (Iterable[hynet_id_]) – Iterable with the bus IDs of the subgrid that shall be aggregated at the representative bus. It must not contain the representative bus.

References

[1]J. Sistermanns, M. Hotz, D. Hewes, R. Witzmann, and W. Utschick, “Feature- and Structure-Preserving Network Reduction for Large-Scale Transmission Grids,” 13th IEEE PES PowerTech Conference, Milano, Italy, Jun. 2019.
hynet.reduction.large_scale.subgrid.restore_aggregation_info(scenario)[source]

Restore the information on aggregated buses from the bus annotation.

Parameters:scenario (Scenario) – Scenario that was subject to network reduction.

hynet.reduction.large_scale.sweep module

Parameter sweeps to assist the selection of an appropriate network reduction.

hynet.reduction.large_scale.sweep.sweep_feature_depth(scenario, rel_impedance_thres, values=None, critical_mw_diff=None, server=None, solver=None, opf_reference=None, show_evaluation=True)[source]

Sweep the feature depth \(\vartheta\)

After and initial electrical coupling-based network reduction, additional bus features may be added to reduce the dispatch error at critical injectors, which is parameterized by the feature depth \(\vartheta\), cf. Section V-A and Fig. 5 in [1]. To assist the selection of an appropriate depth, this function provides the evaluation of the two-stage electrical coupling-based network reduction for different feature depths.

If the feature columns are not present upon the call of this function, the standard features described in Section III in [1] are considered.

Parameters:
  • scenario (Scenario) – Scenario that shall be evaluated.
  • rel_impedance_thres (float, optional) – Relative threshold \(\tau\) for the electrical coupling-based network reduction.
  • values (list[int], optional) – List of (ascending) values for the feature depth \(\vartheta\). By default, the depths 0 to 10 are considered.
  • critical_mw_diff (float, optional) – Absolute threshold in MW on the active power dispatch difference of an injector to consider it as critical. The default is 0.02% of the total active power load.
  • server (OptimizationServer, optional) – hynet optimization server for the computation of the OPFs. By default, a server in local mode is used.
  • solver (SolverInterface, optional) – Solver for the OPF problems. The default selects the most appropriate QCQP solver among those installed.
  • opf_reference (OPFResult, optional) – OPF result of the scenario before the reduction to evaluate the reduction accuracy. By default, an OPF for the provided scenario is utilized.
  • show_evaluation (bool, optional) – If True (default), the results of the sweep are visualized.
Returns:

evaluation – Data frame with information on the extent and accuracy of the reduction for the individual feature depths. This data frame is indexed by the depth and comprises the following columns:

bus_reduction: (hynet_float_)

Ratio of the number of reduced buses w.r.t. the total number of buses before the reduction.

branch_reduction: (hynet_float_)

Ratio of the number of reduced branches w.r.t. the total number of branches before the reduction.

cycle_reduction: (hynet_float_)

Ratio of the number of reduced cycles w.r.t. the total number of cycles before the reduction.

error_disp: (hynet_float_)

Contribution-weighted mean relative active power dispatch error as defined in equation (1) in [1].

error_disp_s: (hynet_float_)

Contribution-weighted mean relative apparent power dispatch error.

error_flow: (hynet_float_)

Contribution-weighted mean relative active power branch flow error as defined in equation (2) in [1].

error_flow_s: (hynet_float_)

Contribution-weighted mean relative apparent power branch flow error.

opf: (hynet.OPFResult)

OPF result for the respective scenario.

Return type:

pandas.DataFrame

References

[1](1, 2, 3, 4) J. Sistermanns, M. Hotz, D. Hewes, R. Witzmann, and W. Utschick, “Feature- and Structure-Preserving Network Reduction for Large-Scale Transmission Grids,” 13th IEEE PES PowerTech Conference, Milano, Italy, Jun. 2019.
hynet.reduction.large_scale.sweep.sweep_max_price_diff(scenario, values, server=None, solver=None, opf_reference=None, show_evaluation=True)[source]

Sweep the maximum nodal price fluctuation \(\delta\) for clustering.

The market-based network reduction is parameterized by the threshold \(\delta\) in $/MW on fluctuations of the nodal price (LMP) from the center of a price cluster, cf. Section IV-D and (4) in [1]. To assist the selection of an appropriate threshold, this function provides the evaluation of the market-based network reduction for different threshold values (cf. Fig. 6 in [1]).

If the feature columns are not present upon the call of this function, the standard features described in Section III in [1] are considered.

Parameters:
  • scenario (Scenario) – Scenario that shall be evaluated.
  • values (list[float]) – List of (ascending) values for the threshold \(\delta\) in $/MW on fluctuations of the nodal price. To identify a reasonable range for the threshold values, it may be helpful to calculate an OPF and inspect the LMP profile via hynet.show_lmp_profile.
  • server (OptimizationServer, optional) – hynet optimization server for the computation of the OPFs. By default, a server in local mode is used.
  • solver (SolverInterface, optional) – Solver for the OPF problems. The default selects the most appropriate QCQP solver among those installed.
  • opf_reference (OPFResult, optional) – OPF result of the scenario before the reduction to evaluate the reduction accuracy. By default, an OPF for the provided scenario is utilized.
  • show_evaluation (bool, optional) – If True (default), the results of the sweep are visualized.
Returns:

evaluation – Data frame with information on the extent and accuracy of the reduction for the individual threshold values. This data frame is indexed by the threshold and comprises the following columns:

bus_reduction: (hynet_float_)

Ratio of the number of reduced buses w.r.t. the total number of buses before the reduction.

branch_reduction: (hynet_float_)

Ratio of the number of reduced branches w.r.t. the total number of branches before the reduction.

cycle_reduction: (hynet_float_)

Ratio of the number of reduced cycles w.r.t. the total number of cycles before the reduction.

error_disp: (hynet_float_)

Contribution-weighted mean relative active power dispatch error as defined in equation (1) in [1].

error_disp_s: (hynet_float_)

Contribution-weighted mean relative apparent power dispatch error.

error_flow: (hynet_float_)

Contribution-weighted mean relative active power branch flow error as defined in equation (2) in [1].

error_flow_s: (hynet_float_)

Contribution-weighted mean relative apparent power branch flow error.

opf: (hynet.OPFResult)

OPF result for the respective scenario.

Return type:

pandas.DataFrame

References

[1](1, 2, 3, 4, 5) J. Sistermanns, M. Hotz, D. Hewes, R. Witzmann, and W. Utschick, “Feature- and Structure-Preserving Network Reduction for Large-Scale Transmission Grids,” 13th IEEE PES PowerTech Conference, Milano, Italy, Jun. 2019.
hynet.reduction.large_scale.sweep.sweep_rel_impedance_thres(scenario, values=None, server=None, solver=None, opf_reference=None, show_evaluation=True)[source]

Sweep the relative impedance threshold :math:` au`.

The electrical coupling-based network reduction is parameterized by the relative impedance threshold :math:` au`, cf. Section IV-C and (3) in [1]. To assist the selection of an appropriate threshold, this function provides the evaluation of the electrical coupling-based network reduction for different threshold values (cf. Fig. 4 in [1]).

If the feature columns are not present upon the call of this function, the standard features described in Section III in [1] are considered.

Parameters:
  • scenario (hynet.Scenario) – Scenario that shall be evaluated.
  • values (list[float], optional) – List of (ascending) values for the relative impedance threshold \(\tau\). By default, the 15 values in the interval [0.005, 0.1] shown in Fig. 4 in [1] are considered.
  • server (OptimizationServer, optional) – hynet optimization server for the computation of the OPFs. By default, a server in local mode is used.
  • solver (SolverInterface, optional) – Solver for the OPF problems. The default selects the most appropriate QCQP solver among those installed.
  • opf_reference (OPFResult, optional) – OPF result of the scenario before the reduction to evaluate the reduction accuracy. By default, an OPF for the provided scenario is utilized.
  • show_evaluation (bool, optional) – If True (default), the results of the sweep are visualized.
Returns:

evaluation – Data frame with information on the extent and accuracy of the reduction for the individual threshold values. This data frame is indexed by the threshold and comprises the following columns:

bus_reduction: (hynet_float_)

Ratio of the number of reduced buses w.r.t. the total number of buses before the reduction.

branch_reduction: (hynet_float_)

Ratio of the number of reduced branches w.r.t. the total number of branches before the reduction.

cycle_reduction: (hynet_float_)

Ratio of the number of reduced cycles w.r.t. the total number of cycles before the reduction.

error_disp: (hynet_float_)

Contribution-weighted mean relative active power dispatch error as defined in equation (1) in [1].

error_disp_s: (hynet_float_)

Contribution-weighted mean relative apparent power dispatch error.

error_flow: (hynet_float_)

Contribution-weighted mean relative active power branch flow error as defined in equation (2) in [1].

error_flow_s: (hynet_float_)

Contribution-weighted mean relative apparent power branch flow error.

opf: (hynet.OPFResult)

OPF result for the respective scenario.

Return type:

pandas.DataFrame

References

[1](1, 2, 3, 4, 5, 6) J. Sistermanns, M. Hotz, D. Hewes, R. Witzmann, and W. Utschick, “Feature- and Structure-Preserving Network Reduction for Large-Scale Transmission Grids,” 13th IEEE PES PowerTech Conference, Milano, Italy, Jun. 2019.

hynet.reduction.large_scale.topology module

Topology-based subgrid selection and reduction.

hynet.reduction.large_scale.topology.identify_islands(scenario, max_island_size)[source]

Identify “islands” at the boundary of the grid.

In the context of the topology-based network reduction, “islands” are clusters of buses that are connected to the main grid via a single corridor. This function identifies these “islands” by testing every corridor, i.e., the branches in the corridor are removed, islanding of a subgrid is detected and, if its size does not exceed the defined maximum island size, it is considered an “island”.

Parameters:
  • scenario (Scenario) – Scenario that shall be examined.
  • max_island_size (int) – Maximum size of an “island” in terms of its number of buses.
Returns:

island_info – Information on the “islands” within the system. The returned list contains an item for every island, which is a tuple comprising the island’s representative bus (i.e., the bus of the main grid to which the island is connected) and a pandas index with the bus ID of all buses of the island.

Return type:

list[tuple(hynet_id_, pandas.Index[hynet_id_])]

hynet.reduction.large_scale.topology.reduce_by_topology(scenario, max_island_size=None)[source]

Apply a topology-based network reduction to the scenario.

This function performs the topology-based network reduction described in Section IV-B in [1].

Parameters:
  • scenario (Scenario) – Scenario that shall be processed.
  • max_island_size (int, optional) – Maximum size of an “island” in terms of its number of buses. By default, it is set to approximately 1% of the total number of buses. Set this parameter to 0 to disable the reduction of “islands”.
Returns:

Number of buses that were reduced.

Return type:

int

References

[1]J. Sistermanns, M. Hotz, D. Hewes, R. Witzmann, and W. Utschick, “Feature- and Structure-Preserving Network Reduction for Large-Scale Transmission Grids,” 13th IEEE PES PowerTech Conference, Milano, Italy, Jun. 2019.
hynet.reduction.large_scale.topology.reduce_islands(scenario, max_island_size)[source]

Reduce “islands” within the scenario.

This function reduces “islands” at the boundary of the grid, see Section IV-B in [1].

Parameters:
  • scenario (Scenario) – Scenario that shall be processed.
  • max_island_size (int) – Maximum size of an “island” in terms of its number of buses.
Returns:

Number of buses that were reduced.

Return type:

int

References

[1]J. Sistermanns, M. Hotz, D. Hewes, R. Witzmann, and W. Utschick, “Feature- and Structure-Preserving Network Reduction for Large-Scale Transmission Grids,” 13th IEEE PES PowerTech Conference, Milano, Italy, Jun. 2019.
hynet.reduction.large_scale.topology.reduce_single_buses(scenario)[source]

Reduce single buses within the scenario.

This function reduces buses that only exhibit one adjacent bus, see Section IV-B in [1]. This function may be called repeatedly to reduce “lines of buses” as considered in [1].

Parameters:scenario (Scenario) – Scenario that shall be processed.
Returns:Number of buses that were reduced.
Return type:int

References

[1](1, 2) J. Sistermanns, M. Hotz, D. Hewes, R. Witzmann, and W. Utschick, “Feature- and Structure-Preserving Network Reduction for Large-Scale Transmission Grids,” 13th IEEE PES PowerTech Conference, Milano, Italy, Jun. 2019.

hynet.reduction.large_scale.utilities module

Utility functions for the network reduction.

hynet.reduction.large_scale.utilities.add_adjacent_bus_info(scenario)[source]

Add information about adjacent buses to the scenario.

This function adds/updates the following columns to the bus data frame:

num_adjacent: (int)
Number of adjacent buses.
adjacent: (pandas.Index[hynet_id_])
Pandas index with the bus ID of all adjacent buses.
Parameters:scenario (Scenario) – Scenario that shall be processed.
hynet.reduction.large_scale.utilities.add_parallel_branch_info(scenario)[source]

Add information about parallel branches to the scenario.

This function adds/updates the following columns to the branch data frame:

parallel: (bool)
True if the branch is parallel to another one and False otherwise.
parallel_main_id: (hynet_id_)
Branch ID of the (arbitrarily selected) main branch among the group of parallel branches. With this information, groups of parallel branches can be determined by filtering this column w.r.t. the main branch ID.
Parameters:scenario (Scenario) – Scenario that shall be processed.
hynet.reduction.large_scale.utilities.remove_adjacent_bus_info(scenario)[source]

Remove the information about adjacent buses.

Parameters:scenario (Scenario) – Scenario that shall be processed.
hynet.reduction.large_scale.utilities.remove_parallel_branch_info(scenario)[source]

Remove the information about parallel branches.

Parameters:scenario (Scenario) – Scenario that shall be processed.

Module contents

Feature- and structure-preserving network reduction for large-scale grids.

This subpackage of hynet implements the reduction strategy for large-scale grid models as introduced in [1], which aims at reducing model complexity while preserving relevant features and the relation to the structure of the original model. Please refer to [1] for more details.

References

[1](1, 2) J. Sistermanns, M. Hotz, D. Hewes, R. Witzmann, and W. Utschick, “Feature- and Structure-Preserving Network Reduction for Large-Scale Transmission Grids,” 13th IEEE PES PowerTech Conference, Milano, Italy, Jun. 2019.