# Voltage monitoring

Contents

## Introduction

In the FARAO CRAC, the user can define voltage constraints on network elements.
These are constraints that monitor that the voltage values on given network elements do not exceed a given threshold.
FARAO allows modelling these constraints in VoltageCnec objects.
However, modelling the impact of remedial actions on voltage values is highly complex and non-linear. This is why CASTOR does not inherently support voltage constraints.
The VoltageMonitoring package allows monitoring voltage values after a RAO has been run.

## The Java API

You can easily call the voltage monitoring module using the JAVA API:

1. Build a VoltageMonitoring object using:
public VoltageMonitoring(Crac crac, Network network, RaoResult raoResult)


With:

• crac: the CRAC object used for the RAO, and containing VoltageCnecs to be monitored.
• network: the network to be monitored.
• raoResult: the RaoResult object containing selected remedial actions (that shall be applied on the network before monitoring voltage values)
2. Run the monitoring algorithm using the constructed object’s following method:
public VoltageMonitoringResult run(String loadFlowProvider, LoadFlowParameters loadFlowParameters, int numberOfLoadFlowsInParallel)


With:

• loadFlowProvider: the name of the load-flow computer to use. This should refer to a PowSyBl load flow provider implementation
• numberOfLoadFlowsInParallel: the number of contingencies to monitor in parallel, allowing a maximum utilization of your computing resources (set it to your number of available CPUs).

Here is a complete example:

Crac crac = ...
Network network = ...
RaoResult raoResult = Rao.find(...).run(...)


## The voltage monitoring result

### JSON import & export

The VoltageMonitoringResult can be written to and read from a JSON file.
Example:

// Export
VoltageMonitoringResult voltageMonitoringResult = ...
OutputStream os = ...
new VoltageMonitoringResultExporter().export(voltageMonitoringResult, os);

// Import
InputStream is = ...
Crac crac = ...
VoltageMonitoringResult voltageMonitoringResult2 = new VoltageMonitoringResultImporter().importVoltageMonitoringResult(is, crac);


### Contents

The VoltageMonitoringResult object contains the results of the voltage monitoring algorithm.

#### Status

The VoltageMonitoringResult has methods describing the security status of the network in regard to the voltage constraints defined in the CRAC:

• SECURE: the network is secure; no voltage thresholds are violated
• HIGH_VOLTAGE_CONSTRAINT: the network is not secure; at least one voltage CNEC has a voltage value higher than its threshold
• LOW_VOLTAGE_CONSTRAINT: the network is not secure; at least one voltage CNEC has a voltage value lower than its threshold
• HIGH_AND_LOW_VOLTAGE_CONSTRAINTS: the network is not secure; at least one voltage CNEC has a voltage value higher than its threshold, and at least one voltage CNEC has a voltage value lower than its threshold
// get the overall status (one of 4 values above)
public Status getStatus()


This information is not directly accessible in the JSON file.

#### Voltage values

The following methods return information about the voltage values for voltage CNECs.

// get VoltageCnecs that have a voltage overshoot
public Set<VoltageCnec> getConstrainedElements()

// get the minimum voltage value among all elements of a voltage CNEC, using the VoltageCnec object or its ID in the CRAC, in KILOVOLTS
public Double getMinVoltage(VoltageCnec voltageCnec)
public Double getMinVoltage(String voltageCnecId)

// get the maximum voltage value among all elements of a voltage CNEC, using the VoltageCnec object or its ID in the CRAC, in KILOVOLTS
public Double getMaxVoltage(VoltageCnec voltageCnec)
public Double getMaxVoltage(String voltageCnecId)

// get min/max voltage values for all voltage CNECs (ExtremeVoltageValues contain one min and one max value in KILOVOLTS)
public Map<VoltageCnec, ExtremeVoltageValues> getExtremeVoltageValues()


Example:

  "extreme-voltage-values-in-kilovolts" : [ {
"cnec-id" : "VL45",
"min" : 144.383355903481,
"max" : 148.4102909359121
}, {
"cnec-id" : "VL46",
"min" : 143.0995761393377,
"max" : 147.66000723838806
} ]


### Printing the result

You can get a human-readable report of the voltage monitoring algorithm, using the following method of the VoltageMonitoringResult object:

public List<String> printConstraints()


### Complete JSON example

{
"type" : "VOLTAGE_MONITORING_RESULT",
"extreme-voltage-values-in-kilovolts" : [ {
"cnec-id" : "VL45",
"min" : 144.383355903481,
"max" : 148.4102909359121
}, {
"cnec-id" : "VL46",
"min" : 143.0995761393377,
"max" : 147.66000723838806
} ]
}


## The voltage monitoring algorithm

Here is a detailed description of how the voltage monitoring algorithm operates:

• Apply optimal preventive remedial actions from RaoResult on the network
• From the CRAC, get the set of states on which VoltageCnecs exist
• For each of these states, monitor voltages:
• Use a new copy of the network
• If the state is not preventive,
• apply the contingency on the network
• from the RaoResult, apply on the network the optimal remedial actions decided by the RAO (automatic and curative)
• Compute load-flow and fetch voltage values for all voltage CNECs
• If the load-flow diverges move on to the next state
• Compare the voltages to their thresholds to report security status
• SECURE: the network is secure; no voltage thresholds are violated
• HIGH_VOLTAGE_CONSTRAINT: the network is not secure; at least one voltage CNEC has a voltage value higher than its threshold
• LOW_VOLTAGE_CONSTRAINT: the network is not secure; at least one voltage CNEC has a voltage value lower than its threshold
• HIGH_AND_LOW_VOLTAGE_CONSTRAINTS: the network is not secure; at least one voltage CNEC has a voltage value higher than its threshold, and at least one voltage CNEC has a voltage value lower than its threshold
• Create a [VoltageMonitoringResult]{#result} containing voltage values and security status
• Assemble all the state-specific VoltageMonitoringResult in one overall VoltageMonitoringResult