diff --git a/open-reac/src/main/java/com/powsybl/openreac/parameters/input/OpenReacParameters.java b/open-reac/src/main/java/com/powsybl/openreac/parameters/input/OpenReacParameters.java index 37620ab6..dda19ae1 100644 --- a/open-reac/src/main/java/com/powsybl/openreac/parameters/input/OpenReacParameters.java +++ b/open-reac/src/main/java/com/powsybl/openreac/parameters/input/OpenReacParameters.java @@ -58,6 +58,46 @@ public class OpenReacParameters { private ReactiveSlackBusesMode reactiveSlackBusesMode = ReactiveSlackBusesMode.NO_GENERATION; + private static final String ACTIVE_POWER_VARIATION_RATE_KEY = "coeff_alpha"; + + private double activePowerVariationRate = 1; // in [0;1] + + private static final String MIN_PLAUSIBLE_ACTIVE_POWER_THRESHOLD_KEY = "Pnull"; + + private double minPlausibleActivePowerThreshold = 0.01; // in MW, for detecting zero value for power + + private static final String LOW_IMPEDANCE_THRESHOLD_KEY = "Znull"; + + private double lowImpedanceThreshold = 1e-4; // in p.u., for detecting null impedance branches + + private static final String MIN_NOMINAL_VOLTAGE_IGNORED_BUS_KEY = "epsilon_nominal_voltage"; + + private double minNominalVoltageIgnoredBus = 1; // in kV, to ignore buses with Vnom lower than this value + + private static final String MIN_NOMINAL_VOLTAGE_IGNORED_VOLTAGE_BOUNDS_KEY = "ignore_voltage_bounds"; + + private double minNominalVoltageIgnoredVoltageBounds = 0; // in kV, to ignore voltage bounds of buses with Vnom lower than this value + + private static final String MAX_PLAUSIBLE_POWER_LIMIT_KEY = "PQmax"; + + private double maxPlausiblePowerLimit = 9000; // MW + + private static final String HIGH_ACTIVE_POWER_DEFAULT_LIMIT_KEY = "defaultPmax"; + + private double highActivePowerDefaultLimit = 1000; // MW + + private static final String LOW_ACTIVE_POWER_DEFAULT_LIMIT_KEY = "defaultPmin"; + + private double lowActivePowerDefaultLimit = 0; // MW + + private static final String DEFAULT_QMAX_PMAX_RATIO_KEY = "defaultQmaxPmaxRatio"; + + private double defaultQmaxPmaxRatio = 0.3; + + private static final String DEFAULT_MINIMAL_QP_RANGE_KEY = "minimalQPrange"; + + private double defaultMinimalQPRange = 1; + private static final String DEFAULT_VARIABLE_SCALING_FACTOR = "default_variable_scaling_factor"; private double defaultVariableScalingFactor = 1; @@ -85,6 +125,10 @@ public OpenReacParameters addSpecificVoltageLimits(List sp return this; } + public List getSpecificVoltageLimits() { + return specificVoltageLimits; + } + /** * A list of shunt compensators, which susceptance will be considered as variable by the optimizer. * The optimizer computes a continuous value that is rounded when results are stored in {@link com.powsybl.openreac.parameters.output.OpenReacResult}. @@ -94,6 +138,10 @@ public OpenReacParameters addVariableShuntCompensators(List shuntsIds) { return this; } + public List getVariableShuntCompensators() { + return variableShuntCompensators; + } + /** * The reactive power produced by every generator in the list will be constant and equal to `targetQ`. */ @@ -102,6 +150,10 @@ public OpenReacParameters addConstantQGenerators(List generatorsIds) { return this; } + public List getConstantQGenerators() { + return constantQGenerators; + } + /** * A list of two windings transformers, which ratio will be considered as variable by the optimizer. */ @@ -110,6 +162,10 @@ public OpenReacParameters addVariableTwoWindingsTransformers(List transf return this; } + public List getVariableTwoWindingsTransformers() { + return variableTwoWindingsTransformers; + } + /** * A list of buses, to which reactive slacks variable will be attached by the optimizer. */ @@ -118,6 +174,10 @@ public OpenReacParameters addConfiguredReactiveSlackBuses(List busesIds) return this; } + public List getConfiguredReactiveSlackBuses() { + return configuredReactiveSlackBuses; + } + /** * The definition of the objective function for the optimization. */ @@ -232,6 +292,159 @@ public OpenReacParameters setReactiveSlackBusesMode(ReactiveSlackBusesMode react return this; } + /** + * @return the weight to favor more/less minimization of active power produced by generators. + */ + public double getActivePowerVariationRate() { + return activePowerVariationRate; + } + + public OpenReacParameters setActivePowerVariationRate(double activePowerVariationRate) { + if (Double.isNaN(activePowerVariationRate) || activePowerVariationRate < 0 || activePowerVariationRate > 1) { + throw new IllegalArgumentException("Active power variation rate must be defined and between 0 and 1 to be consistent."); + } + this.activePowerVariationRate = activePowerVariationRate; + return this; + } + + /** + * @return the threshold of active and reactive power considered as null. + */ + public double getMinPlausibleActivePowerThreshold() { + return minPlausibleActivePowerThreshold; + } + + public OpenReacParameters setMinPlausibleActivePowerThreshold(double minPlausibleActivePowerThreshold) { + if (Double.isNaN(minPlausibleActivePowerThreshold) || minPlausibleActivePowerThreshold < 0) { + throw new IllegalArgumentException("Zero power threshold must be defined and >= 0 to be consistent."); + } + this.minPlausibleActivePowerThreshold = minPlausibleActivePowerThreshold; + return this; + } + + /** + * @return the threshold of impedance considered as null. + */ + public double getLowImpedanceThreshold() { + return lowImpedanceThreshold; + } + + public OpenReacParameters setLowImpedanceThreshold(double lowImpedanceThreshold) { + if (Double.isNaN(lowImpedanceThreshold) || lowImpedanceThreshold < 0) { + throw new IllegalArgumentException("Zero impedance threshold must be defined and >= 0 to be consistent."); + } + this.lowImpedanceThreshold = lowImpedanceThreshold; + return this; + } + + /** + * @return the threshold to ignore voltage levels with nominal voltager lower than it. + */ + public double getMinNominalVoltageIgnoredBus() { + return minNominalVoltageIgnoredBus; + } + + public OpenReacParameters setMinNominalVoltageIgnoredBus(double minNominalVoltageIgnoredBus) { + if (Double.isNaN(minNominalVoltageIgnoredBus) || minNominalVoltageIgnoredBus < 0) { + throw new IllegalArgumentException("Nominal threshold for ignored buses must be defined and >= 0 to be consistent."); + } + this.minNominalVoltageIgnoredBus = minNominalVoltageIgnoredBus; + return this; + } + + /** + * @return the threshold used to replace voltage limits of voltage levels with nominal voltage + * than it. + */ + public double getMinNominalVoltageIgnoredVoltageBounds() { + return minNominalVoltageIgnoredVoltageBounds; + } + + public OpenReacParameters setMinNominalVoltageIgnoredVoltageBounds(double minNominalVoltageIgnoredVoltageBounds) { + if (Double.isNaN(minNominalVoltageIgnoredVoltageBounds) || minNominalVoltageIgnoredVoltageBounds < 0) { + throw new IllegalArgumentException("Nominal threshold for ignored voltage bounds must be defined and >= 0 to be consistent"); + } + this.minNominalVoltageIgnoredVoltageBounds = minNominalVoltageIgnoredVoltageBounds; + return this; + } + + /** + * @return the threshold for maximum active and reactive power considered in correction of generator limits. + */ + public double getPQMax() { + return maxPlausiblePowerLimit; + } + + public OpenReacParameters setPQMax(double pQMax) { + if (Double.isNaN(pQMax) || pQMax <= 0) { + throw new IllegalArgumentException("Maximal consistency value for P and Q must be defined and > 0 to be consistent"); + } + this.maxPlausiblePowerLimit = pQMax; + return this; + } + + /** + * @return the threshold for correction of high active power limit produced by generators. + */ + public double getHighActivePowerDefaultLimit() { + return highActivePowerDefaultLimit; + } + + public OpenReacParameters setHighActivePowerDefaultLimit(double highActivePowerDefaultLimit) { + if (Double.isNaN(highActivePowerDefaultLimit) || highActivePowerDefaultLimit <= 0) { + throw new IllegalArgumentException("Default P max value must be defined and > 0 to be consistent."); + } + this.highActivePowerDefaultLimit = highActivePowerDefaultLimit; + return this; + } + + /** + * @return the threshold for correction of low active power limit produced by generators. + */ + public double getLowActivePowerDefaultLimit() { + return lowActivePowerDefaultLimit; + } + + public OpenReacParameters setLowActivePowerDefaultLimit(double lowActivePowerDefaultLimit) { + if (Double.isNaN(lowActivePowerDefaultLimit) || lowActivePowerDefaultLimit < 0) { + throw new IllegalArgumentException("Default P min value must be defined and >= 0 to be consistent."); + } + this.lowActivePowerDefaultLimit = lowActivePowerDefaultLimit; + return this; + } + + /** + * @return the ratio used to calculate threshold for corrections of high/low reactive power limits. + */ + public double getDefaultQmaxPmaxRatio() { + return defaultQmaxPmaxRatio; + } + + public OpenReacParameters setDefaultQmaxPmaxRatio(double defaultQmaxPmaxRatio) { + // Qmin/Qmax are computed with this value in OpenReac, can not be zero + if (Double.isNaN(defaultQmaxPmaxRatio) || defaultQmaxPmaxRatio <= 0) { + throw new IllegalArgumentException("Default Qmax and Pmax ratio must be defined and > 0 to be consistent."); + } + this.defaultQmaxPmaxRatio = defaultQmaxPmaxRatio; + return this; + } + + /** + * @return the threshold to fix active (resp. reactive) power of generators with + * active (resp. reactive) power limits that are closer than it. + */ + public double getDefaultMinimalQPRange() { + return defaultMinimalQPRange; + } + + public OpenReacParameters setDefaultMinimalQPRange(double defaultMinimalQPRange) { + if (Double.isNaN(defaultMinimalQPRange) || defaultMinimalQPRange < 0) { + throw new IllegalArgumentException("Default minimal QP range must be defined and >= 0 to be consistent."); + } + this.defaultMinimalQPRange = defaultMinimalQPRange; + return this; + } + /** * @return the default scaling value of all the variables in ACOPF solving. */ @@ -292,26 +505,6 @@ public OpenReacParameters setTwoWindingTransformerRatioVariableScalingFactor(dou return this; } - public List getVariableShuntCompensators() { - return variableShuntCompensators; - } - - public List getSpecificVoltageLimits() { - return specificVoltageLimits; - } - - public List getConstantQGenerators() { - return constantQGenerators; - } - - public List getVariableTwoWindingsTransformers() { - return variableTwoWindingsTransformers; - } - - public List getConfiguredReactiveSlackBuses() { - return configuredReactiveSlackBuses; - } - public List getAllAlgorithmParams() { ArrayList allAlgoParams = new ArrayList<>(); allAlgoParams.add(objective.toParam()); @@ -323,6 +516,16 @@ public List getAllAlgorithmParams() { allAlgoParams.add(new OpenReacAlgoParamImpl(MIN_PLAUSIBLE_LOW_VOLTAGE_LIMIT_KEY, Double.toString(minPlausibleLowVoltageLimit))); allAlgoParams.add(new OpenReacAlgoParamImpl(MAX_PLAUSIBLE_HIGH_VOLTAGE_LIMIT_KEY, Double.toString(maxPlausibleHighVoltageLimit))); allAlgoParams.add(reactiveSlackBusesMode.toParam()); + allAlgoParams.add(new OpenReacAlgoParamImpl(ACTIVE_POWER_VARIATION_RATE_KEY, Double.toString(activePowerVariationRate))); + allAlgoParams.add(new OpenReacAlgoParamImpl(MIN_PLAUSIBLE_ACTIVE_POWER_THRESHOLD_KEY, Double.toString(minPlausibleActivePowerThreshold))); + allAlgoParams.add(new OpenReacAlgoParamImpl(LOW_IMPEDANCE_THRESHOLD_KEY, Double.toString(lowImpedanceThreshold))); + allAlgoParams.add(new OpenReacAlgoParamImpl(MIN_NOMINAL_VOLTAGE_IGNORED_BUS_KEY, Double.toString(minNominalVoltageIgnoredBus))); + allAlgoParams.add(new OpenReacAlgoParamImpl(MIN_NOMINAL_VOLTAGE_IGNORED_VOLTAGE_BOUNDS_KEY, Double.toString(minNominalVoltageIgnoredVoltageBounds))); + allAlgoParams.add(new OpenReacAlgoParamImpl(MAX_PLAUSIBLE_POWER_LIMIT_KEY, Double.toString(maxPlausiblePowerLimit))); + allAlgoParams.add(new OpenReacAlgoParamImpl(LOW_ACTIVE_POWER_DEFAULT_LIMIT_KEY, Double.toString(lowActivePowerDefaultLimit))); + allAlgoParams.add(new OpenReacAlgoParamImpl(HIGH_ACTIVE_POWER_DEFAULT_LIMIT_KEY, Double.toString(highActivePowerDefaultLimit))); + allAlgoParams.add(new OpenReacAlgoParamImpl(DEFAULT_QMAX_PMAX_RATIO_KEY, Double.toString(defaultQmaxPmaxRatio))); + allAlgoParams.add(new OpenReacAlgoParamImpl(DEFAULT_MINIMAL_QP_RANGE_KEY, Double.toString(defaultMinimalQPRange))); allAlgoParams.add(new OpenReacAlgoParamImpl(DEFAULT_VARIABLE_SCALING_FACTOR, Double.toString(defaultVariableScalingFactor))); allAlgoParams.add(new OpenReacAlgoParamImpl(DEFAULT_CONSTRAINT_SCALING_FACTOR, Double.toString(defaultConstraintScalingFactor))); allAlgoParams.add(new OpenReacAlgoParamImpl(REACTIVE_SLACK_VARIABLE_SCALING_FACTOR, Double.toString(reactiveSlackVariableScalingFactor))); @@ -395,6 +598,28 @@ public boolean checkAlgorithmParametersIntegrity() { integrityAlgorithmParameters = false; } + if (lowActivePowerDefaultLimit > highActivePowerDefaultLimit) { + LOGGER.warn("Default P min = {} must be lower than default P max = {} to be consistent.", + lowActivePowerDefaultLimit, highActivePowerDefaultLimit); + integrityAlgorithmParameters = false; + } + + if (highActivePowerDefaultLimit > maxPlausiblePowerLimit) { + LOGGER.warn("Default P min = {} and default P max = {} must be lower than PQmax value = {} to be consistent.", + lowActivePowerDefaultLimit, highActivePowerDefaultLimit, maxPlausiblePowerLimit); + integrityAlgorithmParameters = false; + } + + if (highActivePowerDefaultLimit * defaultQmaxPmaxRatio > maxPlausiblePowerLimit) { + LOGGER.warn("Default Q max value = {} value must be lower than PQmax value to be consistent.", + highActivePowerDefaultLimit * defaultQmaxPmaxRatio); + integrityAlgorithmParameters = false; + } + + if (minNominalVoltageIgnoredBus > minNominalVoltageIgnoredVoltageBounds) { + LOGGER.warn("Some buses with ignored voltage bounds will be ignored in calculations."); + } + return integrityAlgorithmParameters; } diff --git a/open-reac/src/main/java/com/powsybl/openreac/parameters/input/json/OpenReacParametersDeserializer.java b/open-reac/src/main/java/com/powsybl/openreac/parameters/input/json/OpenReacParametersDeserializer.java index 721aad05..cc98a602 100644 --- a/open-reac/src/main/java/com/powsybl/openreac/parameters/input/json/OpenReacParametersDeserializer.java +++ b/open-reac/src/main/java/com/powsybl/openreac/parameters/input/json/OpenReacParametersDeserializer.java @@ -91,6 +91,46 @@ public OpenReacParameters deserialize(JsonParser parser, DeserializationContext parser.nextToken(); parameters.setReactiveSlackBusesMode(ReactiveSlackBusesMode.valueOf(parser.getText())); } + case "activePowerVariationRate" -> { + parser.nextToken(); + parameters.setActivePowerVariationRate(parser.getValueAsDouble()); + } + case "minPlausibleActivePowerThreshold" -> { + parser.nextToken(); + parameters.setMinPlausibleActivePowerThreshold(parser.getValueAsDouble()); + } + case "lowImpedanceThreshold" -> { + parser.nextToken(); + parameters.setLowImpedanceThreshold(parser.getValueAsDouble()); + } + case "minNominalVoltageIgnoredBus" -> { + parser.nextToken(); + parameters.setMinNominalVoltageIgnoredBus(parser.getValueAsDouble()); + } + case "minNominalVoltageIgnoredVoltageBounds" -> { + parser.nextToken(); + parameters.setMinNominalVoltageIgnoredVoltageBounds(parser.getValueAsDouble()); + } + case "maxPlausiblePowerLimit" -> { + parser.nextToken(); + parameters.setPQMax(parser.getValueAsDouble()); + } + case "lowActivePowerDefaultLimit" -> { + parser.nextToken(); + parameters.setLowActivePowerDefaultLimit(parser.getValueAsDouble()); + } + case "highActivePowerDefaultLimit" -> { + parser.nextToken(); + parameters.setHighActivePowerDefaultLimit(parser.getValueAsDouble()); + } + case "defaultQmaxPmaxRatio" -> { + parser.nextToken(); + parameters.setDefaultQmaxPmaxRatio(parser.getValueAsDouble()); + } + case "defaultMinimalQPRange" -> { + parser.nextToken(); + parameters.setDefaultMinimalQPRange(parser.getValueAsDouble()); + } case "defaultVariableScalingFactor" -> { parser.nextToken(); parameters.setDefaultVariableScalingFactor(parser.readValueAs(Double.class)); diff --git a/open-reac/src/main/java/com/powsybl/openreac/parameters/input/json/OpenReacParametersSerializer.java b/open-reac/src/main/java/com/powsybl/openreac/parameters/input/json/OpenReacParametersSerializer.java index b789a512..a92fad26 100644 --- a/open-reac/src/main/java/com/powsybl/openreac/parameters/input/json/OpenReacParametersSerializer.java +++ b/open-reac/src/main/java/com/powsybl/openreac/parameters/input/json/OpenReacParametersSerializer.java @@ -47,6 +47,16 @@ public void serialize(OpenReacParameters openReacParameters, JsonGenerator jsonG serializerProvider.defaultSerializeField("minPlausibleLowVoltageLimit", openReacParameters.getMinPlausibleLowVoltageLimit(), jsonGenerator); serializerProvider.defaultSerializeField("maxPlausibleHighVoltageLimit", openReacParameters.getMaxPlausibleHighVoltageLimit(), jsonGenerator); serializerProvider.defaultSerializeField("reactiveSlackBusesMode", openReacParameters.getReactiveSlackBusesMode().name(), jsonGenerator); + serializerProvider.defaultSerializeField("activePowerVariationRate", openReacParameters.getActivePowerVariationRate(), jsonGenerator); + serializerProvider.defaultSerializeField("minPlausibleActivePowerThreshold", openReacParameters.getMinPlausibleActivePowerThreshold(), jsonGenerator); + serializerProvider.defaultSerializeField("lowImpedanceThreshold", openReacParameters.getLowImpedanceThreshold(), jsonGenerator); + serializerProvider.defaultSerializeField("minNominalVoltageIgnoredBus", openReacParameters.getMinNominalVoltageIgnoredBus(), jsonGenerator); + serializerProvider.defaultSerializeField("minNominalVoltageIgnoredVoltageBounds", openReacParameters.getMinNominalVoltageIgnoredVoltageBounds(), jsonGenerator); + serializerProvider.defaultSerializeField("maxPlausiblePowerLimit", openReacParameters.getPQMax(), jsonGenerator); + serializerProvider.defaultSerializeField("lowActivePowerDefaultLimit", openReacParameters.getLowActivePowerDefaultLimit(), jsonGenerator); + serializerProvider.defaultSerializeField("highActivePowerDefaultLimit", openReacParameters.getHighActivePowerDefaultLimit(), jsonGenerator); + serializerProvider.defaultSerializeField("defaultQmaxPmaxRatio", openReacParameters.getDefaultQmaxPmaxRatio(), jsonGenerator); + serializerProvider.defaultSerializeField("defaultMinimalQPRange", openReacParameters.getDefaultMinimalQPRange(), jsonGenerator); serializerProvider.defaultSerializeField("defaultVariableScalingFactor", openReacParameters.getDefaultVariableScalingFactor(), jsonGenerator); serializerProvider.defaultSerializeField("defaultConstraintScalingFactor", openReacParameters.getDefaultConstraintScalingFactor(), jsonGenerator); serializerProvider.defaultSerializeField("reactiveSlackVariableScalingFactor", openReacParameters.getReactiveSlackVariableScalingFactor(), jsonGenerator); diff --git a/open-reac/src/test/java/com/powsybl/openreac/OpenReacParametersTest.java b/open-reac/src/test/java/com/powsybl/openreac/OpenReacParametersTest.java index 31a43bdb..f4ac0859 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/OpenReacParametersTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/OpenReacParametersTest.java @@ -115,6 +115,139 @@ void testMinMaxVoltageLimitIntegrity() { assertTrue(parameters.checkAlgorithmParametersIntegrity()); } + @Test + void testActivePowerVariationRateIntegrity() { + OpenReacParameters parameters = new OpenReacParameters(); + parameters.setActivePowerVariationRate(0); // min value + assertEquals(0., parameters.getActivePowerVariationRate()); + parameters.setActivePowerVariationRate(0.445556); + assertEquals(0.445556, parameters.getActivePowerVariationRate()); + + IllegalArgumentException e1 = assertThrows(IllegalArgumentException.class, () -> parameters.setActivePowerVariationRate(-1.2)); + assertEquals("Active power variation rate must be defined and between 0 and 1 to be consistent.", e1.getMessage()); + IllegalArgumentException e2 = assertThrows(IllegalArgumentException.class, () -> parameters.setActivePowerVariationRate(42)); + assertEquals("Active power variation rate must be defined and between 0 and 1 to be consistent.", e2.getMessage()); + IllegalArgumentException e3 = assertThrows(IllegalArgumentException.class, () -> parameters.setActivePowerVariationRate(Double.NaN)); + assertEquals("Active power variation rate must be defined and between 0 and 1 to be consistent.", e3.getMessage()); + assertTrue(parameters.checkAlgorithmParametersIntegrity()); + } + + @Test + void testZeroPowerThresholdIntegrity() { + OpenReacParameters parameters = new OpenReacParameters(); + parameters.setMinPlausibleActivePowerThreshold(0); + assertEquals(0., parameters.getMinPlausibleActivePowerThreshold()); // min value + parameters.setMinPlausibleActivePowerThreshold(2.365); + assertEquals(2.365, parameters.getMinPlausibleActivePowerThreshold()); + + IllegalArgumentException e1 = assertThrows(IllegalArgumentException.class, () -> parameters.setMinPlausibleActivePowerThreshold(-1.2)); + assertEquals("Zero power threshold must be defined and >= 0 to be consistent.", e1.getMessage()); + IllegalArgumentException e2 = assertThrows(IllegalArgumentException.class, () -> parameters.setMinPlausibleActivePowerThreshold(Double.NaN)); + assertEquals("Zero power threshold must be defined and >= 0 to be consistent.", e2.getMessage()); + assertTrue(parameters.checkAlgorithmParametersIntegrity()); + } + + @Test + void testZeroImpedanceThresholdIntegrity() { + OpenReacParameters parameters = new OpenReacParameters(); + parameters.setLowImpedanceThreshold(0); + assertEquals(0., parameters.getLowImpedanceThreshold()); // min value + parameters.setLowImpedanceThreshold(1e-5); + assertEquals(1e-5, parameters.getLowImpedanceThreshold()); + + IllegalArgumentException e1 = assertThrows(IllegalArgumentException.class, () -> parameters.setLowImpedanceThreshold(-1.2)); + assertEquals("Zero impedance threshold must be defined and >= 0 to be consistent.", e1.getMessage()); + IllegalArgumentException e2 = assertThrows(IllegalArgumentException.class, () -> parameters.setLowImpedanceThreshold(Double.NaN)); + assertEquals("Zero impedance threshold must be defined and >= 0 to be consistent.", e2.getMessage()); + } + + @Test + void testNominalThresholdsIntegrity() { + OpenReacParameters parameters = new OpenReacParameters(); + parameters.setMinNominalVoltageIgnoredBus(0); // min value + assertEquals(0, parameters.getMinNominalVoltageIgnoredBus()); + parameters.setMinNominalVoltageIgnoredBus(45); + assertEquals(45, parameters.getMinNominalVoltageIgnoredBus()); + IllegalArgumentException e1 = assertThrows(IllegalArgumentException.class, () -> parameters.setMinNominalVoltageIgnoredBus(-1.2)); + assertEquals("Nominal threshold for ignored buses must be defined and >= 0 to be consistent.", e1.getMessage()); + IllegalArgumentException e2 = assertThrows(IllegalArgumentException.class, () -> parameters.setMinNominalVoltageIgnoredBus(Double.NaN)); + assertEquals("Nominal threshold for ignored buses must be defined and >= 0 to be consistent.", e2.getMessage()); + + parameters.setMinNominalVoltageIgnoredVoltageBounds(200); + assertEquals(200, parameters.getMinNominalVoltageIgnoredVoltageBounds()); + IllegalArgumentException e3 = assertThrows(IllegalArgumentException.class, () -> parameters.setMinNominalVoltageIgnoredVoltageBounds(-1.2)); + assertEquals("Nominal threshold for ignored voltage bounds must be defined and >= 0 to be consistent", e3.getMessage()); + IllegalArgumentException e4 = assertThrows(IllegalArgumentException.class, () -> parameters.setMinNominalVoltageIgnoredVoltageBounds(Double.NaN)); + assertEquals("Nominal threshold for ignored voltage bounds must be defined and >= 0 to be consistent", e4.getMessage()); + + assertTrue(parameters.checkAlgorithmParametersIntegrity()); + } + + @Test + void testPMinMaxIntegrity() { + OpenReacParameters parameters = new OpenReacParameters(); + parameters.setPQMax(5775); + assertEquals(5775, parameters.getPQMax()); + IllegalArgumentException e1 = assertThrows(IllegalArgumentException.class, () -> parameters.setPQMax(0)); // min value + assertEquals("Maximal consistency value for P and Q must be defined and > 0 to be consistent", e1.getMessage()); + IllegalArgumentException e2 = assertThrows(IllegalArgumentException.class, () -> parameters.setPQMax(-2.1)); + assertEquals("Maximal consistency value for P and Q must be defined and > 0 to be consistent", e2.getMessage()); + IllegalArgumentException e3 = assertThrows(IllegalArgumentException.class, () -> parameters.setPQMax(Double.NaN)); + assertEquals("Maximal consistency value for P and Q must be defined and > 0 to be consistent", e3.getMessage()); + + parameters.setLowActivePowerDefaultLimit(1500); + assertEquals(1500, parameters.getLowActivePowerDefaultLimit()); + IllegalArgumentException e4 = assertThrows(IllegalArgumentException.class, () -> parameters.setLowActivePowerDefaultLimit(-100)); + assertEquals("Default P min value must be defined and >= 0 to be consistent.", e4.getMessage()); + IllegalArgumentException e5 = assertThrows(IllegalArgumentException.class, () -> parameters.setLowActivePowerDefaultLimit(Double.NaN)); + assertEquals("Default P min value must be defined and >= 0 to be consistent.", e5.getMessage()); + + parameters.setHighActivePowerDefaultLimit(1250); + assertEquals(1250, parameters.getHighActivePowerDefaultLimit()); + IllegalArgumentException e6 = assertThrows(IllegalArgumentException.class, () -> parameters.setHighActivePowerDefaultLimit(0)); + assertEquals("Default P max value must be defined and > 0 to be consistent.", e6.getMessage()); + IllegalArgumentException e7 = assertThrows(IllegalArgumentException.class, () -> parameters.setHighActivePowerDefaultLimit(-100)); + assertEquals("Default P max value must be defined and > 0 to be consistent.", e7.getMessage()); + IllegalArgumentException e8 = assertThrows(IllegalArgumentException.class, () -> parameters.setHighActivePowerDefaultLimit(Double.NaN)); + assertEquals("Default P max value must be defined and > 0 to be consistent.", e8.getMessage()); + + assertFalse(parameters.checkAlgorithmParametersIntegrity()); // case defaultPmin > defaultPmax + parameters.setHighActivePowerDefaultLimit(10000); + assertFalse(parameters.checkAlgorithmParametersIntegrity()); // case defaultPmax > pQmax + parameters.setLowActivePowerDefaultLimit(50).setHighActivePowerDefaultLimit(1000); + assertTrue(parameters.checkAlgorithmParametersIntegrity()); + } + + @Test + void testDefaultQmaxPmaxRatioIntegrity() { + OpenReacParameters parameters = new OpenReacParameters(); + parameters.setDefaultQmaxPmaxRatio(0.778); + assertEquals(0.778, parameters.getDefaultQmaxPmaxRatio()); + IllegalArgumentException e1 = assertThrows(IllegalArgumentException.class, () -> parameters.setDefaultQmaxPmaxRatio(0)); + assertEquals("Default Qmax and Pmax ratio must be defined and > 0 to be consistent.", e1.getMessage()); + IllegalArgumentException e2 = assertThrows(IllegalArgumentException.class, () -> parameters.setDefaultQmaxPmaxRatio(-0.3)); + assertEquals("Default Qmax and Pmax ratio must be defined and > 0 to be consistent.", e2.getMessage()); + IllegalArgumentException e3 = assertThrows(IllegalArgumentException.class, () -> parameters.setDefaultQmaxPmaxRatio(Double.NaN)); + assertEquals("Default Qmax and Pmax ratio must be defined and > 0 to be consistent.", e3.getMessage()); + + parameters.setDefaultQmaxPmaxRatio(500); + assertFalse(parameters.checkAlgorithmParametersIntegrity()); + } + + @Test + void testDefaultMinimalQPRangeIntegrity() { + OpenReacParameters parameters = new OpenReacParameters(); + parameters.setDefaultMinimalQPRange(10); + assertEquals(10, parameters.getDefaultMinimalQPRange()); + parameters.setDefaultMinimalQPRange(0); + assertEquals(0, parameters.getDefaultMinimalQPRange()); + + IllegalArgumentException e1 = assertThrows(IllegalArgumentException.class, () -> parameters.setDefaultMinimalQPRange(-1.5)); + assertEquals("Default minimal QP range must be defined and >= 0 to be consistent.", e1.getMessage()); + IllegalArgumentException e2 = assertThrows(IllegalArgumentException.class, () -> parameters.setDefaultMinimalQPRange(Double.NaN)); + assertEquals("Default minimal QP range must be defined and >= 0 to be consistent.", e2.getMessage()); + } + @Test void testVariablesScalingFactorsIntegrity() { OpenReacParameters parameters = new OpenReacParameters(); @@ -177,13 +310,23 @@ void testAlgorithmParams() { parameters.setMinPlausibleLowVoltageLimit(0.8); parameters.setMaxPlausibleHighVoltageLimit(1.2); parameters.setReactiveSlackBusesMode(ReactiveSlackBusesMode.ALL); + parameters.setActivePowerVariationRate(0.56); + parameters.setMinPlausibleActivePowerThreshold(0.5); + parameters.setLowImpedanceThreshold(1e-5); + parameters.setMinNominalVoltageIgnoredBus(10); + parameters.setMinNominalVoltageIgnoredVoltageBounds(5); + parameters.setPQMax(8555.3); + parameters.setLowActivePowerDefaultLimit(99.2); + parameters.setHighActivePowerDefaultLimit(1144); + parameters.setDefaultQmaxPmaxRatio(0.4); + parameters.setDefaultMinimalQPRange(1.1); parameters.setDefaultVariableScalingFactor(0.5); parameters.setDefaultConstraintScalingFactor(0.75); parameters.setReactiveSlackVariableScalingFactor(1e-2); parameters.setTwoWindingTransformerRatioVariableScalingFactor(0.0001); List algoParams = parameters.getAllAlgorithmParams(); - assertEquals(11, algoParams.size()); + assertEquals(21, algoParams.size()); assertEquals("2", algoParams.get(0).getValue()); assertEquals("0.4", algoParams.get(1).getValue()); assertEquals("DEBUG", algoParams.get(2).getValue()); @@ -191,10 +334,20 @@ void testAlgorithmParams() { assertEquals("0.8", algoParams.get(4).getValue()); assertEquals("1.2", algoParams.get(5).getValue()); assertEquals("ALL", algoParams.get(6).getValue()); - assertEquals("0.5", algoParams.get(7).getValue()); - assertEquals("0.75", algoParams.get(8).getValue()); - assertEquals("0.01", algoParams.get(9).getValue()); - assertEquals("1.0E-4", algoParams.get(10).getValue()); + assertEquals("0.56", algoParams.get(7).getValue()); + assertEquals("0.5", algoParams.get(8).getValue()); + assertEquals("1.0E-5", algoParams.get(9).getValue()); + assertEquals("10.0", algoParams.get(10).getValue()); + assertEquals("5.0", algoParams.get(11).getValue()); + assertEquals("8555.3", algoParams.get(12).getValue()); + assertEquals("99.2", algoParams.get(13).getValue()); + assertEquals("1144.0", algoParams.get(14).getValue()); + assertEquals("0.4", algoParams.get(15).getValue()); + assertEquals("1.1", algoParams.get(16).getValue()); + assertEquals("0.5", algoParams.get(17).getValue()); + assertEquals("0.75", algoParams.get(18).getValue()); + assertEquals("0.01", algoParams.get(19).getValue()); + assertEquals("1.0E-4", algoParams.get(20).getValue()); } @Test @@ -212,7 +365,31 @@ void testBusesWithReactiveSlackConfigIntegrity() { } @Test - void testDefaultListsOfParametersIntegrity() { + void testDefaultParametersValuesIntegrity() { + OpenReacParameters parameters = new OpenReacParameters(); + assertEquals(OpenReacOptimisationObjective.MIN_GENERATION, parameters.getObjective()); + assertNull(parameters.getObjectiveDistance()); + assertEquals(OpenReacAmplLogLevel.INFO, parameters.getLogLevelAmpl()); + assertEquals(OpenReacSolverLogLevel.EVERYTHING, parameters.getLogLevelSolver()); + assertEquals(0.5, parameters.getMinPlausibleLowVoltageLimit()); + assertEquals(1.5, parameters.getMaxPlausibleHighVoltageLimit()); + assertEquals(ReactiveSlackBusesMode.NO_GENERATION, parameters.getReactiveSlackBusesMode()); + assertEquals(1., parameters.getActivePowerVariationRate()); + assertEquals(0.01, parameters.getMinPlausibleActivePowerThreshold()); + assertEquals(1e-4, parameters.getLowImpedanceThreshold()); + assertEquals(1., parameters.getMinNominalVoltageIgnoredBus()); + assertEquals(0., parameters.getMinNominalVoltageIgnoredVoltageBounds()); + assertEquals(9000., parameters.getPQMax()); + assertEquals(0, parameters.getLowActivePowerDefaultLimit()); + assertEquals(1000., parameters.getHighActivePowerDefaultLimit()); + assertEquals(0.3, parameters.getDefaultQmaxPmaxRatio()); + assertEquals(1., parameters.getDefaultMinimalQPRange()); + // TODO : add cases for scaling values + assertTrue(parameters.checkAlgorithmParametersIntegrity()); + } + + @Test + void testDefaultParametersListsIntegrity() { // testing default lists of parameters OpenReacParameters parameters = new OpenReacParameters(); assertEquals(0, parameters.getVariableTwoWindingsTransformers().size(), "VariableTwoWindingsTransformers should be empty when using default OpenReacParameter constructor."); @@ -220,7 +397,7 @@ void testDefaultListsOfParametersIntegrity() { assertEquals(0, parameters.getConstantQGenerators().size(), "ConstantQGenerators should be empty when using default OpenReacParameter constructor."); assertEquals(0, parameters.getVariableShuntCompensators().size(), "VariableShuntCompensators should be empty when using default OpenReacParameter constructor."); assertEquals(0, parameters.getConfiguredReactiveSlackBuses().size(), "ConfiguredReactiveSlackBuses should be empty when using default OpenREacParameter constructor."); - assertEquals(10, parameters.getAllAlgorithmParams().size()); + assertEquals(20, parameters.getAllAlgorithmParams().size()); } @Test diff --git a/open-reac/src/test/java/com/powsybl/openreac/OpenReacRunnerTest.java b/open-reac/src/test/java/com/powsybl/openreac/OpenReacRunnerTest.java index 8f965fde..dc6c43a5 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/OpenReacRunnerTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/OpenReacRunnerTest.java @@ -94,7 +94,7 @@ void testDefaultParamAlgoExport() throws IOException { } @Test - void testParamAlgoExport() throws IOException { + void testModifiedParamAlgoExport() throws IOException { Network network = IeeeCdfNetworkFactory.create57(); setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network OpenReacParameters parameters = new OpenReacParameters() @@ -105,6 +105,16 @@ void testParamAlgoExport() throws IOException { .setMinPlausibleLowVoltageLimit(0.7888) .setMaxPlausibleHighVoltageLimit(1.3455) .setReactiveSlackBusesMode(ReactiveSlackBusesMode.ALL) + .setActivePowerVariationRate(0.88) + .setMinPlausibleActivePowerThreshold(0.45) + .setLowImpedanceThreshold(1e-5) + .setMinNominalVoltageIgnoredBus(2.) + .setMinNominalVoltageIgnoredVoltageBounds(0.75) + .setPQMax(3987.76) + .setLowActivePowerDefaultLimit(12.32) + .setHighActivePowerDefaultLimit(1452.66) + .setDefaultQmaxPmaxRatio(0.24) + .setDefaultMinimalQPRange(2.) .setDefaultVariableScalingFactor(1.1222) .setDefaultConstraintScalingFactor(0.7889) .setReactiveSlackVariableScalingFactor(0.2) diff --git a/open-reac/src/test/java/com/powsybl/openreac/parameters/input/json/OpenReacJsonModuleTest.java b/open-reac/src/test/java/com/powsybl/openreac/parameters/input/json/OpenReacJsonModuleTest.java index 1430dd85..eeb19c96 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/parameters/input/json/OpenReacJsonModuleTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/parameters/input/json/OpenReacJsonModuleTest.java @@ -14,6 +14,7 @@ import com.powsybl.openreac.parameters.input.algo.OpenReacAmplLogLevel; import com.powsybl.openreac.parameters.input.algo.OpenReacSolverLogLevel; import com.powsybl.openreac.parameters.input.algo.ReactiveSlackBusesMode; +import com.powsybl.openreac.parameters.input.algo.OpenReacOptimisationObjective; import org.junit.jupiter.api.Test; import java.io.IOException; @@ -29,7 +30,7 @@ class OpenReacJsonModuleTest { @Test - void test() throws IOException { + void testOpenReacParametersLists() throws IOException { ObjectMapper objectMapper = JsonUtil.createObjectMapper() .registerModule(new OpenReactJsonModule()); OpenReacParameters parameters = new OpenReacParameters(); @@ -41,23 +42,16 @@ void test() throws IOException { vloList1.add(new VoltageLimitOverride("bar", VoltageLimitOverride.VoltageLimitType.LOW_VOLTAGE_LIMIT, false, 20)); vloList1.add(new VoltageLimitOverride("bar", VoltageLimitOverride.VoltageLimitType.HIGH_VOLTAGE_LIMIT, false, 26)); + // modify open reac parameters parameters.addSpecificVoltageLimits(vloList1); parameters.addConstantQGenerators(List.of("g1", "g2")); parameters.addVariableTwoWindingsTransformers(List.of("tr1")); parameters.addVariableShuntCompensators(List.of("sc1", "sc2")); - parameters.setObjectiveDistance(5); - parameters.setLogLevelAmpl(OpenReacAmplLogLevel.WARNING); - parameters.setLogLevelSolver(OpenReacSolverLogLevel.NOTHING); - parameters.setMinPlausibleLowVoltageLimit(0.755); - parameters.setMaxPlausibleHighVoltageLimit(1.236); parameters.setReactiveSlackBusesMode(ReactiveSlackBusesMode.CONFIGURED); - parameters.setDefaultVariableScalingFactor(0.756); - parameters.setDefaultConstraintScalingFactor(0.888); - parameters.setReactiveSlackVariableScalingFactor(1e-2); - parameters.setTwoWindingTransformerRatioVariableScalingFactor(0.005); parameters.addConfiguredReactiveSlackBuses(List.of("bus1", "bus2")); + String json = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(parameters); - ComparisonUtils.compareTxt(Objects.requireNonNull(getClass().getResourceAsStream("/parameters.json")), json); + ComparisonUtils.compareTxt(Objects.requireNonNull(getClass().getResourceAsStream("/parametersLists.json")), json); OpenReacParameters parameters2 = objectMapper.readValue(json, OpenReacParameters.class); // List of voltage limit overrides @@ -70,16 +64,63 @@ void test() throws IOException { assertEquals(vloList2, parameters2.getSpecificVoltageLimits()); assertEquals(List.of("g1", "g2"), parameters2.getConstantQGenerators()); assertEquals(List.of("tr1"), parameters2.getVariableTwoWindingsTransformers()); + assertEquals(List.of("sc1", "sc2"), parameters2.getVariableShuntCompensators()); + assertEquals(ReactiveSlackBusesMode.CONFIGURED, parameters2.getReactiveSlackBusesMode()); + assertEquals(List.of("bus1", "bus2"), parameters2.getConfiguredReactiveSlackBuses()); + } + + @Test + void testOpenReacParametersThresholds() throws IOException { + ObjectMapper objectMapper = JsonUtil.createObjectMapper() + .registerModule(new OpenReactJsonModule()); + OpenReacParameters parameters = new OpenReacParameters(); + + // modify open reac parameters + parameters.setObjectiveDistance(5); + parameters.setLogLevelAmpl(OpenReacAmplLogLevel.WARNING); + parameters.setLogLevelSolver(OpenReacSolverLogLevel.NOTHING); + parameters.setMinPlausibleLowVoltageLimit(0.755); + parameters.setMaxPlausibleHighVoltageLimit(1.236); + parameters.setReactiveSlackBusesMode(ReactiveSlackBusesMode.ALL); + parameters.setActivePowerVariationRate(0.56); + parameters.setMinPlausibleActivePowerThreshold(0.5); + parameters.setLowImpedanceThreshold(1e-5); + parameters.setMinNominalVoltageIgnoredBus(10.); + parameters.setMinNominalVoltageIgnoredVoltageBounds(5.); + parameters.setPQMax(8555.3); + parameters.setLowActivePowerDefaultLimit(99.2); + parameters.setHighActivePowerDefaultLimit(1144.); + parameters.setDefaultQmaxPmaxRatio(0.4); + parameters.setDefaultMinimalQPRange(1.1); + parameters.setDefaultVariableScalingFactor(0.756); + parameters.setDefaultConstraintScalingFactor(0.888); + parameters.setReactiveSlackVariableScalingFactor(1e-2); + parameters.setTwoWindingTransformerRatioVariableScalingFactor(0.005); + + String json = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(parameters); + ComparisonUtils.compareTxt(Objects.requireNonNull(getClass().getResourceAsStream("/parametersThresholds.json")), json); + OpenReacParameters parameters2 = objectMapper.readValue(json, OpenReacParameters.class); + assertEquals(5, parameters2.getObjectiveDistance()); assertEquals(OpenReacAmplLogLevel.WARNING, parameters2.getLogLevelAmpl()); assertEquals(OpenReacSolverLogLevel.NOTHING, parameters2.getLogLevelSolver()); assertEquals(0.755, parameters2.getMinPlausibleLowVoltageLimit()); assertEquals(1.236, parameters2.getMaxPlausibleHighVoltageLimit()); - assertEquals(ReactiveSlackBusesMode.CONFIGURED, parameters2.getReactiveSlackBusesMode()); + assertEquals(ReactiveSlackBusesMode.ALL, parameters2.getReactiveSlackBusesMode()); + assertEquals(OpenReacOptimisationObjective.MIN_GENERATION, parameters2.getObjective()); + assertEquals(0.56, parameters2.getActivePowerVariationRate()); + assertEquals(0.5, parameters2.getMinPlausibleActivePowerThreshold()); + assertEquals(1e-5, parameters2.getLowImpedanceThreshold()); + assertEquals(10., parameters2.getMinNominalVoltageIgnoredBus()); + assertEquals(5., parameters2.getMinNominalVoltageIgnoredVoltageBounds()); + assertEquals(8555.3, parameters2.getPQMax()); + assertEquals(99.2, parameters2.getLowActivePowerDefaultLimit()); + assertEquals(1144., parameters2.getHighActivePowerDefaultLimit()); + assertEquals(0.4, parameters2.getDefaultQmaxPmaxRatio()); + assertEquals(1.1, parameters2.getDefaultMinimalQPRange()); assertEquals(0.756, parameters2.getDefaultVariableScalingFactor()); assertEquals(0.888, parameters2.getDefaultConstraintScalingFactor()); assertEquals(1e-2, parameters2.getReactiveSlackVariableScalingFactor()); assertEquals(0.005, parameters2.getTwoWindingTransformerRatioVariableScalingFactor()); - assertEquals(List.of("bus1", "bus2"), parameters2.getConfiguredReactiveSlackBuses()); } } diff --git a/open-reac/src/test/resources/expected_inputs/param_algo.txt b/open-reac/src/test/resources/expected_inputs/param_algo.txt index fac48ff1..07b96927 100644 --- a/open-reac/src/test/resources/expected_inputs/param_algo.txt +++ b/open-reac/src/test/resources/expected_inputs/param_algo.txt @@ -5,6 +5,16 @@ log_level_knitro 2 min_plausible_low_voltage_limit 0.5 max_plausible_high_voltage_limit 1.5 buses_with_reactive_slacks CONFIGURED +coeff_alpha 1.0 +Pnull 0.01 +Znull 1.0E-4 +epsilon_nominal_voltage 1.0 +ignore_voltage_bounds 0.0 +PQmax 9000.0 +defaultPmin 0.0 +defaultPmax 1000.0 +defaultQmaxPmaxRatio 0.3 +minimalQPrange 1.0 default_variable_scaling_factor 1.0 default_constraint_scaling_factor 1.0 reactive_slack_variable_scaling_factor 0.1 diff --git a/open-reac/src/test/resources/openreac-input-algo-parameters/default.txt b/open-reac/src/test/resources/openreac-input-algo-parameters/default.txt index dc9b99ac..73774fb2 100644 --- a/open-reac/src/test/resources/openreac-input-algo-parameters/default.txt +++ b/open-reac/src/test/resources/openreac-input-algo-parameters/default.txt @@ -4,6 +4,16 @@ log_level_knitro 2 min_plausible_low_voltage_limit 0.5 max_plausible_high_voltage_limit 1.5 buses_with_reactive_slacks NO_GENERATION +coeff_alpha 1.0 +Pnull 0.01 +Znull 1.0E-4 +epsilon_nominal_voltage 1.0 +ignore_voltage_bounds 0.0 +PQmax 9000.0 +defaultPmin 0.0 +defaultPmax 1000.0 +defaultQmaxPmaxRatio 0.3 +minimalQPrange 1.0 default_variable_scaling_factor 1.0 default_constraint_scaling_factor 1.0 reactive_slack_variable_scaling_factor 0.1 diff --git a/open-reac/src/test/resources/openreac-input-algo-parameters/modified_param_algo.txt b/open-reac/src/test/resources/openreac-input-algo-parameters/modified_param_algo.txt index fe2fdfbd..b2af5a2c 100644 --- a/open-reac/src/test/resources/openreac-input-algo-parameters/modified_param_algo.txt +++ b/open-reac/src/test/resources/openreac-input-algo-parameters/modified_param_algo.txt @@ -5,6 +5,16 @@ log_level_knitro 1 min_plausible_low_voltage_limit 0.7888 max_plausible_high_voltage_limit 1.3455 buses_with_reactive_slacks ALL +coeff_alpha 0.88 +Pnull 0.45 +Znull 1.0E-5 +epsilon_nominal_voltage 2.0 +ignore_voltage_bounds 0.75 +PQmax 3987.76 +defaultPmin 12.32 +defaultPmax 1452.66 +defaultQmaxPmaxRatio 0.24 +minimalQPrange 2.0 default_variable_scaling_factor 1.1222 default_constraint_scaling_factor 0.7889 reactive_slack_variable_scaling_factor 0.2 diff --git a/open-reac/src/test/resources/parameters.json b/open-reac/src/test/resources/parametersLists.json similarity index 53% rename from open-reac/src/test/resources/parameters.json rename to open-reac/src/test/resources/parametersLists.json index 98972911..79ffbc86 100644 --- a/open-reac/src/test/resources/parameters.json +++ b/open-reac/src/test/resources/parametersLists.json @@ -26,14 +26,23 @@ "variableShuntCompensators" : [ "sc1", "sc2" ], "configuredReactiveSlackBuses" : [ "bus1", "bus2" ], "objective" : "MIN_GENERATION", - "objectiveDistance" : 5.0, - "logLevelAmpl" : "WARNING", - "logLevelSolver" : "NOTHING", - "minPlausibleLowVoltageLimit" : 0.755, - "maxPlausibleHighVoltageLimit" : 1.236, + "logLevelAmpl" : "INFO", + "logLevelSolver" : "EVERYTHING", + "minPlausibleLowVoltageLimit" : 0.5, + "maxPlausibleHighVoltageLimit" : 1.5, "reactiveSlackBusesMode" : "CONFIGURED", - "defaultVariableScalingFactor" : 0.756, - "defaultConstraintScalingFactor" : 0.888, - "reactiveSlackVariableScalingFactor" : 0.01, - "twoWindingTransformerRatioVariableScalingFactor" : 0.005 + "activePowerVariationRate" : 1.0, + "minPlausibleActivePowerThreshold" : 0.01, + "lowImpedanceThreshold" : 1.0E-4, + "minNominalVoltageIgnoredBus" : 1.0, + "minNominalVoltageIgnoredVoltageBounds" : 0.0, + "maxPlausiblePowerLimit" : 9000.0, + "lowActivePowerDefaultLimit" : 0.0, + "highActivePowerDefaultLimit" : 1000.0, + "defaultQmaxPmaxRatio" : 0.3, + "defaultMinimalQPRange" : 1.0, + "defaultVariableScalingFactor" : 1.0, + "defaultConstraintScalingFactor" : 1.0, + "reactiveSlackVariableScalingFactor" : 0.1, + "twoWindingTransformerRatioVariableScalingFactor" : 0.001 } \ No newline at end of file diff --git a/open-reac/src/test/resources/parametersThresholds.json b/open-reac/src/test/resources/parametersThresholds.json new file mode 100644 index 00000000..1fcece0c --- /dev/null +++ b/open-reac/src/test/resources/parametersThresholds.json @@ -0,0 +1,28 @@ +{ + "version" : "1.0", + "specificVoltageLimits" : [ ], + "constantQGenerators" : [ ], + "variableTwoWindingsTransformers" : [ ], + "variableShuntCompensators" : [ ], + "objective" : "MIN_GENERATION", + "objectiveDistance" : 5.0, + "logLevelAmpl" : "WARNING", + "logLevelSolver" : "NOTHING", + "minPlausibleLowVoltageLimit" : 0.755, + "maxPlausibleHighVoltageLimit" : 1.236, + "reactiveSlackBusesMode" : "ALL", + "activePowerVariationRate" : 0.56, + "minPlausibleActivePowerThreshold" : 0.5, + "lowImpedanceThreshold" : 1.0E-5, + "minNominalVoltageIgnoredBus" : 10.0, + "minNominalVoltageIgnoredVoltageBounds" : 5.0, + "maxPlausiblePowerLimit" : 8555.3, + "lowActivePowerDefaultLimit" : 99.2, + "highActivePowerDefaultLimit" : 1144.0, + "defaultQmaxPmaxRatio" : 0.4, + "defaultMinimalQPRange" : 1.1, + "defaultVariableScalingFactor" : 0.756, + "defaultConstraintScalingFactor" : 0.888, + "reactiveSlackVariableScalingFactor" : 0.01, + "twoWindingTransformerRatioVariableScalingFactor" : 0.005 +} \ No newline at end of file