Repository navigation
Voltage regulation refactoring
Starting from powsybl-core 7.4.0, voltage regulation is no longer modeled with different equipment-specific attributes or with dedicated extensions. Equipment able to regulate voltage now directly or indirectly owns a com.powsybl.iidm.network.regulation.VoltageRegulation object through the VoltageRegulationHolder API.
This guide explains the new model and gives migration procedures and examples. The new model is also described in the powsybl-core documentation.
Before the refactoring, voltage regulation data was spread across:
- direct attributes on network elements;
- equipment-specific regulation modes;
- tap-changer-specific attributes;
- IIDM extensions.
The model was inconsistent between equipment types.
| Equipment / feature | Previous modeling |
|---|---|
Generator |
voltageRegulatorOn, targetV, targetQ, regulatingTerminal
|
Battery |
targetQ and VoltageRegulation extension |
StaticVarCompensator |
regulationMode, voltageSetpoint, reactivePowerSetpoint, regulating, regulatingTerminal
|
VscConverterStation / VoltageSourceConverter
|
voltageRegulatorOn, voltageSetpoint, reactivePowerSetpoint, regulatingTerminal
|
ShuntCompensator |
voltageRegulatorOn, targetV, targetDeadband, regulatingTerminal
|
RatioTapChanger |
regulationMode, regulationValue, targetV, targetDeadband, regulating, regulationTerminal
|
| Remote reactive power regulation |
RemoteReactivePowerControl extension |
| Voltage per reactive power regulation |
VoltagePerReactivePowerControl extension |
| Battery voltage regulation |
VoltageRegulation extension |
Conceptually, the previous model was:
Equipment:
- local regulation attributes:
- targetV / voltageSetpoint
- targetQ / reactivePowerSetpoint
- voltageRegulatorOn / regulating
- regulatingTerminal
- optional extensions:
- VoltageRegulation
- RemoteReactivePowerControl
- VoltagePerReactivePowerControl
After the refactoring, voltage regulation is represented by:
- a common
VoltageRegulationobject; - a common
RegulationModeenum; - local target values stored on the regulated equipment;
- optional remote regulation data stored in
VoltageRegulation.
The new model is:
VoltageRegulationHolder:
- localTargetV
- localTargetQ
- VoltageRegulation:
- mode
- regulating
- terminal
- targetValue
- targetDeadband
- slope
The VoltageRegulation object is optional.
The common API is available through:
com.powsybl.iidm.network.regulation.VoltageRegulation;
com.powsybl.iidm.network.regulation.VoltageRegulationHolder;
com.powsybl.iidm.network.regulation.VoltageRegulationHolderAdder;
com.powsybl.iidm.network.regulation.RegulationMode;The following equipment can directly or indirectly contain a VoltageRegulation object:
| Equipment | How regulation is now modeled |
|---|---|
Battery |
Implements the common voltage regulation holder API |
Generator |
Implements the common voltage regulation holder API |
StaticVarCompensator |
Implements the common voltage regulation holder API |
VscConverterStation |
Implements the common voltage regulation holder API |
ShuntCompensator |
Implements the common voltage regulation holder API |
RatioTapChanger |
Uses the common VoltageRegulation model for tap-changer voltage/reactive regulation |
In addition, RatioTapChanger objects may be contained in:
| Parent equipment | Impact |
|---|---|
TwoWindingsTransformer |
Its RatioTapChanger, if present, uses VoltageRegulation
|
ThreeWindingsTransformer.Leg |
Each leg ratio tap changer, if present, uses VoltageRegulation
|
PhaseTapChanger is not migrated to the new VoltageRegulation model. It keeps its own phase regulation API.
The VoltageRegulation object contains the regulation state and the target used when regulation is explicitly associated with a terminal.
| Attribute | Type | Variant-dependent | Meaning |
|---|---|---|---|
mode |
RegulationMode |
Yes | Regulation mode |
regulating |
boolean |
Yes | Whether regulation is enabled |
terminal |
Terminal |
No | Regulated terminal. Can be local or remote |
targetValue |
double |
Yes | Target value for the selected mode when a terminal is explicitly set |
targetDeadband |
double |
Yes | Deadband, mainly for discrete regulation such as ratio tap changers and shunt compensators |
slope |
double |
Yes | Slope for VOLTAGE_PER_REACTIVE_POWER
|
The common regulation modes are:
| New mode | Meaning |
|---|---|
RegulationMode.VOLTAGE |
Voltage regulation |
RegulationMode.REACTIVE_POWER |
Reactive power regulation |
RegulationMode.VOLTAGE_PER_REACTIVE_POWER |
Voltage per reactive power regulation |
The previous equipment-specific regulation mode enums have been replaced by this common enum.
Here is the table of the authorized modes by equipment:
| Equipment | Voltage | Reactive Power | Voltage per reactive power |
|---|---|---|---|
Battery |
X | X (*) | |
Generator |
X | X (*) | |
RatioTapChanger |
X (*) | X (*) | |
ShuntCompensator |
X | ||
StaticVarCompensator |
X | X | X |
VscConverterStation / VoltageSourceConverter
|
X | X (*) |
(*) The terminal is required
For local regulation, no explicit VoltageRegulation.terminal is required.
The target is stored on the regulated equipment:
| Mode | Local target attribute |
|---|---|
RegulationMode.VOLTAGE |
localTargetV |
RegulationMode.VOLTAGE_PER_REACTIVE_POWER |
localTargetV and slope
|
RegulationMode.REACTIVE_POWER |
localTargetQ |
Example:
generator.setLocalTargetV(225.0)
.newVoltageRegulation()
.withMode(RegulationMode.VOLTAGE)
.withRegulating(true)
.build();For remote regulation, set an explicit terminal on VoltageRegulation.
The remote target is stored in VoltageRegulation.targetValue.
Example:
generator.setLocalTargetV(225.0)
.newVoltageRegulation()
.withMode(RegulationMode.VOLTAGE)
.withRegulating(true)
.withTerminal(remoteTerminal)
.withTargetValue(400.0)
.build();The local target may still be useful, for instance as an equivalent local target or fallback value.
Use the common helper methods on voltage-regulation holders:
| Need | Method |
|---|---|
| Check whether regulation is enabled | isRegulating() |
| Check whether an equipment regulates in a mode | isRegulatingWithMode(RegulationMode) |
| Get the effective regulating terminal: the explicitly configured regulating terminal when one exists, otherwise the holder’s own local terminal |
getRegulatingTerminal() |
| Returns whether a regulating terminal has been explicitly configured. This does not take the implicit local-terminal fallback into account, so it can return false even though getRegulatingTerminal() returns the local terminal |
hasRegulatingTerminal() |
| Get the effective voltage target | getRegulatingTargetV() |
| Get the effective reactive power target | getRegulatingTargetQ() |
| Get local voltage target | getLocalTargetV() |
| Get local reactive power target | getLocalTargetQ() |
| Get the raw regulation object | getVoltageRegulation() |
The former voltage-regulation extensions are no longer part of the active public extension model.
They have been moved to:
com.powsybl.iidm.network.extensions.removedMoved extensions:
| Previous extension | New status |
|---|---|
VoltageRegulation |
Moved to com.powsybl.iidm.network.extensions.removed.VoltageRegulationExtension
|
RemoteReactivePowerControl |
Moved to com.powsybl.iidm.network.extensions.removed.RemoteReactivePowerControl
|
VoltagePerReactivePowerControl |
Moved to com.powsybl.iidm.network.extensions.removed.VoltagePerReactivePowerControl
|
These classes exist for backward compatibility during serialization/deserialization. New application code must not create or rely on these extensions.
The following implementation and adder classes are removed from the active extension API:
VoltageRegulationImplVoltageRegulationAdderVoltageRegulationAdderImplVoltageRegulationAdderImplProviderRemoteReactivePowerControlImplRemoteReactivePowerControlAdderRemoteReactivePowerControlAdderImplRemoteReactivePowerControlAdderImplProviderVoltagePerReactivePowerControlImplVoltagePerReactivePowerControlAdderVoltagePerReactivePowerControlAdderImplVoltagePerReactivePowerControlAdderImplProviderAbstractVoltagePerReactivePowerControlTest
IIDM serialization remains backward compatible.
When importing IIDM files using versions before the refactoring, old attributes and extensions are converted into the new VoltageRegulation object.
Examples:
| Old data | Imported as |
|---|---|
Battery VoltageRegulation extension |
Battery.getVoltageRegulation() |
Generator RemoteReactivePowerControl extension |
Generator.getVoltageRegulation() with RegulationMode.REACTIVE_POWER
|
SVC VoltagePerReactivePowerControl extension |
StaticVarCompensator.getVoltageRegulation() with RegulationMode.VOLTAGE_PER_REACTIVE_POWER
|
voltageRegulatorOn / voltageSetpoint / reactivePowerSetpoint
|
VoltageRegulation plus localTargetV / localTargetQ
|
When exporting to older IIDM versions, the new model is converted back when possible:
| New model | Exported as in older versions |
|---|---|
| Battery voltage regulation | Former battery VoltageRegulation extension |
| Generator remote reactive power regulation |
RemoteReactivePowerControl extension |
| SVC voltage per reactive power regulation |
VoltagePerReactivePowerControl extension |
| VSC voltage regulation attributes | Former VSC attributes and regulating terminal representation |
Replace equipment-specific regulation mode imports with the common enum.
Before:
import com.powsybl.iidm.network.StaticVarCompensator;After:
import com.powsybl.iidm.network.regulation.RegulationMode;Then replace:
StaticVarCompensator.RegulationMode.VOLTAGEwith:
RegulationMode.VOLTAGEReplace old boolean regulation flags with VoltageRegulation.isRegulating() or holder helper methods.
| Before | After |
|---|---|
isVoltageRegulatorOn() |
isRegulating() |
setVoltageRegulatorOn(boolean) |
getVoltageRegulation().setRegulating(boolean) or newVoltageRegulation().withRegulating(boolean)
|
isRegulating() on older equipment-specific APIs |
isRegulating() from VoltageRegulationHolder
|
Use local targets for local regulation, and VoltageRegulation.targetValue for explicit-terminal regulation.
| Previous concept | New concept |
|---|---|
| Local voltage setpoint |
setLocalTargetV(double) / getLocalTargetV()
|
| Local reactive power setpoint |
setLocalTargetQ(double) / getLocalTargetQ()
|
| Remote voltage target | getVoltageRegulation().setTargetValue(double) |
| Remote reactive power target | getVoltageRegulation().setTargetValue(double) |
| Generic effective voltage target | getRegulatingTargetV() |
| Generic effective reactive power target | getRegulatingTargetQ() |
| Before | After |
|---|---|
getRegulatingTerminal() |
getRegulatingTerminal() still available as common helper |
setRegulatingTerminal(Terminal) |
getVoltageRegulation().setTerminal(terminal, targetValue) or builder .withTerminal(terminal).withTargetValue(value)
|
getRegulationTerminal() on RatioTapChanger
|
getVoltageRegulation().getTerminal() or getRegulatingTerminal()
|
setRegulationTerminal(Terminal) on RatioTapChanger
|
newVoltageRegulation().withTerminal(terminal) |
For an existing object:
equipment.newVoltageRegulation()
.withMode(RegulationMode.VOLTAGE)
.withRegulating(true)
.build();For an equipment adder:
voltageLevel.newGenerator()
.setId("GEN")
.setLocalTargetV(225.0)
.newVoltageRegulation()
.withMode(RegulationMode.VOLTAGE)
.withRegulating(true)
.add()
.add();Use:
-
.build()when configuring regulation on an existing equipment; -
.add()when configuring regulation through an equipment adder.
Before:
generator.setTargetV(225.0)
.setVoltageRegulatorOn(true);After:
generator.setLocalTargetV(225.0)
.newVoltageRegulation()
.withMode(RegulationMode.VOLTAGE)
.withRegulating(true)
.build();Before:
generator.setTargetV(400.0, 225.0)
.setRegulatingTerminal(remoteTerminal)
.setVoltageRegulatorOn(true);After:
generator.setLocalTargetV(225.0)
.newVoltageRegulation()
.withMode(RegulationMode.VOLTAGE)
.withRegulating(true)
.withTerminal(remoteTerminal)
.withTargetValue(400.0)
.build();Before:
svc.setReactivePowerSetpoint(50.0)
.setRegulationMode(StaticVarCompensator.RegulationMode.REACTIVE_POWER)
.setRegulating(true);After:
svc.setLocalTargetQ(50.0)
.newVoltageRegulation()
.withMode(RegulationMode.REACTIVE_POWER)
.withRegulating(true)
.build();Before (generators):
generator.newExtension(RemoteReactivePowerControlAdder.class)
.withTargetQ(-100.0)
.withRegulatingTerminal(remoteTerminal)
.withEnabled(true)
.add();After:
generator.setLocalTargetQ(25.0)
.newVoltageRegulation()
.withMode(RegulationMode.REACTIVE_POWER)
.withRegulating(true)
.withTerminal(remoteTerminal)
.withTargetValue(-100.0)
.build();Before:
svc.newExtension(VoltagePerReactivePowerControlAdder.class)
.withSlope(0.3)
.add();After:
svc.newVoltageRegulation()
.withMode(RegulationMode.VOLTAGE_PER_REACTIVE_POWER)
.withRegulating(true)
.withSlope(0.3)
.build();| Before | After |
|---|---|
targetQ |
localTargetQ |
Battery VoltageRegulation extension |
Battery.getVoltageRegulation() |
Extension voltageRegulatorOn
|
VoltageRegulation.isRegulating() |
Extension targetV
|
localTargetV for local regulation, targetValue for explicit-terminal regulation |
Extension regulatingTerminal
|
VoltageRegulation.terminal |
| Deprecated / removed API | New API |
|---|---|
Battery.getTargetQ() |
Battery.getRegulatingTargetQ() or getLocalTargetQ()
|
Battery.setTargetQ(double) |
Battery.setLocalTargetQ(double) |
BatteryAdder.setTargetQ(double) |
BatteryAdder.setLocalTargetQ(double) |
VoltageRegulationExtension.isVoltageRegulatorOn() |
Battery.isRegulating() or VoltageRegulation.isRegulating()
|
VoltageRegulationExtension.setVoltageRegulatorOn(boolean) |
VoltageRegulation.setRegulating(boolean) |
VoltageRegulationExtension.getTargetV() |
Battery.getRegulatingTargetV() |
VoltageRegulationExtension.setTargetV(double) |
Battery.setLocalTargetV(double) or VoltageRegulation.setTargetValue(double)
|
VoltageRegulationExtension.getRegulatingTerminal() |
Battery.getRegulatingTerminal() |
VoltageRegulationExtension.setRegulatingTerminal(Terminal) |
VoltageRegulation.setTerminal(Terminal, double) |
Battery battery = voltageLevel.newBattery()
.setId("BAT")
.setBus("B1")
.setConnectableBus("B1")
.setTargetP(10.0)
.setTargetQ(5.0)
.setMinP(-20.0)
.setMaxP(20.0)
.add();
battery.newExtension(VoltageRegulationAdder.class)
.withVoltageRegulatorOn(true)
.withTargetV(225.0)
.add();Battery battery = voltageLevel.newBattery()
.setId("BAT")
.setBus("B1")
.setConnectableBus("B1")
.setTargetP(10.0)
.setLocalTargetQ(5.0)
.setLocalTargetV(225.0)
.setMinP(-20.0)
.setMaxP(20.0)
.newVoltageRegulation()
.withMode(RegulationMode.VOLTAGE)
.withRegulating(true)
.add()
.add();Battery battery = voltageLevel.newBattery()
.setId("BAT")
.setBus("B1")
.setConnectableBus("B1")
.setTargetP(10.0)
.setLocalTargetQ(5.0)
.setLocalTargetV(225.0)
.setMinP(-20.0)
.setMaxP(20.0)
.newVoltageRegulation()
.withMode(RegulationMode.VOLTAGE)
.withRegulating(true)
.withTerminal(remoteTerminal)
.withTargetValue(400.0)
.add()
.add();| Before | After |
|---|---|
voltageRegulatorOn |
VoltageRegulation.regulating |
targetV |
localTargetV or VoltageRegulation.targetValue
|
targetQ |
localTargetQ or VoltageRegulation.targetValue in REACTIVE_POWER mode |
regulatingTerminal |
VoltageRegulation.terminal |
RemoteReactivePowerControl extension |
VoltageRegulation with RegulationMode.REACTIVE_POWER
|
| Deprecated API | New API |
|---|---|
isVoltageRegulatorOn() |
isRegulating() |
setVoltageRegulatorOn(boolean) |
VoltageRegulation.setRegulating(boolean) |
getTargetV() |
getRegulatingTargetV() |
setTargetV(double) |
setLocalTargetV(double) for local regulation |
setTargetV(double, double) |
VoltageRegulation.setTargetValue(double) and setLocalTargetV(double)
|
getTargetQ() |
getRegulatingTargetQ() |
setTargetQ(double) |
setLocalTargetQ(double) |
setRegulatingTerminal(Terminal) |
VoltageRegulation.setTerminal(Terminal, double) |
Generator generator = voltageLevel.newGenerator()
.setId("GEN")
.setBus("B1")
.setConnectableBus("B1")
.setEnergySource(EnergySource.THERMAL)
.setMinP(0.0)
.setMaxP(100.0)
.setTargetP(80.0)
.setTargetQ(10.0)
.setTargetV(225.0)
.setVoltageRegulatorOn(true)
.add();Generator generator = voltageLevel.newGenerator()
.setId("GEN")
.setBus("B1")
.setConnectableBus("B1")
.setEnergySource(EnergySource.THERMAL)
.setMinP(0.0)
.setMaxP(100.0)
.setTargetP(80.0)
.setLocalTargetQ(10.0)
.setLocalTargetV(225.0)
.newVoltageRegulation()
.withMode(RegulationMode.VOLTAGE)
.withRegulating(true)
.add()
.add();generator.setLocalTargetQ(10.0)
.newVoltageRegulation()
.withMode(RegulationMode.REACTIVE_POWER)
.withRegulating(true)
.withTerminal(remoteTerminal)
.withTargetValue(-100.0)
.build();| Before | After |
|---|---|
StaticVarCompensator.RegulationMode |
RegulationMode |
voltageSetpoint |
localTargetV or VoltageRegulation.targetValue
|
reactivePowerSetpoint |
localTargetQ or VoltageRegulation.targetValue
|
regulating |
VoltageRegulation.regulating |
regulatingTerminal |
VoltageRegulation.terminal |
VoltagePerReactivePowerControl extension |
VoltageRegulation with RegulationMode.VOLTAGE_PER_REACTIVE_POWER
|
| Deprecated API | New API |
|---|---|
getVoltageSetpoint() |
getRegulatingTargetV() |
setVoltageSetpoint(double) |
setLocalTargetV(double) or VoltageRegulation.setTargetValue(double)
|
getReactivePowerSetpoint() |
getRegulatingTargetQ() |
setReactivePowerSetpoint(double) |
setLocalTargetQ(double) or VoltageRegulation.setTargetValue(double)
|
getRegulationMode() |
VoltageRegulation.getMode() |
setRegulationMode(RegulationMode) |
VoltageRegulation.setMode(RegulationMode) |
setRegulating(boolean) |
VoltageRegulation.setRegulating(boolean) |
setRegulatingTerminal(Terminal) |
VoltageRegulation.setTerminal(Terminal, double) |
StaticVarCompensator svc = voltageLevel.newStaticVarCompensator()
.setId("SVC")
.setBus("B1")
.setConnectableBus("B1")
.setBmin(-0.01)
.setBmax(0.01)
.setVoltageSetpoint(225.0)
.setReactivePowerSetpoint(20.0)
.setRegulationMode(StaticVarCompensator.RegulationMode.VOLTAGE)
.setRegulating(true)
.add();StaticVarCompensator svc = voltageLevel.newStaticVarCompensator()
.setId("SVC")
.setBus("B1")
.setConnectableBus("B1")
.setBmin(-0.01)
.setBmax(0.01)
.setLocalTargetV(225.0)
.setLocalTargetQ(20.0)
.newVoltageRegulation()
.withMode(RegulationMode.VOLTAGE)
.withRegulating(true)
.add()
.add();svc.newVoltageRegulation()
.withMode(RegulationMode.VOLTAGE_PER_REACTIVE_POWER)
.withRegulating(true)
.withSlope(0.3)
.build();| Before | After |
|---|---|
voltageRegulatorOn |
VoltageRegulation.regulating |
voltageSetpoint |
localTargetV or VoltageRegulation.targetValue
|
reactivePowerSetpoint |
localTargetQ or VoltageRegulation.targetValue
|
regulatingTerminal |
VoltageRegulation.terminal |
| Deprecated API | New API |
|---|---|
isVoltageRegulatorOn() |
isRegulating() |
setVoltageRegulatorOn(boolean) |
VoltageRegulation.setRegulating(boolean) |
getVoltageSetpoint() |
getRegulatingTargetV() |
setVoltageSetpoint(double) |
setLocalTargetV(double) or VoltageRegulation.setTargetValue(double)
|
getReactivePowerSetpoint() |
getRegulatingTargetQ() |
setReactivePowerSetpoint(double) |
setLocalTargetQ(double) or VoltageRegulation.setTargetValue(double)
|
setRegulatingTerminal(Terminal) |
VoltageRegulation.setTerminal(Terminal, double) |
VscConverterStation vsc = voltageLevel.newVscConverterStation()
.setId("VSC")
.setBus("B1")
.setConnectableBus("B1")
.setLossFactor(1.0f)
.setVoltageSetpoint(225.0)
.setReactivePowerSetpoint(20.0)
.setVoltageRegulatorOn(true)
.add();VscConverterStation vsc = voltageLevel.newVscConverterStation()
.setId("VSC")
.setBus("B1")
.setConnectableBus("B1")
.setLossFactor(1.0f)
.setLocalTargetV(225.0)
.setLocalTargetQ(20.0)
.newVoltageRegulation()
.withMode(RegulationMode.VOLTAGE)
.withRegulating(true)
.add()
.add();vsc.setLocalTargetQ(20.0)
.setLocalTargetV(225.0)
.newVoltageRegulation()
.withMode(RegulationMode.VOLTAGE)
.withRegulating(true)
.withTerminal(remoteTerminal)
.withTargetValue(400.0)
.build();| Before | After |
|---|---|
voltageRegulatorOn |
VoltageRegulation.regulating |
targetV |
localTargetV or VoltageRegulation.targetValue
|
targetDeadband |
VoltageRegulation.targetDeadband |
regulatingTerminal |
VoltageRegulation.terminal |
| Deprecated API | New API |
|---|---|
isVoltageRegulatorOn() |
isRegulating() |
setVoltageRegulatorOn(boolean) |
VoltageRegulation.setRegulating(boolean) |
getTargetV() |
getRegulatingTargetV() |
setTargetV(double) |
setLocalTargetV(double) or VoltageRegulation.setTargetValue(double)
|
getTargetDeadband() |
VoltageRegulation.getTargetDeadband() |
setTargetDeadband(double) |
VoltageRegulation.setTargetDeadband(double) |
setRegulatingTerminal(Terminal) |
VoltageRegulation.setTerminal(Terminal, double) |
shuntCompensator.setLocalTargetV(225.0)
.newVoltageRegulation()
.withMode(RegulationMode.VOLTAGE)
.withRegulating(true)
.withTargetDeadband(0.1)
.build();shuntCompensator.newVoltageRegulation()
.withMode(RegulationMode.VOLTAGE)
.withRegulating(true)
.withTerminal(remoteTerminal)
.withTargetValue(400.0)
.withTargetDeadband(0.1)
.build();| Before | After |
|---|---|
RatioTapChanger.RegulationMode |
RegulationMode |
regulationMode |
VoltageRegulation.mode |
regulationValue |
VoltageRegulation.targetValue |
targetV |
VoltageRegulation.targetValue with RegulationMode.VOLTAGE
|
targetDeadband |
VoltageRegulation.targetDeadband |
regulating |
VoltageRegulation.regulating |
regulationTerminal |
VoltageRegulation.terminal |
| Deprecated API | New API |
|---|---|
getRegulationMode() |
VoltageRegulation.getMode() |
setRegulationMode(RegulationMode) |
VoltageRegulation.setMode(RegulationMode) |
getRegulationValue() |
VoltageRegulation.getTargetValue() |
setRegulationValue(double) |
VoltageRegulation.setTargetValue(double) |
getTargetV() |
getRegulatingTargetV() |
setTargetV(double) |
VoltageRegulation.setTargetValue(double) |
getTargetDeadband() |
VoltageRegulation.getTargetDeadband() |
setTargetDeadband(double) |
VoltageRegulation.setTargetDeadband(double) |
setRegulating(boolean) |
VoltageRegulation.setRegulating(boolean) |
getRegulationTerminal() |
VoltageRegulation.getTerminal() or getRegulatingTerminal()
|
setRegulationTerminal(Terminal) |
VoltageRegulation.setTerminal(Terminal, double) |
ratioTapChanger.setTargetV(225.0)
.setRegulating(true)
.setRegulationTerminal(regulationTerminal)
.setTargetDeadband(0.1);ratioTapChanger.newVoltageRegulation()
.withMode(RegulationMode.VOLTAGE)
.withRegulating(true)
.withTerminal(regulationTerminal)
.withTargetValue(225.0)
.withTargetDeadband(0.1)
.build();ratioTapChanger.newVoltageRegulation()
.withMode(RegulationMode.REACTIVE_POWER)
.withRegulating(true)
.withTerminal(regulationTerminal)
.withTargetValue(50.0)
.withTargetDeadband(0.1)
.build();Voltage regulation validation is now centralized.
Important validation rules include:
| Rule | Consequence |
|---|---|
If regulating is true, mode must be defined |
Otherwise the network is invalid |
If a remote or explicit terminal is used, targetValue must be defined |
Otherwise the network is invalid |
If no terminal is set for local voltage or local reactive regulation, targetValue is expected to be NaN
|
Use localTargetV or localTargetQ instead |
targetDeadband must be defined for regulating ShuntCompensator and RatioTapChanger
|
Otherwise the network is invalid |
targetDeadband must not be negative |
Otherwise the network is invalid |
slope must be defined for VOLTAGE_PER_REACTIVE_POWER when regulating |
Otherwise the network is invalid |
VoltageRegulation.terminal must belong to the same network |
Otherwise the network is invalid |
A regulating RatioTapChanger must have a regulation terminal |
Otherwise the network is invalid |
A regulating RatioTapChanger must have load tap changing capabilities |
Otherwise the network is invalid |
The verbose generator load-flow validation result format has changed.
| Previous column | New columns |
|---|---|
voltageRegulatorOn |
regulationMode, regulating
|
voltageRegulatorOn_postComp |
regulationMode_postComp, regulating_postComp
|
Update parsers and tests that read verbose load-flow validation files.
VoltageRegulationUtils has moved.
| Before | After |
|---|---|
com.powsybl.iidm.modification.util.VoltageRegulationUtils |
com.powsybl.iidm.network.util.VoltageRegulationUtils |
The following methods have been removed from the generic TapChanger interface:
setRegulating(boolean)getRegulationTerminal()setRegulationTerminal(Terminal)
They are now specific to the appropriate tap changer APIs:
-
PhaseTapChangerkeeps its own phase regulation API; -
RatioTapChangeruses the newVoltageRegulationmodel, with deprecated compatibility methods where available.
Generator modifications now distinguish the regulation mode from the regulation status.
| Deprecated attribute / method | Replacement |
|---|---|
Boolean voltageRegulatorOn |
RegulationMode voltageRegulationMode and Boolean regulating
|
getVoltageRegulatorOn() |
VoltageRegulation.isRegulating() |
setVoltageRegulatorOn(boolean) |
Set regulating and, if needed, voltageRegulationMode
|
Example:
generator.newVoltageRegulation()
.withMode(RegulationMode.VOLTAGE)
.withRegulating(true)
.build();| Deprecated method | New method |
|---|---|
getTargetQ() |
getRegulatingTargetQ() or getLocalTargetQ()
|
setTargetQ(double) |
setLocalTargetQ(double) |
| Deprecated method | New method |
|---|---|
setTargetQ(double) |
setLocalTargetQ(double) |
| Deprecated method | New method |
|---|---|
isVoltageRegulatorOn() |
isRegulating() |
setVoltageRegulatorOn(boolean) |
VoltageRegulation.setRegulating(boolean) |
setRegulatingTerminal(Terminal) |
VoltageRegulation.setTerminal(Terminal, double) |
getTargetV() |
getRegulatingTargetV() |
setTargetV(double) |
setLocalTargetV(double) or VoltageRegulation.setTargetValue(double)
|
setTargetV(double, double) |
setLocalTargetV(double) and VoltageRegulation.setTargetValue(double)
|
getEquivalentLocalTargetV() |
getLocalTargetV() |
getTargetQ() |
getRegulatingTargetQ() |
setTargetQ(double) |
setLocalTargetQ(double) |
| Deprecated method | New method |
|---|---|
setVoltageRegulatorOn(boolean) |
newVoltageRegulation().withRegulating(boolean) |
setRegulatingTerminal(Terminal) |
newVoltageRegulation().withTerminal(Terminal) |
setTargetV(double) |
setLocalTargetV(double) or newVoltageRegulation().withTargetValue(double)
|
setTargetV(double, double) |
setLocalTargetV(double) and newVoltageRegulation().withTargetValue(double)
|
setTargetQ(double) |
setLocalTargetQ(double) |
| Deprecated method | New method |
|---|---|
getVoltageSetpoint() |
getRegulatingTargetV() |
setVoltageSetpoint(double) |
setLocalTargetV(double) or VoltageRegulation.setTargetValue(double)
|
getReactivePowerSetpoint() |
getRegulatingTargetQ() |
setReactivePowerSetpoint(double) |
setLocalTargetQ(double) or VoltageRegulation.setTargetValue(double)
|
getRegulationMode() |
VoltageRegulation.getMode() |
setRegulationMode(RegulationMode) |
VoltageRegulation.setMode(RegulationMode) |
setRegulating(boolean) |
VoltageRegulation.setRegulating(boolean) |
setRegulatingTerminal(Terminal) |
VoltageRegulation.setTerminal(Terminal, double) |
| Deprecated method | New method |
|---|---|
setVoltageSetpoint(double) |
setLocalTargetV(double) or newVoltageRegulation().withTargetValue(double)
|
setReactivePowerSetpoint(double) |
setLocalTargetQ(double) or newVoltageRegulation().withTargetValue(double)
|
setRegulationMode(RegulationMode) |
newVoltageRegulation().withMode(RegulationMode) |
setRegulating(boolean) |
newVoltageRegulation().withRegulating(boolean) |
setRegulatingTerminal(Terminal) |
newVoltageRegulation().withTerminal(Terminal) |
| Deprecated method | New method |
|---|---|
isVoltageRegulatorOn() |
isRegulating() |
setVoltageRegulatorOn(boolean) |
VoltageRegulation.setRegulating(boolean) |
getVoltageSetpoint() |
getRegulatingTargetV() |
setVoltageSetpoint(double) |
setLocalTargetV(double) or VoltageRegulation.setTargetValue(double)
|
getReactivePowerSetpoint() |
getRegulatingTargetQ() |
setReactivePowerSetpoint(double) |
setLocalTargetQ(double) or VoltageRegulation.setTargetValue(double)
|
setRegulatingTerminal(Terminal) |
VoltageRegulation.setTerminal(Terminal, double) |
| Deprecated method | New method |
|---|---|
setVoltageRegulatorOn(boolean) |
newVoltageRegulation().withRegulating(boolean) |
setVoltageSetpoint(double) |
setLocalTargetV(double) or newVoltageRegulation().withTargetValue(double)
|
setReactivePowerSetpoint(double) |
setLocalTargetQ(double) or newVoltageRegulation().withTargetValue(double)
|
setRegulatingTerminal(Terminal) |
newVoltageRegulation().withTerminal(Terminal) |
| Deprecated method | New method |
|---|---|
setRegulatingTerminal(Terminal) |
VoltageRegulation.setTerminal(Terminal, double) |
isVoltageRegulatorOn() |
isRegulating() |
setVoltageRegulatorOn(boolean) |
VoltageRegulation.setRegulating(boolean) |
getTargetV() |
getRegulatingTargetV() |
setTargetV(double) |
setLocalTargetV(double) or VoltageRegulation.setTargetValue(double)
|
getTargetDeadband() |
VoltageRegulation.getTargetDeadband() |
setTargetDeadband(double) |
VoltageRegulation.setTargetDeadband(double) |
| Deprecated method | New method |
|---|---|
setRegulatingTerminal(Terminal) |
newVoltageRegulation().withTerminal(Terminal) |
setVoltageRegulatorOn(boolean) |
newVoltageRegulation().withRegulating(boolean) |
setTargetV(double) |
setLocalTargetV(double) or newVoltageRegulation().withTargetValue(double)
|
setTargetDeadband(double) |
newVoltageRegulation().withTargetDeadband(double) |
| Deprecated method | New method |
|---|---|
getRegulationMode() |
VoltageRegulation.getMode() |
setRegulationMode(RegulationMode) |
VoltageRegulation.setMode(RegulationMode) |
getRegulationValue() |
VoltageRegulation.getTargetValue() |
setRegulationValue(double) |
VoltageRegulation.setTargetValue(double) |
getTargetV() |
getRegulatingTargetV() |
setTargetV(double) |
VoltageRegulation.setTargetValue(double) |
getTargetDeadband() |
VoltageRegulation.getTargetDeadband() |
setTargetDeadband(double) |
VoltageRegulation.setTargetDeadband(double) |
setRegulating(boolean) |
VoltageRegulation.setRegulating(boolean) |
getRegulationTerminal() |
VoltageRegulation.getTerminal() or getRegulatingTerminal()
|
setRegulationTerminal(Terminal) |
VoltageRegulation.setTerminal(Terminal, double) |
| Deprecated method | New method |
|---|---|
setRegulationMode(RegulationMode) |
newVoltageRegulation().withMode(RegulationMode) |
setRegulationValue(double) |
newVoltageRegulation().withTargetValue(double) |
setTargetV(double) |
newVoltageRegulation().withMode(RegulationMode.VOLTAGE).withTargetValue(double) |
setRegulating(boolean) |
newVoltageRegulation().withRegulating(boolean) |
setRegulationTerminal(Terminal) |
newVoltageRegulation().withTerminal(Terminal) |
setTargetDeadband(double) |
newVoltageRegulation().withTargetDeadband(double) |
Use the following checklist when migrating an application:
- Replace equipment-specific regulation mode enums with
com.powsybl.iidm.network.regulation.RegulationMode. - Replace old regulation extensions with
newVoltageRegulation(). - Replace
targetV/voltageSetpointwith:-
localTargetVfor local voltage targets; -
VoltageRegulation.targetValuefor explicit-terminal voltage targets.
-
- Replace
targetQ/reactivePowerSetpointwith:-
localTargetQfor local reactive power targets; -
VoltageRegulation.targetValuefor explicit-terminal reactive power targets.
-
- Replace
voltageRegulatorOnwithVoltageRegulation.regulating. - Replace
regulatingTerminal/regulationTerminalsetters withVoltageRegulation.terminal. - For
ShuntCompensatorandRatioTapChanger, movetargetDeadbandtoVoltageRegulation.targetDeadband. - For voltage-per-reactive-power regulation, set:
-
mode = RegulationMode.VOLTAGE_PER_REACTIVE_POWER; -
slope; -
regulating = true.
-
- Update imports of
VoltageRegulationUtils. - Update load-flow validation result parsers if they read verbose generator validation files.