Capacity calculation for RSC

This user story concerns Regional Security Coordinators (RSCs). An efficient and safe management of the European electricity system requires coordination at regional level. This is the role of RSCs, whose objectives are the coordinated security of the electricity system, the integration of large-scale renewable energy generation and the development of the European electricity market. They perform five core services for TSOs:

• Coordinated security analysis
• Outage planning coordination
• Coordinated capacity allocation
• Short-term and very short-term adequacy forecast
• Individual and common grid modeling and data set delivery

We are going to explain how to perform a coordinated capacity computation using Powsybl and some specific developments. We want to ensure that flows across borders respect given maximum admissible values, while ensuring electricity security of supply. If some overloads are reported, a remedial actions optimization is called to find the cheapest solution to solve the constraints. Remedial actions can be either changing the tap of a PST (it modifies the impedance of the network and so the load-flows) or doing generator redispatching.

# Workflow

The first input data of this process is the network model, coming from UCTE or CIM-CGMES European exchange formats. We also need an object to define the security domain of the network, built from a CRAC file (Contingency list, Remedial Actions and additional Constraints): it contains a contingencies list, the constraints to monitor and the available remedial actions to get rid of the constraints.

In this process, we also need two computation engines:

• A loadflow computation is launched before and after each contingency to identify overloads.
• A sensitivity computation: for each border, a sensitivity analysis determines the impact on the flow of a small variation of the PST angle, and that for all PSTs, and determines the impact on the flow of a small variation of the generation, and that for all generators.

A cost function is built from the previous results of the sensitivity computation. It is then sent to a solver to find the remedial actions avoiding constraints at a minimal cost.

A security analysis is performed at the end of the process to validate the set of remedial actions found by the optimization.

All Powsybl features used in this workflow are described below with some implementation examples.

# Identification of the power system blocks

This user story involves several features from the Powsybl framework and some other features that are specific:

The studied network comes from a set of TSOs’ networks. The TSOs’ networks can be provided in a common TSO exchange format such as UCTE or CIM-CGMES formats. The following lines of code come format from powsybl-tutorials and illustrate this functionality.

File fileBe = new File("/path/to/file/MicroGridTestConfiguration_T4_BE_BB_Complete_v2.zip");
File fileNl = new File("/path/to/file/MicroGridTestConfiguration_T4_NL_BB_Complete_v2.zip");


Each input file is imported and transformed to an in-memory object representing the network.

Network networkBe = Importers.loadNetwork(fileBe.toString());


A topological merge of the TSOs’ networks is done. The following lines of code come from powsybl-tutorials and illustrate this functionality.

networkBe.merge(networkNl);


Then, flows are computed with a load flow simulator. Since there is no fully functional open source load flow simulator integrated to powsybl for the time being, we use Hades2 for the purpose of the tutorial, which is closed source software, but available under a freeware license for experimental purposes. For more details, please visit this page to learn about Hades2.

A loadflow is run on the working variant of the in-memory network with a set of parameters. A computation manager computationManager (here defined locally) is used. The default parameters are listed here. Here angles are set to zero and voltages are set to one per unit. We also create a new variant to store the calculated flows. Note that a network variant is close to a state vector and gathers variables such as injections, productions, tap positions, states of buses, etc.

ComputationManager computationManager = LocalComputationManager.getDefault();


The sensitivity computation module is dedicated to compute the linearized impact of small network variations on the state variables of some elements. The sensivity computation is fully described here. In this user story, we use this module to compute all coefficients of the cost function. Since there is no fully functional open source sensitivity computation module integrated to Powsybl for the time being, we use Hades2 for the purpose of the tutorial, which is closed source software, but available under a freeware license for experimental purposes. For more details, please visit this page to learn about Hades2.

Remedial actions are read from the CRAC file and given to the optimizer which is a specific module. The best set of remedial actions is converted in actions understandable by Powsybl. The CRAC file also provides the contingency list, which is also converted to an understandable object for Powsybl called Contingency.

ContingenciesProvider contingenciesProvider = new ContingenciesProvider() {
@Override
public List<Contingency> getContingencies(Network network) {
// Code here how you want to fill/map the list of contingencies.
}
};


The final set of remedial actions is validated through a security analysis. A security analysis needs an input variant, a set of parameters as a securityAnalysisParameters object and a set of contingencies as a contingenciesProvider object.

SecurityAnalysis securityAnalysis = new Hades2SecurityAnalysisFactory().create(networkBe, computationManager, 0);
SecurityAnalysisParameters securityAnalysisParameters = new SecurityAnalysisParameters(); // Default parameters.
network.getVariantManager().cloneVariant(VariantManagerConstants.INITIAL_VARIANT_ID, "saVariant");
SecurityAnalysisResult securityAnalysisResult = securityAnalysis.run("saVariant", securityAnalysisParameters, contingenciesProvider).join();


# External features are:

The cost function builder is in fact a big toolbox using some power system blocks from the Powsybl framework. For more details about this builder, please refer to FARAO website. The Google OR-Tools open source library is used to perform the optimization: please visit this page for more details.