diff --git a/open-reac/README.md b/open-reac/README.md index dbb35fac..48136249 100644 --- a/open-reac/README.md +++ b/open-reac/README.md @@ -94,7 +94,7 @@ These are specified in the file `param_algo.txt`: | `min_plausible_low_voltage_limit` | Consistency bound for low voltage limit of voltage levels (see [4.1](#41-voltage-level-limits-computation)) | $0.5$ (p.u.) | $\mathbb{R}^{+}$ | | `max_plausible_high_voltage_limit` | Consistency bound for high voltage limit of voltage levels (see [4.1](#41-voltage-level-limits-computation)) | $1.5$ (p.u.) | [`min_plausible_low_voltage_limit`; $\infty$] | | `ignore_voltage_bounds` | Threshold to replace voltage limits of voltage levels with nominal voltage lower than it, by [min_plausible_low_voltage_limit; max_plausible_high_voltage_limit] | $0$ (p.u.) | $\mathbb{R}^{+}$ | -| `buses_with_reactive_slacks` | Choice of which buses will have reactive slacks attached in ACOPF solving (see [7](#7-alternative-current-optimal-power-flow)) | NO_GENERATION | {CONFIGURED, NO_GENERATION, ALL} | +| `buses_with_reactive_slacks` | Choice of which buses will have reactive slacks attached in ACOPF solving (see [7](#7-alternative-current-optimal-power-flow)) | ALL | {CONFIGURED, NO_GENERATION, ALL} | | `PQmax` | Threshold for maximum active and reactive power considered in correction of generator limits (see [4.4](#44-pq-units-domain)) | $9000$ (MW, MVAr) | $\mathbb{R}$ | | `defaultPmax` | Threshold for correction of high active power limit produced by generators (see [4.4](#44-pq-units-domain)) | $1000$ (MW) | $\mathbb{R}$ | | `defaultPmin` | Threshold for correction of low active power limit produced by generators (see [4.4](#44-pq-units-domain)) | $0$ (MW) | $\mathbb{R}$ | @@ -104,7 +104,7 @@ These are specified in the file `param_algo.txt`: | `default_constraint_scaling_factor` | Default scaling factor applied to all the constraints before ACOPF solving | $1$ | $\mathbb{R}^{+}$ | | `reactive_slack_variable_scaling_factor` | Scaling factor applied to all reactive slacks variables before ACOPF solving (see [7](#7-alternative-current-optimal-power-flow)) | $0.1$ | $\mathbb{R}^{*,+}$ | | `transformer_ratio_variable_scaling_factor` | Scaling factor applied to all transformer ratio variables before ACOPF solving (see [7](#7-alternative-current-optimal-power-flow)) | $0.001$ | $\mathbb{R}^{*,+}$ | - +| `shunt_variable_scaling_factor` | Scaling factor applied to all shunt variables before ACOPF solving (see [7](#7-alternative-current-optimal-power-flow)) | $0.1$ | $\mathbb{R}^{*,+}$ | Please note that for these parameters, the AMPL code defines default values which may be different from those in Java (for example, for the scaling values). This allows a user to use the AMPL code without going through the Java interface, and without providing the file `param_algo.txt`. 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 ef7f4147..62d3352a 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 @@ -60,7 +60,7 @@ public class OpenReacParameters { private double maxPlausibleHighVoltageLimit = 1.5; // in pu - private ReactiveSlackBusesMode reactiveSlackBusesMode = ReactiveSlackBusesMode.NO_GENERATION; + private ReactiveSlackBusesMode reactiveSlackBusesMode = ReactiveSlackBusesMode.ALL; private static final String ACTIVE_POWER_VARIATION_RATE_KEY = "coeff_alpha"; @@ -118,6 +118,10 @@ public class OpenReacParameters { private double twoWindingTransformerRatioVariableScalingFactor = 1e-3; + private static final String SHUNT_VARIABLE_SCALING_FACTOR_KEY = "shunt_variable_scaling_factor"; + + private double shuntVariableScalingFactor = 1e-1; + // Shunt compensator alert threshold // (to help reporting the shunt compensators with a delta between optimized and discretized reactive value over this threshold in MVar) @@ -514,6 +518,21 @@ public OpenReacParameters setTwoWindingTransformerRatioVariableScalingFactor(dou return this; } + /** + * @return the scaling value of shunt variables in ACOPF. + */ + public double getShuntVariableScalingFactor() { + return shuntVariableScalingFactor; + } + + public OpenReacParameters setShuntVariableScalingFactor(double shuntVariableScalingFactor) { + if (shuntVariableScalingFactor <= 0 || Double.isNaN(shuntVariableScalingFactor)) { + throw new IllegalArgumentException("Scaling factor for shunt variables must be > 0 and defined to be consistent."); + } + this.shuntVariableScalingFactor = shuntVariableScalingFactor; + return this; + } + /** * @return the shunt compensator activation alert threshold */ @@ -554,6 +573,7 @@ public List getAllAlgorithmParams() { allAlgoParams.add(new OpenReacAlgoParamImpl(DEFAULT_CONSTRAINT_SCALING_FACTOR, Double.toString(defaultConstraintScalingFactor))); allAlgoParams.add(new OpenReacAlgoParamImpl(REACTIVE_SLACK_VARIABLE_SCALING_FACTOR, Double.toString(reactiveSlackVariableScalingFactor))); allAlgoParams.add(new OpenReacAlgoParamImpl(TWO_WINDING_TRANSFORMER_RATIO_VARIABLE_SCALING_FACTOR, Double.toString(twoWindingTransformerRatioVariableScalingFactor))); + allAlgoParams.add(new OpenReacAlgoParamImpl(SHUNT_VARIABLE_SCALING_FACTOR_KEY, Double.toString(shuntVariableScalingFactor))); return allAlgoParams; } 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 5a4819f2..f49506a4 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 @@ -147,6 +147,10 @@ public OpenReacParameters deserialize(JsonParser parser, DeserializationContext parser.nextToken(); parameters.setTwoWindingTransformerRatioVariableScalingFactor(parser.readValueAs(Double.class)); } + case "shuntVariableScalingFactor" -> { + parser.nextToken(); + parameters.setShuntVariableScalingFactor(parser.readValueAs(Double.class)); + } default -> throw new IllegalStateException("Unexpected field: " + parser.getCurrentName()); } } 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 e78337c7..3225d5b0 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 @@ -61,6 +61,7 @@ public void serialize(OpenReacParameters openReacParameters, JsonGenerator jsonG serializerProvider.defaultSerializeField("defaultConstraintScalingFactor", openReacParameters.getDefaultConstraintScalingFactor(), jsonGenerator); serializerProvider.defaultSerializeField("reactiveSlackVariableScalingFactor", openReacParameters.getReactiveSlackVariableScalingFactor(), jsonGenerator); serializerProvider.defaultSerializeField("twoWindingTransformerRatioVariableScalingFactor", openReacParameters.getTwoWindingTransformerRatioVariableScalingFactor(), jsonGenerator); + serializerProvider.defaultSerializeField("shuntVariableScalingFactor", openReacParameters.getShuntVariableScalingFactor(), jsonGenerator); jsonGenerator.writeEndObject(); } } diff --git a/open-reac/src/main/resources/openreac/reactiveopf.mod b/open-reac/src/main/resources/openreac/reactiveopf.mod index 90fd13f4..df57bc3a 100644 --- a/open-reac/src/main/resources/openreac/reactiveopf.mod +++ b/open-reac/src/main/resources/openreac/reactiveopf.mod @@ -954,8 +954,8 @@ subject to ctr_balance_P{PROBLEM_ACOPF,k in BUSCC}: set BUSCC_SLACK := if buses_with_reactive_slacks == "ALL" then BUSCC else if buses_with_reactive_slacks == "NO_GENERATION" then {n in BUSCC: (card{(g,n) in UNITON: (g,n) not in UNIT_FIXQ}==0 and card{(svc,n) in SVCON}==0 and card{(vscconv,n) in VSCCONVON}==0)} else BUSCC inter PARAM_BUSES_WITH_REACTIVE_SLACK; # if = "CONFIGURED", buses given as parameter but in connex component -var slack1_balance_Q{BUSCC_SLACK} >=0; -var slack2_balance_Q{BUSCC_SLACK} >=0; +var slack1_shunt_B{BUSCC_SLACK} >= 0; +var slack2_shunt_B{BUSCC_SLACK} >= 0; #subject to ctr_compl_slack_Q{PROBLEM_ACOPF,k in BUSCC_SLACK}: slack1_balance_Q[k] >= 0 complements slack2_balance_Q[k] >= 0; subject to ctr_balance_Q{PROBLEM_ACOPF,k in BUSCC}: @@ -980,8 +980,8 @@ subject to ctr_balance_Q{PROBLEM_ACOPF,k in BUSCC}: + sum{(l,k) in LCCCONVON} lccconv_Q0[1,l,k] # Fixed value # Slack variables + if k in BUSCC_SLACK then - (- slack1_balance_Q[k] # Homogeneous to a generation of reactive power (condensator) - + slack2_balance_Q[k]) # homogeneous to a reactive load (self) + (- base100MVA * V[k]^2 * slack1_shunt_B[k] # Homogeneous to a generation of reactive power (condensator) + + base100MVA * V[k]^2 * slack2_shunt_B[k]) # homogeneous to a reactive load (self) = 0; @@ -1013,8 +1013,8 @@ param penalty_voltage_target_low := 0.01; minimize problem_acopf_objective: sum{n in BUSCC_SLACK} ( - penalty_invest_rea_pos * slack1_balance_Q[n] - + penalty_invest_rea_neg * slack2_balance_Q[n] + penalty_invest_rea_pos * base100MVA * slack1_shunt_B[n] + + penalty_invest_rea_neg * base100MVA * slack2_shunt_B[n] ) # coeff_alpha == 1 : minimize sum of generation, all generating units vary with 1 unique variable alpha diff --git a/open-reac/src/main/resources/openreac/reactiveopf.run b/open-reac/src/main/resources/openreac/reactiveopf.run index f248a799..f69be358 100644 --- a/open-reac/src/main/resources/openreac/reactiveopf.run +++ b/open-reac/src/main/resources/openreac/reactiveopf.run @@ -316,7 +316,7 @@ if ignore_voltage_bounds >= epsilon_nominal_voltage then printf{LOG_INFO} "Parameter: for all busses with nominal voltage <= ignore_voltage_bounds=%.1f, voltage bounds are ignored and replaced by [%.3f;%.3f]\n",ignore_voltage_bounds,min_plausible_low_voltage_limit,max_plausible_high_voltage_limit; check ignore_voltage_bounds >= 0; -param buses_with_reactive_slacks symbolic default "NO_GENERATION"; +param buses_with_reactive_slacks symbolic default "ALL"; if "buses_with_reactive_slacks" in PARAM_ALGO_KEYS then let buses_with_reactive_slacks := PARAM_ALGO_VALUES["buses_with_reactive_slacks"]; printf{LOG_INFO} "Parameter: choice for buses with reactive slacks in ACOPF := %Q (%s)\n", buses_with_reactive_slacks, if buses_with_reactive_slacks == "ALL" then "every bus in connex component." @@ -374,6 +374,10 @@ if "transformer_ratio_variable_scaling_factor" in PARAM_ALGO_KEYS then let trans printf{LOG_INFO} "Parameter: scaling factor for tranformer ratio variables := %.3f\n",transformer_ratio_variable_scaling_factor; check transformer_ratio_variable_scaling_factor > 0; +param shunt_variable_scaling_factor default 1e-1; +if "shunt_variable_scaling_factor" in PARAM_ALGO_KEYS then let shunt_variable_scaling_factor := num(PARAM_ALGO_VALUES["shunt_variable_scaling_factor"]); +printf{LOG_INFO} "Parameter: scaling factor for shunt variables := %.3f\n",shunt_variable_scaling_factor; +check shunt_variable_scaling_factor > 0; ############################################################################### # Solver choice and options @@ -971,8 +975,8 @@ let {n in BUSVV} V[n] := bus_V0[1,n]; let {n in BUSCC diff BUSVV} V[n] := voltage_lower_bound[1,bus_substation[1,n]] + 0.8 *(voltage_upper_bound[1,bus_substation[1,n]] - voltage_lower_bound[1,bus_substation[1,n]]); -let {n in BUSCC_SLACK} slack1_balance_Q[n] := 0; -let {n in BUSCC_SLACK} slack2_balance_Q[n] := 0; +let {n in BUSCC_SLACK} slack1_shunt_B[n] := 0; +let {n in BUSCC_SLACK} slack2_shunt_B[n] := 0; let alpha := 0.01; let {(g,n) in UNITON} P_bounded[g,n] := max(P_dcopf[g,n],unit_Pc[1,g,n]); let {(g,n) in UNITON} Q[g,n] := 0.5*(corrected_unit_Qmax[g,n] + corrected_unit_Qmin[g,n]); @@ -989,16 +993,18 @@ let tempstr := ctime(); printf{LOG_KNITRO} "\n######################################################################\n"; printf{LOG_KNITRO} "** ACopf solve: start (%s)\n\n",ctime(); -option knitro_options ("opttol=1 opttolabs=1e-1 feastol=1 feastolabs=1e-3 maxit=200 outlev=3"); +option knitro_options ("opttol=1 opttolabs=1e-1 feastol=1 feastolabs=1e-3 maxit=300 outlev=3"); let {i in 1.._nvars} _var[i].xscalefactor := default_variable_scaling_factor; let {i in 1.._ncons} _con[i].cscalefactor := default_constraint_scaling_factor; -let {n in BUSCC_SLACK} slack1_balance_Q[n].xscalefactor := reactive_slack_variable_scaling_factor; -let {n in BUSCC_SLACK} slack2_balance_Q[n].xscalefactor := reactive_slack_variable_scaling_factor; +let {n in BUSCC_SLACK} slack1_shunt_B[n].xscalefactor := reactive_slack_variable_scaling_factor; +let {n in BUSCC_SLACK} slack2_shunt_B[n].xscalefactor := reactive_slack_variable_scaling_factor; let {(qq,m,n) in BRANCHCC_REGL_VAR} branch_Ror_var[qq,m,n].xscalefactor := transformer_ratio_variable_scaling_factor; +let {(shunt,n) in SHUNT_VAR} shunt_var[shunt,n].xscalefactor := shunt_variable_scaling_factor; + # solve acopf and avoid knitro printing if user asks if (log_level_knitro <= 1) then { solve problem_acopf_objective > (nullDevice); @@ -1013,6 +1019,13 @@ printf{LOG_KNITRO} "\n** ACopf solve: end (%s -> %s)\n",tempstr,ctime(); printf{LOG_KNITRO} "######################################################################\n\n"; +param slack1_balance_Q{n in BUSCC_SLACK}; +param slack2_balance_Q{n in BUSCC_SLACK}; +for {n in BUSCC_SLACK} { + let slack1_balance_Q[n] := base100MVA * V[n]^2 * slack1_shunt_B[n].val; + let slack2_balance_Q[n] := base100MVA * V[n]^2 * slack2_shunt_B[n].val; +} + ############################################################################### # Analysis of solve_result_num ############################################################################### diff --git a/open-reac/src/main/resources/openreac/reactiveopfexit.run b/open-reac/src/main/resources/openreac/reactiveopfexit.run index 1f47ae4f..4e7a8fc3 100644 --- a/open-reac/src/main/resources/openreac/reactiveopfexit.run +++ b/open-reac/src/main/resources/openreac/reactiveopfexit.run @@ -71,7 +71,7 @@ printf "%s %f\n","default_variable_scaling_factor",default_variable_scaling_fact printf "%s %f\n","default_constraint_scaling_factor",default_constraint_scaling_factor > (fileOut); printf "%s %f\n","reactive_slack_variable_scaling_factor",reactive_slack_variable_scaling_factor > (fileOut); printf "%s %f\n","transformer_ratio_variable_scaling_factor",transformer_ratio_variable_scaling_factor > (fileOut); - +printf "%s %f\n","shunt_variable_scaling_factor",shunt_variable_scaling_factor > (fileOut); close (fileOut); printf "\n*** End of file reactiveopfexit.run : %s\n",ctime(); diff --git a/open-reac/src/main/resources/openreac/reactiveopfoutput.run b/open-reac/src/main/resources/openreac/reactiveopfoutput.run index d2b67213..ecfc2bcd 100644 --- a/open-reac/src/main/resources/openreac/reactiveopfoutput.run +++ b/open-reac/src/main/resources/openreac/reactiveopfoutput.run @@ -273,6 +273,7 @@ printf "%s %f\n","default_variable_scaling_factor",default_variable_scaling_fact printf "%s %f\n","default_constraint_scaling_factor",default_constraint_scaling_factor > (fileOut); printf "%s %f\n","reactive_slack_variable_scaling_factor",reactive_slack_variable_scaling_factor > (fileOut); printf "%s %f\n","transformer_ratio_variable_scaling_factor",transformer_ratio_variable_scaling_factor > (fileOut); +printf "%s %f\n","shunt_variable_scaling_factor",shunt_variable_scaling_factor > (fileOut); printf "\n" > (fileOut); printf "%s %i\n","nb_substations",card(SUBSTATIONS) > (fileOut); 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 4b4f3665..dd3e89a1 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/OpenReacParametersTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/OpenReacParametersTest.java @@ -249,42 +249,64 @@ void testDefaultMinimalQPRangeIntegrity() { assertEquals("Default minimal QP range must be defined and >= 0 to be consistent.", e2.getMessage()); } + @Test + void testTwoWindingTransformerRatioVariablesScalingFactor() { + OpenReacParameters parameters = new OpenReacParameters(); + + // Consistency of t2wt ratio variables scaling factor + parameters.setTwoWindingTransformerRatioVariableScalingFactor(0.007); + assertEquals(0.007, parameters.getTwoWindingTransformerRatioVariableScalingFactor()); + IllegalArgumentException e1 = assertThrows(IllegalArgumentException.class, () -> parameters.setTwoWindingTransformerRatioVariableScalingFactor(-0.25)); + assertEquals("Scaling factor for transformer ratio variables must be > 0 and defined to be consistent.", e1.getMessage()); + IllegalArgumentException e2 = assertThrows(IllegalArgumentException.class, () -> parameters.setTwoWindingTransformerRatioVariableScalingFactor(0)); + assertEquals("Scaling factor for transformer ratio variables must be > 0 and defined to be consistent.", e2.getMessage()); + IllegalArgumentException e3 = assertThrows(IllegalArgumentException.class, () -> parameters.setTwoWindingTransformerRatioVariableScalingFactor(Double.NaN)); + assertEquals("Scaling factor for transformer ratio variables must be > 0 and defined to be consistent.", e3.getMessage()); + } + + @Test + void testShuntVariablesScalingFactor() { + OpenReacParameters parameters = new OpenReacParameters(); + + // Consistency of shunt variables scaling factor + parameters.setShuntVariableScalingFactor(0.011); + assertEquals(0.011, parameters.getShuntVariableScalingFactor()); + IllegalArgumentException e1 = assertThrows(IllegalArgumentException.class, () -> parameters.setShuntVariableScalingFactor(-0.25)); + assertEquals("Scaling factor for shunt variables must be > 0 and defined to be consistent.", e1.getMessage()); + IllegalArgumentException e2 = assertThrows(IllegalArgumentException.class, () -> parameters.setShuntVariableScalingFactor(0)); + assertEquals("Scaling factor for shunt variables must be > 0 and defined to be consistent.", e2.getMessage()); + IllegalArgumentException e3 = assertThrows(IllegalArgumentException.class, () -> parameters.setShuntVariableScalingFactor(Double.NaN)); + assertEquals("Scaling factor for shunt variables must be > 0 and defined to be consistent.", e3.getMessage()); + } + + @Test + void testReactiveSlackVariablesScalingFactorsIntegrity() { + OpenReacParameters parameters = new OpenReacParameters(); + + // Consistency of reactive slack variables scaling factor + parameters.setReactiveSlackVariableScalingFactor(0.058); + assertEquals(0.058, parameters.getReactiveSlackVariableScalingFactor()); + IllegalArgumentException e1 = assertThrows(IllegalArgumentException.class, () -> parameters.setReactiveSlackVariableScalingFactor(-0.25)); + assertEquals("Scaling factor for reactive slack variables must be > 0 and defined to be consistent.", e1.getMessage()); + IllegalArgumentException e2 = assertThrows(IllegalArgumentException.class, () -> parameters.setReactiveSlackVariableScalingFactor(0)); + assertEquals("Scaling factor for reactive slack variables must be > 0 and defined to be consistent.", e2.getMessage()); + IllegalArgumentException e3 = assertThrows(IllegalArgumentException.class, () -> parameters.setReactiveSlackVariableScalingFactor(Double.NaN)); + assertEquals("Scaling factor for reactive slack variables must be > 0 and defined to be consistent.", e3.getMessage()); + } + @Test void testVariablesScalingFactorsIntegrity() { OpenReacParameters parameters = new OpenReacParameters(); // Consistency of default scaling factor - assertEquals(1, parameters.getDefaultVariableScalingFactor()); // default value parameters.setDefaultVariableScalingFactor(0.8); assertEquals(0.8, parameters.getDefaultVariableScalingFactor()); - IllegalArgumentException e = assertThrows(IllegalArgumentException.class, () -> parameters.setDefaultVariableScalingFactor(-0.25)); - assertEquals("Default scaling factor for variables must be > 0 and defined to be consistent.", e.getMessage()); + IllegalArgumentException e1 = assertThrows(IllegalArgumentException.class, () -> parameters.setDefaultVariableScalingFactor(-0.25)); + assertEquals("Default scaling factor for variables must be > 0 and defined to be consistent.", e1.getMessage()); IllegalArgumentException e2 = assertThrows(IllegalArgumentException.class, () -> parameters.setDefaultVariableScalingFactor(0)); assertEquals("Default scaling factor for variables must be > 0 and defined to be consistent.", e2.getMessage()); IllegalArgumentException e3 = assertThrows(IllegalArgumentException.class, () -> parameters.setDefaultVariableScalingFactor(Double.NaN)); assertEquals("Default scaling factor for variables must be > 0 and defined to be consistent.", e3.getMessage()); - - // Consistency of reactive slack variables scaling factor - assertEquals(1e-1, parameters.getReactiveSlackVariableScalingFactor()); // default value - parameters.setReactiveSlackVariableScalingFactor(0.058); - assertEquals(0.058, parameters.getReactiveSlackVariableScalingFactor()); - IllegalArgumentException e4 = assertThrows(IllegalArgumentException.class, () -> parameters.setReactiveSlackVariableScalingFactor(-0.25)); - assertEquals("Scaling factor for reactive slack variables must be > 0 and defined to be consistent.", e4.getMessage()); - IllegalArgumentException e5 = assertThrows(IllegalArgumentException.class, () -> parameters.setReactiveSlackVariableScalingFactor(0)); - assertEquals("Scaling factor for reactive slack variables must be > 0 and defined to be consistent.", e5.getMessage()); - IllegalArgumentException e6 = assertThrows(IllegalArgumentException.class, () -> parameters.setReactiveSlackVariableScalingFactor(Double.NaN)); - assertEquals("Scaling factor for reactive slack variables must be > 0 and defined to be consistent.", e6.getMessage()); - - // Consistency of t2wt ratio variables scaling factor - assertEquals(1e-3, parameters.getTwoWindingTransformerRatioVariableScalingFactor()); // default value - parameters.setTwoWindingTransformerRatioVariableScalingFactor(0.007); - assertEquals(0.007, parameters.getTwoWindingTransformerRatioVariableScalingFactor()); - IllegalArgumentException e7 = assertThrows(IllegalArgumentException.class, () -> parameters.setTwoWindingTransformerRatioVariableScalingFactor(-0.25)); - assertEquals("Scaling factor for transformer ratio variables must be > 0 and defined to be consistent.", e7.getMessage()); - IllegalArgumentException e8 = assertThrows(IllegalArgumentException.class, () -> parameters.setTwoWindingTransformerRatioVariableScalingFactor(0)); - assertEquals("Scaling factor for transformer ratio variables must be > 0 and defined to be consistent.", e8.getMessage()); - IllegalArgumentException e9 = assertThrows(IllegalArgumentException.class, () -> parameters.setTwoWindingTransformerRatioVariableScalingFactor(Double.NaN)); - assertEquals("Scaling factor for transformer ratio variables must be > 0 and defined to be consistent.", e9.getMessage()); } @Test @@ -325,9 +347,10 @@ void testAlgorithmParams() { parameters.setDefaultConstraintScalingFactor(0.75); parameters.setReactiveSlackVariableScalingFactor(1e-2); parameters.setTwoWindingTransformerRatioVariableScalingFactor(0.0001); + parameters.setShuntVariableScalingFactor(3e-2); List algoParams = parameters.getAllAlgorithmParams(); - assertEquals(21, algoParams.size()); + assertEquals(22, algoParams.size()); assertEquals("2", algoParams.get(0).getValue()); assertEquals("0.4", algoParams.get(1).getValue()); assertEquals("DEBUG", algoParams.get(2).getValue()); @@ -349,13 +372,14 @@ void testAlgorithmParams() { assertEquals("0.75", algoParams.get(18).getValue()); assertEquals("0.01", algoParams.get(19).getValue()); assertEquals("1.0E-4", algoParams.get(20).getValue()); + assertEquals("0.03", algoParams.get(21).getValue()); } @Test void testBusesWithReactiveSlackConfigIntegrity() { OpenReacParameters parameters = new OpenReacParameters(); - assertEquals(ReactiveSlackBusesMode.NO_GENERATION, parameters.getReactiveSlackBusesMode()); // default value + assertEquals(ReactiveSlackBusesMode.ALL, parameters.getReactiveSlackBusesMode()); // default value assertThrows(NullPointerException.class, () -> parameters.setReactiveSlackBusesMode(null)); parameters.setReactiveSlackBusesMode(ReactiveSlackBusesMode.CONFIGURED); assertEquals("CONFIGURED", parameters.getReactiveSlackBusesMode().toParam().getValue()); @@ -374,7 +398,7 @@ void testDefaultParametersValuesIntegrity() { assertEquals(OpenReacSolverLogLevel.EVERYTHING, parameters.getLogLevelSolver()); assertEquals(0.5, parameters.getMinPlausibleLowVoltageLimit()); assertEquals(1.5, parameters.getMaxPlausibleHighVoltageLimit()); - assertEquals(ReactiveSlackBusesMode.NO_GENERATION, parameters.getReactiveSlackBusesMode()); + assertEquals(ReactiveSlackBusesMode.ALL, parameters.getReactiveSlackBusesMode()); assertEquals(1., parameters.getActivePowerVariationRate()); assertEquals(0.01, parameters.getMinPlausibleActivePowerThreshold()); assertEquals(1e-4, parameters.getLowImpedanceThreshold()); @@ -385,7 +409,10 @@ void testDefaultParametersValuesIntegrity() { assertEquals(1000., parameters.getHighActivePowerDefaultLimit()); assertEquals(0.3, parameters.getDefaultQmaxPmaxRatio()); assertEquals(1., parameters.getDefaultMinimalQPRange()); - // TODO : add cases for scaling values + assertEquals(1, parameters.getDefaultVariableScalingFactor()); + assertEquals(1e-1, parameters.getReactiveSlackVariableScalingFactor()); + assertEquals(1e-3, parameters.getTwoWindingTransformerRatioVariableScalingFactor()); + assertEquals(1e-1, parameters.getShuntVariableScalingFactor()); assertTrue(parameters.checkAlgorithmParametersIntegrity()); } @@ -397,8 +424,8 @@ void testDefaultParametersListsIntegrity() { assertEquals(0, parameters.getSpecificVoltageLimits().size(), "SpecificVoltageLimits should be empty when using default OpenReacParameter constructor."); 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(20, parameters.getAllAlgorithmParams().size()); + assertEquals(0, parameters.getConfiguredReactiveSlackBuses().size(), "ConfiguredReactiveSlackBuses should be empty when using default OpenReacParameter constructor."); + assertEquals(21, 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 a9d151a7..923c0ee1 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/OpenReacRunnerTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/OpenReacRunnerTest.java @@ -107,7 +107,7 @@ void testModifiedParamAlgoExport() throws IOException { .setLogLevelSolver(OpenReacSolverLogLevel.ONLY_RESULTS) .setMinPlausibleLowVoltageLimit(0.7888) .setMaxPlausibleHighVoltageLimit(1.3455) - .setReactiveSlackBusesMode(ReactiveSlackBusesMode.ALL) + .setReactiveSlackBusesMode(ReactiveSlackBusesMode.NO_GENERATION) .setActivePowerVariationRate(0.88) .setMinPlausibleActivePowerThreshold(0.45) .setLowImpedanceThreshold(1e-5) @@ -121,7 +121,8 @@ void testModifiedParamAlgoExport() throws IOException { .setDefaultVariableScalingFactor(1.1222) .setDefaultConstraintScalingFactor(0.7889) .setReactiveSlackVariableScalingFactor(0.2) - .setTwoWindingTransformerRatioVariableScalingFactor(0.0045); + .setTwoWindingTransformerRatioVariableScalingFactor(0.0045) + .setShuntVariableScalingFactor(0.101); LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( List.of("empty_case/reactiveopf_results_indic.txt")); @@ -231,7 +232,7 @@ void testOutputFileParsing() throws IOException { assertEquals(1, openReacResult.getVscModifications().size()); assertEquals(7, openReacResult.getGeneratorModifications().size()); assertEquals(3, openReacResult.getVoltageProfile().size()); - assertEquals(86, openReacResult.getIndicators().size()); + assertEquals(87, openReacResult.getIndicators().size()); assertTrue(openReacResult.getReactiveSlacks().isEmpty()); } } 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 07b96927..a0b2e565 100644 --- a/open-reac/src/test/resources/expected_inputs/param_algo.txt +++ b/open-reac/src/test/resources/expected_inputs/param_algo.txt @@ -19,4 +19,5 @@ default_variable_scaling_factor 1.0 default_constraint_scaling_factor 1.0 reactive_slack_variable_scaling_factor 0.1 transformer_ratio_variable_scaling_factor 0.001 +shunt_variable_scaling_factor 0.1 diff --git a/open-reac/src/test/resources/mock_outputs/reactiveopf_results_indic.txt b/open-reac/src/test/resources/mock_outputs/reactiveopf_results_indic.txt index 16c3e8dd..36fe7884 100644 --- a/open-reac/src/test/resources/mock_outputs/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/mock_outputs/reactiveopf_results_indic.txt @@ -25,7 +25,7 @@ epsilon_nominal_voltage 1.000000 min_plausible_low_voltage_limit 0.500000 max_plausible_high_voltage_limit 1.500000 ignore_voltage_bounds 0.000000 -buses_with_reactive_slacks NO_GENERATION +buses_with_reactive_slacks ALL PQmax 9000.000000 defaultPmax 1000.000000 defaultPmin 0.000000 @@ -37,6 +37,7 @@ default_variable_scaling_factor 1.000000 default_constraint_scaling_factor 1.000000 reactive_slack_variable_scaling_factor 0.100000 transformer_ratio_variable_scaling_factor 0.001000 +shunt_variable_scaling_factor 0.100000 nb_substations 42 nb_bus_in_data_file 58 @@ -44,8 +45,8 @@ nb_bus_in_ACDC_CC 57 nb_bus_in_AC_CC 57 nb_bus_in_ACDC_but_out_AC_CC 0 nb_bus_with_voltage_value 57 -nb_bus_with_reactive_slacks 53 -nb_bus_without_reactive_slacks 4 +nb_bus_with_reactive_slacks 57 +nb_bus_without_reactive_slacks 0 nb_branch_in_data_file 80 nb_branch_in_AC_CC 80 nb_branch_with_nonsmall_impedance 80 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 73774fb2..f2d2f613 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 @@ -3,7 +3,7 @@ log_level_ampl INFO log_level_knitro 2 min_plausible_low_voltage_limit 0.5 max_plausible_high_voltage_limit 1.5 -buses_with_reactive_slacks NO_GENERATION +buses_with_reactive_slacks ALL coeff_alpha 1.0 Pnull 0.01 Znull 1.0E-4 @@ -18,4 +18,5 @@ default_variable_scaling_factor 1.0 default_constraint_scaling_factor 1.0 reactive_slack_variable_scaling_factor 0.1 transformer_ratio_variable_scaling_factor 0.001 +shunt_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 b2af5a2c..686bd1d2 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 @@ -4,7 +4,7 @@ log_level_ampl WARNING log_level_knitro 1 min_plausible_low_voltage_limit 0.7888 max_plausible_high_voltage_limit 1.3455 -buses_with_reactive_slacks ALL +buses_with_reactive_slacks NO_GENERATION coeff_alpha 0.88 Pnull 0.45 Znull 1.0E-5 @@ -19,4 +19,5 @@ default_variable_scaling_factor 1.1222 default_constraint_scaling_factor 0.7889 reactive_slack_variable_scaling_factor 0.2 transformer_ratio_variable_scaling_factor 0.0045 +shunt_variable_scaling_factor 0.101 diff --git a/open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_generators.csv b/open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_generators.csv index a1706533..8a9b2752 100644 --- a/open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_generators.csv +++ b/open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_generators.csv @@ -1,6 +1,6 @@ #variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW); -1;1;1;'true';1.083;232.4;48.6;-233.0;-48.6; -1;2;2;'true';1.045;40.0;50.0;-40.7;-50.0; +1;1;1;'true';1.083;232.4;48.7;-233.0;-48.7; +1;2;2;'true';1.045;40.0;49.9;-40.7;-49.9; 1;3;3;'false';0.971;0;0;0;0; 1;4;6;'false';0.973;0;0;0;0; 1;5;8;'false';1.500;0;0;0;0; diff --git a/open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_indic.txt b/open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_indic.txt index 4aa3530b..cbdccbc7 100644 --- a/open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_indic.txt @@ -1,18 +1,18 @@ final_status OK dcopf_status OK -ctime_start 'Mon Apr 01 12:22:19 2024' +ctime_start 'Thu Jun 20 14:34:11 2024' last_solve_result_num 0 nb_iter_last 6 nb_iter_total 6 -_ampl_elapsed_time 0.062000 -_total_solve_time 0.031250 +_ampl_elapsed_time 0.032000 +_total_solve_time 0.000000 total_time 0 operatingSystem windows OS 'Windows_NT' COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_14143080586829170076' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_15080248147598462242' log_level_ampl INFO log_level_knitro 2 @@ -25,7 +25,7 @@ epsilon_nominal_voltage 1.000000 min_plausible_low_voltage_limit 0.500000 max_plausible_high_voltage_limit 1.500000 ignore_voltage_bounds 0.000000 -buses_with_reactive_slacks NO_GENERATION +buses_with_reactive_slacks ALL PQmax 9000.000000 defaultPmax 1000.000000 defaultPmin 0.000000 @@ -37,6 +37,7 @@ default_variable_scaling_factor 1.000000 default_constraint_scaling_factor 1.000000 reactive_slack_variable_scaling_factor 0.100000 transformer_ratio_variable_scaling_factor 0.001000 +shunt_variable_scaling_factor 0.100000 nb_substations 14 nb_bus_in_data_file 14 @@ -44,8 +45,8 @@ nb_bus_in_ACDC_CC 14 nb_bus_in_AC_CC 14 nb_bus_in_ACDC_but_out_AC_CC 0 nb_bus_with_voltage_value 14 -nb_bus_with_reactive_slacks 12 -nb_bus_without_reactive_slacks 2 +nb_bus_with_reactive_slacks 14 +nb_bus_without_reactive_slacks 0 nb_branch_in_data_file 20 nb_branch_in_AC_CC 20 nb_branch_with_nonsmall_impedance 20 @@ -81,9 +82,9 @@ min_teta_dc -0.12 min_teta_ac -0.11 teta_min -3.12 max_delta_teta_dc 0.159330 -max_delta_teta_ac 0.140571 +max_delta_teta_ac 0.140559 min_delta_teta_dc -0.041368 -min_delta_teta_ac -0.041534 +min_delta_teta_ac -0.041533 nb_reactive_slacks 0 nb_slacks_condensator 0 diff --git a/open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_voltages.csv index 58d56b24..20f1298f 100644 --- a/open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_voltages.csv +++ b/open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_voltages.csv @@ -1,5 +1,5 @@ #variant;bus;V(pu);theta(rad);id; -1;1;1.083;0.168;"VL1_0"; +1;1;1.083;0.167;"VL1_0"; 1;2;1.045;0.089;"VL2_0"; 1;3;0.971;-0.042;"VL3_0"; 1;4;0.991;0.000;"VL4_0"; diff --git a/open-reac/src/test/resources/openreac-output-real-network/reactiveopf_results_indic.txt b/open-reac/src/test/resources/openreac-output-real-network/reactiveopf_results_indic.txt index a768d155..ba6544bd 100644 --- a/open-reac/src/test/resources/openreac-output-real-network/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/openreac-output-real-network/reactiveopf_results_indic.txt @@ -1,18 +1,18 @@ final_status OK dcopf_status OK -ctime_start 'Mon Apr 01 12:18:15 2024' +ctime_start 'Thu Jun 20 14:42:54 2024' last_solve_result_num 0 nb_iter_last 7 nb_iter_total 7 -_ampl_elapsed_time 0.032000 -_total_solve_time 0.046875 +_ampl_elapsed_time 0.078000 +_total_solve_time 0.031250 total_time 0 operatingSystem windows OS 'Windows_NT' COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_14716501820934220752' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_16419245349654459503' log_level_ampl INFO log_level_knitro 2 @@ -25,7 +25,7 @@ epsilon_nominal_voltage 1.000000 min_plausible_low_voltage_limit 0.500000 max_plausible_high_voltage_limit 1.500000 ignore_voltage_bounds 0.000000 -buses_with_reactive_slacks NO_GENERATION +buses_with_reactive_slacks ALL PQmax 9000.000000 defaultPmax 1000.000000 defaultPmin 0.000000 @@ -37,6 +37,7 @@ default_variable_scaling_factor 1.000000 default_constraint_scaling_factor 1.000000 reactive_slack_variable_scaling_factor 0.100000 transformer_ratio_variable_scaling_factor 0.001000 +shunt_variable_scaling_factor 0.100000 nb_substations 42 nb_bus_in_data_file 57 @@ -44,8 +45,8 @@ nb_bus_in_ACDC_CC 57 nb_bus_in_AC_CC 57 nb_bus_in_ACDC_but_out_AC_CC 0 nb_bus_with_voltage_value 57 -nb_bus_with_reactive_slacks 53 -nb_bus_without_reactive_slacks 4 +nb_bus_with_reactive_slacks 57 +nb_bus_without_reactive_slacks 0 nb_branch_in_data_file 80 nb_branch_in_AC_CC 80 nb_branch_with_nonsmall_impedance 80 diff --git a/open-reac/src/test/resources/openreac-output-shunt/reactiveopf_results_indic.txt b/open-reac/src/test/resources/openreac-output-shunt/reactiveopf_results_indic.txt index cefc036e..4b072890 100644 --- a/open-reac/src/test/resources/openreac-output-shunt/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/openreac-output-shunt/reactiveopf_results_indic.txt @@ -1,18 +1,18 @@ final_status OK dcopf_status OK -ctime_start 'Mon Apr 01 12:20:13 2024' +ctime_start 'Thu Jun 20 14:41:11 2024' last_solve_result_num 0 -nb_iter_last 20 -nb_iter_total 20 -_ampl_elapsed_time 0.063000 -_total_solve_time 0.046875 +nb_iter_last 35 +nb_iter_total 35 +_ampl_elapsed_time 0.047000 +_total_solve_time 0.031250 total_time 0 operatingSystem windows OS 'Windows_NT' COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_3013493296207512901' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_10955859460968685093' log_level_ampl INFO log_level_knitro 2 @@ -25,7 +25,7 @@ epsilon_nominal_voltage 1.000000 min_plausible_low_voltage_limit 0.500000 max_plausible_high_voltage_limit 1.500000 ignore_voltage_bounds 0.000000 -buses_with_reactive_slacks NO_GENERATION +buses_with_reactive_slacks ALL PQmax 9000.000000 defaultPmax 1000.000000 defaultPmin 0.000000 @@ -37,6 +37,7 @@ default_variable_scaling_factor 1.000000 default_constraint_scaling_factor 1.000000 reactive_slack_variable_scaling_factor 0.100000 transformer_ratio_variable_scaling_factor 0.001000 +shunt_variable_scaling_factor 0.100000 nb_substations 3 nb_bus_in_data_file 3 @@ -44,8 +45,8 @@ nb_bus_in_ACDC_CC 3 nb_bus_in_AC_CC 3 nb_bus_in_ACDC_but_out_AC_CC 0 nb_bus_with_voltage_value 0 -nb_bus_with_reactive_slacks 2 -nb_bus_without_reactive_slacks 1 +nb_bus_with_reactive_slacks 3 +nb_bus_without_reactive_slacks 0 nb_branch_in_data_file 2 nb_branch_in_AC_CC 2 nb_branch_with_nonsmall_impedance 2 diff --git a/open-reac/src/test/resources/openreac-output-svc/reactiveopf_results_indic.txt b/open-reac/src/test/resources/openreac-output-svc/reactiveopf_results_indic.txt index 4021d0d6..82d999e8 100644 --- a/open-reac/src/test/resources/openreac-output-svc/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/openreac-output-svc/reactiveopf_results_indic.txt @@ -1,18 +1,18 @@ final_status OK dcopf_status OK -ctime_start 'Mon Apr 01 12:21:04 2024' +ctime_start 'Thu Jun 20 14:40:34 2024' last_solve_result_num 0 nb_iter_last 6 nb_iter_total 6 _ampl_elapsed_time 0.047000 -_total_solve_time 0.046875 +_total_solve_time 0.015625 total_time 0 operatingSystem windows OS 'Windows_NT' COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_10447832462844756764' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_11839740265781623806' log_level_ampl INFO log_level_knitro 2 @@ -25,7 +25,7 @@ epsilon_nominal_voltage 1.000000 min_plausible_low_voltage_limit 0.500000 max_plausible_high_voltage_limit 1.500000 ignore_voltage_bounds 0.000000 -buses_with_reactive_slacks NO_GENERATION +buses_with_reactive_slacks ALL PQmax 9000.000000 defaultPmax 1000.000000 defaultPmin 0.000000 @@ -37,6 +37,7 @@ default_variable_scaling_factor 1.000000 default_constraint_scaling_factor 1.000000 reactive_slack_variable_scaling_factor 0.100000 transformer_ratio_variable_scaling_factor 0.001000 +shunt_variable_scaling_factor 0.100000 nb_substations 2 nb_bus_in_data_file 2 @@ -44,8 +45,8 @@ nb_bus_in_ACDC_CC 2 nb_bus_in_AC_CC 2 nb_bus_in_ACDC_but_out_AC_CC 0 nb_bus_with_voltage_value 0 -nb_bus_with_reactive_slacks 0 -nb_bus_without_reactive_slacks 2 +nb_bus_with_reactive_slacks 2 +nb_bus_without_reactive_slacks 0 nb_branch_in_data_file 1 nb_branch_in_AC_CC 1 nb_branch_with_nonsmall_impedance 1 diff --git a/open-reac/src/test/resources/openreac-output-transfo/reactiveopf_results_indic.txt b/open-reac/src/test/resources/openreac-output-transfo/reactiveopf_results_indic.txt index 5f45745f..8a0fad45 100644 --- a/open-reac/src/test/resources/openreac-output-transfo/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/openreac-output-transfo/reactiveopf_results_indic.txt @@ -1,18 +1,18 @@ final_status OK dcopf_status OK -ctime_start 'Mon Apr 01 12:18:59 2024' +ctime_start 'Thu Jun 20 14:44:47 2024' last_solve_result_num 0 nb_iter_last 5 nb_iter_total 5 -_ampl_elapsed_time 0.063000 -_total_solve_time 0.031250 +_ampl_elapsed_time 0.047000 +_total_solve_time 0.046875 total_time 0 operatingSystem windows OS 'Windows_NT' COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_6686274912630047225' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_7513458987966328583' log_level_ampl INFO log_level_knitro 2 @@ -25,7 +25,7 @@ epsilon_nominal_voltage 1.000000 min_plausible_low_voltage_limit 0.500000 max_plausible_high_voltage_limit 1.500000 ignore_voltage_bounds 0.000000 -buses_with_reactive_slacks NO_GENERATION +buses_with_reactive_slacks ALL PQmax 9000.000000 defaultPmax 1000.000000 defaultPmin 0.000000 @@ -37,6 +37,7 @@ default_variable_scaling_factor 1.000000 default_constraint_scaling_factor 1.000000 reactive_slack_variable_scaling_factor 0.100000 transformer_ratio_variable_scaling_factor 0.001000 +shunt_variable_scaling_factor 0.100000 nb_substations 3 nb_bus_in_data_file 3 @@ -44,8 +45,8 @@ nb_bus_in_ACDC_CC 3 nb_bus_in_AC_CC 3 nb_bus_in_ACDC_but_out_AC_CC 0 nb_bus_with_voltage_value 0 -nb_bus_with_reactive_slacks 2 -nb_bus_without_reactive_slacks 1 +nb_bus_with_reactive_slacks 3 +nb_bus_without_reactive_slacks 0 nb_branch_in_data_file 2 nb_branch_in_AC_CC 2 nb_branch_with_nonsmall_impedance 2 @@ -81,9 +82,9 @@ min_teta_dc -0.05 min_teta_ac -0.08 teta_min -3.05 max_delta_teta_dc 0.045914 -max_delta_teta_ac 0.081650 +max_delta_teta_ac 0.081636 min_delta_teta_dc 0.009298 -min_delta_teta_ac 0.014294 +min_delta_teta_ac 0.014293 nb_reactive_slacks 0 nb_slacks_condensator 0 diff --git a/open-reac/src/test/resources/openreac-output-vsc/reactiveopf_results_indic.txt b/open-reac/src/test/resources/openreac-output-vsc/reactiveopf_results_indic.txt index 0f7fe9a3..e2d6706c 100644 --- a/open-reac/src/test/resources/openreac-output-vsc/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/openreac-output-vsc/reactiveopf_results_indic.txt @@ -1,18 +1,18 @@ final_status OK dcopf_status OK -ctime_start 'Mon Apr 01 12:21:43 2024' +ctime_start 'Thu Jun 20 14:38:57 2024' last_solve_result_num 0 nb_iter_last 6 nb_iter_total 6 -_ampl_elapsed_time 0.063000 -_total_solve_time 0.015625 +_ampl_elapsed_time 0.047000 +_total_solve_time 0.031250 total_time 0 operatingSystem windows OS 'Windows_NT' COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_8140062921975933350' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_4294773797099927510' log_level_ampl INFO log_level_knitro 2 @@ -25,7 +25,7 @@ epsilon_nominal_voltage 1.000000 min_plausible_low_voltage_limit 0.500000 max_plausible_high_voltage_limit 1.500000 ignore_voltage_bounds 0.000000 -buses_with_reactive_slacks NO_GENERATION +buses_with_reactive_slacks ALL PQmax 9000.000000 defaultPmax 1000.000000 defaultPmin 0.000000 @@ -37,6 +37,7 @@ default_variable_scaling_factor 1.000000 default_constraint_scaling_factor 1.000000 reactive_slack_variable_scaling_factor 0.100000 transformer_ratio_variable_scaling_factor 0.001000 +shunt_variable_scaling_factor 0.100000 nb_substations 6 nb_bus_in_data_file 6 @@ -44,8 +45,8 @@ nb_bus_in_ACDC_CC 6 nb_bus_in_AC_CC 6 nb_bus_in_ACDC_but_out_AC_CC 0 nb_bus_with_voltage_value 0 -nb_bus_with_reactive_slacks 0 -nb_bus_without_reactive_slacks 6 +nb_bus_with_reactive_slacks 6 +nb_bus_without_reactive_slacks 0 nb_branch_in_data_file 7 nb_branch_in_AC_CC 7 nb_branch_with_nonsmall_impedance 7 @@ -81,9 +82,9 @@ min_teta_dc -0.20 min_teta_ac -0.93 teta_min -3.20 max_delta_teta_dc 0.066667 -max_delta_teta_ac 0.220225 +max_delta_teta_ac 0.220224 min_delta_teta_dc -0.200000 -min_delta_teta_ac -0.927212 +min_delta_teta_ac -0.927179 nb_reactive_slacks 0 nb_slacks_condensator 0 diff --git a/open-reac/src/test/resources/openreac-output-warm-start/reactiveopf_results_indic.txt b/open-reac/src/test/resources/openreac-output-warm-start/reactiveopf_results_indic.txt index e98ac678..f2caf73d 100644 --- a/open-reac/src/test/resources/openreac-output-warm-start/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/openreac-output-warm-start/reactiveopf_results_indic.txt @@ -1,18 +1,18 @@ final_status OK dcopf_status OK -ctime_start 'Mon Apr 01 12:16:18 2024' +ctime_start 'Thu Jun 20 14:43:42 2024' last_solve_result_num 0 nb_iter_last 5 nb_iter_total 5 -_ampl_elapsed_time 0.031000 -_total_solve_time 0.000000 +_ampl_elapsed_time 0.048000 +_total_solve_time 0.031250 total_time 0 operatingSystem windows OS 'Windows_NT' COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_15875136273009914017' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_8325889982896404457' log_level_ampl INFO log_level_knitro 2 @@ -25,7 +25,7 @@ epsilon_nominal_voltage 1.000000 min_plausible_low_voltage_limit 0.500000 max_plausible_high_voltage_limit 1.500000 ignore_voltage_bounds 0.000000 -buses_with_reactive_slacks NO_GENERATION +buses_with_reactive_slacks ALL PQmax 9000.000000 defaultPmax 1000.000000 defaultPmin 0.000000 @@ -37,6 +37,7 @@ default_variable_scaling_factor 1.000000 default_constraint_scaling_factor 1.000000 reactive_slack_variable_scaling_factor 0.100000 transformer_ratio_variable_scaling_factor 0.001000 +shunt_variable_scaling_factor 0.100000 nb_substations 3 nb_bus_in_data_file 3 @@ -44,8 +45,8 @@ nb_bus_in_ACDC_CC 3 nb_bus_in_AC_CC 3 nb_bus_in_ACDC_but_out_AC_CC 0 nb_bus_with_voltage_value 0 -nb_bus_with_reactive_slacks 2 -nb_bus_without_reactive_slacks 1 +nb_bus_with_reactive_slacks 3 +nb_bus_without_reactive_slacks 0 nb_branch_in_data_file 2 nb_branch_in_AC_CC 2 nb_branch_with_nonsmall_impedance 2 @@ -81,9 +82,9 @@ min_teta_dc -0.05 min_teta_ac -0.08 teta_min -3.05 max_delta_teta_dc 0.045914 -max_delta_teta_ac 0.081650 +max_delta_teta_ac 0.081651 min_delta_teta_dc 0.009298 -min_delta_teta_ac 0.014293 +min_delta_teta_ac 0.014294 nb_reactive_slacks 0 nb_slacks_condensator 0 diff --git a/open-reac/src/test/resources/parametersLists.json b/open-reac/src/test/resources/parametersLists.json index 79ffbc86..69d5e7c3 100644 --- a/open-reac/src/test/resources/parametersLists.json +++ b/open-reac/src/test/resources/parametersLists.json @@ -44,5 +44,6 @@ "defaultVariableScalingFactor" : 1.0, "defaultConstraintScalingFactor" : 1.0, "reactiveSlackVariableScalingFactor" : 0.1, - "twoWindingTransformerRatioVariableScalingFactor" : 0.001 + "twoWindingTransformerRatioVariableScalingFactor" : 0.001, + "shuntVariableScalingFactor" : 0.1 } \ No newline at end of file diff --git a/open-reac/src/test/resources/parametersThresholds.json b/open-reac/src/test/resources/parametersThresholds.json index 1fcece0c..96df9fa8 100644 --- a/open-reac/src/test/resources/parametersThresholds.json +++ b/open-reac/src/test/resources/parametersThresholds.json @@ -24,5 +24,6 @@ "defaultVariableScalingFactor" : 0.756, "defaultConstraintScalingFactor" : 0.888, "reactiveSlackVariableScalingFactor" : 0.01, - "twoWindingTransformerRatioVariableScalingFactor" : 0.005 + "twoWindingTransformerRatioVariableScalingFactor" : 0.005, + "shuntVariableScalingFactor" : 0.1 } \ No newline at end of file