From b7671322ee25cba1c13a276d72d9df868244a88a Mon Sep 17 00:00:00 2001 From: p-arvy Date: Wed, 27 Nov 2024 17:47:01 +0100 Subject: [PATCH 01/63] Divide OpenReacRunnerTest into several TUs Signed-off-by: p-arvy --- .../powsybl/openreac/OpenReacRunnerTest.java | 520 ------------------ .../AbstractOpenReacRunnerTest.java | 134 +++++ .../optimization/OpenReacAmplIOTest.java | 141 +++++ .../OpenReacOptimizationTest.java | 273 +++++++++ .../OpenReacParametrizationTest.java | 91 +++ .../TestLocalCommandExecutor.java | 2 +- 6 files changed, 640 insertions(+), 521 deletions(-) delete mode 100644 open-reac/src/test/java/com/powsybl/openreac/OpenReacRunnerTest.java create mode 100644 open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java create mode 100644 open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacAmplIOTest.java create mode 100644 open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationTest.java create mode 100644 open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacParametrizationTest.java rename open-reac/src/test/java/com/powsybl/openreac/{ => optimization}/TestLocalCommandExecutor.java (97%) diff --git a/open-reac/src/test/java/com/powsybl/openreac/OpenReacRunnerTest.java b/open-reac/src/test/java/com/powsybl/openreac/OpenReacRunnerTest.java deleted file mode 100644 index 4a0179f7..00000000 --- a/open-reac/src/test/java/com/powsybl/openreac/OpenReacRunnerTest.java +++ /dev/null @@ -1,520 +0,0 @@ -/** - * Copyright (c) 2023, RTE (http://www.rte-france.com) - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -package com.powsybl.openreac; - -import com.google.common.jimfs.Configuration; -import com.google.common.jimfs.Jimfs; -import com.powsybl.commons.report.ReportNode; -import com.powsybl.commons.report.TypedValue; -import com.powsybl.commons.test.ComparisonUtils; -import com.powsybl.computation.ComputationManager; -import com.powsybl.computation.local.LocalCommandExecutor; -import com.powsybl.computation.local.LocalComputationConfig; -import com.powsybl.computation.local.LocalComputationManager; -import com.powsybl.ieeecdf.converter.IeeeCdfNetworkFactory; -import com.powsybl.iidm.network.*; -import com.powsybl.loadflow.LoadFlow; -import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.openreac.network.HvdcNetworkFactory; -import com.powsybl.openreac.network.VoltageControlNetworkFactory; -import com.powsybl.openreac.parameters.input.OpenReacParameters; -import com.powsybl.openreac.parameters.input.algo.OpenReacAmplLogLevel; -import com.powsybl.openreac.parameters.input.algo.ReactiveSlackBusesMode; -import com.powsybl.openreac.parameters.input.algo.OpenReacOptimisationObjective; -import com.powsybl.openreac.parameters.input.algo.OpenReacSolverLogLevel; -import com.powsybl.openreac.parameters.output.OpenReacResult; -import com.powsybl.openreac.parameters.output.OpenReacStatus; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.FileSystem; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ForkJoinPool; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import static org.junit.jupiter.api.Assertions.*; - -/** - * @author Geoffroy Jamgotchian {@literal } - * @author Nicolas PIERRE {@literal } - */ -class OpenReacRunnerTest { - protected FileSystem fileSystem; - protected Path tmpDir; - - @BeforeEach - public void setUp() throws IOException { - fileSystem = Jimfs.newFileSystem(Configuration.unix()); - tmpDir = Files.createDirectory(fileSystem.getPath("tmp")); - } - - @AfterEach - void tearDown() throws IOException { - fileSystem.close(); - } - - private void assertEqualsToRef(Path p, String refFileName) throws IOException { - try (InputStream actual = Files.newInputStream(p)) { - ComparisonUtils.assertTxtEquals(Objects.requireNonNull(getClass().getResourceAsStream(refFileName)), actual); - } - } - - private Path getAmplExecPath() throws IOException { - Path execFolder; - try (Stream walk = Files.walk(tmpDir)) { - execFolder = walk.limit(2).collect(Collectors.toList()).get(1); - } - return execFolder; - } - - @Test - void testDefaultParamAlgoExport() throws IOException { - Network network = IeeeCdfNetworkFactory.create57(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - OpenReacParameters parameters = new OpenReacParameters(); - - LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( - List.of("empty_case/reactiveopf_results_indic.txt")); - try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), - localCommandExecutor, ForkJoinPool.commonPool())) { - OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, - new OpenReacConfig(true), computationManager); - Path execFolder = getAmplExecPath(); - assertEqualsToRef(execFolder.resolve("param_algo.txt"), "/openreac-input-algo-parameters/default.txt"); - } - } - - @Test - 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() - .setObjective(OpenReacOptimisationObjective.SPECIFIC_VOLTAGE_PROFILE) - .setObjectiveDistance(69) - .setLogLevelAmpl(OpenReacAmplLogLevel.WARNING) - .setLogLevelSolver(OpenReacSolverLogLevel.ONLY_RESULTS) - .setMinPlausibleLowVoltageLimit(0.7888) - .setMaxPlausibleHighVoltageLimit(1.3455) - .setReactiveSlackBusesMode(ReactiveSlackBusesMode.NO_GENERATION) - .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) - .setTwoWindingTransformerRatioVariableScalingFactor(0.0045) - .setShuntVariableScalingFactor(0.101); - - LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( - List.of("empty_case/reactiveopf_results_indic.txt")); - try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), - localCommandExecutor, ForkJoinPool.commonPool())) { - OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, - new OpenReacConfig(true), computationManager); - Path execFolder = getAmplExecPath(); - assertEqualsToRef(execFolder.resolve("param_algo.txt"), "/openreac-input-algo-parameters/modified_param_algo.txt"); - } - } - - @Test - void testInputFile() throws IOException { - Network network = IeeeCdfNetworkFactory.create57(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - - OpenReacParameters parameters = new OpenReacParameters().setObjective( - OpenReacOptimisationObjective.BETWEEN_HIGH_AND_LOW_VOLTAGE_LIMIT) - .setObjectiveDistance(70) - .setReactiveSlackBusesMode(ReactiveSlackBusesMode.CONFIGURED) - .addVariableTwoWindingsTransformers(network.getTwoWindingsTransformerStream() - .limit(1) - .map(TwoWindingsTransformer::getId) - .collect(Collectors.toList())) - .addConstantQGenerators( - network.getGeneratorStream().limit(1).map(Generator::getId).collect(Collectors.toList())) - .addVariableShuntCompensators( - network.getShuntCompensatorStream().limit(1).map(ShuntCompensator::getId).collect(Collectors.toList())) - .addConfiguredReactiveSlackBuses( - network.getBusView().getBusStream().limit(1).map(Bus::getId).collect(Collectors.toList())); - - LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( - List.of("empty_case/reactiveopf_results_indic.txt")); - try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), - localCommandExecutor, ForkJoinPool.commonPool())) { - OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, - new OpenReacConfig(true), computationManager); - Path execFolder = getAmplExecPath(); - assertEqualsToRef(execFolder.resolve("param_algo.txt"), "/expected_inputs/param_algo.txt"); - assertEqualsToRef(execFolder.resolve("param_generators_reactive.txt"), "/expected_inputs/param_generators_reactive.txt"); - assertEqualsToRef(execFolder.resolve("param_shunts.txt"), "/expected_inputs/param_shunts.txt"); - assertEqualsToRef(execFolder.resolve("param_transformers.txt"), "/expected_inputs/param_transformers.txt"); - assertEqualsToRef(execFolder.resolve("param_buses_with_reactive_slack.txt"), "/expected_inputs/param_buses_with_reactive_slack.txt"); - } - } - - @Test - void testOutputFileParsing() throws IOException { - Network network = IeeeCdfNetworkFactory.create57(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - // To parse correctly data from output files, there must be an ID in the Ampl mapper - // For this we add dummy elements to the network, - // they will get exported, but the ampl mapper will have IDs for them. - // All the values are bad, and they are not used. - // RTC - network.getTwoWindingsTransformerStream() - .forEach(t -> t.newRatioTapChanger() - .setLowTapPosition(0) - .setTapPosition(0) - .beginStep() - .setR(0.01) - .setX(0.0001) - .setB(0) - .setG(0) - .setRho(1.1) - .endStep() - .add()); - // SVC - VoltageLevel vl = network.getVoltageLevelStream().iterator().next(); - vl.getBusBreakerView().newBus().setId("bus-1").add(); - vl.newStaticVarCompensator() - .setId("dummyStaticVarCompensator") - .setBus("bus-1") - .setBmin(1.1) - .setBmax(1.3) - .setRegulationMode(StaticVarCompensator.RegulationMode.OFF) - .add(); - // VSC - vl.newVscConverterStation() - .setId("dummyVscConverterStation") - .setConnectableBus("bus-1") - .setBus("bus-1") - .setLossFactor(1.1f) - .setVoltageSetpoint(405.0) - .setVoltageRegulatorOn(true) - .add(); - - LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( - List.of("mock_outputs/reactiveopf_results_generators.csv", - "mock_outputs/reactiveopf_results_indic.txt", - "mock_outputs/reactiveopf_results_rtc.csv", - "mock_outputs/reactiveopf_results_shunts.csv", - "mock_outputs/reactiveopf_results_static_var_compensators.csv", - "mock_outputs/reactiveopf_results_vsc_converter_stations.csv", - "mock_outputs/reactiveopf_results_voltages.csv")); - try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), - localCommandExecutor, ForkJoinPool.commonPool())) { - OpenReacResult openReacResult = OpenReacRunner.run(network, - network.getVariantManager().getWorkingVariantId(), new OpenReacParameters(), new OpenReacConfig(true), - computationManager); - - assertEquals(OpenReacStatus.OK, openReacResult.getStatus()); - assertEquals(1, openReacResult.getShuntsModifications().size()); - assertEquals(2, openReacResult.getTapPositionModifications().size()); - assertEquals(1, openReacResult.getSvcModifications().size()); - assertEquals(1, openReacResult.getVscModifications().size()); - assertEquals(7, openReacResult.getGeneratorModifications().size()); - assertEquals(3, openReacResult.getVoltageProfile().size()); - assertEquals(87, openReacResult.getIndicators().size()); - assertTrue(openReacResult.getReactiveSlacks().isEmpty()); - } - } - - @Test - void testRunAsync() throws IOException { - Network network = IeeeCdfNetworkFactory.create14(); - String subFolder = "openreac-output-ieee14"; - OpenReacParameters parameters = new OpenReacParameters(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( - List.of(subFolder + "/reactiveopf_results_generators.csv", - subFolder + "/reactiveopf_results_indic.txt", - subFolder + "/reactiveopf_results_rtc.csv", - subFolder + "/reactiveopf_results_shunts.csv", - subFolder + "/reactiveopf_results_static_var_compensators.csv", - subFolder + "/reactiveopf_results_vsc_converter_stations.csv", - subFolder + "/reactiveopf_results_voltages.csv")); - // To really run open reac, use the commented line below. Be sure that open-reac/src/test/resources/com/powsybl/config/test/config.yml contains your ampl path -// try (ComputationManager computationManager = new LocalComputationManager()) { - try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), - localCommandExecutor, ForkJoinPool.commonPool())) { - CompletableFuture openReacResults = OpenReacRunner.runAsync(network, - network.getVariantManager().getWorkingVariantId(), parameters, new OpenReacConfig(true), - computationManager); - OpenReacResult openReacResult = openReacResults.join(); - assertEquals(OpenReacStatus.OK, openReacResult.getStatus()); - } - } - - private void testAllModifAndLoadFlow(Network network, String subFolder, OpenReacParameters parameters, ReportNode reportNode) throws IOException { - runAndApplyAllModifications(network, subFolder, parameters, true, reportNode); - LoadFlowResult loadFlowResult = LoadFlow.run(network); - assertTrue(loadFlowResult.isFullyConverged()); - } - - @Test - void testOnlyGenerator() throws IOException { - Network network = IeeeCdfNetworkFactory.create14(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - testAllModifAndLoadFlow(network, "openreac-output-ieee14", new OpenReacParameters(), ReportNode.NO_OP); - } - - @Test - void testHvdc() throws IOException { - Network network = HvdcNetworkFactory.createNetworkWithGenerators2(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - network.getVscConverterStation("cs3").getTerminal().setP(0.0); - network.getVscConverterStation("cs4").getTerminal().setP(0.0); - OpenReacParameters parameters = new OpenReacParameters(); - parameters.addConstantQGenerators(List.of("g1", "g2", "g5", "g6")); - testAllModifAndLoadFlow(network, "openreac-output-vsc", parameters, ReportNode.NO_OP); - } - - @Test - void testSvc() throws IOException { - Network network = VoltageControlNetworkFactory.createWithStaticVarCompensator(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - network.getVoltageLevelStream().forEach(vl -> vl.setLowVoltageLimit(380).setHighVoltageLimit(420)); - network.getStaticVarCompensator("svc1").setVoltageSetpoint(390).setRegulationMode(StaticVarCompensator.RegulationMode.VOLTAGE); - OpenReacParameters parameters = new OpenReacParameters(); - parameters.addConstantQGenerators(List.of("g1")); - testAllModifAndLoadFlow(network, "openreac-output-svc", parameters, ReportNode.NO_OP); - } - - @Test - void testShunt() throws IOException { - Network network = create(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - ShuntCompensator shunt = network.getShuntCompensator("SHUNT"); - assertFalse(shunt.getTerminal().isConnected()); - assertEquals(393, shunt.getTargetV()); - - OpenReacParameters parameters = new OpenReacParameters(); - parameters.addVariableShuntCompensators(List.of(shunt.getId())); - ReportNode reportNode = ReportNode.newRootReportNode().withMessageTemplate("openReac", "openReac").build(); - testAllModifAndLoadFlow(network, "openreac-output-shunt", parameters, reportNode); - - assertEquals(3, reportNode.getChildren().size()); - ReportNode reportShunts = reportNode.getChildren().get(2); - assertEquals(2, reportShunts.getChildren().size()); - assertEquals("shuntCompensatorDeltaOverThresholdCount", reportShunts.getChildren().get(0).getMessageKey()); - Map values = reportShunts.getChildren().get(0).getValues(); - assertEquals("1", values.get("shuntsCount").toString()); - assertEquals(TypedValue.INFO_SEVERITY.getValue(), values.get("reportSeverity").toString()); - - assertEquals("shuntCompensatorDeltaDiscretizedOptimizedOverThreshold", reportShunts.getChildren().get(1).getMessageKey()); - values = reportShunts.getChildren().get(1).getValues(); - assertEquals("SHUNT", values.get("shuntCompensatorId").toString()); - assertEquals("25", values.get("maxSectionCount").toString()); - assertEquals("160.0", values.get("discretizedValue").toString()); - assertEquals("123.4", values.get("optimalValue").toString()); - assertEquals(TypedValue.TRACE_SEVERITY.getValue(), values.get("reportSeverity").toString()); - - assertTrue(shunt.getTerminal().isConnected()); // shunt has been reconnected - assertEquals(420.8, shunt.getTargetV()); // targetV has been updated - } - - @Test - void testShuntWithDeltaBetweenDiscretizedAndOptimalReactiveValueUnderThreshold() throws IOException { - Network network = create(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - ShuntCompensator shunt = network.getShuntCompensator("SHUNT"); - assertFalse(shunt.getTerminal().isConnected()); - assertEquals(393, shunt.getTargetV()); - - OpenReacParameters parameters = new OpenReacParameters(); - parameters.setShuntCompensatorActivationAlertThreshold(100.); - parameters.addVariableShuntCompensators(List.of(shunt.getId())); - ReportNode reportNode = ReportNode.newRootReportNode().withMessageTemplate("openReac", "openReac").build(); - testAllModifAndLoadFlow(network, "openreac-output-shunt", parameters, reportNode); - - assertEquals(2, reportNode.getChildren().size()); - - assertTrue(shunt.getTerminal().isConnected()); // shunt has been reconnected - assertEquals(420.8, shunt.getTargetV()); // targetV has been updated - } - - @Test - void testTransformer() throws IOException { - Network network = VoltageControlNetworkFactory.createNetworkWithT2wt(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - RatioTapChanger rtc = network.getTwoWindingsTransformer("T2wT").getRatioTapChanger() - .setTapPosition(2) - .setTargetDeadband(0) - .setRegulating(true); - assertEquals(2, rtc.getTapPosition()); - assertEquals(33.0, rtc.getTargetV()); - - OpenReacParameters parameters = new OpenReacParameters(); - parameters.addConstantQGenerators(List.of("GEN_1")); - parameters.addVariableTwoWindingsTransformers(List.of("T2wT")); - testAllModifAndLoadFlow(network, "openreac-output-transfo", parameters, ReportNode.NO_OP); - assertEquals(0, rtc.getTapPosition()); - assertEquals(22.935, rtc.getTargetV()); - } - - @Test - void testRealNetwork() throws IOException { - Network network = IeeeCdfNetworkFactory.create57(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - OpenReacParameters parameters = new OpenReacParameters(); - testAllModifAndLoadFlow(network, "openreac-output-real-network", parameters, ReportNode.NO_OP); - } - - @Test - void testWarmStart() throws IOException { - Network network = VoltageControlNetworkFactory.createNetworkWithT2wt(); - setDefaultVoltageLimits(network); - String subFolder = "openreac-output-warm-start"; - OpenReacParameters parameters = new OpenReacParameters(); - - runAndApplyAllModifications(network, subFolder, parameters, false, ReportNode.NO_OP); // without warm start, no update - assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_1").getV()); - assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_1").getAngle()); - assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_2").getV()); - assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_2").getAngle()); - assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_3").getV()); - assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_3").getAngle()); - - runAndApplyAllModifications(network, subFolder, parameters, true, ReportNode.NO_OP); - assertEquals(119.592, network.getBusBreakerView().getBus("BUS_1").getV()); - assertEquals(0.802, network.getBusBreakerView().getBus("BUS_1").getAngle(), 0.001); - assertEquals(118.8, network.getBusBreakerView().getBus("BUS_2").getV()); - assertEquals(0, network.getBusBreakerView().getBus("BUS_2").getAngle()); - assertEquals(22.935, network.getBusBreakerView().getBus("BUS_3").getV()); - assertEquals(-4.698, network.getBusBreakerView().getBus("BUS_3").getAngle(), 0.001); - } - - private void runAndApplyAllModifications(Network network, String subFolder, OpenReacParameters parameters, - boolean updateNetworkWithVoltages, ReportNode reportNode) throws IOException { - LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( - List.of(subFolder + "/reactiveopf_results_generators.csv", - subFolder + "/reactiveopf_results_indic.txt", - subFolder + "/reactiveopf_results_rtc.csv", - subFolder + "/reactiveopf_results_shunts.csv", - subFolder + "/reactiveopf_results_static_var_compensators.csv", - subFolder + "/reactiveopf_results_vsc_converter_stations.csv", - subFolder + "/reactiveopf_results_voltages.csv")); - // To really run open reac, use the commentede line below. Be sure that open-reac/src/test/resources/com/powsybl/config/test/config.yml contains your ampl path -// try (ComputationManager computationManager = new LocalComputationManager()) { - try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), - localCommandExecutor, ForkJoinPool.commonPool())) { - OpenReacResult openReacResult = OpenReacRunner.run(network, - network.getVariantManager().getWorkingVariantId(), parameters, - new OpenReacConfig(true), computationManager, reportNode, null); - assertEquals(OpenReacStatus.OK, openReacResult.getStatus()); - openReacResult.setUpdateNetworkWithVoltages(updateNetworkWithVoltages); - openReacResult.applyAllModifications(network); - } - } - - public static Network create() { - Network network = Network.create("svc", "test"); - Substation s1 = network.newSubstation() - .setId("S1") - .add(); - Substation s2 = network.newSubstation() - .setId("S2") - .add(); - VoltageLevel vl1 = s1.newVoltageLevel() - .setId("vl1") - .setNominalV(400) - .setHighVoltageLimit(420) - .setLowVoltageLimit(380) - .setTopologyKind(TopologyKind.BUS_BREAKER) - .add(); - vl1.getBusBreakerView().newBus() - .setId("b1") - .add(); - vl1.newGenerator() - .setId("g1") - .setConnectableBus("b1") - .setBus("b1") - .setTargetP(101.3664) - .setTargetV(390) - .setMinP(0) - .setMaxP(150) - .setVoltageRegulatorOn(true) - .add(); - VoltageLevel vl2 = s2.newVoltageLevel() - .setId("vl2") - .setNominalV(400) - .setTopologyKind(TopologyKind.BUS_BREAKER) - .add(); - vl2.getBusBreakerView().newBus() - .setId("b2") - .add(); - vl2.newLoad() - .setId("ld1") - .setConnectableBus("b2") - .setBus("b2") - .setP0(101) - .setQ0(150) - .add(); - VoltageLevel vl3 = s2.newVoltageLevel() - .setId("vl3") - .setNominalV(400) - .setTopologyKind(TopologyKind.BUS_BREAKER) - .add(); - vl3.getBusBreakerView().newBus() - .setId("b3") - .add(); - vl3.newShuntCompensator() - .setId("SHUNT") - // .setBus("b3") - .setConnectableBus("b3") - .setSectionCount(0) - .setVoltageRegulatorOn(true) - .setTargetV(393) - .setTargetDeadband(5.0) - .newLinearModel() - .setMaximumSectionCount(25) - .setBPerSection(1e-3) - .add() - .add(); - network.newLine() - .setId("l1") - .setBus1("b1") - .setBus2("b2") - .setR(1) - .setX(3) - .add(); - network.newLine() - .setId("l2") - .setBus1("b3") - .setBus2("b2") - .setR(1) - .setX(3) - .add(); - return network; - } - - void setDefaultVoltageLimits(Network network) { - for (VoltageLevel vl : network.getVoltageLevels()) { - if (vl.getLowVoltageLimit() <= 0 || Double.isNaN(vl.getLowVoltageLimit())) { - vl.setLowVoltageLimit(0.5 * vl.getNominalV()); - } - if (Double.isNaN(vl.getHighVoltageLimit())) { - vl.setHighVoltageLimit(1.5 * vl.getNominalV()); - } - } - } -} diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java new file mode 100644 index 00000000..52dab131 --- /dev/null +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) 2023, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package com.powsybl.openreac.optimization; + +import com.google.common.jimfs.Configuration; +import com.google.common.jimfs.Jimfs; +import com.powsybl.commons.report.ReportNode; +import com.powsybl.commons.test.ComparisonUtils; +import com.powsybl.computation.ComputationManager; +import com.powsybl.computation.local.LocalCommandExecutor; +import com.powsybl.computation.local.LocalComputationConfig; +import com.powsybl.computation.local.LocalComputationManager; +import com.powsybl.iidm.network.*; +import com.powsybl.loadflow.LoadFlow; +import com.powsybl.loadflow.LoadFlowResult; +import com.powsybl.openreac.OpenReacConfig; +import com.powsybl.openreac.OpenReacRunner; +import com.powsybl.openreac.parameters.input.OpenReacParameters; +import com.powsybl.openreac.parameters.output.OpenReacResult; +import com.powsybl.openreac.parameters.output.OpenReacStatus; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.FileSystem; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.Objects; +import java.util.concurrent.ForkJoinPool; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.*; + +/** + * @author Geoffroy Jamgotchian {@literal } + * @author Nicolas PIERRE {@literal } + */ +abstract class AbstractOpenReacRunnerTest { + protected FileSystem fileSystem; + protected Path tmpDir; + + @BeforeEach + public void setUp() throws IOException { + fileSystem = Jimfs.newFileSystem(Configuration.unix()); + tmpDir = Files.createDirectory(fileSystem.getPath("tmp")); + } + + @AfterEach + void tearDown() throws IOException { + fileSystem.close(); + } + + protected void assertEqualsToRef(Path p, String refFileName) throws IOException { + try (InputStream actual = Files.newInputStream(p)) { + ComparisonUtils.assertTxtEquals(Objects.requireNonNull(getClass().getResourceAsStream(refFileName)), actual); + } + } + + protected Path getAmplExecPath() throws IOException { + Path execFolder; + try (Stream walk = Files.walk(tmpDir)) { + execFolder = walk.limit(2).collect(Collectors.toList()).get(1); + } + return execFolder; + } + + /** + * Runs OpenReac, apply the results and run a load flow. + */ + protected void testAllModifAndLoadFlow(Network network, String subFolder, OpenReacParameters parameters, ReportNode reportNode) throws IOException { + runAndApplyAllModifications(network, subFolder, parameters, true, reportNode); + LoadFlowResult loadFlowResult = LoadFlow.run(network); + assertTrue(loadFlowResult.isFullyConverged()); + } + + /** + * Runs OpenReac and apply the results on the network. + * The application of the voltage plan calculated by optimization is optional. + */ + protected void runAndApplyAllModifications(Network network, String subFolder, OpenReacParameters parameters, + boolean updateNetworkWithVoltages, ReportNode reportNode) throws IOException { + OpenReacResult openReacResult = runOpenReac(network, subFolder, parameters, reportNode); + assertEquals(OpenReacStatus.OK, openReacResult.getStatus()); + openReacResult.setUpdateNetworkWithVoltages(updateNetworkWithVoltages); + openReacResult.applyAllModifications(network); + } + + /** + * Runs OpenReac and returns associated result. + * Note that OpenReac is not really executed by default. If the execution line is not uncommented, + * the results are retrieved and stored in an {@link OpenReacResult} object. + */ + protected OpenReacResult runOpenReac(Network network, String subFolder, OpenReacParameters parameters, ReportNode reportNode) throws IOException { + // set default voltage limits to every voltage levels of the network + setDefaultVoltageLimits(network); + LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( + List.of(subFolder + "/reactiveopf_results_generators.csv", + subFolder + "/reactiveopf_results_indic.txt", + subFolder + "/reactiveopf_results_rtc.csv", + subFolder + "/reactiveopf_results_shunts.csv", + subFolder + "/reactiveopf_results_static_var_compensators.csv", + subFolder + "/reactiveopf_results_vsc_converter_stations.csv", + subFolder + "/reactiveopf_results_voltages.csv")); + // To really run open reac, use the commentede line below. Be sure that open-reac/src/test/resources/com/powsybl/config/test/config.yml contains your ampl path +// try (ComputationManager computationManager = new LocalComputationManager()) { + try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), + localCommandExecutor, ForkJoinPool.commonPool())) { + return OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, + new OpenReacConfig(true), computationManager, reportNode, null); + } + } + + /** + * Add voltage limits to voltage levels with undefined limits. + * OpenReac needs voltage limits to run optimization. + */ + void setDefaultVoltageLimits(Network network) { + for (VoltageLevel vl : network.getVoltageLevels()) { + if (vl.getLowVoltageLimit() <= 0 || Double.isNaN(vl.getLowVoltageLimit())) { + vl.setLowVoltageLimit(0.5 * vl.getNominalV()); + } + if (Double.isNaN(vl.getHighVoltageLimit())) { + vl.setHighVoltageLimit(1.5 * vl.getNominalV()); + } + } + } +} diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacAmplIOTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacAmplIOTest.java new file mode 100644 index 00000000..d8b31d34 --- /dev/null +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacAmplIOTest.java @@ -0,0 +1,141 @@ +/** + * Copyright (c) 2023, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package com.powsybl.openreac.optimization; + +import com.powsybl.computation.ComputationManager; +import com.powsybl.computation.local.LocalCommandExecutor; +import com.powsybl.computation.local.LocalComputationConfig; +import com.powsybl.computation.local.LocalComputationManager; +import com.powsybl.ieeecdf.converter.IeeeCdfNetworkFactory; +import com.powsybl.iidm.network.*; +import com.powsybl.openreac.OpenReacConfig; +import com.powsybl.openreac.OpenReacRunner; +import com.powsybl.openreac.parameters.input.OpenReacParameters; +import com.powsybl.openreac.parameters.input.algo.OpenReacOptimisationObjective; +import com.powsybl.openreac.parameters.input.algo.ReactiveSlackBusesMode; +import com.powsybl.openreac.parameters.output.OpenReacResult; +import com.powsybl.openreac.parameters.output.OpenReacStatus; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.nio.file.Path; +import java.util.List; +import java.util.concurrent.ForkJoinPool; +import java.util.stream.Collectors; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * @author Geoffroy Jamgotchian {@literal } + * @author Nicolas PIERRE {@literal } + */ +public class OpenReacAmplIOTest extends AbstractOpenReacRunnerTest { + + @Test + void testInputFile() throws IOException { + Network network = IeeeCdfNetworkFactory.create57(); + setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network + + OpenReacParameters parameters = new OpenReacParameters().setObjective( + OpenReacOptimisationObjective.BETWEEN_HIGH_AND_LOW_VOLTAGE_LIMIT) + .setObjectiveDistance(70) + .setReactiveSlackBusesMode(ReactiveSlackBusesMode.CONFIGURED) + .addVariableTwoWindingsTransformers(network.getTwoWindingsTransformerStream() + .limit(1) + .map(TwoWindingsTransformer::getId) + .collect(Collectors.toList())) + .addConstantQGenerators( + network.getGeneratorStream().limit(1).map(Generator::getId).collect(Collectors.toList())) + .addVariableShuntCompensators( + network.getShuntCompensatorStream().limit(1).map(ShuntCompensator::getId).collect(Collectors.toList())) + .addConfiguredReactiveSlackBuses( + network.getBusView().getBusStream().limit(1).map(Bus::getId).collect(Collectors.toList())); + + LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( + List.of("empty_case/reactiveopf_results_indic.txt")); + try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), + localCommandExecutor, ForkJoinPool.commonPool())) { + OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, + new OpenReacConfig(true), computationManager); + Path execFolder = getAmplExecPath(); + assertEqualsToRef(execFolder.resolve("param_algo.txt"), "/expected_inputs/param_algo.txt"); + assertEqualsToRef(execFolder.resolve("param_generators_reactive.txt"), "/expected_inputs/param_generators_reactive.txt"); + assertEqualsToRef(execFolder.resolve("param_shunts.txt"), "/expected_inputs/param_shunts.txt"); + assertEqualsToRef(execFolder.resolve("param_transformers.txt"), "/expected_inputs/param_transformers.txt"); + assertEqualsToRef(execFolder.resolve("param_buses_with_reactive_slack.txt"), "/expected_inputs/param_buses_with_reactive_slack.txt"); + } + } + + @Test + void testOutputFileParsing() throws IOException { + Network network = IeeeCdfNetworkFactory.create57(); + setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network + // To parse correctly data from output files, there must be an ID in the Ampl mapper + // For this we add dummy elements to the network, + // they will get exported, but the ampl mapper will have IDs for them. + // All the values are bad, and they are not used. + // RTC + network.getTwoWindingsTransformerStream() + .forEach(t -> t.newRatioTapChanger() + .setLowTapPosition(0) + .setTapPosition(0) + .beginStep() + .setR(0.01) + .setX(0.0001) + .setB(0) + .setG(0) + .setRho(1.1) + .endStep() + .add()); + // SVC + VoltageLevel vl = network.getVoltageLevelStream().iterator().next(); + vl.getBusBreakerView().newBus().setId("bus-1").add(); + vl.newStaticVarCompensator() + .setId("dummyStaticVarCompensator") + .setBus("bus-1") + .setBmin(1.1) + .setBmax(1.3) + .setRegulationMode(StaticVarCompensator.RegulationMode.OFF) + .add(); + // VSC + vl.newVscConverterStation() + .setId("dummyVscConverterStation") + .setConnectableBus("bus-1") + .setBus("bus-1") + .setLossFactor(1.1f) + .setVoltageSetpoint(405.0) + .setVoltageRegulatorOn(true) + .add(); + + LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( + List.of("mock_outputs/reactiveopf_results_generators.csv", + "mock_outputs/reactiveopf_results_indic.txt", + "mock_outputs/reactiveopf_results_rtc.csv", + "mock_outputs/reactiveopf_results_shunts.csv", + "mock_outputs/reactiveopf_results_static_var_compensators.csv", + "mock_outputs/reactiveopf_results_vsc_converter_stations.csv", + "mock_outputs/reactiveopf_results_voltages.csv")); + try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), + localCommandExecutor, ForkJoinPool.commonPool())) { + OpenReacResult openReacResult = OpenReacRunner.run(network, + network.getVariantManager().getWorkingVariantId(), new OpenReacParameters(), new OpenReacConfig(true), + computationManager); + + assertEquals(OpenReacStatus.OK, openReacResult.getStatus()); + assertEquals(1, openReacResult.getShuntsModifications().size()); + assertEquals(2, openReacResult.getTapPositionModifications().size()); + assertEquals(1, openReacResult.getSvcModifications().size()); + assertEquals(1, openReacResult.getVscModifications().size()); + assertEquals(7, openReacResult.getGeneratorModifications().size()); + assertEquals(3, openReacResult.getVoltageProfile().size()); + assertEquals(87, openReacResult.getIndicators().size()); + assertTrue(openReacResult.getReactiveSlacks().isEmpty()); + } + } + +} diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationTest.java new file mode 100644 index 00000000..b7a2ff18 --- /dev/null +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationTest.java @@ -0,0 +1,273 @@ +/** + * Copyright (c) 2023, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package com.powsybl.openreac.optimization; + +import com.powsybl.commons.report.ReportNode; +import com.powsybl.commons.report.TypedValue; +import com.powsybl.computation.ComputationManager; +import com.powsybl.computation.local.LocalCommandExecutor; +import com.powsybl.computation.local.LocalComputationConfig; +import com.powsybl.computation.local.LocalComputationManager; +import com.powsybl.ieeecdf.converter.IeeeCdfNetworkFactory; +import com.powsybl.iidm.network.*; +import com.powsybl.openreac.OpenReacConfig; +import com.powsybl.openreac.OpenReacRunner; +import com.powsybl.openreac.network.HvdcNetworkFactory; +import com.powsybl.openreac.network.VoltageControlNetworkFactory; +import com.powsybl.openreac.parameters.input.OpenReacParameters; +import com.powsybl.openreac.parameters.output.OpenReacResult; +import com.powsybl.openreac.parameters.output.OpenReacStatus; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ForkJoinPool; + +import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * @author Geoffroy Jamgotchian {@literal } + * @author Nicolas PIERRE {@literal } + */ +public class OpenReacOptimizationTest extends AbstractOpenReacRunnerTest { + + @Test + void testRunAsync() throws IOException { + Network network = IeeeCdfNetworkFactory.create14(); + String subFolder = "openreac-output-ieee14"; + OpenReacParameters parameters = new OpenReacParameters(); + setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network + LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( + List.of(subFolder + "/reactiveopf_results_generators.csv", + subFolder + "/reactiveopf_results_indic.txt", + subFolder + "/reactiveopf_results_rtc.csv", + subFolder + "/reactiveopf_results_shunts.csv", + subFolder + "/reactiveopf_results_static_var_compensators.csv", + subFolder + "/reactiveopf_results_vsc_converter_stations.csv", + subFolder + "/reactiveopf_results_voltages.csv")); + // To really run open reac, use the commented line below. Be sure that open-reac/src/test/resources/com/powsybl/config/test/config.yml contains your ampl path +// try (ComputationManager computationManager = new LocalComputationManager()) { + try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), + localCommandExecutor, ForkJoinPool.commonPool())) { + CompletableFuture openReacResults = OpenReacRunner.runAsync(network, + network.getVariantManager().getWorkingVariantId(), parameters, new OpenReacConfig(true), + computationManager); + OpenReacResult openReacResult = openReacResults.join(); + assertEquals(OpenReacStatus.OK, openReacResult.getStatus()); + } + } + + @Test + void testOnlyGenerator() throws IOException { + Network network = IeeeCdfNetworkFactory.create14(); + testAllModifAndLoadFlow(network, "openreac-output-ieee14", new OpenReacParameters(), ReportNode.NO_OP); + } + + @Test + void testHvdc() throws IOException { + Network network = HvdcNetworkFactory.createNetworkWithGenerators2(); + network.getVscConverterStation("cs3").getTerminal().setP(0.0); + network.getVscConverterStation("cs4").getTerminal().setP(0.0); + OpenReacParameters parameters = new OpenReacParameters(); + parameters.addConstantQGenerators(List.of("g1", "g2", "g5", "g6")); + testAllModifAndLoadFlow(network, "openreac-output-vsc", parameters, ReportNode.NO_OP); + } + + @Test + void testSvc() throws IOException { + Network network = VoltageControlNetworkFactory.createWithStaticVarCompensator(); + network.getVoltageLevelStream().forEach(vl -> vl.setLowVoltageLimit(380).setHighVoltageLimit(420)); + network.getStaticVarCompensator("svc1").setVoltageSetpoint(390).setRegulationMode(StaticVarCompensator.RegulationMode.VOLTAGE); + OpenReacParameters parameters = new OpenReacParameters(); + parameters.addConstantQGenerators(List.of("g1")); + testAllModifAndLoadFlow(network, "openreac-output-svc", parameters, ReportNode.NO_OP); + } + + @Test + void testShunt() throws IOException { + Network network = create(); + ShuntCompensator shunt = network.getShuntCompensator("SHUNT"); + assertFalse(shunt.getTerminal().isConnected()); + assertEquals(393, shunt.getTargetV()); + + OpenReacParameters parameters = new OpenReacParameters(); + parameters.addVariableShuntCompensators(List.of(shunt.getId())); + ReportNode reportNode = ReportNode.newRootReportNode().withMessageTemplate("openReac", "openReac").build(); + testAllModifAndLoadFlow(network, "openreac-output-shunt", parameters, reportNode); + + assertEquals(3, reportNode.getChildren().size()); + ReportNode reportShunts = reportNode.getChildren().get(2); + assertEquals(2, reportShunts.getChildren().size()); + assertEquals("shuntCompensatorDeltaOverThresholdCount", reportShunts.getChildren().get(0).getMessageKey()); + Map values = reportShunts.getChildren().get(0).getValues(); + assertEquals("1", values.get("shuntsCount").toString()); + assertEquals(TypedValue.INFO_SEVERITY.getValue(), values.get("reportSeverity").toString()); + + assertEquals("shuntCompensatorDeltaDiscretizedOptimizedOverThreshold", reportShunts.getChildren().get(1).getMessageKey()); + values = reportShunts.getChildren().get(1).getValues(); + assertEquals("SHUNT", values.get("shuntCompensatorId").toString()); + assertEquals("25", values.get("maxSectionCount").toString()); + assertEquals("160.0", values.get("discretizedValue").toString()); + assertEquals("123.4", values.get("optimalValue").toString()); + assertEquals(TypedValue.TRACE_SEVERITY.getValue(), values.get("reportSeverity").toString()); + + assertTrue(shunt.getTerminal().isConnected()); // shunt has been reconnected + assertEquals(420.8, shunt.getTargetV()); // targetV has been updated + } + + @Test + void testShuntWithDeltaBetweenDiscretizedAndOptimalReactiveValueUnderThreshold() throws IOException { + Network network = create(); + ShuntCompensator shunt = network.getShuntCompensator("SHUNT"); + assertFalse(shunt.getTerminal().isConnected()); + assertEquals(393, shunt.getTargetV()); + + OpenReacParameters parameters = new OpenReacParameters(); + parameters.setShuntCompensatorActivationAlertThreshold(100.); + parameters.addVariableShuntCompensators(List.of(shunt.getId())); + ReportNode reportNode = ReportNode.newRootReportNode().withMessageTemplate("openReac", "openReac").build(); + testAllModifAndLoadFlow(network, "openreac-output-shunt", parameters, reportNode); + + assertEquals(2, reportNode.getChildren().size()); + + assertTrue(shunt.getTerminal().isConnected()); // shunt has been reconnected + assertEquals(420.8, shunt.getTargetV()); // targetV has been updated + } + + @Test + void testTransformer() throws IOException { + Network network = VoltageControlNetworkFactory.createNetworkWithT2wt(); + RatioTapChanger rtc = network.getTwoWindingsTransformer("T2wT").getRatioTapChanger() + .setTapPosition(2) + .setTargetDeadband(0) + .setRegulating(true); + assertEquals(2, rtc.getTapPosition()); + assertEquals(33.0, rtc.getTargetV()); + + OpenReacParameters parameters = new OpenReacParameters(); + parameters.addConstantQGenerators(List.of("GEN_1")); + parameters.addVariableTwoWindingsTransformers(List.of("T2wT")); + testAllModifAndLoadFlow(network, "openreac-output-transfo", parameters, ReportNode.NO_OP); + assertEquals(0, rtc.getTapPosition()); + assertEquals(22.935, rtc.getTargetV()); + } + + @Test + void testRealNetwork() throws IOException { + Network network = IeeeCdfNetworkFactory.create57(); + OpenReacParameters parameters = new OpenReacParameters(); + testAllModifAndLoadFlow(network, "openreac-output-real-network", parameters, ReportNode.NO_OP); + } + + @Test + void testWarmStart() throws IOException { + Network network = VoltageControlNetworkFactory.createNetworkWithT2wt(); + String subFolder = "openreac-output-warm-start"; + OpenReacParameters parameters = new OpenReacParameters(); + + runAndApplyAllModifications(network, subFolder, parameters, false, ReportNode.NO_OP); // without warm start, no update + assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_1").getV()); + assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_1").getAngle()); + assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_2").getV()); + assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_2").getAngle()); + assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_3").getV()); + assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_3").getAngle()); + + runAndApplyAllModifications(network, subFolder, parameters, true, ReportNode.NO_OP); + assertEquals(119.592, network.getBusBreakerView().getBus("BUS_1").getV()); + assertEquals(0.802, network.getBusBreakerView().getBus("BUS_1").getAngle(), 0.001); + assertEquals(118.8, network.getBusBreakerView().getBus("BUS_2").getV()); + assertEquals(0, network.getBusBreakerView().getBus("BUS_2").getAngle()); + assertEquals(22.935, network.getBusBreakerView().getBus("BUS_3").getV()); + assertEquals(-4.698, network.getBusBreakerView().getBus("BUS_3").getAngle(), 0.001); + } + + public static Network create() { + Network network = Network.create("svc", "test"); + Substation s1 = network.newSubstation() + .setId("S1") + .add(); + Substation s2 = network.newSubstation() + .setId("S2") + .add(); + VoltageLevel vl1 = s1.newVoltageLevel() + .setId("vl1") + .setNominalV(400) + .setHighVoltageLimit(420) + .setLowVoltageLimit(380) + .setTopologyKind(TopologyKind.BUS_BREAKER) + .add(); + vl1.getBusBreakerView().newBus() + .setId("b1") + .add(); + vl1.newGenerator() + .setId("g1") + .setConnectableBus("b1") + .setBus("b1") + .setTargetP(101.3664) + .setTargetV(390) + .setMinP(0) + .setMaxP(150) + .setVoltageRegulatorOn(true) + .add(); + VoltageLevel vl2 = s2.newVoltageLevel() + .setId("vl2") + .setNominalV(400) + .setTopologyKind(TopologyKind.BUS_BREAKER) + .add(); + vl2.getBusBreakerView().newBus() + .setId("b2") + .add(); + vl2.newLoad() + .setId("ld1") + .setConnectableBus("b2") + .setBus("b2") + .setP0(101) + .setQ0(150) + .add(); + VoltageLevel vl3 = s2.newVoltageLevel() + .setId("vl3") + .setNominalV(400) + .setTopologyKind(TopologyKind.BUS_BREAKER) + .add(); + vl3.getBusBreakerView().newBus() + .setId("b3") + .add(); + vl3.newShuntCompensator() + .setId("SHUNT") + // .setBus("b3") + .setConnectableBus("b3") + .setSectionCount(0) + .setVoltageRegulatorOn(true) + .setTargetV(393) + .setTargetDeadband(5.0) + .newLinearModel() + .setMaximumSectionCount(25) + .setBPerSection(1e-3) + .add() + .add(); + network.newLine() + .setId("l1") + .setBus1("b1") + .setBus2("b2") + .setR(1) + .setX(3) + .add(); + network.newLine() + .setId("l2") + .setBus1("b3") + .setBus2("b2") + .setR(1) + .setX(3) + .add(); + return network; + } + +} diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacParametrizationTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacParametrizationTest.java new file mode 100644 index 00000000..c850c96a --- /dev/null +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacParametrizationTest.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) 2023, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package com.powsybl.openreac.optimization; + +import com.powsybl.computation.ComputationManager; +import com.powsybl.computation.local.LocalCommandExecutor; +import com.powsybl.computation.local.LocalComputationConfig; +import com.powsybl.computation.local.LocalComputationManager; +import com.powsybl.ieeecdf.converter.IeeeCdfNetworkFactory; +import com.powsybl.iidm.network.Network; +import com.powsybl.openreac.OpenReacConfig; +import com.powsybl.openreac.OpenReacRunner; +import com.powsybl.openreac.parameters.input.OpenReacParameters; +import com.powsybl.openreac.parameters.input.algo.OpenReacAmplLogLevel; +import com.powsybl.openreac.parameters.input.algo.OpenReacOptimisationObjective; +import com.powsybl.openreac.parameters.input.algo.OpenReacSolverLogLevel; +import com.powsybl.openreac.parameters.input.algo.ReactiveSlackBusesMode; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.nio.file.Path; +import java.util.List; +import java.util.concurrent.ForkJoinPool; + +/** + * @author Geoffroy Jamgotchian {@literal } + * @author Nicolas PIERRE {@literal } + */ +public class OpenReacParametrizationTest extends AbstractOpenReacRunnerTest { + + @Test + void testDefaultParamAlgoExport() throws IOException { + Network network = IeeeCdfNetworkFactory.create57(); + setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network + OpenReacParameters parameters = new OpenReacParameters(); + + LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( + List.of("empty_case/reactiveopf_results_indic.txt")); + try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), + localCommandExecutor, ForkJoinPool.commonPool())) { + OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, + new OpenReacConfig(true), computationManager); + Path execFolder = getAmplExecPath(); + assertEqualsToRef(execFolder.resolve("param_algo.txt"), "/openreac-input-algo-parameters/default.txt"); + } + } + + @Test + 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() + .setObjective(OpenReacOptimisationObjective.SPECIFIC_VOLTAGE_PROFILE) + .setObjectiveDistance(69) + .setLogLevelAmpl(OpenReacAmplLogLevel.WARNING) + .setLogLevelSolver(OpenReacSolverLogLevel.ONLY_RESULTS) + .setMinPlausibleLowVoltageLimit(0.7888) + .setMaxPlausibleHighVoltageLimit(1.3455) + .setReactiveSlackBusesMode(ReactiveSlackBusesMode.NO_GENERATION) + .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) + .setTwoWindingTransformerRatioVariableScalingFactor(0.0045) + .setShuntVariableScalingFactor(0.101); + + LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( + List.of("empty_case/reactiveopf_results_indic.txt")); + try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), + localCommandExecutor, ForkJoinPool.commonPool())) { + OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, + new OpenReacConfig(true), computationManager); + Path execFolder = getAmplExecPath(); + assertEqualsToRef(execFolder.resolve("param_algo.txt"), "/openreac-input-algo-parameters/modified_param_algo.txt"); + } + } + +} diff --git a/open-reac/src/test/java/com/powsybl/openreac/TestLocalCommandExecutor.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/TestLocalCommandExecutor.java similarity index 97% rename from open-reac/src/test/java/com/powsybl/openreac/TestLocalCommandExecutor.java rename to open-reac/src/test/java/com/powsybl/openreac/optimization/TestLocalCommandExecutor.java index cffaba1f..fa55a0ae 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/TestLocalCommandExecutor.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/TestLocalCommandExecutor.java @@ -4,7 +4,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package com.powsybl.openreac; +package com.powsybl.openreac.optimization; import com.powsybl.computation.local.LocalCommandExecutor; From 8da89b08f17688747f0be11bb4ddae8dd886ee93 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Wed, 27 Nov 2024 18:48:26 +0100 Subject: [PATCH 02/63] Add TUs for ACOPF indicators Signed-off-by: p-arvy --- .../AbstractOpenReacRunnerTest.java | 14 +- ... OpenReacOptimizationAndLoadFlowTest.java} | 7 +- .../OpenReacOptimizationIndicatorsTest.java | 192 ++++++++++++++++++ 3 files changed, 208 insertions(+), 5 deletions(-) rename open-reac/src/test/java/com/powsybl/openreac/optimization/{OpenReacOptimizationTest.java => OpenReacOptimizationAndLoadFlowTest.java} (97%) create mode 100644 open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java index 52dab131..0ef48f70 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java @@ -12,7 +12,6 @@ import com.powsybl.commons.test.ComparisonUtils; import com.powsybl.computation.ComputationManager; import com.powsybl.computation.local.LocalCommandExecutor; -import com.powsybl.computation.local.LocalComputationConfig; import com.powsybl.computation.local.LocalComputationManager; import com.powsybl.iidm.network.*; import com.powsybl.loadflow.LoadFlow; @@ -92,6 +91,13 @@ protected void runAndApplyAllModifications(Network network, String subFolder, Op openReacResult.applyAllModifications(network); } + /** + * Runs OpenReac and returns associated result. + */ + protected OpenReacResult runOpenReac(Network network, String subFolder) throws IOException { + return runOpenReac(network, subFolder, new OpenReacParameters(), ReportNode.NO_OP); + } + /** * Runs OpenReac and returns associated result. * Note that OpenReac is not really executed by default. If the execution line is not uncommented, @@ -109,9 +115,9 @@ protected OpenReacResult runOpenReac(Network network, String subFolder, OpenReac subFolder + "/reactiveopf_results_vsc_converter_stations.csv", subFolder + "/reactiveopf_results_voltages.csv")); // To really run open reac, use the commentede line below. Be sure that open-reac/src/test/resources/com/powsybl/config/test/config.yml contains your ampl path -// try (ComputationManager computationManager = new LocalComputationManager()) { - try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), - localCommandExecutor, ForkJoinPool.commonPool())) { + try (ComputationManager computationManager = new LocalComputationManager()) { +// try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), +// localCommandExecutor, ForkJoinPool.commonPool())) { return OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, new OpenReacConfig(true), computationManager, reportNode, null); } diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java similarity index 97% rename from open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationTest.java rename to open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java index b7a2ff18..fa431d9e 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java @@ -14,6 +14,8 @@ import com.powsybl.computation.local.LocalComputationManager; import com.powsybl.ieeecdf.converter.IeeeCdfNetworkFactory; import com.powsybl.iidm.network.*; +import com.powsybl.loadflow.LoadFlow; +import com.powsybl.loadflow.LoadFlowResult; import com.powsybl.openreac.OpenReacConfig; import com.powsybl.openreac.OpenReacRunner; import com.powsybl.openreac.network.HvdcNetworkFactory; @@ -36,7 +38,7 @@ * @author Geoffroy Jamgotchian {@literal } * @author Nicolas PIERRE {@literal } */ -public class OpenReacOptimizationTest extends AbstractOpenReacRunnerTest { +public class OpenReacOptimizationAndLoadFlowTest extends AbstractOpenReacRunnerTest { @Test void testRunAsync() throws IOException { @@ -187,6 +189,9 @@ void testWarmStart() throws IOException { assertEquals(0, network.getBusBreakerView().getBus("BUS_2").getAngle()); assertEquals(22.935, network.getBusBreakerView().getBus("BUS_3").getV()); assertEquals(-4.698, network.getBusBreakerView().getBus("BUS_3").getAngle(), 0.001); + + LoadFlowResult loadFlowResult = LoadFlow.run(network); + assertTrue(loadFlowResult.isFullyConverged()); } public static Network create() { diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java new file mode 100644 index 00000000..8fabdb72 --- /dev/null +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java @@ -0,0 +1,192 @@ +/** + * Copyright (c) 2024, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 + */ +package com.powsybl.openreac.optimization; + +import com.powsybl.commons.report.ReportNode; +import com.powsybl.ieeecdf.converter.IeeeCdfNetworkFactory; +import com.powsybl.iidm.network.Network; +import com.powsybl.openreac.network.HvdcNetworkFactory; +import com.powsybl.openreac.network.VoltageControlNetworkFactory; +import com.powsybl.openreac.parameters.input.OpenReacParameters; +import com.powsybl.openreac.parameters.input.algo.OpenReacAmplLogLevel; +import com.powsybl.openreac.parameters.input.algo.OpenReacOptimisationObjective; +import com.powsybl.openreac.parameters.input.algo.OpenReacSolverLogLevel; +import com.powsybl.openreac.parameters.input.algo.ReactiveSlackBusesMode; +import com.powsybl.openreac.parameters.output.OpenReacResult; +import com.powsybl.openreac.parameters.output.OpenReacStatus; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * @author Pierre ARVY {@literal } + */ +public class OpenReacOptimizationIndicatorsTest extends AbstractOpenReacRunnerTest { + + // TODO : find some parameters that are working. Take things that seem good + @Test + void testInputIndicators() throws IOException { + Network network = IeeeCdfNetworkFactory.create57(); + OpenReacParameters parameters = new OpenReacParameters() + .setObjective(OpenReacOptimisationObjective.SPECIFIC_VOLTAGE_PROFILE) + .setObjectiveDistance(69) + .setLogLevelAmpl(OpenReacAmplLogLevel.WARNING) + .setLogLevelSolver(OpenReacSolverLogLevel.ONLY_RESULTS) + .setMinPlausibleLowVoltageLimit(0.7888) + .setMaxPlausibleHighVoltageLimit(1.3455) + .setReactiveSlackBusesMode(ReactiveSlackBusesMode.NO_GENERATION) + .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) + .setTwoWindingTransformerRatioVariableScalingFactor(0.0045) + .setShuntVariableScalingFactor(0.101); + OpenReacResult result = runOpenReac(network, "", parameters, ReportNode.NO_OP); + + // verify buses outside main SC have been excluded + assertEquals("INFO", result.getIndicators().get("log_level_ampl")); + assertEquals("2", result.getIndicators().get("log_level_knitro")); + assertEquals("2", result.getIndicators().get("objective_choice")); + assertEquals("0.69", result.getIndicators().get("ratio_voltage_target")); + assertEquals("2", result.getIndicators().get("coeff_alpha")); + assertEquals("2", result.getIndicators().get("Pnull")); + assertEquals("2", result.getIndicators().get("Znull")); + assertEquals("2", result.getIndicators().get("epsilon_nominal_voltage")); + assertEquals("2", result.getIndicators().get("min_plausible_low_voltage_limit")); + assertEquals("2", result.getIndicators().get("max_plausible_high_voltage_limit")); + assertEquals("2", result.getIndicators().get("ignore_voltage_bounds")); + assertEquals("16", result.getIndicators().get("buses_with_reactive_slacks")); + assertEquals("12", result.getIndicators().get("PQmax")); + assertEquals("4", result.getIndicators().get("defaultPmax")); + assertEquals("1", result.getIndicators().get("defaultPmin")); + assertEquals("1", result.getIndicators().get("defaultQmaxPmaxRatio")); + assertEquals("1", result.getIndicators().get("defaultQmin")); + assertEquals("1", result.getIndicators().get("defaultQmax")); + assertEquals("1", result.getIndicators().get("minimalQPrange")); + assertEquals("1", result.getIndicators().get("default_variable_scaling_factor")); + assertEquals("1", result.getIndicators().get("default_constraint_scaling_factor")); + assertEquals("1", result.getIndicators().get("reactive_slack_variable_scaling_factor")); + assertEquals("1", result.getIndicators().get("transformer_ratio_variable_scaling_factor")); + assertEquals("1", result.getIndicators().get("shunt_variable_scaling_factor")); + } + + @Test + void testBusIndicators() throws IOException { + Network network = HvdcNetworkFactory.createLccWithBiggerComponents(); + network.getBusBreakerView().getBus("b1").setV(400); + OpenReacResult result = runOpenReac(network, ""); + + // verify buses outside main SC have been excluded + assertEquals(OpenReacStatus.OK, result.getStatus()); + assertEquals("16", result.getIndicators().get("nb_substations")); + assertEquals("16", result.getIndicators().get("nb_bus_in_data_file")); + assertEquals("16", result.getIndicators().get("nb_bus_in_ACDC_CC")); + assertEquals("12", result.getIndicators().get("nb_bus_in_AC_CC")); + assertEquals("4", result.getIndicators().get("nb_bus_in_ACDC_but_out_AC_CC")); + assertEquals("1", result.getIndicators().get("nb_bus_with_voltage_value")); + } + + @Test + void testBranchesIndicators() throws IOException { + Network network = VoltageControlNetworkFactory.createWithSimpleRemoteControl(); + network.getLine("l12").getTerminal2().disconnect(); + network.getLine("l24").getTerminal1().disconnect(); + OpenReacResult result = runOpenReac(network, "openreac-output-branches-opened"); + + // verify opened branches have been excluded + assertEquals(OpenReacStatus.OK, result.getStatus()); + assertEquals("4", result.getIndicators().get("nb_branch_in_data_file")); + assertEquals("2", result.getIndicators().get("nb_branch_in_AC_CC")); + assertEquals("1", result.getIndicators().get("nb_branch_with_nonsmall_impedance")); + assertEquals("1", result.getIndicators().get("nb_branch_with_zero_or_small_impedance")); + } + + // TODO : unit excluded from opti and fixed + + @Test + void testTransformersIndicators() throws IOException { + Network network = VoltageControlNetworkFactory.createNetworkWith2T2wt(); + OpenReacParameters parameters = new OpenReacParameters(); + parameters.addVariableTwoWindingsTransformers(List.of("T2wT1")); + OpenReacResult result = runOpenReac(network, "", parameters, ReportNode.NO_OP); + + // verify only one rtc has been optimized + assertEquals(OpenReacStatus.OK, result.getStatus()); + assertEquals("1", result.getIndicators().get("nb_transformers_with_variable_ratio")); + assertEquals("1", result.getIndicators().get("nb_transformers_with_fixed_ratio")); + } + + // TODO : VSC and LCC converter stations + + @Test + void testShunts() throws IOException { + Network network = OpenReacOptimizationAndLoadFlowTest.create(); + // add one shunt that will be fixed in optimization + network.getVoltageLevel("vl3").newShuntCompensator() + .setId("SHUNT2") + .setBus("b3") + .setConnectableBus("b3") + .setSectionCount(0) + .setVoltageRegulatorOn(true) + .setTargetV(393) + .setTargetDeadband(5.0) + .newLinearModel() + .setMaximumSectionCount(25) + .setBPerSection(1e-3) + .add() + .add(); + // add one shunt that will not be considered in optimization, as it is neither optimized nor connected + network.getVoltageLevel("vl3").newShuntCompensator() + .setId("SHUNT3") + // .setBus("b3") + .setConnectableBus("b3") + .setSectionCount(0) + .setVoltageRegulatorOn(true) + .setTargetV(393) + .setTargetDeadband(5.0) + .newLinearModel() + .setMaximumSectionCount(25) + .setBPerSection(1e-3) + .add() + .add(); + OpenReacParameters parameters = new OpenReacParameters(); + parameters.addVariableShuntCompensators(List.of("SHUNT")); + OpenReacResult result = runOpenReac(network, ""); + + // verify only one shunt has been optimized + assertEquals(OpenReacStatus.OK, result.getStatus()); + assertEquals("3", result.getIndicators().get("nb_shunt_in_data_file")); + assertEquals("3", result.getIndicators().get("nb_shunt_connectable_or_in_AC_CC")); + assertEquals("1", result.getIndicators().get("nb_shunt_with_fixed_value")); + assertEquals("1", result.getIndicators().get("nb_shunt_with_variable_value")); // FIXME + } + + @Test + void testSvcIndicators() throws IOException { + Network network = VoltageControlNetworkFactory.createWithStaticVarCompensator(); + OpenReacResult result = runOpenReac(network, ""); + + assertEquals(OpenReacStatus.OK, result.getStatus()); + assertEquals("1", result.getIndicators().get("nb_svc_in_data_file")); + assertEquals("1", result.getIndicators().get("nb_svc_in_AC_CC")); + assertEquals("0", result.getIndicators().get("nb_svc_up_and_operating")); + } + +} From 50548d22dfc43c75faf39c6fdaf150eeb853ff2e Mon Sep 17 00:00:00 2001 From: p-arvy Date: Wed, 4 Dec 2024 17:11:56 +0100 Subject: [PATCH 03/63] Add tests on equipment bounds in optimization of OpenReac Signed-off-by: p-arvy --- .../OpecReacOptimizationBoundsTest.java | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java new file mode 100644 index 00000000..c95bc0cf --- /dev/null +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) 2024, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 + */ +package com.powsybl.openreac.optimization; + +import com.powsybl.iidm.network.Network; +import com.powsybl.openreac.network.VoltageControlNetworkFactory; +import com.powsybl.openreac.parameters.output.OpenReacResult; +import com.powsybl.openreac.parameters.output.OpenReacStatus; +import org.junit.jupiter.api.Test; + +import java.io.IOException; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * Test the equipment bounds in OpenReac optimization. + * + * @author Pierre ARVY {@literal } + */ +class OpecReacOptimizationBoundsTest extends AbstractOpenReacRunnerTest { + + @Test + void testGeneratorsMaxPBounds() throws IOException { + Network network = VoltageControlNetworkFactory.createWithTwoVoltageControls(); + // due to the disconnection, the network is now imbalanced + // and max p of generators is not enough to provide balance + network.getLine("l45").getTerminal2().disconnect(); + OpenReacResult result = runOpenReac(network, "openreac-output-branches-opened"); + assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); + + // increase max p of generators to allow power balance + network.getGenerator("g2").setMaxP(2.5); + network.getGenerator("g3").setMaxP(2.5); + result = runOpenReac(network, "openreac-output-branches-opened"); + assertEquals(OpenReacStatus.OK, result.getStatus()); + } + + @Test + void testGeneratorsMinPBounds() throws IOException { + Network network = VoltageControlNetworkFactory.createWithTwoVoltageControls(); + // due to the modifications, the network is now imbalanced + // and min p of generators is not small enough to provide balance + network.getLine("l45").getTerminal2().disconnect(); + network.getLoad("l4").setP0(3); + network.getGenerator("g2").setMinP(2); + network.getGenerator("g3").setMinP(2); + OpenReacResult result = runOpenReac(network, "openreac-output-branches-opened"); + assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); + + // decrease min p of generators to allow power balance + // but targetP will be fixed in optimization, because it is too close of maxP + network.getGenerator("g2").setMinP(1); + network.getGenerator("g3").setMinP(1); + result = runOpenReac(network, "openreac-output-branches-opened"); + assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); + + // increase max p of generators to allow modification of targetP in optimization + network.getGenerator("g2").setMaxP(2.5); + network.getGenerator("g3").setMaxP(2.5); + result = runOpenReac(network, "openreac-output-branches-opened"); + assertEquals(OpenReacStatus.OK, result.getStatus()); + } + +} From 802dd1d8ed80f8f7a60b7d7323bf9c25d5e04522 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Wed, 4 Dec 2024 17:12:16 +0100 Subject: [PATCH 04/63] Improve tests on ouput indicators of OpenReac Signed-off-by: p-arvy --- .../OpenReacOptimizationIndicatorsTest.java | 228 ++++++++++++------ 1 file changed, 159 insertions(+), 69 deletions(-) diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java index 8fabdb72..6a059afd 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java @@ -10,6 +10,7 @@ import com.powsybl.commons.report.ReportNode; import com.powsybl.ieeecdf.converter.IeeeCdfNetworkFactory; import com.powsybl.iidm.network.Network; +import com.powsybl.iidm.network.StaticVarCompensator; import com.powsybl.openreac.network.HvdcNetworkFactory; import com.powsybl.openreac.network.VoltageControlNetworkFactory; import com.powsybl.openreac.parameters.input.OpenReacParameters; @@ -27,64 +28,67 @@ import static org.junit.jupiter.api.Assertions.assertEquals; /** + * Test the indicators returned by OpenReac optimization. + * Note that some indicators might depend on optimization process, + * and can not be tested in unit tests. + * * @author Pierre ARVY {@literal } */ -public class OpenReacOptimizationIndicatorsTest extends AbstractOpenReacRunnerTest { +class OpenReacOptimizationIndicatorsTest extends AbstractOpenReacRunnerTest { - // TODO : find some parameters that are working. Take things that seem good @Test - void testInputIndicators() throws IOException { + void testParametrizationIndicators() throws IOException { Network network = IeeeCdfNetworkFactory.create57(); OpenReacParameters parameters = new OpenReacParameters() .setObjective(OpenReacOptimisationObjective.SPECIFIC_VOLTAGE_PROFILE) - .setObjectiveDistance(69) + .setObjectiveDistance(70) .setLogLevelAmpl(OpenReacAmplLogLevel.WARNING) .setLogLevelSolver(OpenReacSolverLogLevel.ONLY_RESULTS) - .setMinPlausibleLowVoltageLimit(0.7888) - .setMaxPlausibleHighVoltageLimit(1.3455) + .setMinPlausibleLowVoltageLimit(0.655) + .setMaxPlausibleHighVoltageLimit(1.425) .setReactiveSlackBusesMode(ReactiveSlackBusesMode.NO_GENERATION) - .setActivePowerVariationRate(0.88) - .setMinPlausibleActivePowerThreshold(0.45) + .setActivePowerVariationRate(0.999) + .setMinPlausibleActivePowerThreshold(0.02) .setLowImpedanceThreshold(1e-5) - .setMinNominalVoltageIgnoredBus(2.) - .setMinNominalVoltageIgnoredVoltageBounds(0.75) - .setPQMax(3987.76) - .setLowActivePowerDefaultLimit(12.32) - .setHighActivePowerDefaultLimit(1452.66) - .setDefaultQmaxPmaxRatio(0.24) + .setMinNominalVoltageIgnoredBus(0.75) + .setMinNominalVoltageIgnoredVoltageBounds(0.85) + .setPQMax(4001) + .setLowActivePowerDefaultLimit(0.1) + .setHighActivePowerDefaultLimit(1001) + .setDefaultQmaxPmaxRatio(0.2) .setDefaultMinimalQPRange(2.) - .setDefaultVariableScalingFactor(1.1222) - .setDefaultConstraintScalingFactor(0.7889) - .setReactiveSlackVariableScalingFactor(0.2) - .setTwoWindingTransformerRatioVariableScalingFactor(0.0045) - .setShuntVariableScalingFactor(0.101); + .setDefaultVariableScalingFactor(1.001) + .setDefaultConstraintScalingFactor(0.999) + .setReactiveSlackVariableScalingFactor(1e-2) + .setTwoWindingTransformerRatioVariableScalingFactor(2e-3) + .setShuntVariableScalingFactor(0.11); OpenReacResult result = runOpenReac(network, "", parameters, ReportNode.NO_OP); // verify buses outside main SC have been excluded - assertEquals("INFO", result.getIndicators().get("log_level_ampl")); - assertEquals("2", result.getIndicators().get("log_level_knitro")); - assertEquals("2", result.getIndicators().get("objective_choice")); - assertEquals("0.69", result.getIndicators().get("ratio_voltage_target")); - assertEquals("2", result.getIndicators().get("coeff_alpha")); - assertEquals("2", result.getIndicators().get("Pnull")); - assertEquals("2", result.getIndicators().get("Znull")); - assertEquals("2", result.getIndicators().get("epsilon_nominal_voltage")); - assertEquals("2", result.getIndicators().get("min_plausible_low_voltage_limit")); - assertEquals("2", result.getIndicators().get("max_plausible_high_voltage_limit")); - assertEquals("2", result.getIndicators().get("ignore_voltage_bounds")); - assertEquals("16", result.getIndicators().get("buses_with_reactive_slacks")); - assertEquals("12", result.getIndicators().get("PQmax")); - assertEquals("4", result.getIndicators().get("defaultPmax")); - assertEquals("1", result.getIndicators().get("defaultPmin")); - assertEquals("1", result.getIndicators().get("defaultQmaxPmaxRatio")); - assertEquals("1", result.getIndicators().get("defaultQmin")); - assertEquals("1", result.getIndicators().get("defaultQmax")); - assertEquals("1", result.getIndicators().get("minimalQPrange")); - assertEquals("1", result.getIndicators().get("default_variable_scaling_factor")); - assertEquals("1", result.getIndicators().get("default_constraint_scaling_factor")); - assertEquals("1", result.getIndicators().get("reactive_slack_variable_scaling_factor")); - assertEquals("1", result.getIndicators().get("transformer_ratio_variable_scaling_factor")); - assertEquals("1", result.getIndicators().get("shunt_variable_scaling_factor")); + assertEquals("WARNING", result.getIndicators().get("log_level_ampl")); + assertEquals(1, Integer.parseInt(result.getIndicators().get("log_level_knitro"))); + assertEquals(2, Integer.parseInt(result.getIndicators().get("objective_choice"))); + assertEquals(0.7, Double.parseDouble(result.getIndicators().get("ratio_voltage_target"))); + assertEquals(0.999, Double.parseDouble(result.getIndicators().get("coeff_alpha"))); + assertEquals(0.02, Double.parseDouble(result.getIndicators().get("Pnull"))); + assertEquals(1e-5, Double.parseDouble(result.getIndicators().get("Znull"))); + assertEquals(0.75, Double.parseDouble(result.getIndicators().get("epsilon_nominal_voltage"))); + assertEquals(0.655, Double.parseDouble(result.getIndicators().get("min_plausible_low_voltage_limit"))); + assertEquals(1.425, Double.parseDouble(result.getIndicators().get("max_plausible_high_voltage_limit"))); + assertEquals(0.85, Double.parseDouble(result.getIndicators().get("ignore_voltage_bounds"))); + assertEquals("NO_GENERATION", result.getIndicators().get("buses_with_reactive_slacks")); + assertEquals(4001, Double.parseDouble(result.getIndicators().get("PQmax"))); + assertEquals(1001, Double.parseDouble(result.getIndicators().get("defaultPmax"))); + assertEquals(0.1, Double.parseDouble(result.getIndicators().get("defaultPmin"))); + assertEquals(0.2, Double.parseDouble(result.getIndicators().get("defaultQmaxPmaxRatio"))); + assertEquals(-200.2, Double.parseDouble(result.getIndicators().get("defaultQmin"))); + assertEquals(200.2, Double.parseDouble(result.getIndicators().get("defaultQmax"))); + assertEquals(2.0, Double.parseDouble(result.getIndicators().get("minimalQPrange"))); + assertEquals(1.001, Double.parseDouble(result.getIndicators().get("default_variable_scaling_factor"))); + assertEquals(0.999, Double.parseDouble(result.getIndicators().get("default_constraint_scaling_factor"))); + assertEquals(0.01, Double.parseDouble(result.getIndicators().get("reactive_slack_variable_scaling_factor"))); + assertEquals(0.002, Double.parseDouble(result.getIndicators().get("transformer_ratio_variable_scaling_factor"))); + assertEquals(0.11, Double.parseDouble(result.getIndicators().get("shunt_variable_scaling_factor"))); } @Test @@ -93,14 +97,14 @@ void testBusIndicators() throws IOException { network.getBusBreakerView().getBus("b1").setV(400); OpenReacResult result = runOpenReac(network, ""); - // verify buses outside main SC have been excluded assertEquals(OpenReacStatus.OK, result.getStatus()); - assertEquals("16", result.getIndicators().get("nb_substations")); - assertEquals("16", result.getIndicators().get("nb_bus_in_data_file")); - assertEquals("16", result.getIndicators().get("nb_bus_in_ACDC_CC")); - assertEquals("12", result.getIndicators().get("nb_bus_in_AC_CC")); - assertEquals("4", result.getIndicators().get("nb_bus_in_ACDC_but_out_AC_CC")); - assertEquals("1", result.getIndicators().get("nb_bus_with_voltage_value")); + assertEquals(16, Integer.parseInt(result.getIndicators().get("nb_substations"))); + assertEquals(16, Integer.parseInt(result.getIndicators().get("nb_bus_in_data_file"))); + assertEquals(16, Integer.parseInt(result.getIndicators().get("nb_bus_in_ACDC_CC"))); + // verify buses outside main SC have been excluded + assertEquals(12, Integer.parseInt(result.getIndicators().get("nb_bus_in_AC_CC"))); + assertEquals(4, Integer.parseInt(result.getIndicators().get("nb_bus_in_ACDC_but_out_AC_CC"))); + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_bus_with_voltage_value"))); } @Test @@ -108,17 +112,36 @@ void testBranchesIndicators() throws IOException { Network network = VoltageControlNetworkFactory.createWithSimpleRemoteControl(); network.getLine("l12").getTerminal2().disconnect(); network.getLine("l24").getTerminal1().disconnect(); + // due to disconnected lines, increase max P of generators in main CC + network.getGenerator("g3").setMaxP(3); + network.getGenerator("g4").setMaxP(3); OpenReacResult result = runOpenReac(network, "openreac-output-branches-opened"); - // verify opened branches have been excluded assertEquals(OpenReacStatus.OK, result.getStatus()); - assertEquals("4", result.getIndicators().get("nb_branch_in_data_file")); - assertEquals("2", result.getIndicators().get("nb_branch_in_AC_CC")); - assertEquals("1", result.getIndicators().get("nb_branch_with_nonsmall_impedance")); - assertEquals("1", result.getIndicators().get("nb_branch_with_zero_or_small_impedance")); + assertEquals(4, Integer.parseInt(result.getIndicators().get("nb_branch_in_data_file"))); + // verify opened branches have been excluded + assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_branch_in_AC_CC"))); + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_with_nonsmall_impedance"))); + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_with_zero_or_small_impedance"))); } - // TODO : unit excluded from opti and fixed + @Test + void testGeneratorIndicators() throws IOException { + Network network = VoltageControlNetworkFactory.createWithGeneratorRemoteControl(); + network.getGenerator("g1").setTargetQ(50); + OpenReacParameters parameters = new OpenReacParameters(); + parameters.addConstantQGenerators(List.of("g1", "g3")); + OpenReacResult result = runOpenReac(network, "", parameters, ReportNode.NO_OP); + + assertEquals(OpenReacStatus.OK, result.getStatus()); + assertEquals(3, Integer.parseInt(result.getIndicators().get("nb_unit_in_data_file"))); + assertEquals(3, Integer.parseInt(result.getIndicators().get("nb_unit_in_AC_CC"))); + assertEquals(3, Integer.parseInt(result.getIndicators().get("nb_unit_up_and_running"))); + // verify that only the generators indicated as constant and with defined target Q are fixed in optimization + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_unit_with_fixed_reactive_power"))); + // verify other generators are optimized + assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_unit_with_variable_reactive_power"))); + } @Test void testTransformersIndicators() throws IOException { @@ -129,14 +152,38 @@ void testTransformersIndicators() throws IOException { // verify only one rtc has been optimized assertEquals(OpenReacStatus.OK, result.getStatus()); - assertEquals("1", result.getIndicators().get("nb_transformers_with_variable_ratio")); - assertEquals("1", result.getIndicators().get("nb_transformers_with_fixed_ratio")); + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_transformers_with_variable_ratio"))); + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_transformers_with_fixed_ratio"))); } - // TODO : VSC and LCC converter stations + @Test + void testVscIndicators() throws IOException { + Network network = HvdcNetworkFactory.createVsc(); + // FIXME : should not depend on P/Q values on terminal + network.getVscConverterStation("cs2").getTerminal().setP(2).setQ(1); + OpenReacResult result = runOpenReac(network, ""); + + assertEquals(OpenReacStatus.OK, result.getStatus()); + assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_vsc_converter_in_data_file"))); + // verify only vsc in main cc is optimized + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_vsc_converter_up_and_running"))); + } @Test - void testShunts() throws IOException { + void testLccIndicators() throws IOException { + Network network = HvdcNetworkFactory.createLcc(); + // FIXME : should not depend on P/Q values on terminal + network.getLccConverterStation("cs2").getTerminal().setP(2).setQ(1); + OpenReacResult result = runOpenReac(network, ""); + + assertEquals(OpenReacStatus.OK, result.getStatus()); + assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_lcc_converter_in_data_file"))); + // verify only lcc in main cc is considered in optimization + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_lcc_converter_up_and_running"))); + } + + @Test + void testShuntsIndicators() throws IOException { Network network = OpenReacOptimizationAndLoadFlowTest.create(); // add one shunt that will be fixed in optimization network.getVoltageLevel("vl3").newShuntCompensator() @@ -168,25 +215,68 @@ void testShunts() throws IOException { .add(); OpenReacParameters parameters = new OpenReacParameters(); parameters.addVariableShuntCompensators(List.of("SHUNT")); - OpenReacResult result = runOpenReac(network, ""); + OpenReacResult result = runOpenReac(network, "", parameters); - // verify only one shunt has been optimized assertEquals(OpenReacStatus.OK, result.getStatus()); - assertEquals("3", result.getIndicators().get("nb_shunt_in_data_file")); - assertEquals("3", result.getIndicators().get("nb_shunt_connectable_or_in_AC_CC")); - assertEquals("1", result.getIndicators().get("nb_shunt_with_fixed_value")); - assertEquals("1", result.getIndicators().get("nb_shunt_with_variable_value")); // FIXME + assertEquals(3, Integer.parseInt(result.getIndicators().get("nb_shunt_in_data_file"))); + assertEquals(3, Integer.parseInt(result.getIndicators().get("nb_shunt_connectable_or_in_AC_CC"))); + // verify disconnected shunt, and not optimized, is not considered in shunts with fixed values + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_shunt_with_fixed_value"))); + // verify only one shunt has been optimized (even if it was disconnected) + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_shunt_with_variable_value"))); } @Test void testSvcIndicators() throws IOException { Network network = VoltageControlNetworkFactory.createWithStaticVarCompensator(); + network.getVoltageLevel("vl2").newStaticVarCompensator() + .setId("svc2") + .setConnectableBus("b2") + .setBus("b2") + .setRegulationMode(StaticVarCompensator.RegulationMode.VOLTAGE) + .setVoltageSetpoint(400) + .setBmin(-0.008) + .setBmax(0.008) + .add(); + OpenReacResult result = runOpenReac(network, ""); + + assertEquals(OpenReacStatus.OK, result.getStatus()); + assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_svc_in_data_file"))); + assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_svc_in_AC_CC"))); + // verify only one svc is regulating + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_svc_up_and_operating"))); + } + + @Test + void testBatteryIndicators() throws IOException { + Network network = VoltageControlNetworkFactory.createWithGeneratorRemoteControl(); + network.getVoltageLevel("vl4") + .newBattery() + .setId("bat1") + .setMinP(-10) + .setMaxP(10) + .setTargetP(2) + .setBus("b4") + .setConnectableBus("b4") + .setTargetQ(0) + .add(); + network.getVoltageLevel("vl1") + .newBattery() + .setId("bat2") + .setMinP(-9) + .setMaxP(11) + .setTargetP(1) + .setBus("b1") + .setConnectableBus("b1") + .setTargetQ(0.2) + .add(); OpenReacResult result = runOpenReac(network, ""); assertEquals(OpenReacStatus.OK, result.getStatus()); - assertEquals("1", result.getIndicators().get("nb_svc_in_data_file")); - assertEquals("1", result.getIndicators().get("nb_svc_in_AC_CC")); - assertEquals("0", result.getIndicators().get("nb_svc_up_and_operating")); + assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_batteries"))); + // verify the sum of max and min active power of the batteries + assertEquals(21, Double.parseDouble(result.getIndicators().get("sum_batteries_pmax"))); + assertEquals(-19, Double.parseDouble(result.getIndicators().get("sum_batteries_pmin"))); } } From 81908d8a03d2b69fe237c7c5688c0cf495207742 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Wed, 4 Dec 2024 17:12:27 +0100 Subject: [PATCH 05/63] Clean Signed-off-by: p-arvy --- .../optimization/AbstractOpenReacRunnerTest.java | 10 ++++++++-- .../openreac/optimization/OpenReacAmplIOTest.java | 2 +- .../OpenReacOptimizationAndLoadFlowTest.java | 2 +- .../optimization/OpenReacParametrizationTest.java | 2 +- .../test/resources/com/powsybl/config/test/config.yml | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java index 0ef48f70..7f6f920b 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java @@ -31,7 +31,6 @@ import java.nio.file.Path; import java.util.List; import java.util.Objects; -import java.util.concurrent.ForkJoinPool; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -95,7 +94,14 @@ protected void runAndApplyAllModifications(Network network, String subFolder, Op * Runs OpenReac and returns associated result. */ protected OpenReacResult runOpenReac(Network network, String subFolder) throws IOException { - return runOpenReac(network, subFolder, new OpenReacParameters(), ReportNode.NO_OP); + return runOpenReac(network, subFolder, new OpenReacParameters()); + } + + /** + * Runs OpenReac and returns associated result. + */ + protected OpenReacResult runOpenReac(Network network, String subFolder, OpenReacParameters parameters) throws IOException { + return runOpenReac(network, subFolder, parameters, ReportNode.NO_OP); } /** diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacAmplIOTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacAmplIOTest.java index d8b31d34..20f6e00b 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacAmplIOTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacAmplIOTest.java @@ -34,7 +34,7 @@ * @author Geoffroy Jamgotchian {@literal } * @author Nicolas PIERRE {@literal } */ -public class OpenReacAmplIOTest extends AbstractOpenReacRunnerTest { +class OpenReacAmplIOTest extends AbstractOpenReacRunnerTest { @Test void testInputFile() throws IOException { diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java index fa431d9e..54260bd6 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java @@ -38,7 +38,7 @@ * @author Geoffroy Jamgotchian {@literal } * @author Nicolas PIERRE {@literal } */ -public class OpenReacOptimizationAndLoadFlowTest extends AbstractOpenReacRunnerTest { +class OpenReacOptimizationAndLoadFlowTest extends AbstractOpenReacRunnerTest { @Test void testRunAsync() throws IOException { diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacParametrizationTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacParametrizationTest.java index c850c96a..02809d2f 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacParametrizationTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacParametrizationTest.java @@ -30,7 +30,7 @@ * @author Geoffroy Jamgotchian {@literal } * @author Nicolas PIERRE {@literal } */ -public class OpenReacParametrizationTest extends AbstractOpenReacRunnerTest { +class OpenReacParametrizationTest extends AbstractOpenReacRunnerTest { @Test void testDefaultParamAlgoExport() throws IOException { diff --git a/open-reac/src/test/resources/com/powsybl/config/test/config.yml b/open-reac/src/test/resources/com/powsybl/config/test/config.yml index 1acd4f0d..9d797384 100644 --- a/open-reac/src/test/resources/com/powsybl/config/test/config.yml +++ b/open-reac/src/test/resources/com/powsybl/config/test/config.yml @@ -1,2 +1,2 @@ ampl: - homeDir: ??? + homeDir: D:\AMPL-13.1.20220703-Win-64 From f6746be7f8b8294702aa9ab46df0b55531e86fc3 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Wed, 4 Dec 2024 18:44:58 +0100 Subject: [PATCH 06/63] Add resources Signed-off-by: p-arvy --- .../AbstractOpenReacRunnerTest.java | 58 ++++++++---- .../OpecReacOptimizationBoundsTest.java | 10 +- .../OpenReacOptimizationAndLoadFlowTest.java | 18 ++-- .../OpenReacOptimizationIndicatorsTest.java | 21 ++--- .../com/powsybl/config/test/config.yml | 2 +- .../reactiveopf_results_indic.txt | 94 +++++++++++++++++++ .../reactiveopf_results_indic.txt | 93 ++++++++++++++++++ .../reactiveopf_results_indic.txt | 94 +++++++++++++++++++ .../reactiveopf_results_indic.txt | 93 ++++++++++++++++++ .../reactiveopf_results_indic.txt | 94 +++++++++++++++++++ .../reactiveopf_results_indic.txt | 93 ++++++++++++++++++ .../reactiveopf_results_indic.txt | 93 ++++++++++++++++++ .../bus-test/reactiveopf_results_indic.txt | 93 ++++++++++++++++++ .../reactiveopf_results_indic.txt | 93 ++++++++++++++++++ .../reactiveopf_results_indic.txt | 93 ++++++++++++++++++ .../lcc-test/reactiveopf_results_indic.txt | 93 ++++++++++++++++++ .../shunt-test/reactiveopf_results_indic.txt | 93 ++++++++++++++++++ .../svc-test/reactiveopf_results_indic.txt | 93 ++++++++++++++++++ .../reactiveopf_results_indic.txt | 93 ++++++++++++++++++ .../vsc-test/reactiveopf_results_indic.txt | 93 ++++++++++++++++++ .../reactiveopf_results_generators.csv | 0 .../reactiveopf_results_indic.txt | 0 .../reactiveopf_results_rtc.csv | 0 .../reactiveopf_results_shunts.csv | 0 ...iveopf_results_static_var_compensators.csv | 0 .../reactiveopf_results_voltages.csv | 0 ...tiveopf_results_vsc_converter_stations.csv | 0 .../reactiveopf_results_generators.csv | 0 .../reactiveopf_results_indic.txt | 0 .../reactiveopf_results_rtc.csv | 0 .../reactiveopf_results_shunts.csv | 0 ...iveopf_results_static_var_compensators.csv | 0 .../reactiveopf_results_voltages.csv | 0 ...tiveopf_results_vsc_converter_stations.csv | 0 .../reactiveopf_results_generators.csv | 0 .../reactiveopf_results_indic.txt | 0 .../reactiveopf_results_rtc.csv | 0 .../reactiveopf_results_shunts.csv | 0 ...iveopf_results_static_var_compensators.csv | 0 .../reactiveopf_results_voltages.csv | 0 ...tiveopf_results_vsc_converter_stations.csv | 0 .../reactiveopf_results_generators.csv | 0 .../reactiveopf_results_indic.txt | 0 .../reactiveopf_results_rtc.csv | 0 .../reactiveopf_results_shunts.csv | 0 ...iveopf_results_static_var_compensators.csv | 0 .../reactiveopf_results_voltages.csv | 0 ...tiveopf_results_vsc_converter_stations.csv | 0 .../reactiveopf_results_generators.csv | 0 .../reactiveopf_results_indic.txt | 0 .../reactiveopf_results_rtc.csv | 0 .../reactiveopf_results_shunts.csv | 0 ...iveopf_results_static_var_compensators.csv | 0 .../reactiveopf_results_voltages.csv | 0 ...tiveopf_results_vsc_converter_stations.csv | 0 .../reactiveopf_results_generators.csv | 0 .../reactiveopf_results_indic.txt | 0 .../reactiveopf_results_rtc.csv | 0 .../reactiveopf_results_shunts.csv | 0 ...iveopf_results_static_var_compensators.csv | 0 .../reactiveopf_results_voltages.csv | 0 ...tiveopf_results_vsc_converter_stations.csv | 0 .../reactiveopf_results_generators.csv | 0 .../reactiveopf_results_indic.txt | 0 .../reactiveopf_results_rtc.csv | 0 .../reactiveopf_results_shunts.csv | 0 ...iveopf_results_static_var_compensators.csv | 0 .../reactiveopf_results_voltages.csv | 0 ...tiveopf_results_vsc_converter_stations.csv | 0 69 files changed, 1463 insertions(+), 44 deletions(-) create mode 100644 open-reac/src/test/resources/optimization/bounds/generators-pmax-too-small/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generators-pmax/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generators-pmin-too-high/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generators-pmin/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generators-target-p-too-close-pmax/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/indicators/battery-test/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/indicators/branches-test/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/indicators/bus-test/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/indicators/generators-test/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/indicators/input-parameters-test/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/indicators/lcc-test/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/indicators/shunt-test/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/indicators/svc-test/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/indicators/transfo-test/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/indicators/vsc-test/reactiveopf_results_indic.txt rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-ieee14/reactiveopf_results_generators.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-ieee14/reactiveopf_results_indic.txt (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-ieee14/reactiveopf_results_rtc.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-ieee14/reactiveopf_results_shunts.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-ieee14/reactiveopf_results_static_var_compensators.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-ieee14/reactiveopf_results_voltages.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-ieee14/reactiveopf_results_vsc_converter_stations.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-real-network/reactiveopf_results_generators.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-real-network/reactiveopf_results_indic.txt (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-real-network/reactiveopf_results_rtc.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-real-network/reactiveopf_results_shunts.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-real-network/reactiveopf_results_static_var_compensators.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-real-network/reactiveopf_results_voltages.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-real-network/reactiveopf_results_vsc_converter_stations.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-shunt/reactiveopf_results_generators.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-shunt/reactiveopf_results_indic.txt (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-shunt/reactiveopf_results_rtc.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-shunt/reactiveopf_results_shunts.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-shunt/reactiveopf_results_static_var_compensators.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-shunt/reactiveopf_results_voltages.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-shunt/reactiveopf_results_vsc_converter_stations.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-svc/reactiveopf_results_generators.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-svc/reactiveopf_results_indic.txt (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-svc/reactiveopf_results_rtc.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-svc/reactiveopf_results_shunts.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-svc/reactiveopf_results_static_var_compensators.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-svc/reactiveopf_results_voltages.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-svc/reactiveopf_results_vsc_converter_stations.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-transfo/reactiveopf_results_generators.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-transfo/reactiveopf_results_indic.txt (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-transfo/reactiveopf_results_rtc.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-transfo/reactiveopf_results_shunts.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-transfo/reactiveopf_results_static_var_compensators.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-transfo/reactiveopf_results_voltages.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-transfo/reactiveopf_results_vsc_converter_stations.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-vsc/reactiveopf_results_generators.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-vsc/reactiveopf_results_indic.txt (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-vsc/reactiveopf_results_rtc.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-vsc/reactiveopf_results_shunts.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-vsc/reactiveopf_results_static_var_compensators.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-vsc/reactiveopf_results_voltages.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-vsc/reactiveopf_results_vsc_converter_stations.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-warm-start/reactiveopf_results_generators.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-warm-start/reactiveopf_results_indic.txt (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-warm-start/reactiveopf_results_rtc.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-warm-start/reactiveopf_results_shunts.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-warm-start/reactiveopf_results_static_var_compensators.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-warm-start/reactiveopf_results_voltages.csv (100%) rename open-reac/src/test/resources/{ => optimization/loadflow}/openreac-output-warm-start/reactiveopf_results_vsc_converter_stations.csv (100%) diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java index 7f6f920b..f2dfd0ad 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java @@ -12,6 +12,7 @@ import com.powsybl.commons.test.ComparisonUtils; import com.powsybl.computation.ComputationManager; import com.powsybl.computation.local.LocalCommandExecutor; +import com.powsybl.computation.local.LocalComputationConfig; import com.powsybl.computation.local.LocalComputationManager; import com.powsybl.iidm.network.*; import com.powsybl.loadflow.LoadFlow; @@ -27,13 +28,15 @@ import java.io.IOException; import java.io.InputStream; import java.nio.file.FileSystem; -import java.nio.file.Files; import java.nio.file.Path; +import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.concurrent.ForkJoinPool; import java.util.stream.Collectors; import java.util.stream.Stream; +import static java.nio.file.Files.*; import static org.junit.jupiter.api.Assertions.*; /** @@ -47,7 +50,7 @@ abstract class AbstractOpenReacRunnerTest { @BeforeEach public void setUp() throws IOException { fileSystem = Jimfs.newFileSystem(Configuration.unix()); - tmpDir = Files.createDirectory(fileSystem.getPath("tmp")); + tmpDir = createDirectory(fileSystem.getPath("tmp")); } @AfterEach @@ -56,14 +59,14 @@ void tearDown() throws IOException { } protected void assertEqualsToRef(Path p, String refFileName) throws IOException { - try (InputStream actual = Files.newInputStream(p)) { + try (InputStream actual = newInputStream(p)) { ComparisonUtils.assertTxtEquals(Objects.requireNonNull(getClass().getResourceAsStream(refFileName)), actual); } } protected Path getAmplExecPath() throws IOException { Path execFolder; - try (Stream walk = Files.walk(tmpDir)) { + try (Stream walk = walk(tmpDir)) { execFolder = walk.limit(2).collect(Collectors.toList()).get(1); } return execFolder; @@ -90,40 +93,59 @@ protected void runAndApplyAllModifications(Network network, String subFolder, Op openReacResult.applyAllModifications(network); } + // TODO : remove useless methods here /** * Runs OpenReac and returns associated result. */ protected OpenReacResult runOpenReac(Network network, String subFolder) throws IOException { - return runOpenReac(network, subFolder, new OpenReacParameters()); + return runOpenReac(network, subFolder, false); } /** * Runs OpenReac and returns associated result. */ - protected OpenReacResult runOpenReac(Network network, String subFolder, OpenReacParameters parameters) throws IOException { + protected OpenReacResult runOpenReac(Network network, String subFolder, boolean onlyIndicators) throws IOException { + return runOpenReac(network, subFolder, new OpenReacParameters(), onlyIndicators); + } + + /** + * Runs OpenReac and returns associated result. + */ + protected OpenReacResult runOpenReac(Network network, String subFolder, OpenReacParameters parameters, boolean onlyIndicators) throws IOException { return runOpenReac(network, subFolder, parameters, ReportNode.NO_OP); } + /** + * Runs OpenReac and returns associated result. + */ + protected OpenReacResult runOpenReac(Network network, String subFolder, OpenReacParameters parameters, ReportNode reportNode) throws IOException { + return runOpenReac(network, subFolder, parameters, false, reportNode); + } + /** * Runs OpenReac and returns associated result. * Note that OpenReac is not really executed by default. If the execution line is not uncommented, * the results are retrieved and stored in an {@link OpenReacResult} object. */ - protected OpenReacResult runOpenReac(Network network, String subFolder, OpenReacParameters parameters, ReportNode reportNode) throws IOException { + protected OpenReacResult runOpenReac(Network network, String subFolder, OpenReacParameters parameters, + boolean onlyIndicators, ReportNode reportNode) throws IOException { // set default voltage limits to every voltage levels of the network setDefaultVoltageLimits(network); - LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( - List.of(subFolder + "/reactiveopf_results_generators.csv", - subFolder + "/reactiveopf_results_indic.txt", - subFolder + "/reactiveopf_results_rtc.csv", - subFolder + "/reactiveopf_results_shunts.csv", - subFolder + "/reactiveopf_results_static_var_compensators.csv", - subFolder + "/reactiveopf_results_vsc_converter_stations.csv", - subFolder + "/reactiveopf_results_voltages.csv")); + List outputFileNames = new ArrayList<>(List.of(subFolder + "/reactiveopf_results_indic.txt")); + if (!onlyIndicators) { + outputFileNames.addAll(List.of( + subFolder + "/reactiveopf_results_rtc.csv", + subFolder + "/reactiveopf_results_shunts.csv", + subFolder + "/reactiveopf_results_static_var_compensators.csv", + subFolder + "/reactiveopf_results_vsc_converter_stations.csv", + subFolder + "/reactiveopf_results_voltages.csv" + )); + } + LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor(outputFileNames); // To really run open reac, use the commentede line below. Be sure that open-reac/src/test/resources/com/powsybl/config/test/config.yml contains your ampl path - try (ComputationManager computationManager = new LocalComputationManager()) { -// try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), -// localCommandExecutor, ForkJoinPool.commonPool())) { +// try (ComputationManager computationManager = new LocalComputationManager()) { + try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), + localCommandExecutor, ForkJoinPool.commonPool())) { return OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, new OpenReacConfig(true), computationManager, reportNode, null); } diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java index c95bc0cf..a362a790 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java @@ -30,13 +30,13 @@ void testGeneratorsMaxPBounds() throws IOException { // due to the disconnection, the network is now imbalanced // and max p of generators is not enough to provide balance network.getLine("l45").getTerminal2().disconnect(); - OpenReacResult result = runOpenReac(network, "openreac-output-branches-opened"); + OpenReacResult result = runOpenReac(network, "optimization/bounds/generators-pmax-too-small", true); assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); // increase max p of generators to allow power balance network.getGenerator("g2").setMaxP(2.5); network.getGenerator("g3").setMaxP(2.5); - result = runOpenReac(network, "openreac-output-branches-opened"); + result = runOpenReac(network, "optimization/bounds/generators-pmax", true); assertEquals(OpenReacStatus.OK, result.getStatus()); } @@ -49,20 +49,20 @@ void testGeneratorsMinPBounds() throws IOException { network.getLoad("l4").setP0(3); network.getGenerator("g2").setMinP(2); network.getGenerator("g3").setMinP(2); - OpenReacResult result = runOpenReac(network, "openreac-output-branches-opened"); + OpenReacResult result = runOpenReac(network, "optimization/bounds/generators-pmin-too-high", true); assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); // decrease min p of generators to allow power balance // but targetP will be fixed in optimization, because it is too close of maxP network.getGenerator("g2").setMinP(1); network.getGenerator("g3").setMinP(1); - result = runOpenReac(network, "openreac-output-branches-opened"); + result = runOpenReac(network, "optimization/bounds/generators-target-p-too-close-pmax", true); assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); // increase max p of generators to allow modification of targetP in optimization network.getGenerator("g2").setMaxP(2.5); network.getGenerator("g3").setMaxP(2.5); - result = runOpenReac(network, "openreac-output-branches-opened"); + result = runOpenReac(network, "optimization/bounds/generators-pmin", true); assertEquals(OpenReacStatus.OK, result.getStatus()); } diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java index 54260bd6..89eba645 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java @@ -43,7 +43,7 @@ class OpenReacOptimizationAndLoadFlowTest extends AbstractOpenReacRunnerTest { @Test void testRunAsync() throws IOException { Network network = IeeeCdfNetworkFactory.create14(); - String subFolder = "openreac-output-ieee14"; + String subFolder = "optimization/loadflow/openreac-output-ieee14"; OpenReacParameters parameters = new OpenReacParameters(); setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( @@ -69,7 +69,7 @@ void testRunAsync() throws IOException { @Test void testOnlyGenerator() throws IOException { Network network = IeeeCdfNetworkFactory.create14(); - testAllModifAndLoadFlow(network, "openreac-output-ieee14", new OpenReacParameters(), ReportNode.NO_OP); + testAllModifAndLoadFlow(network, "optimization/loadflow/openreac-output-ieee14", new OpenReacParameters(), ReportNode.NO_OP); } @Test @@ -79,7 +79,7 @@ void testHvdc() throws IOException { network.getVscConverterStation("cs4").getTerminal().setP(0.0); OpenReacParameters parameters = new OpenReacParameters(); parameters.addConstantQGenerators(List.of("g1", "g2", "g5", "g6")); - testAllModifAndLoadFlow(network, "openreac-output-vsc", parameters, ReportNode.NO_OP); + testAllModifAndLoadFlow(network, "optimization/loadflow/openreac-output-vsc", parameters, ReportNode.NO_OP); } @Test @@ -89,7 +89,7 @@ void testSvc() throws IOException { network.getStaticVarCompensator("svc1").setVoltageSetpoint(390).setRegulationMode(StaticVarCompensator.RegulationMode.VOLTAGE); OpenReacParameters parameters = new OpenReacParameters(); parameters.addConstantQGenerators(List.of("g1")); - testAllModifAndLoadFlow(network, "openreac-output-svc", parameters, ReportNode.NO_OP); + testAllModifAndLoadFlow(network, "optimization/loadflow/openreac-output-svc", parameters, ReportNode.NO_OP); } @Test @@ -102,7 +102,7 @@ void testShunt() throws IOException { OpenReacParameters parameters = new OpenReacParameters(); parameters.addVariableShuntCompensators(List.of(shunt.getId())); ReportNode reportNode = ReportNode.newRootReportNode().withMessageTemplate("openReac", "openReac").build(); - testAllModifAndLoadFlow(network, "openreac-output-shunt", parameters, reportNode); + testAllModifAndLoadFlow(network, "optimization/loadflow/openreac-output-shunt", parameters, reportNode); assertEquals(3, reportNode.getChildren().size()); ReportNode reportShunts = reportNode.getChildren().get(2); @@ -135,7 +135,7 @@ void testShuntWithDeltaBetweenDiscretizedAndOptimalReactiveValueUnderThreshold() parameters.setShuntCompensatorActivationAlertThreshold(100.); parameters.addVariableShuntCompensators(List.of(shunt.getId())); ReportNode reportNode = ReportNode.newRootReportNode().withMessageTemplate("openReac", "openReac").build(); - testAllModifAndLoadFlow(network, "openreac-output-shunt", parameters, reportNode); + testAllModifAndLoadFlow(network, "optimization/loadflow/openreac-output-shunt", parameters, reportNode); assertEquals(2, reportNode.getChildren().size()); @@ -156,7 +156,7 @@ void testTransformer() throws IOException { OpenReacParameters parameters = new OpenReacParameters(); parameters.addConstantQGenerators(List.of("GEN_1")); parameters.addVariableTwoWindingsTransformers(List.of("T2wT")); - testAllModifAndLoadFlow(network, "openreac-output-transfo", parameters, ReportNode.NO_OP); + testAllModifAndLoadFlow(network, "optimization/loadflow/openreac-output-transfo", parameters, ReportNode.NO_OP); assertEquals(0, rtc.getTapPosition()); assertEquals(22.935, rtc.getTargetV()); } @@ -165,13 +165,13 @@ void testTransformer() throws IOException { void testRealNetwork() throws IOException { Network network = IeeeCdfNetworkFactory.create57(); OpenReacParameters parameters = new OpenReacParameters(); - testAllModifAndLoadFlow(network, "openreac-output-real-network", parameters, ReportNode.NO_OP); + testAllModifAndLoadFlow(network, "optimization/loadflow/openreac-output-real-network", parameters, ReportNode.NO_OP); } @Test void testWarmStart() throws IOException { Network network = VoltageControlNetworkFactory.createNetworkWithT2wt(); - String subFolder = "openreac-output-warm-start"; + String subFolder = "optimization/loadflow/openreac-output-warm-start"; OpenReacParameters parameters = new OpenReacParameters(); runAndApplyAllModifications(network, subFolder, parameters, false, ReportNode.NO_OP); // without warm start, no update diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java index 6a059afd..74c3d32b 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java @@ -7,7 +7,6 @@ */ package com.powsybl.openreac.optimization; -import com.powsybl.commons.report.ReportNode; import com.powsybl.ieeecdf.converter.IeeeCdfNetworkFactory; import com.powsybl.iidm.network.Network; import com.powsybl.iidm.network.StaticVarCompensator; @@ -62,7 +61,7 @@ void testParametrizationIndicators() throws IOException { .setReactiveSlackVariableScalingFactor(1e-2) .setTwoWindingTransformerRatioVariableScalingFactor(2e-3) .setShuntVariableScalingFactor(0.11); - OpenReacResult result = runOpenReac(network, "", parameters, ReportNode.NO_OP); + OpenReacResult result = runOpenReac(network, "optimization/indicators/input-parameters-test", parameters, true); // verify buses outside main SC have been excluded assertEquals("WARNING", result.getIndicators().get("log_level_ampl")); @@ -95,7 +94,7 @@ void testParametrizationIndicators() throws IOException { void testBusIndicators() throws IOException { Network network = HvdcNetworkFactory.createLccWithBiggerComponents(); network.getBusBreakerView().getBus("b1").setV(400); - OpenReacResult result = runOpenReac(network, ""); + OpenReacResult result = runOpenReac(network, "optimization/indicators/bus-test", true); assertEquals(OpenReacStatus.OK, result.getStatus()); assertEquals(16, Integer.parseInt(result.getIndicators().get("nb_substations"))); @@ -115,7 +114,7 @@ void testBranchesIndicators() throws IOException { // due to disconnected lines, increase max P of generators in main CC network.getGenerator("g3").setMaxP(3); network.getGenerator("g4").setMaxP(3); - OpenReacResult result = runOpenReac(network, "openreac-output-branches-opened"); + OpenReacResult result = runOpenReac(network, "optimization/indicators/branches-test", true); assertEquals(OpenReacStatus.OK, result.getStatus()); assertEquals(4, Integer.parseInt(result.getIndicators().get("nb_branch_in_data_file"))); @@ -131,7 +130,7 @@ void testGeneratorIndicators() throws IOException { network.getGenerator("g1").setTargetQ(50); OpenReacParameters parameters = new OpenReacParameters(); parameters.addConstantQGenerators(List.of("g1", "g3")); - OpenReacResult result = runOpenReac(network, "", parameters, ReportNode.NO_OP); + OpenReacResult result = runOpenReac(network, "optimization/indicators/generators-test", parameters, true); assertEquals(OpenReacStatus.OK, result.getStatus()); assertEquals(3, Integer.parseInt(result.getIndicators().get("nb_unit_in_data_file"))); @@ -148,7 +147,7 @@ void testTransformersIndicators() throws IOException { Network network = VoltageControlNetworkFactory.createNetworkWith2T2wt(); OpenReacParameters parameters = new OpenReacParameters(); parameters.addVariableTwoWindingsTransformers(List.of("T2wT1")); - OpenReacResult result = runOpenReac(network, "", parameters, ReportNode.NO_OP); + OpenReacResult result = runOpenReac(network, "optimization/indicators/transfo-test", parameters, true); // verify only one rtc has been optimized assertEquals(OpenReacStatus.OK, result.getStatus()); @@ -161,7 +160,7 @@ void testVscIndicators() throws IOException { Network network = HvdcNetworkFactory.createVsc(); // FIXME : should not depend on P/Q values on terminal network.getVscConverterStation("cs2").getTerminal().setP(2).setQ(1); - OpenReacResult result = runOpenReac(network, ""); + OpenReacResult result = runOpenReac(network, "optimization/indicators/vsc-test"); assertEquals(OpenReacStatus.OK, result.getStatus()); assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_vsc_converter_in_data_file"))); @@ -174,7 +173,7 @@ void testLccIndicators() throws IOException { Network network = HvdcNetworkFactory.createLcc(); // FIXME : should not depend on P/Q values on terminal network.getLccConverterStation("cs2").getTerminal().setP(2).setQ(1); - OpenReacResult result = runOpenReac(network, ""); + OpenReacResult result = runOpenReac(network, "optimization/indicators/lcc-test", true); assertEquals(OpenReacStatus.OK, result.getStatus()); assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_lcc_converter_in_data_file"))); @@ -215,7 +214,7 @@ void testShuntsIndicators() throws IOException { .add(); OpenReacParameters parameters = new OpenReacParameters(); parameters.addVariableShuntCompensators(List.of("SHUNT")); - OpenReacResult result = runOpenReac(network, "", parameters); + OpenReacResult result = runOpenReac(network, "optimization/indicators/shunt-test", parameters, true); assertEquals(OpenReacStatus.OK, result.getStatus()); assertEquals(3, Integer.parseInt(result.getIndicators().get("nb_shunt_in_data_file"))); @@ -238,7 +237,7 @@ void testSvcIndicators() throws IOException { .setBmin(-0.008) .setBmax(0.008) .add(); - OpenReacResult result = runOpenReac(network, ""); + OpenReacResult result = runOpenReac(network, "optimization/indicators/svc-test", true); assertEquals(OpenReacStatus.OK, result.getStatus()); assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_svc_in_data_file"))); @@ -270,7 +269,7 @@ void testBatteryIndicators() throws IOException { .setConnectableBus("b1") .setTargetQ(0.2) .add(); - OpenReacResult result = runOpenReac(network, ""); + OpenReacResult result = runOpenReac(network, "optimization/indicators/battery-test", true); assertEquals(OpenReacStatus.OK, result.getStatus()); assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_batteries"))); diff --git a/open-reac/src/test/resources/com/powsybl/config/test/config.yml b/open-reac/src/test/resources/com/powsybl/config/test/config.yml index 9d797384..1acd4f0d 100644 --- a/open-reac/src/test/resources/com/powsybl/config/test/config.yml +++ b/open-reac/src/test/resources/com/powsybl/config/test/config.yml @@ -1,2 +1,2 @@ ampl: - homeDir: D:\AMPL-13.1.20220703-Win-64 + homeDir: ??? diff --git a/open-reac/src/test/resources/optimization/bounds/generators-pmax-too-small/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generators-pmax-too-small/reactiveopf_results_indic.txt new file mode 100644 index 00000000..edad4c5b --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generators-pmax-too-small/reactiveopf_results_indic.txt @@ -0,0 +1,94 @@ +final_status NOK +dcopf_status OK + +ctime_start 'Wed Dec 04 18:39:06 2024' +last_solve_result_num 200 +nb_iter_last 67 +nb_iter_total 67 +_ampl_elapsed_time 0.140000 +_total_solve_time 0.046875 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_16806244976153640704' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 5 +nb_bus_in_data_file 5 +nb_bus_in_ACDC_CC 4 +nb_bus_in_AC_CC 4 +nb_bus_in_ACDC_but_out_AC_CC 0 +nb_bus_with_voltage_value 0 +nb_bus_with_reactive_slacks 4 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 4 +nb_branch_in_AC_CC 3 +nb_branch_with_nonsmall_impedance 3 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 2 +nb_unit_up_and_running 2 +nb_unit_with_variable_reactive_power 2 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.02 +max_teta_ac 0.01 +teta_max 3.02 +min_teta_dc -0.05 +min_teta_ac -0.03 +teta_min -3.05 +max_delta_teta_dc 0.050000 +max_delta_teta_ac 0.030638 +min_delta_teta_dc -0.025000 +min_delta_teta_ac -0.014361 + +nb_reactive_slacks 4 +nb_slacks_condensator 4 +sum_slacks_condensator 2.6 +nb_slacks_self 4 +sum_slacks_self 2.5 +messageInfo1 'Acopf optimization was ***not*** successfull - Convergence to an infeasible solution' diff --git a/open-reac/src/test/resources/optimization/bounds/generators-pmax/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generators-pmax/reactiveopf_results_indic.txt new file mode 100644 index 00000000..aefdeae1 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generators-pmax/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 18:39:06 2024' +last_solve_result_num 0 +nb_iter_last 7 +nb_iter_total 7 +_ampl_elapsed_time 0.139000 +_total_solve_time 0.031250 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_7246203715336309657' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 5 +nb_bus_in_data_file 5 +nb_bus_in_ACDC_CC 4 +nb_bus_in_AC_CC 4 +nb_bus_in_ACDC_but_out_AC_CC 0 +nb_bus_with_voltage_value 0 +nb_bus_with_reactive_slacks 4 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 4 +nb_branch_in_AC_CC 3 +nb_branch_with_nonsmall_impedance 3 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 2 +nb_unit_up_and_running 2 +nb_unit_with_variable_reactive_power 2 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.02 +max_teta_ac 0.03 +teta_max 3.02 +min_teta_dc -0.05 +min_teta_ac -0.05 +teta_min -3.05 +max_delta_teta_dc 0.050000 +max_delta_teta_ac 0.051670 +min_delta_teta_dc -0.025000 +min_delta_teta_ac -0.025352 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/bounds/generators-pmin-too-high/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generators-pmin-too-high/reactiveopf_results_indic.txt new file mode 100644 index 00000000..b213826c --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generators-pmin-too-high/reactiveopf_results_indic.txt @@ -0,0 +1,94 @@ +final_status NOK +dcopf_status OK + +ctime_start 'Wed Dec 04 18:39:05 2024' +last_solve_result_num 200 +nb_iter_last 60 +nb_iter_total 60 +_ampl_elapsed_time 0.155000 +_total_solve_time 0.046875 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_14708682651458660614' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 5 +nb_bus_in_data_file 5 +nb_bus_in_ACDC_CC 4 +nb_bus_in_AC_CC 4 +nb_bus_in_ACDC_but_out_AC_CC 0 +nb_bus_with_voltage_value 0 +nb_bus_with_reactive_slacks 4 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 4 +nb_branch_in_AC_CC 3 +nb_branch_with_nonsmall_impedance 3 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 2 +nb_unit_up_and_running 2 +nb_unit_with_variable_reactive_power 2 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.01 +max_teta_ac 0.02 +teta_max 3.01 +min_teta_dc -0.03 +min_teta_ac -0.04 +teta_min -3.03 +max_delta_teta_dc 0.030000 +max_delta_teta_ac 0.035331 +min_delta_teta_dc -0.015000 +min_delta_teta_ac -0.018693 + +nb_reactive_slacks 4 +nb_slacks_condensator 4 +sum_slacks_condensator 1.3 +nb_slacks_self 4 +sum_slacks_self 1.2 +messageInfo1 'Acopf optimization was ***not*** successfull - Convergence to an infeasible solution' diff --git a/open-reac/src/test/resources/optimization/bounds/generators-pmin/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generators-pmin/reactiveopf_results_indic.txt new file mode 100644 index 00000000..b3a69be6 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generators-pmin/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 18:39:05 2024' +last_solve_result_num 0 +nb_iter_last 7 +nb_iter_total 7 +_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_5930746422974926450' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 5 +nb_bus_in_data_file 5 +nb_bus_in_ACDC_CC 4 +nb_bus_in_AC_CC 4 +nb_bus_in_ACDC_but_out_AC_CC 0 +nb_bus_with_voltage_value 0 +nb_bus_with_reactive_slacks 4 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 4 +nb_branch_in_AC_CC 3 +nb_branch_with_nonsmall_impedance 3 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 2 +nb_unit_up_and_running 2 +nb_unit_with_variable_reactive_power 2 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.01 +max_teta_ac 0.03 +teta_max 3.01 +min_teta_dc -0.03 +min_teta_ac -0.05 +teta_min -3.03 +max_delta_teta_dc 0.030000 +max_delta_teta_ac 0.054735 +min_delta_teta_dc -0.015000 +min_delta_teta_ac -0.026527 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/bounds/generators-target-p-too-close-pmax/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generators-target-p-too-close-pmax/reactiveopf_results_indic.txt new file mode 100644 index 00000000..edce49c4 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generators-target-p-too-close-pmax/reactiveopf_results_indic.txt @@ -0,0 +1,94 @@ +final_status NOK +dcopf_status OK + +ctime_start 'Wed Dec 04 18:39:05 2024' +last_solve_result_num 200 +nb_iter_last 60 +nb_iter_total 60 +_ampl_elapsed_time 0.109000 +_total_solve_time 0.046875 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_3318717096223947573' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 5 +nb_bus_in_data_file 5 +nb_bus_in_ACDC_CC 4 +nb_bus_in_AC_CC 4 +nb_bus_in_ACDC_but_out_AC_CC 0 +nb_bus_with_voltage_value 0 +nb_bus_with_reactive_slacks 4 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 4 +nb_branch_in_AC_CC 3 +nb_branch_with_nonsmall_impedance 3 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 2 +nb_unit_up_and_running 2 +nb_unit_with_variable_reactive_power 2 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.01 +max_teta_ac 0.02 +teta_max 3.01 +min_teta_dc -0.03 +min_teta_ac -0.04 +teta_min -3.03 +max_delta_teta_dc 0.030000 +max_delta_teta_ac 0.035331 +min_delta_teta_dc -0.015000 +min_delta_teta_ac -0.018693 + +nb_reactive_slacks 4 +nb_slacks_condensator 4 +sum_slacks_condensator 1.3 +nb_slacks_self 4 +sum_slacks_self 1.2 +messageInfo1 'Acopf optimization was ***not*** successfull - Convergence to an infeasible solution' diff --git a/open-reac/src/test/resources/optimization/indicators/battery-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/battery-test/reactiveopf_results_indic.txt new file mode 100644 index 00000000..2f49c9cc --- /dev/null +++ b/open-reac/src/test/resources/optimization/indicators/battery-test/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 17:57:29 2024' +last_solve_result_num 0 +nb_iter_last 10 +nb_iter_total 10 +_ampl_elapsed_time 0.109000 +_total_solve_time 0.046875 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_8792994315745054563' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 4 +nb_bus_in_data_file 4 +nb_bus_in_ACDC_CC 4 +nb_bus_in_AC_CC 4 +nb_bus_in_ACDC_but_out_AC_CC 0 +nb_bus_with_voltage_value 0 +nb_bus_with_reactive_slacks 4 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 3 +nb_branch_in_AC_CC 3 +nb_branch_with_nonsmall_impedance 3 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 3 +nb_unit_up_and_running 3 +nb_unit_with_variable_reactive_power 3 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 2 +sum_batteries_pmax 21.0 +sum_batteries_pmin -19.0 + +max_teta_dc 0.03 +max_teta_ac 0.02 +teta_max 3.03 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.030896 +max_delta_teta_ac 0.015495 +min_delta_teta_dc 0.018725 +min_delta_teta_ac 0.009609 + +nb_reactive_slacks 1 +nb_slacks_condensator 1 +sum_slacks_condensator 25.4 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/branches-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/branches-test/reactiveopf_results_indic.txt new file mode 100644 index 00000000..93f59eb1 --- /dev/null +++ b/open-reac/src/test/resources/optimization/indicators/branches-test/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 17:57:29 2024' +last_solve_result_num 0 +nb_iter_last 8 +nb_iter_total 8 +_ampl_elapsed_time 0.141000 +_total_solve_time 0.015625 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_16228844043131338938' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 4 +nb_bus_in_data_file 4 +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 3 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 4 +nb_branch_in_AC_CC 2 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 1 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 2 +nb_unit_up_and_running 2 +nb_unit_with_variable_reactive_power 2 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 2 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.03 +max_teta_ac 0.01 +teta_max 3.03 +min_teta_dc -0.00 +min_teta_ac -0.00 +teta_min -3.00 +max_delta_teta_dc 0.030000 +max_delta_teta_ac 0.013386 +min_delta_teta_dc 0.000001 +min_delta_teta_ac 0.000000 + +nb_reactive_slacks 2 +nb_slacks_condensator 2 +sum_slacks_condensator 0.2 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/bus-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/bus-test/reactiveopf_results_indic.txt new file mode 100644 index 00000000..4fc11e98 --- /dev/null +++ b/open-reac/src/test/resources/optimization/indicators/bus-test/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 17:57:30 2024' +last_solve_result_num 0 +nb_iter_last 17 +nb_iter_total 17 +_ampl_elapsed_time 0.124000 +_total_solve_time 0.031250 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_4215184811660139075' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 16 +nb_bus_in_data_file 16 +nb_bus_in_ACDC_CC 16 +nb_bus_in_AC_CC 12 +nb_bus_in_ACDC_but_out_AC_CC 4 +nb_bus_with_voltage_value 1 +nb_bus_with_reactive_slacks 12 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 14 +nb_branch_in_AC_CC 11 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 10 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 2 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc -0.00 +min_teta_ac -0.00 +teta_min -3.00 +max_delta_teta_dc 0.000937 +max_delta_teta_ac 0.003363 +min_delta_teta_dc 0.000000 +min_delta_teta_ac -0.000000 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/generators-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/generators-test/reactiveopf_results_indic.txt new file mode 100644 index 00000000..c9c996ee --- /dev/null +++ b/open-reac/src/test/resources/optimization/indicators/generators-test/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 17:57:29 2024' +last_solve_result_num 0 +nb_iter_last 9 +nb_iter_total 9 +_ampl_elapsed_time 0.109000 +_total_solve_time 0.031250 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_4963164058041255301' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 4 +nb_bus_in_data_file 4 +nb_bus_in_ACDC_CC 4 +nb_bus_in_AC_CC 4 +nb_bus_in_ACDC_but_out_AC_CC 0 +nb_bus_with_voltage_value 0 +nb_bus_with_reactive_slacks 4 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 3 +nb_branch_in_AC_CC 3 +nb_branch_with_nonsmall_impedance 3 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 3 +nb_unit_up_and_running 3 +nb_unit_with_variable_reactive_power 2 +nb_unit_with_fixed_reactive_power 1 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.03 +max_teta_ac 0.02 +teta_max 3.03 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.031208 +max_delta_teta_ac 0.015617 +min_delta_teta_dc 0.018725 +min_delta_teta_ac 0.009685 + +nb_reactive_slacks 1 +nb_slacks_condensator 1 +sum_slacks_condensator 35.9 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/input-parameters-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/input-parameters-test/reactiveopf_results_indic.txt new file mode 100644 index 00000000..e7bb228a --- /dev/null +++ b/open-reac/src/test/resources/optimization/indicators/input-parameters-test/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 17:57:28 2024' +last_solve_result_num 0 +nb_iter_last 7 +nb_iter_total 7 +_ampl_elapsed_time 0.140000 +_total_solve_time 0.031250 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_10158983132520924590' + +log_level_ampl WARNING +log_level_knitro 1 +objective_choice 2 +ratio_voltage_target 0.700000 +coeff_alpha 0.999000 +Pnull 0.020000 +Znull 0.000010 +epsilon_nominal_voltage 0.750000 +min_plausible_low_voltage_limit 0.655000 +max_plausible_high_voltage_limit 1.425000 +ignore_voltage_bounds 0.850000 +buses_with_reactive_slacks NO_GENERATION +PQmax 4001.000000 +defaultPmax 1001.000000 +defaultPmin 0.100000 +defaultQmaxPmaxRatio 0.200000 +defaultQmin -200.200000 +defaultQmax 200.200000 +minimalQPrange 2.000000 +default_variable_scaling_factor 1.001000 +default_constraint_scaling_factor 0.999000 +reactive_slack_variable_scaling_factor 0.010000 +transformer_ratio_variable_scaling_factor 0.002000 +shunt_variable_scaling_factor 0.110000 + +nb_substations 42 +nb_bus_in_data_file 57 +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_branch_in_data_file 80 +nb_branch_in_AC_CC 80 +nb_branch_with_nonsmall_impedance 80 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 7 +nb_unit_in_AC_CC 7 +nb_unit_up_and_running 4 +nb_unit_with_variable_reactive_power 4 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 42 +nb_load_in_AC_CC 42 +nb_shunt_in_data_file 3 +nb_shunt_connectable_or_in_AC_CC 3 +nb_shunt_with_fixed_value 3 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.21 +max_teta_ac 0.13 +teta_max 3.21 +min_teta_dc -0.17 +min_teta_ac -0.17 +teta_min -3.17 +max_delta_teta_dc 0.146072 +max_delta_teta_ac 0.105543 +min_delta_teta_dc -0.144911 +min_delta_teta_ac -0.088988 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/lcc-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/lcc-test/reactiveopf_results_indic.txt new file mode 100644 index 00000000..04782c22 --- /dev/null +++ b/open-reac/src/test/resources/optimization/indicators/lcc-test/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 17:57:27 2024' +last_solve_result_num 0 +nb_iter_last 6 +nb_iter_total 6 +_ampl_elapsed_time 0.173000 +_total_solve_time 0.078125 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_1900278357647775261' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +nb_bus_in_ACDC_CC 3 +nb_bus_in_AC_CC 2 +nb_bus_in_ACDC_but_out_AC_CC 1 +nb_bus_with_voltage_value 0 +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 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 2 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 2 +nb_lcc_converter_up_and_running 1 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.000975 +max_delta_teta_ac 0.001211 +min_delta_teta_dc 0.000975 +min_delta_teta_ac 0.001211 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/shunt-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/shunt-test/reactiveopf_results_indic.txt new file mode 100644 index 00000000..611ec18f --- /dev/null +++ b/open-reac/src/test/resources/optimization/indicators/shunt-test/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 18:32:41 2024' +last_solve_result_num 0 +nb_iter_last 35 +nb_iter_total 35 +_ampl_elapsed_time 0.108000 +_total_solve_time 0.031250 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_15990639329670156176' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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 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 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 3 +nb_shunt_connectable_or_in_AC_CC 3 +nb_shunt_with_fixed_value 1 +nb_shunt_with_variable_value 1 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc 0.00 +min_teta_ac -0.00 +teta_min -3.00 +max_delta_teta_dc 0.001894 +max_delta_teta_ac 0.001642 +min_delta_teta_dc 0.000000 +min_delta_teta_ac -0.000773 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/svc-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/svc-test/reactiveopf_results_indic.txt new file mode 100644 index 00000000..6c681c4e --- /dev/null +++ b/open-reac/src/test/resources/optimization/indicators/svc-test/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 17:57:28 2024' +last_solve_result_num 0 +nb_iter_last 4 +nb_iter_total 4 +_ampl_elapsed_time 0.125000 +_total_solve_time 0.062500 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_2452729350162475477' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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 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 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 2 +nb_svc_in_AC_CC 2 +nb_svc_up_and_operating 1 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.001894 +max_delta_teta_ac 0.001258 +min_delta_teta_dc 0.001894 +min_delta_teta_ac 0.001258 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/transfo-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/transfo-test/reactiveopf_results_indic.txt new file mode 100644 index 00000000..9fb65985 --- /dev/null +++ b/open-reac/src/test/resources/optimization/indicators/transfo-test/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 17:57:26 2024' +last_solve_result_num 0 +nb_iter_last 4 +nb_iter_total 4 +_ampl_elapsed_time 0.142000 +_total_solve_time 0.046875 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_3953804062991735571' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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 3 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 3 +nb_branch_in_AC_CC 3 +nb_branch_with_nonsmall_impedance 3 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 2 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 1 +nb_transformers_with_fixed_ratio 1 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.01 +max_teta_ac 0.02 +teta_max 3.01 +min_teta_dc -0.02 +min_teta_ac -0.04 +teta_min -3.02 +max_delta_teta_dc 0.022957 +max_delta_teta_ac 0.037399 +min_delta_teta_dc 0.009298 +min_delta_teta_ac 0.016902 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/vsc-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/vsc-test/reactiveopf_results_indic.txt new file mode 100644 index 00000000..882281eb --- /dev/null +++ b/open-reac/src/test/resources/optimization/indicators/vsc-test/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 17:15:42 2024' +last_solve_result_num 0 +nb_iter_last 5 +nb_iter_total 5 +_ampl_elapsed_time 0.093000 +_total_solve_time 0.062500 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_995048131625005748' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +nb_bus_in_ACDC_CC 3 +nb_bus_in_AC_CC 2 +nb_bus_in_ACDC_but_out_AC_CC 1 +nb_bus_with_voltage_value 0 +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 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 2 +nb_vsc_converter_up_and_running 1 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.000975 +max_delta_teta_ac 0.001335 +min_delta_teta_dc 0.000975 +min_delta_teta_ac 0.001335 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-ieee14/reactiveopf_results_generators.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_generators.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-ieee14/reactiveopf_results_generators.csv diff --git a/open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/loadflow/openreac-output-ieee14/reactiveopf_results_indic.txt similarity index 100% rename from open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_indic.txt rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-ieee14/reactiveopf_results_indic.txt diff --git a/open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-ieee14/reactiveopf_results_rtc.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_rtc.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-ieee14/reactiveopf_results_rtc.csv diff --git a/open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-ieee14/reactiveopf_results_shunts.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_shunts.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-ieee14/reactiveopf_results_shunts.csv diff --git a/open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-ieee14/reactiveopf_results_static_var_compensators.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_static_var_compensators.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-ieee14/reactiveopf_results_static_var_compensators.csv diff --git a/open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-ieee14/reactiveopf_results_voltages.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_voltages.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-ieee14/reactiveopf_results_voltages.csv diff --git a/open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-ieee14/reactiveopf_results_vsc_converter_stations.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-ieee14/reactiveopf_results_vsc_converter_stations.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-ieee14/reactiveopf_results_vsc_converter_stations.csv diff --git a/open-reac/src/test/resources/openreac-output-real-network/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-real-network/reactiveopf_results_generators.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-real-network/reactiveopf_results_generators.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-real-network/reactiveopf_results_generators.csv diff --git a/open-reac/src/test/resources/openreac-output-real-network/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/loadflow/openreac-output-real-network/reactiveopf_results_indic.txt similarity index 100% rename from open-reac/src/test/resources/openreac-output-real-network/reactiveopf_results_indic.txt rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-real-network/reactiveopf_results_indic.txt diff --git a/open-reac/src/test/resources/openreac-output-real-network/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-real-network/reactiveopf_results_rtc.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-real-network/reactiveopf_results_rtc.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-real-network/reactiveopf_results_rtc.csv diff --git a/open-reac/src/test/resources/openreac-output-real-network/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-real-network/reactiveopf_results_shunts.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-real-network/reactiveopf_results_shunts.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-real-network/reactiveopf_results_shunts.csv diff --git a/open-reac/src/test/resources/openreac-output-real-network/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-real-network/reactiveopf_results_static_var_compensators.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-real-network/reactiveopf_results_static_var_compensators.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-real-network/reactiveopf_results_static_var_compensators.csv diff --git a/open-reac/src/test/resources/openreac-output-real-network/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-real-network/reactiveopf_results_voltages.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-real-network/reactiveopf_results_voltages.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-real-network/reactiveopf_results_voltages.csv diff --git a/open-reac/src/test/resources/openreac-output-real-network/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-real-network/reactiveopf_results_vsc_converter_stations.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-real-network/reactiveopf_results_vsc_converter_stations.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-real-network/reactiveopf_results_vsc_converter_stations.csv diff --git a/open-reac/src/test/resources/openreac-output-shunt/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-shunt/reactiveopf_results_generators.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-shunt/reactiveopf_results_generators.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-shunt/reactiveopf_results_generators.csv diff --git a/open-reac/src/test/resources/openreac-output-shunt/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/loadflow/openreac-output-shunt/reactiveopf_results_indic.txt similarity index 100% rename from open-reac/src/test/resources/openreac-output-shunt/reactiveopf_results_indic.txt rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-shunt/reactiveopf_results_indic.txt diff --git a/open-reac/src/test/resources/openreac-output-shunt/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-shunt/reactiveopf_results_rtc.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-shunt/reactiveopf_results_rtc.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-shunt/reactiveopf_results_rtc.csv diff --git a/open-reac/src/test/resources/openreac-output-shunt/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-shunt/reactiveopf_results_shunts.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-shunt/reactiveopf_results_shunts.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-shunt/reactiveopf_results_shunts.csv diff --git a/open-reac/src/test/resources/openreac-output-shunt/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-shunt/reactiveopf_results_static_var_compensators.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-shunt/reactiveopf_results_static_var_compensators.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-shunt/reactiveopf_results_static_var_compensators.csv diff --git a/open-reac/src/test/resources/openreac-output-shunt/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-shunt/reactiveopf_results_voltages.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-shunt/reactiveopf_results_voltages.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-shunt/reactiveopf_results_voltages.csv diff --git a/open-reac/src/test/resources/openreac-output-shunt/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-shunt/reactiveopf_results_vsc_converter_stations.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-shunt/reactiveopf_results_vsc_converter_stations.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-shunt/reactiveopf_results_vsc_converter_stations.csv diff --git a/open-reac/src/test/resources/openreac-output-svc/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-svc/reactiveopf_results_generators.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-svc/reactiveopf_results_generators.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-svc/reactiveopf_results_generators.csv diff --git a/open-reac/src/test/resources/openreac-output-svc/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/loadflow/openreac-output-svc/reactiveopf_results_indic.txt similarity index 100% rename from open-reac/src/test/resources/openreac-output-svc/reactiveopf_results_indic.txt rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-svc/reactiveopf_results_indic.txt diff --git a/open-reac/src/test/resources/openreac-output-svc/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-svc/reactiveopf_results_rtc.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-svc/reactiveopf_results_rtc.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-svc/reactiveopf_results_rtc.csv diff --git a/open-reac/src/test/resources/openreac-output-svc/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-svc/reactiveopf_results_shunts.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-svc/reactiveopf_results_shunts.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-svc/reactiveopf_results_shunts.csv diff --git a/open-reac/src/test/resources/openreac-output-svc/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-svc/reactiveopf_results_static_var_compensators.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-svc/reactiveopf_results_static_var_compensators.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-svc/reactiveopf_results_static_var_compensators.csv diff --git a/open-reac/src/test/resources/openreac-output-svc/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-svc/reactiveopf_results_voltages.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-svc/reactiveopf_results_voltages.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-svc/reactiveopf_results_voltages.csv diff --git a/open-reac/src/test/resources/openreac-output-svc/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-svc/reactiveopf_results_vsc_converter_stations.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-svc/reactiveopf_results_vsc_converter_stations.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-svc/reactiveopf_results_vsc_converter_stations.csv diff --git a/open-reac/src/test/resources/openreac-output-transfo/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-transfo/reactiveopf_results_generators.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-transfo/reactiveopf_results_generators.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-transfo/reactiveopf_results_generators.csv diff --git a/open-reac/src/test/resources/openreac-output-transfo/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/loadflow/openreac-output-transfo/reactiveopf_results_indic.txt similarity index 100% rename from open-reac/src/test/resources/openreac-output-transfo/reactiveopf_results_indic.txt rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-transfo/reactiveopf_results_indic.txt diff --git a/open-reac/src/test/resources/openreac-output-transfo/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-transfo/reactiveopf_results_rtc.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-transfo/reactiveopf_results_rtc.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-transfo/reactiveopf_results_rtc.csv diff --git a/open-reac/src/test/resources/openreac-output-transfo/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-transfo/reactiveopf_results_shunts.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-transfo/reactiveopf_results_shunts.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-transfo/reactiveopf_results_shunts.csv diff --git a/open-reac/src/test/resources/openreac-output-transfo/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-transfo/reactiveopf_results_static_var_compensators.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-transfo/reactiveopf_results_static_var_compensators.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-transfo/reactiveopf_results_static_var_compensators.csv diff --git a/open-reac/src/test/resources/openreac-output-transfo/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-transfo/reactiveopf_results_voltages.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-transfo/reactiveopf_results_voltages.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-transfo/reactiveopf_results_voltages.csv diff --git a/open-reac/src/test/resources/openreac-output-transfo/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-transfo/reactiveopf_results_vsc_converter_stations.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-transfo/reactiveopf_results_vsc_converter_stations.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-transfo/reactiveopf_results_vsc_converter_stations.csv diff --git a/open-reac/src/test/resources/openreac-output-vsc/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_generators.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-vsc/reactiveopf_results_generators.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_generators.csv diff --git a/open-reac/src/test/resources/openreac-output-vsc/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_indic.txt similarity index 100% rename from open-reac/src/test/resources/openreac-output-vsc/reactiveopf_results_indic.txt rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_indic.txt diff --git a/open-reac/src/test/resources/openreac-output-vsc/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_rtc.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-vsc/reactiveopf_results_rtc.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_rtc.csv diff --git a/open-reac/src/test/resources/openreac-output-vsc/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_shunts.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-vsc/reactiveopf_results_shunts.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_shunts.csv diff --git a/open-reac/src/test/resources/openreac-output-vsc/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_static_var_compensators.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-vsc/reactiveopf_results_static_var_compensators.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_static_var_compensators.csv diff --git a/open-reac/src/test/resources/openreac-output-vsc/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_voltages.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-vsc/reactiveopf_results_voltages.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_voltages.csv diff --git a/open-reac/src/test/resources/openreac-output-vsc/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_vsc_converter_stations.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-vsc/reactiveopf_results_vsc_converter_stations.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_vsc_converter_stations.csv diff --git a/open-reac/src/test/resources/openreac-output-warm-start/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-warm-start/reactiveopf_results_generators.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-warm-start/reactiveopf_results_generators.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-warm-start/reactiveopf_results_generators.csv diff --git a/open-reac/src/test/resources/openreac-output-warm-start/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/loadflow/openreac-output-warm-start/reactiveopf_results_indic.txt similarity index 100% rename from open-reac/src/test/resources/openreac-output-warm-start/reactiveopf_results_indic.txt rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-warm-start/reactiveopf_results_indic.txt diff --git a/open-reac/src/test/resources/openreac-output-warm-start/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-warm-start/reactiveopf_results_rtc.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-warm-start/reactiveopf_results_rtc.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-warm-start/reactiveopf_results_rtc.csv diff --git a/open-reac/src/test/resources/openreac-output-warm-start/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-warm-start/reactiveopf_results_shunts.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-warm-start/reactiveopf_results_shunts.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-warm-start/reactiveopf_results_shunts.csv diff --git a/open-reac/src/test/resources/openreac-output-warm-start/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-warm-start/reactiveopf_results_static_var_compensators.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-warm-start/reactiveopf_results_static_var_compensators.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-warm-start/reactiveopf_results_static_var_compensators.csv diff --git a/open-reac/src/test/resources/openreac-output-warm-start/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-warm-start/reactiveopf_results_voltages.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-warm-start/reactiveopf_results_voltages.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-warm-start/reactiveopf_results_voltages.csv diff --git a/open-reac/src/test/resources/openreac-output-warm-start/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-warm-start/reactiveopf_results_vsc_converter_stations.csv similarity index 100% rename from open-reac/src/test/resources/openreac-output-warm-start/reactiveopf_results_vsc_converter_stations.csv rename to open-reac/src/test/resources/optimization/loadflow/openreac-output-warm-start/reactiveopf_results_vsc_converter_stations.csv From 84e5da65d9b53f82d3a1991da79b19cc8eeda845 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Thu, 12 Dec 2024 15:53:53 +0100 Subject: [PATCH 07/63] Clean Signed-off-by: p-arvy --- .../AbstractOpenReacRunnerTest.java | 19 ++----------------- .../OpenReacOptimizationIndicatorsTest.java | 2 +- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java index f2dfd0ad..965a9eff 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java @@ -87,20 +87,12 @@ protected void testAllModifAndLoadFlow(Network network, String subFolder, OpenRe */ protected void runAndApplyAllModifications(Network network, String subFolder, OpenReacParameters parameters, boolean updateNetworkWithVoltages, ReportNode reportNode) throws IOException { - OpenReacResult openReacResult = runOpenReac(network, subFolder, parameters, reportNode); + OpenReacResult openReacResult = runOpenReac(network, subFolder, parameters, false, reportNode); assertEquals(OpenReacStatus.OK, openReacResult.getStatus()); openReacResult.setUpdateNetworkWithVoltages(updateNetworkWithVoltages); openReacResult.applyAllModifications(network); } - // TODO : remove useless methods here - /** - * Runs OpenReac and returns associated result. - */ - protected OpenReacResult runOpenReac(Network network, String subFolder) throws IOException { - return runOpenReac(network, subFolder, false); - } - /** * Runs OpenReac and returns associated result. */ @@ -112,14 +104,7 @@ protected OpenReacResult runOpenReac(Network network, String subFolder, boolean * Runs OpenReac and returns associated result. */ protected OpenReacResult runOpenReac(Network network, String subFolder, OpenReacParameters parameters, boolean onlyIndicators) throws IOException { - return runOpenReac(network, subFolder, parameters, ReportNode.NO_OP); - } - - /** - * Runs OpenReac and returns associated result. - */ - protected OpenReacResult runOpenReac(Network network, String subFolder, OpenReacParameters parameters, ReportNode reportNode) throws IOException { - return runOpenReac(network, subFolder, parameters, false, reportNode); + return runOpenReac(network, subFolder, parameters, onlyIndicators, ReportNode.NO_OP); } /** diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java index 74c3d32b..d98304e4 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java @@ -160,7 +160,7 @@ void testVscIndicators() throws IOException { Network network = HvdcNetworkFactory.createVsc(); // FIXME : should not depend on P/Q values on terminal network.getVscConverterStation("cs2").getTerminal().setP(2).setQ(1); - OpenReacResult result = runOpenReac(network, "optimization/indicators/vsc-test"); + OpenReacResult result = runOpenReac(network, "optimization/indicators/vsc-test", true); assertEquals(OpenReacStatus.OK, result.getStatus()); assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_vsc_converter_in_data_file"))); From a54206bbc407bcfe594573e20a8f57dbdb0ba261 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Thu, 12 Dec 2024 16:03:46 +0100 Subject: [PATCH 08/63] Clean code adding new TUs Signed-off-by: p-arvy --- .../AbstractOpenReacRunnerTest.java | 61 +--- .../OpecReacOptimizationBoundsTest.java | 69 ----- .../OpenReacOptimizationIndicatorsTest.java | 281 ------------------ .../reactiveopf_results_indic.txt | 94 ------ .../reactiveopf_results_indic.txt | 93 ------ .../reactiveopf_results_indic.txt | 94 ------ .../reactiveopf_results_indic.txt | 93 ------ .../reactiveopf_results_indic.txt | 94 ------ .../reactiveopf_results_indic.txt | 93 ------ .../reactiveopf_results_indic.txt | 93 ------ .../bus-test/reactiveopf_results_indic.txt | 93 ------ .../reactiveopf_results_indic.txt | 93 ------ .../reactiveopf_results_indic.txt | 93 ------ .../lcc-test/reactiveopf_results_indic.txt | 93 ------ .../shunt-test/reactiveopf_results_indic.txt | 93 ------ .../svc-test/reactiveopf_results_indic.txt | 93 ------ .../reactiveopf_results_indic.txt | 93 ------ .../vsc-test/reactiveopf_results_indic.txt | 93 ------ 18 files changed, 16 insertions(+), 1793 deletions(-) delete mode 100644 open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java delete mode 100644 open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java delete mode 100644 open-reac/src/test/resources/optimization/bounds/generators-pmax-too-small/reactiveopf_results_indic.txt delete mode 100644 open-reac/src/test/resources/optimization/bounds/generators-pmax/reactiveopf_results_indic.txt delete mode 100644 open-reac/src/test/resources/optimization/bounds/generators-pmin-too-high/reactiveopf_results_indic.txt delete mode 100644 open-reac/src/test/resources/optimization/bounds/generators-pmin/reactiveopf_results_indic.txt delete mode 100644 open-reac/src/test/resources/optimization/bounds/generators-target-p-too-close-pmax/reactiveopf_results_indic.txt delete mode 100644 open-reac/src/test/resources/optimization/indicators/battery-test/reactiveopf_results_indic.txt delete mode 100644 open-reac/src/test/resources/optimization/indicators/branches-test/reactiveopf_results_indic.txt delete mode 100644 open-reac/src/test/resources/optimization/indicators/bus-test/reactiveopf_results_indic.txt delete mode 100644 open-reac/src/test/resources/optimization/indicators/generators-test/reactiveopf_results_indic.txt delete mode 100644 open-reac/src/test/resources/optimization/indicators/input-parameters-test/reactiveopf_results_indic.txt delete mode 100644 open-reac/src/test/resources/optimization/indicators/lcc-test/reactiveopf_results_indic.txt delete mode 100644 open-reac/src/test/resources/optimization/indicators/shunt-test/reactiveopf_results_indic.txt delete mode 100644 open-reac/src/test/resources/optimization/indicators/svc-test/reactiveopf_results_indic.txt delete mode 100644 open-reac/src/test/resources/optimization/indicators/transfo-test/reactiveopf_results_indic.txt delete mode 100644 open-reac/src/test/resources/optimization/indicators/vsc-test/reactiveopf_results_indic.txt diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java index 965a9eff..a53d9720 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java @@ -73,7 +73,7 @@ protected Path getAmplExecPath() throws IOException { } /** - * Runs OpenReac, apply the results and run a load flow. + * Runs OpenReac, apply the results and verify that a load flow converges on these results. */ protected void testAllModifAndLoadFlow(Network network, String subFolder, OpenReacParameters parameters, ReportNode reportNode) throws IOException { runAndApplyAllModifications(network, subFolder, parameters, true, reportNode); @@ -83,56 +83,27 @@ protected void testAllModifAndLoadFlow(Network network, String subFolder, OpenRe /** * Runs OpenReac and apply the results on the network. - * The application of the voltage plan calculated by optimization is optional. */ - protected void runAndApplyAllModifications(Network network, String subFolder, OpenReacParameters parameters, - boolean updateNetworkWithVoltages, ReportNode reportNode) throws IOException { - OpenReacResult openReacResult = runOpenReac(network, subFolder, parameters, false, reportNode); - assertEquals(OpenReacStatus.OK, openReacResult.getStatus()); - openReacResult.setUpdateNetworkWithVoltages(updateNetworkWithVoltages); - openReacResult.applyAllModifications(network); - } - - /** - * Runs OpenReac and returns associated result. - */ - protected OpenReacResult runOpenReac(Network network, String subFolder, boolean onlyIndicators) throws IOException { - return runOpenReac(network, subFolder, new OpenReacParameters(), onlyIndicators); - } - - /** - * Runs OpenReac and returns associated result. - */ - protected OpenReacResult runOpenReac(Network network, String subFolder, OpenReacParameters parameters, boolean onlyIndicators) throws IOException { - return runOpenReac(network, subFolder, parameters, onlyIndicators, ReportNode.NO_OP); - } - - /** - * Runs OpenReac and returns associated result. - * Note that OpenReac is not really executed by default. If the execution line is not uncommented, - * the results are retrieved and stored in an {@link OpenReacResult} object. - */ - protected OpenReacResult runOpenReac(Network network, String subFolder, OpenReacParameters parameters, - boolean onlyIndicators, ReportNode reportNode) throws IOException { - // set default voltage limits to every voltage levels of the network - setDefaultVoltageLimits(network); - List outputFileNames = new ArrayList<>(List.of(subFolder + "/reactiveopf_results_indic.txt")); - if (!onlyIndicators) { - outputFileNames.addAll(List.of( - subFolder + "/reactiveopf_results_rtc.csv", - subFolder + "/reactiveopf_results_shunts.csv", - subFolder + "/reactiveopf_results_static_var_compensators.csv", - subFolder + "/reactiveopf_results_vsc_converter_stations.csv", - subFolder + "/reactiveopf_results_voltages.csv" - )); - } - LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor(outputFileNames); + void runAndApplyAllModifications(Network network, String subFolder, OpenReacParameters parameters, + boolean updateNetworkWithVoltages, ReportNode reportNode) throws IOException { + LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( + List.of(subFolder + "/reactiveopf_results_generators.csv", + subFolder + "/reactiveopf_results_indic.txt", + subFolder + "/reactiveopf_results_rtc.csv", + subFolder + "/reactiveopf_results_shunts.csv", + subFolder + "/reactiveopf_results_static_var_compensators.csv", + subFolder + "/reactiveopf_results_vsc_converter_stations.csv", + subFolder + "/reactiveopf_results_voltages.csv")); // To really run open reac, use the commentede line below. Be sure that open-reac/src/test/resources/com/powsybl/config/test/config.yml contains your ampl path // try (ComputationManager computationManager = new LocalComputationManager()) { try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), localCommandExecutor, ForkJoinPool.commonPool())) { - return OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, + OpenReacResult openReacResult = OpenReacRunner.run(network, + network.getVariantManager().getWorkingVariantId(), parameters, new OpenReacConfig(true), computationManager, reportNode, null); + assertEquals(OpenReacStatus.OK, openReacResult.getStatus()); + openReacResult.setUpdateNetworkWithVoltages(updateNetworkWithVoltages); + openReacResult.applyAllModifications(network); } } diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java deleted file mode 100644 index a362a790..00000000 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Copyright (c) 2024, RTE (http://www.rte-france.com) - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * SPDX-License-Identifier: MPL-2.0 - */ -package com.powsybl.openreac.optimization; - -import com.powsybl.iidm.network.Network; -import com.powsybl.openreac.network.VoltageControlNetworkFactory; -import com.powsybl.openreac.parameters.output.OpenReacResult; -import com.powsybl.openreac.parameters.output.OpenReacStatus; -import org.junit.jupiter.api.Test; - -import java.io.IOException; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -/** - * Test the equipment bounds in OpenReac optimization. - * - * @author Pierre ARVY {@literal } - */ -class OpecReacOptimizationBoundsTest extends AbstractOpenReacRunnerTest { - - @Test - void testGeneratorsMaxPBounds() throws IOException { - Network network = VoltageControlNetworkFactory.createWithTwoVoltageControls(); - // due to the disconnection, the network is now imbalanced - // and max p of generators is not enough to provide balance - network.getLine("l45").getTerminal2().disconnect(); - OpenReacResult result = runOpenReac(network, "optimization/bounds/generators-pmax-too-small", true); - assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); - - // increase max p of generators to allow power balance - network.getGenerator("g2").setMaxP(2.5); - network.getGenerator("g3").setMaxP(2.5); - result = runOpenReac(network, "optimization/bounds/generators-pmax", true); - assertEquals(OpenReacStatus.OK, result.getStatus()); - } - - @Test - void testGeneratorsMinPBounds() throws IOException { - Network network = VoltageControlNetworkFactory.createWithTwoVoltageControls(); - // due to the modifications, the network is now imbalanced - // and min p of generators is not small enough to provide balance - network.getLine("l45").getTerminal2().disconnect(); - network.getLoad("l4").setP0(3); - network.getGenerator("g2").setMinP(2); - network.getGenerator("g3").setMinP(2); - OpenReacResult result = runOpenReac(network, "optimization/bounds/generators-pmin-too-high", true); - assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); - - // decrease min p of generators to allow power balance - // but targetP will be fixed in optimization, because it is too close of maxP - network.getGenerator("g2").setMinP(1); - network.getGenerator("g3").setMinP(1); - result = runOpenReac(network, "optimization/bounds/generators-target-p-too-close-pmax", true); - assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); - - // increase max p of generators to allow modification of targetP in optimization - network.getGenerator("g2").setMaxP(2.5); - network.getGenerator("g3").setMaxP(2.5); - result = runOpenReac(network, "optimization/bounds/generators-pmin", true); - assertEquals(OpenReacStatus.OK, result.getStatus()); - } - -} diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java deleted file mode 100644 index d98304e4..00000000 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java +++ /dev/null @@ -1,281 +0,0 @@ -/** - * Copyright (c) 2024, RTE (http://www.rte-france.com) - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * SPDX-License-Identifier: MPL-2.0 - */ -package com.powsybl.openreac.optimization; - -import com.powsybl.ieeecdf.converter.IeeeCdfNetworkFactory; -import com.powsybl.iidm.network.Network; -import com.powsybl.iidm.network.StaticVarCompensator; -import com.powsybl.openreac.network.HvdcNetworkFactory; -import com.powsybl.openreac.network.VoltageControlNetworkFactory; -import com.powsybl.openreac.parameters.input.OpenReacParameters; -import com.powsybl.openreac.parameters.input.algo.OpenReacAmplLogLevel; -import com.powsybl.openreac.parameters.input.algo.OpenReacOptimisationObjective; -import com.powsybl.openreac.parameters.input.algo.OpenReacSolverLogLevel; -import com.powsybl.openreac.parameters.input.algo.ReactiveSlackBusesMode; -import com.powsybl.openreac.parameters.output.OpenReacResult; -import com.powsybl.openreac.parameters.output.OpenReacStatus; -import org.junit.jupiter.api.Test; - -import java.io.IOException; -import java.util.List; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -/** - * Test the indicators returned by OpenReac optimization. - * Note that some indicators might depend on optimization process, - * and can not be tested in unit tests. - * - * @author Pierre ARVY {@literal } - */ -class OpenReacOptimizationIndicatorsTest extends AbstractOpenReacRunnerTest { - - @Test - void testParametrizationIndicators() throws IOException { - Network network = IeeeCdfNetworkFactory.create57(); - OpenReacParameters parameters = new OpenReacParameters() - .setObjective(OpenReacOptimisationObjective.SPECIFIC_VOLTAGE_PROFILE) - .setObjectiveDistance(70) - .setLogLevelAmpl(OpenReacAmplLogLevel.WARNING) - .setLogLevelSolver(OpenReacSolverLogLevel.ONLY_RESULTS) - .setMinPlausibleLowVoltageLimit(0.655) - .setMaxPlausibleHighVoltageLimit(1.425) - .setReactiveSlackBusesMode(ReactiveSlackBusesMode.NO_GENERATION) - .setActivePowerVariationRate(0.999) - .setMinPlausibleActivePowerThreshold(0.02) - .setLowImpedanceThreshold(1e-5) - .setMinNominalVoltageIgnoredBus(0.75) - .setMinNominalVoltageIgnoredVoltageBounds(0.85) - .setPQMax(4001) - .setLowActivePowerDefaultLimit(0.1) - .setHighActivePowerDefaultLimit(1001) - .setDefaultQmaxPmaxRatio(0.2) - .setDefaultMinimalQPRange(2.) - .setDefaultVariableScalingFactor(1.001) - .setDefaultConstraintScalingFactor(0.999) - .setReactiveSlackVariableScalingFactor(1e-2) - .setTwoWindingTransformerRatioVariableScalingFactor(2e-3) - .setShuntVariableScalingFactor(0.11); - OpenReacResult result = runOpenReac(network, "optimization/indicators/input-parameters-test", parameters, true); - - // verify buses outside main SC have been excluded - assertEquals("WARNING", result.getIndicators().get("log_level_ampl")); - assertEquals(1, Integer.parseInt(result.getIndicators().get("log_level_knitro"))); - assertEquals(2, Integer.parseInt(result.getIndicators().get("objective_choice"))); - assertEquals(0.7, Double.parseDouble(result.getIndicators().get("ratio_voltage_target"))); - assertEquals(0.999, Double.parseDouble(result.getIndicators().get("coeff_alpha"))); - assertEquals(0.02, Double.parseDouble(result.getIndicators().get("Pnull"))); - assertEquals(1e-5, Double.parseDouble(result.getIndicators().get("Znull"))); - assertEquals(0.75, Double.parseDouble(result.getIndicators().get("epsilon_nominal_voltage"))); - assertEquals(0.655, Double.parseDouble(result.getIndicators().get("min_plausible_low_voltage_limit"))); - assertEquals(1.425, Double.parseDouble(result.getIndicators().get("max_plausible_high_voltage_limit"))); - assertEquals(0.85, Double.parseDouble(result.getIndicators().get("ignore_voltage_bounds"))); - assertEquals("NO_GENERATION", result.getIndicators().get("buses_with_reactive_slacks")); - assertEquals(4001, Double.parseDouble(result.getIndicators().get("PQmax"))); - assertEquals(1001, Double.parseDouble(result.getIndicators().get("defaultPmax"))); - assertEquals(0.1, Double.parseDouble(result.getIndicators().get("defaultPmin"))); - assertEquals(0.2, Double.parseDouble(result.getIndicators().get("defaultQmaxPmaxRatio"))); - assertEquals(-200.2, Double.parseDouble(result.getIndicators().get("defaultQmin"))); - assertEquals(200.2, Double.parseDouble(result.getIndicators().get("defaultQmax"))); - assertEquals(2.0, Double.parseDouble(result.getIndicators().get("minimalQPrange"))); - assertEquals(1.001, Double.parseDouble(result.getIndicators().get("default_variable_scaling_factor"))); - assertEquals(0.999, Double.parseDouble(result.getIndicators().get("default_constraint_scaling_factor"))); - assertEquals(0.01, Double.parseDouble(result.getIndicators().get("reactive_slack_variable_scaling_factor"))); - assertEquals(0.002, Double.parseDouble(result.getIndicators().get("transformer_ratio_variable_scaling_factor"))); - assertEquals(0.11, Double.parseDouble(result.getIndicators().get("shunt_variable_scaling_factor"))); - } - - @Test - void testBusIndicators() throws IOException { - Network network = HvdcNetworkFactory.createLccWithBiggerComponents(); - network.getBusBreakerView().getBus("b1").setV(400); - OpenReacResult result = runOpenReac(network, "optimization/indicators/bus-test", true); - - assertEquals(OpenReacStatus.OK, result.getStatus()); - assertEquals(16, Integer.parseInt(result.getIndicators().get("nb_substations"))); - assertEquals(16, Integer.parseInt(result.getIndicators().get("nb_bus_in_data_file"))); - assertEquals(16, Integer.parseInt(result.getIndicators().get("nb_bus_in_ACDC_CC"))); - // verify buses outside main SC have been excluded - assertEquals(12, Integer.parseInt(result.getIndicators().get("nb_bus_in_AC_CC"))); - assertEquals(4, Integer.parseInt(result.getIndicators().get("nb_bus_in_ACDC_but_out_AC_CC"))); - assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_bus_with_voltage_value"))); - } - - @Test - void testBranchesIndicators() throws IOException { - Network network = VoltageControlNetworkFactory.createWithSimpleRemoteControl(); - network.getLine("l12").getTerminal2().disconnect(); - network.getLine("l24").getTerminal1().disconnect(); - // due to disconnected lines, increase max P of generators in main CC - network.getGenerator("g3").setMaxP(3); - network.getGenerator("g4").setMaxP(3); - OpenReacResult result = runOpenReac(network, "optimization/indicators/branches-test", true); - - assertEquals(OpenReacStatus.OK, result.getStatus()); - assertEquals(4, Integer.parseInt(result.getIndicators().get("nb_branch_in_data_file"))); - // verify opened branches have been excluded - assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_branch_in_AC_CC"))); - assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_with_nonsmall_impedance"))); - assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_with_zero_or_small_impedance"))); - } - - @Test - void testGeneratorIndicators() throws IOException { - Network network = VoltageControlNetworkFactory.createWithGeneratorRemoteControl(); - network.getGenerator("g1").setTargetQ(50); - OpenReacParameters parameters = new OpenReacParameters(); - parameters.addConstantQGenerators(List.of("g1", "g3")); - OpenReacResult result = runOpenReac(network, "optimization/indicators/generators-test", parameters, true); - - assertEquals(OpenReacStatus.OK, result.getStatus()); - assertEquals(3, Integer.parseInt(result.getIndicators().get("nb_unit_in_data_file"))); - assertEquals(3, Integer.parseInt(result.getIndicators().get("nb_unit_in_AC_CC"))); - assertEquals(3, Integer.parseInt(result.getIndicators().get("nb_unit_up_and_running"))); - // verify that only the generators indicated as constant and with defined target Q are fixed in optimization - assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_unit_with_fixed_reactive_power"))); - // verify other generators are optimized - assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_unit_with_variable_reactive_power"))); - } - - @Test - void testTransformersIndicators() throws IOException { - Network network = VoltageControlNetworkFactory.createNetworkWith2T2wt(); - OpenReacParameters parameters = new OpenReacParameters(); - parameters.addVariableTwoWindingsTransformers(List.of("T2wT1")); - OpenReacResult result = runOpenReac(network, "optimization/indicators/transfo-test", parameters, true); - - // verify only one rtc has been optimized - assertEquals(OpenReacStatus.OK, result.getStatus()); - assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_transformers_with_variable_ratio"))); - assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_transformers_with_fixed_ratio"))); - } - - @Test - void testVscIndicators() throws IOException { - Network network = HvdcNetworkFactory.createVsc(); - // FIXME : should not depend on P/Q values on terminal - network.getVscConverterStation("cs2").getTerminal().setP(2).setQ(1); - OpenReacResult result = runOpenReac(network, "optimization/indicators/vsc-test", true); - - assertEquals(OpenReacStatus.OK, result.getStatus()); - assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_vsc_converter_in_data_file"))); - // verify only vsc in main cc is optimized - assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_vsc_converter_up_and_running"))); - } - - @Test - void testLccIndicators() throws IOException { - Network network = HvdcNetworkFactory.createLcc(); - // FIXME : should not depend on P/Q values on terminal - network.getLccConverterStation("cs2").getTerminal().setP(2).setQ(1); - OpenReacResult result = runOpenReac(network, "optimization/indicators/lcc-test", true); - - assertEquals(OpenReacStatus.OK, result.getStatus()); - assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_lcc_converter_in_data_file"))); - // verify only lcc in main cc is considered in optimization - assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_lcc_converter_up_and_running"))); - } - - @Test - void testShuntsIndicators() throws IOException { - Network network = OpenReacOptimizationAndLoadFlowTest.create(); - // add one shunt that will be fixed in optimization - network.getVoltageLevel("vl3").newShuntCompensator() - .setId("SHUNT2") - .setBus("b3") - .setConnectableBus("b3") - .setSectionCount(0) - .setVoltageRegulatorOn(true) - .setTargetV(393) - .setTargetDeadband(5.0) - .newLinearModel() - .setMaximumSectionCount(25) - .setBPerSection(1e-3) - .add() - .add(); - // add one shunt that will not be considered in optimization, as it is neither optimized nor connected - network.getVoltageLevel("vl3").newShuntCompensator() - .setId("SHUNT3") - // .setBus("b3") - .setConnectableBus("b3") - .setSectionCount(0) - .setVoltageRegulatorOn(true) - .setTargetV(393) - .setTargetDeadband(5.0) - .newLinearModel() - .setMaximumSectionCount(25) - .setBPerSection(1e-3) - .add() - .add(); - OpenReacParameters parameters = new OpenReacParameters(); - parameters.addVariableShuntCompensators(List.of("SHUNT")); - OpenReacResult result = runOpenReac(network, "optimization/indicators/shunt-test", parameters, true); - - assertEquals(OpenReacStatus.OK, result.getStatus()); - assertEquals(3, Integer.parseInt(result.getIndicators().get("nb_shunt_in_data_file"))); - assertEquals(3, Integer.parseInt(result.getIndicators().get("nb_shunt_connectable_or_in_AC_CC"))); - // verify disconnected shunt, and not optimized, is not considered in shunts with fixed values - assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_shunt_with_fixed_value"))); - // verify only one shunt has been optimized (even if it was disconnected) - assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_shunt_with_variable_value"))); - } - - @Test - void testSvcIndicators() throws IOException { - Network network = VoltageControlNetworkFactory.createWithStaticVarCompensator(); - network.getVoltageLevel("vl2").newStaticVarCompensator() - .setId("svc2") - .setConnectableBus("b2") - .setBus("b2") - .setRegulationMode(StaticVarCompensator.RegulationMode.VOLTAGE) - .setVoltageSetpoint(400) - .setBmin(-0.008) - .setBmax(0.008) - .add(); - OpenReacResult result = runOpenReac(network, "optimization/indicators/svc-test", true); - - assertEquals(OpenReacStatus.OK, result.getStatus()); - assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_svc_in_data_file"))); - assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_svc_in_AC_CC"))); - // verify only one svc is regulating - assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_svc_up_and_operating"))); - } - - @Test - void testBatteryIndicators() throws IOException { - Network network = VoltageControlNetworkFactory.createWithGeneratorRemoteControl(); - network.getVoltageLevel("vl4") - .newBattery() - .setId("bat1") - .setMinP(-10) - .setMaxP(10) - .setTargetP(2) - .setBus("b4") - .setConnectableBus("b4") - .setTargetQ(0) - .add(); - network.getVoltageLevel("vl1") - .newBattery() - .setId("bat2") - .setMinP(-9) - .setMaxP(11) - .setTargetP(1) - .setBus("b1") - .setConnectableBus("b1") - .setTargetQ(0.2) - .add(); - OpenReacResult result = runOpenReac(network, "optimization/indicators/battery-test", true); - - assertEquals(OpenReacStatus.OK, result.getStatus()); - assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_batteries"))); - // verify the sum of max and min active power of the batteries - assertEquals(21, Double.parseDouble(result.getIndicators().get("sum_batteries_pmax"))); - assertEquals(-19, Double.parseDouble(result.getIndicators().get("sum_batteries_pmin"))); - } - -} diff --git a/open-reac/src/test/resources/optimization/bounds/generators-pmax-too-small/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generators-pmax-too-small/reactiveopf_results_indic.txt deleted file mode 100644 index edad4c5b..00000000 --- a/open-reac/src/test/resources/optimization/bounds/generators-pmax-too-small/reactiveopf_results_indic.txt +++ /dev/null @@ -1,94 +0,0 @@ -final_status NOK -dcopf_status OK - -ctime_start 'Wed Dec 04 18:39:06 2024' -last_solve_result_num 200 -nb_iter_last 67 -nb_iter_total 67 -_ampl_elapsed_time 0.140000 -_total_solve_time 0.046875 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_16806244976153640704' - -log_level_ampl INFO -log_level_knitro 2 -objective_choice 0 -ratio_voltage_target 0.500000 -coeff_alpha 1.000000 -Pnull 0.010000 -Znull 0.000100 -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 ALL -PQmax 9000.000000 -defaultPmax 1000.000000 -defaultPmin 0.000000 -defaultQmaxPmaxRatio 0.300000 -defaultQmin -300.000000 -defaultQmax 300.000000 -minimalQPrange 1.000000 -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 5 -nb_bus_in_data_file 5 -nb_bus_in_ACDC_CC 4 -nb_bus_in_AC_CC 4 -nb_bus_in_ACDC_but_out_AC_CC 0 -nb_bus_with_voltage_value 0 -nb_bus_with_reactive_slacks 4 -nb_bus_without_reactive_slacks 0 -nb_branch_in_data_file 4 -nb_branch_in_AC_CC 3 -nb_branch_with_nonsmall_impedance 3 -nb_branch_with_zero_or_small_impedance 0 -nb_unit_in_data_file 3 -nb_unit_in_AC_CC 2 -nb_unit_up_and_running 2 -nb_unit_with_variable_reactive_power 2 -nb_unit_with_fixed_reactive_power 0 -nb_load_in_data_file 2 -nb_load_in_AC_CC 1 -nb_shunt_in_data_file 0 -nb_shunt_connectable_or_in_AC_CC 0 -nb_shunt_with_fixed_value 0 -nb_shunt_with_variable_value 0 -nb_transformers_with_variable_ratio 0 -nb_transformers_with_fixed_ratio 0 -nb_svc_in_data_file 0 -nb_svc_in_AC_CC 0 -nb_svc_up_and_operating 0 -nb_vsc_converter_in_data_file 0 -nb_vsc_converter_up_and_running 0 -nb_lcc_converter_in_data_file 0 -nb_lcc_converter_up_and_running 0 -nb_batteries 0 -sum_batteries_pmax 0.0 -sum_batteries_pmin 0.0 - -max_teta_dc 0.02 -max_teta_ac 0.01 -teta_max 3.02 -min_teta_dc -0.05 -min_teta_ac -0.03 -teta_min -3.05 -max_delta_teta_dc 0.050000 -max_delta_teta_ac 0.030638 -min_delta_teta_dc -0.025000 -min_delta_teta_ac -0.014361 - -nb_reactive_slacks 4 -nb_slacks_condensator 4 -sum_slacks_condensator 2.6 -nb_slacks_self 4 -sum_slacks_self 2.5 -messageInfo1 'Acopf optimization was ***not*** successfull - Convergence to an infeasible solution' diff --git a/open-reac/src/test/resources/optimization/bounds/generators-pmax/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generators-pmax/reactiveopf_results_indic.txt deleted file mode 100644 index aefdeae1..00000000 --- a/open-reac/src/test/resources/optimization/bounds/generators-pmax/reactiveopf_results_indic.txt +++ /dev/null @@ -1,93 +0,0 @@ -final_status OK -dcopf_status OK - -ctime_start 'Wed Dec 04 18:39:06 2024' -last_solve_result_num 0 -nb_iter_last 7 -nb_iter_total 7 -_ampl_elapsed_time 0.139000 -_total_solve_time 0.031250 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_7246203715336309657' - -log_level_ampl INFO -log_level_knitro 2 -objective_choice 0 -ratio_voltage_target 0.500000 -coeff_alpha 1.000000 -Pnull 0.010000 -Znull 0.000100 -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 ALL -PQmax 9000.000000 -defaultPmax 1000.000000 -defaultPmin 0.000000 -defaultQmaxPmaxRatio 0.300000 -defaultQmin -300.000000 -defaultQmax 300.000000 -minimalQPrange 1.000000 -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 5 -nb_bus_in_data_file 5 -nb_bus_in_ACDC_CC 4 -nb_bus_in_AC_CC 4 -nb_bus_in_ACDC_but_out_AC_CC 0 -nb_bus_with_voltage_value 0 -nb_bus_with_reactive_slacks 4 -nb_bus_without_reactive_slacks 0 -nb_branch_in_data_file 4 -nb_branch_in_AC_CC 3 -nb_branch_with_nonsmall_impedance 3 -nb_branch_with_zero_or_small_impedance 0 -nb_unit_in_data_file 3 -nb_unit_in_AC_CC 2 -nb_unit_up_and_running 2 -nb_unit_with_variable_reactive_power 2 -nb_unit_with_fixed_reactive_power 0 -nb_load_in_data_file 2 -nb_load_in_AC_CC 1 -nb_shunt_in_data_file 0 -nb_shunt_connectable_or_in_AC_CC 0 -nb_shunt_with_fixed_value 0 -nb_shunt_with_variable_value 0 -nb_transformers_with_variable_ratio 0 -nb_transformers_with_fixed_ratio 0 -nb_svc_in_data_file 0 -nb_svc_in_AC_CC 0 -nb_svc_up_and_operating 0 -nb_vsc_converter_in_data_file 0 -nb_vsc_converter_up_and_running 0 -nb_lcc_converter_in_data_file 0 -nb_lcc_converter_up_and_running 0 -nb_batteries 0 -sum_batteries_pmax 0.0 -sum_batteries_pmin 0.0 - -max_teta_dc 0.02 -max_teta_ac 0.03 -teta_max 3.02 -min_teta_dc -0.05 -min_teta_ac -0.05 -teta_min -3.05 -max_delta_teta_dc 0.050000 -max_delta_teta_ac 0.051670 -min_delta_teta_dc -0.025000 -min_delta_teta_ac -0.025352 - -nb_reactive_slacks 0 -nb_slacks_condensator 0 -sum_slacks_condensator 0.0 -nb_slacks_self 0 -sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/bounds/generators-pmin-too-high/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generators-pmin-too-high/reactiveopf_results_indic.txt deleted file mode 100644 index b213826c..00000000 --- a/open-reac/src/test/resources/optimization/bounds/generators-pmin-too-high/reactiveopf_results_indic.txt +++ /dev/null @@ -1,94 +0,0 @@ -final_status NOK -dcopf_status OK - -ctime_start 'Wed Dec 04 18:39:05 2024' -last_solve_result_num 200 -nb_iter_last 60 -nb_iter_total 60 -_ampl_elapsed_time 0.155000 -_total_solve_time 0.046875 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_14708682651458660614' - -log_level_ampl INFO -log_level_knitro 2 -objective_choice 0 -ratio_voltage_target 0.500000 -coeff_alpha 1.000000 -Pnull 0.010000 -Znull 0.000100 -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 ALL -PQmax 9000.000000 -defaultPmax 1000.000000 -defaultPmin 0.000000 -defaultQmaxPmaxRatio 0.300000 -defaultQmin -300.000000 -defaultQmax 300.000000 -minimalQPrange 1.000000 -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 5 -nb_bus_in_data_file 5 -nb_bus_in_ACDC_CC 4 -nb_bus_in_AC_CC 4 -nb_bus_in_ACDC_but_out_AC_CC 0 -nb_bus_with_voltage_value 0 -nb_bus_with_reactive_slacks 4 -nb_bus_without_reactive_slacks 0 -nb_branch_in_data_file 4 -nb_branch_in_AC_CC 3 -nb_branch_with_nonsmall_impedance 3 -nb_branch_with_zero_or_small_impedance 0 -nb_unit_in_data_file 3 -nb_unit_in_AC_CC 2 -nb_unit_up_and_running 2 -nb_unit_with_variable_reactive_power 2 -nb_unit_with_fixed_reactive_power 0 -nb_load_in_data_file 2 -nb_load_in_AC_CC 1 -nb_shunt_in_data_file 0 -nb_shunt_connectable_or_in_AC_CC 0 -nb_shunt_with_fixed_value 0 -nb_shunt_with_variable_value 0 -nb_transformers_with_variable_ratio 0 -nb_transformers_with_fixed_ratio 0 -nb_svc_in_data_file 0 -nb_svc_in_AC_CC 0 -nb_svc_up_and_operating 0 -nb_vsc_converter_in_data_file 0 -nb_vsc_converter_up_and_running 0 -nb_lcc_converter_in_data_file 0 -nb_lcc_converter_up_and_running 0 -nb_batteries 0 -sum_batteries_pmax 0.0 -sum_batteries_pmin 0.0 - -max_teta_dc 0.01 -max_teta_ac 0.02 -teta_max 3.01 -min_teta_dc -0.03 -min_teta_ac -0.04 -teta_min -3.03 -max_delta_teta_dc 0.030000 -max_delta_teta_ac 0.035331 -min_delta_teta_dc -0.015000 -min_delta_teta_ac -0.018693 - -nb_reactive_slacks 4 -nb_slacks_condensator 4 -sum_slacks_condensator 1.3 -nb_slacks_self 4 -sum_slacks_self 1.2 -messageInfo1 'Acopf optimization was ***not*** successfull - Convergence to an infeasible solution' diff --git a/open-reac/src/test/resources/optimization/bounds/generators-pmin/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generators-pmin/reactiveopf_results_indic.txt deleted file mode 100644 index b3a69be6..00000000 --- a/open-reac/src/test/resources/optimization/bounds/generators-pmin/reactiveopf_results_indic.txt +++ /dev/null @@ -1,93 +0,0 @@ -final_status OK -dcopf_status OK - -ctime_start 'Wed Dec 04 18:39:05 2024' -last_solve_result_num 0 -nb_iter_last 7 -nb_iter_total 7 -_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_5930746422974926450' - -log_level_ampl INFO -log_level_knitro 2 -objective_choice 0 -ratio_voltage_target 0.500000 -coeff_alpha 1.000000 -Pnull 0.010000 -Znull 0.000100 -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 ALL -PQmax 9000.000000 -defaultPmax 1000.000000 -defaultPmin 0.000000 -defaultQmaxPmaxRatio 0.300000 -defaultQmin -300.000000 -defaultQmax 300.000000 -minimalQPrange 1.000000 -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 5 -nb_bus_in_data_file 5 -nb_bus_in_ACDC_CC 4 -nb_bus_in_AC_CC 4 -nb_bus_in_ACDC_but_out_AC_CC 0 -nb_bus_with_voltage_value 0 -nb_bus_with_reactive_slacks 4 -nb_bus_without_reactive_slacks 0 -nb_branch_in_data_file 4 -nb_branch_in_AC_CC 3 -nb_branch_with_nonsmall_impedance 3 -nb_branch_with_zero_or_small_impedance 0 -nb_unit_in_data_file 3 -nb_unit_in_AC_CC 2 -nb_unit_up_and_running 2 -nb_unit_with_variable_reactive_power 2 -nb_unit_with_fixed_reactive_power 0 -nb_load_in_data_file 2 -nb_load_in_AC_CC 1 -nb_shunt_in_data_file 0 -nb_shunt_connectable_or_in_AC_CC 0 -nb_shunt_with_fixed_value 0 -nb_shunt_with_variable_value 0 -nb_transformers_with_variable_ratio 0 -nb_transformers_with_fixed_ratio 0 -nb_svc_in_data_file 0 -nb_svc_in_AC_CC 0 -nb_svc_up_and_operating 0 -nb_vsc_converter_in_data_file 0 -nb_vsc_converter_up_and_running 0 -nb_lcc_converter_in_data_file 0 -nb_lcc_converter_up_and_running 0 -nb_batteries 0 -sum_batteries_pmax 0.0 -sum_batteries_pmin 0.0 - -max_teta_dc 0.01 -max_teta_ac 0.03 -teta_max 3.01 -min_teta_dc -0.03 -min_teta_ac -0.05 -teta_min -3.03 -max_delta_teta_dc 0.030000 -max_delta_teta_ac 0.054735 -min_delta_teta_dc -0.015000 -min_delta_teta_ac -0.026527 - -nb_reactive_slacks 0 -nb_slacks_condensator 0 -sum_slacks_condensator 0.0 -nb_slacks_self 0 -sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/bounds/generators-target-p-too-close-pmax/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generators-target-p-too-close-pmax/reactiveopf_results_indic.txt deleted file mode 100644 index edce49c4..00000000 --- a/open-reac/src/test/resources/optimization/bounds/generators-target-p-too-close-pmax/reactiveopf_results_indic.txt +++ /dev/null @@ -1,94 +0,0 @@ -final_status NOK -dcopf_status OK - -ctime_start 'Wed Dec 04 18:39:05 2024' -last_solve_result_num 200 -nb_iter_last 60 -nb_iter_total 60 -_ampl_elapsed_time 0.109000 -_total_solve_time 0.046875 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_3318717096223947573' - -log_level_ampl INFO -log_level_knitro 2 -objective_choice 0 -ratio_voltage_target 0.500000 -coeff_alpha 1.000000 -Pnull 0.010000 -Znull 0.000100 -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 ALL -PQmax 9000.000000 -defaultPmax 1000.000000 -defaultPmin 0.000000 -defaultQmaxPmaxRatio 0.300000 -defaultQmin -300.000000 -defaultQmax 300.000000 -minimalQPrange 1.000000 -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 5 -nb_bus_in_data_file 5 -nb_bus_in_ACDC_CC 4 -nb_bus_in_AC_CC 4 -nb_bus_in_ACDC_but_out_AC_CC 0 -nb_bus_with_voltage_value 0 -nb_bus_with_reactive_slacks 4 -nb_bus_without_reactive_slacks 0 -nb_branch_in_data_file 4 -nb_branch_in_AC_CC 3 -nb_branch_with_nonsmall_impedance 3 -nb_branch_with_zero_or_small_impedance 0 -nb_unit_in_data_file 3 -nb_unit_in_AC_CC 2 -nb_unit_up_and_running 2 -nb_unit_with_variable_reactive_power 2 -nb_unit_with_fixed_reactive_power 0 -nb_load_in_data_file 2 -nb_load_in_AC_CC 1 -nb_shunt_in_data_file 0 -nb_shunt_connectable_or_in_AC_CC 0 -nb_shunt_with_fixed_value 0 -nb_shunt_with_variable_value 0 -nb_transformers_with_variable_ratio 0 -nb_transformers_with_fixed_ratio 0 -nb_svc_in_data_file 0 -nb_svc_in_AC_CC 0 -nb_svc_up_and_operating 0 -nb_vsc_converter_in_data_file 0 -nb_vsc_converter_up_and_running 0 -nb_lcc_converter_in_data_file 0 -nb_lcc_converter_up_and_running 0 -nb_batteries 0 -sum_batteries_pmax 0.0 -sum_batteries_pmin 0.0 - -max_teta_dc 0.01 -max_teta_ac 0.02 -teta_max 3.01 -min_teta_dc -0.03 -min_teta_ac -0.04 -teta_min -3.03 -max_delta_teta_dc 0.030000 -max_delta_teta_ac 0.035331 -min_delta_teta_dc -0.015000 -min_delta_teta_ac -0.018693 - -nb_reactive_slacks 4 -nb_slacks_condensator 4 -sum_slacks_condensator 1.3 -nb_slacks_self 4 -sum_slacks_self 1.2 -messageInfo1 'Acopf optimization was ***not*** successfull - Convergence to an infeasible solution' diff --git a/open-reac/src/test/resources/optimization/indicators/battery-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/battery-test/reactiveopf_results_indic.txt deleted file mode 100644 index 2f49c9cc..00000000 --- a/open-reac/src/test/resources/optimization/indicators/battery-test/reactiveopf_results_indic.txt +++ /dev/null @@ -1,93 +0,0 @@ -final_status OK -dcopf_status OK - -ctime_start 'Wed Dec 04 17:57:29 2024' -last_solve_result_num 0 -nb_iter_last 10 -nb_iter_total 10 -_ampl_elapsed_time 0.109000 -_total_solve_time 0.046875 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_8792994315745054563' - -log_level_ampl INFO -log_level_knitro 2 -objective_choice 0 -ratio_voltage_target 0.500000 -coeff_alpha 1.000000 -Pnull 0.010000 -Znull 0.000100 -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 ALL -PQmax 9000.000000 -defaultPmax 1000.000000 -defaultPmin 0.000000 -defaultQmaxPmaxRatio 0.300000 -defaultQmin -300.000000 -defaultQmax 300.000000 -minimalQPrange 1.000000 -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 4 -nb_bus_in_data_file 4 -nb_bus_in_ACDC_CC 4 -nb_bus_in_AC_CC 4 -nb_bus_in_ACDC_but_out_AC_CC 0 -nb_bus_with_voltage_value 0 -nb_bus_with_reactive_slacks 4 -nb_bus_without_reactive_slacks 0 -nb_branch_in_data_file 3 -nb_branch_in_AC_CC 3 -nb_branch_with_nonsmall_impedance 3 -nb_branch_with_zero_or_small_impedance 0 -nb_unit_in_data_file 3 -nb_unit_in_AC_CC 3 -nb_unit_up_and_running 3 -nb_unit_with_variable_reactive_power 3 -nb_unit_with_fixed_reactive_power 0 -nb_load_in_data_file 1 -nb_load_in_AC_CC 1 -nb_shunt_in_data_file 0 -nb_shunt_connectable_or_in_AC_CC 0 -nb_shunt_with_fixed_value 0 -nb_shunt_with_variable_value 0 -nb_transformers_with_variable_ratio 0 -nb_transformers_with_fixed_ratio 0 -nb_svc_in_data_file 0 -nb_svc_in_AC_CC 0 -nb_svc_up_and_operating 0 -nb_vsc_converter_in_data_file 0 -nb_vsc_converter_up_and_running 0 -nb_lcc_converter_in_data_file 0 -nb_lcc_converter_up_and_running 0 -nb_batteries 2 -sum_batteries_pmax 21.0 -sum_batteries_pmin -19.0 - -max_teta_dc 0.03 -max_teta_ac 0.02 -teta_max 3.03 -min_teta_dc 0.00 -min_teta_ac 0.00 -teta_min -3.00 -max_delta_teta_dc 0.030896 -max_delta_teta_ac 0.015495 -min_delta_teta_dc 0.018725 -min_delta_teta_ac 0.009609 - -nb_reactive_slacks 1 -nb_slacks_condensator 1 -sum_slacks_condensator 25.4 -nb_slacks_self 0 -sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/branches-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/branches-test/reactiveopf_results_indic.txt deleted file mode 100644 index 93f59eb1..00000000 --- a/open-reac/src/test/resources/optimization/indicators/branches-test/reactiveopf_results_indic.txt +++ /dev/null @@ -1,93 +0,0 @@ -final_status OK -dcopf_status OK - -ctime_start 'Wed Dec 04 17:57:29 2024' -last_solve_result_num 0 -nb_iter_last 8 -nb_iter_total 8 -_ampl_elapsed_time 0.141000 -_total_solve_time 0.015625 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_16228844043131338938' - -log_level_ampl INFO -log_level_knitro 2 -objective_choice 0 -ratio_voltage_target 0.500000 -coeff_alpha 1.000000 -Pnull 0.010000 -Znull 0.000100 -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 ALL -PQmax 9000.000000 -defaultPmax 1000.000000 -defaultPmin 0.000000 -defaultQmaxPmaxRatio 0.300000 -defaultQmin -300.000000 -defaultQmax 300.000000 -minimalQPrange 1.000000 -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 4 -nb_bus_in_data_file 4 -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 3 -nb_bus_without_reactive_slacks 0 -nb_branch_in_data_file 4 -nb_branch_in_AC_CC 2 -nb_branch_with_nonsmall_impedance 1 -nb_branch_with_zero_or_small_impedance 1 -nb_unit_in_data_file 3 -nb_unit_in_AC_CC 2 -nb_unit_up_and_running 2 -nb_unit_with_variable_reactive_power 2 -nb_unit_with_fixed_reactive_power 0 -nb_load_in_data_file 2 -nb_load_in_AC_CC 2 -nb_shunt_in_data_file 0 -nb_shunt_connectable_or_in_AC_CC 0 -nb_shunt_with_fixed_value 0 -nb_shunt_with_variable_value 0 -nb_transformers_with_variable_ratio 0 -nb_transformers_with_fixed_ratio 0 -nb_svc_in_data_file 0 -nb_svc_in_AC_CC 0 -nb_svc_up_and_operating 0 -nb_vsc_converter_in_data_file 0 -nb_vsc_converter_up_and_running 0 -nb_lcc_converter_in_data_file 0 -nb_lcc_converter_up_and_running 0 -nb_batteries 0 -sum_batteries_pmax 0.0 -sum_batteries_pmin 0.0 - -max_teta_dc 0.03 -max_teta_ac 0.01 -teta_max 3.03 -min_teta_dc -0.00 -min_teta_ac -0.00 -teta_min -3.00 -max_delta_teta_dc 0.030000 -max_delta_teta_ac 0.013386 -min_delta_teta_dc 0.000001 -min_delta_teta_ac 0.000000 - -nb_reactive_slacks 2 -nb_slacks_condensator 2 -sum_slacks_condensator 0.2 -nb_slacks_self 0 -sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/bus-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/bus-test/reactiveopf_results_indic.txt deleted file mode 100644 index 4fc11e98..00000000 --- a/open-reac/src/test/resources/optimization/indicators/bus-test/reactiveopf_results_indic.txt +++ /dev/null @@ -1,93 +0,0 @@ -final_status OK -dcopf_status OK - -ctime_start 'Wed Dec 04 17:57:30 2024' -last_solve_result_num 0 -nb_iter_last 17 -nb_iter_total 17 -_ampl_elapsed_time 0.124000 -_total_solve_time 0.031250 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_4215184811660139075' - -log_level_ampl INFO -log_level_knitro 2 -objective_choice 0 -ratio_voltage_target 0.500000 -coeff_alpha 1.000000 -Pnull 0.010000 -Znull 0.000100 -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 ALL -PQmax 9000.000000 -defaultPmax 1000.000000 -defaultPmin 0.000000 -defaultQmaxPmaxRatio 0.300000 -defaultQmin -300.000000 -defaultQmax 300.000000 -minimalQPrange 1.000000 -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 16 -nb_bus_in_data_file 16 -nb_bus_in_ACDC_CC 16 -nb_bus_in_AC_CC 12 -nb_bus_in_ACDC_but_out_AC_CC 4 -nb_bus_with_voltage_value 1 -nb_bus_with_reactive_slacks 12 -nb_bus_without_reactive_slacks 0 -nb_branch_in_data_file 14 -nb_branch_in_AC_CC 11 -nb_branch_with_nonsmall_impedance 1 -nb_branch_with_zero_or_small_impedance 10 -nb_unit_in_data_file 3 -nb_unit_in_AC_CC 1 -nb_unit_up_and_running 1 -nb_unit_with_variable_reactive_power 1 -nb_unit_with_fixed_reactive_power 0 -nb_load_in_data_file 2 -nb_load_in_AC_CC 1 -nb_shunt_in_data_file 0 -nb_shunt_connectable_or_in_AC_CC 0 -nb_shunt_with_fixed_value 0 -nb_shunt_with_variable_value 0 -nb_transformers_with_variable_ratio 0 -nb_transformers_with_fixed_ratio 0 -nb_svc_in_data_file 0 -nb_svc_in_AC_CC 0 -nb_svc_up_and_operating 0 -nb_vsc_converter_in_data_file 0 -nb_vsc_converter_up_and_running 0 -nb_lcc_converter_in_data_file 2 -nb_lcc_converter_up_and_running 0 -nb_batteries 0 -sum_batteries_pmax 0.0 -sum_batteries_pmin 0.0 - -max_teta_dc 0.00 -max_teta_ac 0.00 -teta_max 3.00 -min_teta_dc -0.00 -min_teta_ac -0.00 -teta_min -3.00 -max_delta_teta_dc 0.000937 -max_delta_teta_ac 0.003363 -min_delta_teta_dc 0.000000 -min_delta_teta_ac -0.000000 - -nb_reactive_slacks 0 -nb_slacks_condensator 0 -sum_slacks_condensator 0.0 -nb_slacks_self 0 -sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/generators-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/generators-test/reactiveopf_results_indic.txt deleted file mode 100644 index c9c996ee..00000000 --- a/open-reac/src/test/resources/optimization/indicators/generators-test/reactiveopf_results_indic.txt +++ /dev/null @@ -1,93 +0,0 @@ -final_status OK -dcopf_status OK - -ctime_start 'Wed Dec 04 17:57:29 2024' -last_solve_result_num 0 -nb_iter_last 9 -nb_iter_total 9 -_ampl_elapsed_time 0.109000 -_total_solve_time 0.031250 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_4963164058041255301' - -log_level_ampl INFO -log_level_knitro 2 -objective_choice 0 -ratio_voltage_target 0.500000 -coeff_alpha 1.000000 -Pnull 0.010000 -Znull 0.000100 -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 ALL -PQmax 9000.000000 -defaultPmax 1000.000000 -defaultPmin 0.000000 -defaultQmaxPmaxRatio 0.300000 -defaultQmin -300.000000 -defaultQmax 300.000000 -minimalQPrange 1.000000 -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 4 -nb_bus_in_data_file 4 -nb_bus_in_ACDC_CC 4 -nb_bus_in_AC_CC 4 -nb_bus_in_ACDC_but_out_AC_CC 0 -nb_bus_with_voltage_value 0 -nb_bus_with_reactive_slacks 4 -nb_bus_without_reactive_slacks 0 -nb_branch_in_data_file 3 -nb_branch_in_AC_CC 3 -nb_branch_with_nonsmall_impedance 3 -nb_branch_with_zero_or_small_impedance 0 -nb_unit_in_data_file 3 -nb_unit_in_AC_CC 3 -nb_unit_up_and_running 3 -nb_unit_with_variable_reactive_power 2 -nb_unit_with_fixed_reactive_power 1 -nb_load_in_data_file 1 -nb_load_in_AC_CC 1 -nb_shunt_in_data_file 0 -nb_shunt_connectable_or_in_AC_CC 0 -nb_shunt_with_fixed_value 0 -nb_shunt_with_variable_value 0 -nb_transformers_with_variable_ratio 0 -nb_transformers_with_fixed_ratio 0 -nb_svc_in_data_file 0 -nb_svc_in_AC_CC 0 -nb_svc_up_and_operating 0 -nb_vsc_converter_in_data_file 0 -nb_vsc_converter_up_and_running 0 -nb_lcc_converter_in_data_file 0 -nb_lcc_converter_up_and_running 0 -nb_batteries 0 -sum_batteries_pmax 0.0 -sum_batteries_pmin 0.0 - -max_teta_dc 0.03 -max_teta_ac 0.02 -teta_max 3.03 -min_teta_dc 0.00 -min_teta_ac 0.00 -teta_min -3.00 -max_delta_teta_dc 0.031208 -max_delta_teta_ac 0.015617 -min_delta_teta_dc 0.018725 -min_delta_teta_ac 0.009685 - -nb_reactive_slacks 1 -nb_slacks_condensator 1 -sum_slacks_condensator 35.9 -nb_slacks_self 0 -sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/input-parameters-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/input-parameters-test/reactiveopf_results_indic.txt deleted file mode 100644 index e7bb228a..00000000 --- a/open-reac/src/test/resources/optimization/indicators/input-parameters-test/reactiveopf_results_indic.txt +++ /dev/null @@ -1,93 +0,0 @@ -final_status OK -dcopf_status OK - -ctime_start 'Wed Dec 04 17:57:28 2024' -last_solve_result_num 0 -nb_iter_last 7 -nb_iter_total 7 -_ampl_elapsed_time 0.140000 -_total_solve_time 0.031250 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_10158983132520924590' - -log_level_ampl WARNING -log_level_knitro 1 -objective_choice 2 -ratio_voltage_target 0.700000 -coeff_alpha 0.999000 -Pnull 0.020000 -Znull 0.000010 -epsilon_nominal_voltage 0.750000 -min_plausible_low_voltage_limit 0.655000 -max_plausible_high_voltage_limit 1.425000 -ignore_voltage_bounds 0.850000 -buses_with_reactive_slacks NO_GENERATION -PQmax 4001.000000 -defaultPmax 1001.000000 -defaultPmin 0.100000 -defaultQmaxPmaxRatio 0.200000 -defaultQmin -200.200000 -defaultQmax 200.200000 -minimalQPrange 2.000000 -default_variable_scaling_factor 1.001000 -default_constraint_scaling_factor 0.999000 -reactive_slack_variable_scaling_factor 0.010000 -transformer_ratio_variable_scaling_factor 0.002000 -shunt_variable_scaling_factor 0.110000 - -nb_substations 42 -nb_bus_in_data_file 57 -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_branch_in_data_file 80 -nb_branch_in_AC_CC 80 -nb_branch_with_nonsmall_impedance 80 -nb_branch_with_zero_or_small_impedance 0 -nb_unit_in_data_file 7 -nb_unit_in_AC_CC 7 -nb_unit_up_and_running 4 -nb_unit_with_variable_reactive_power 4 -nb_unit_with_fixed_reactive_power 0 -nb_load_in_data_file 42 -nb_load_in_AC_CC 42 -nb_shunt_in_data_file 3 -nb_shunt_connectable_or_in_AC_CC 3 -nb_shunt_with_fixed_value 3 -nb_shunt_with_variable_value 0 -nb_transformers_with_variable_ratio 0 -nb_transformers_with_fixed_ratio 0 -nb_svc_in_data_file 0 -nb_svc_in_AC_CC 0 -nb_svc_up_and_operating 0 -nb_vsc_converter_in_data_file 0 -nb_vsc_converter_up_and_running 0 -nb_lcc_converter_in_data_file 0 -nb_lcc_converter_up_and_running 0 -nb_batteries 0 -sum_batteries_pmax 0.0 -sum_batteries_pmin 0.0 - -max_teta_dc 0.21 -max_teta_ac 0.13 -teta_max 3.21 -min_teta_dc -0.17 -min_teta_ac -0.17 -teta_min -3.17 -max_delta_teta_dc 0.146072 -max_delta_teta_ac 0.105543 -min_delta_teta_dc -0.144911 -min_delta_teta_ac -0.088988 - -nb_reactive_slacks 0 -nb_slacks_condensator 0 -sum_slacks_condensator 0.0 -nb_slacks_self 0 -sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/lcc-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/lcc-test/reactiveopf_results_indic.txt deleted file mode 100644 index 04782c22..00000000 --- a/open-reac/src/test/resources/optimization/indicators/lcc-test/reactiveopf_results_indic.txt +++ /dev/null @@ -1,93 +0,0 @@ -final_status OK -dcopf_status OK - -ctime_start 'Wed Dec 04 17:57:27 2024' -last_solve_result_num 0 -nb_iter_last 6 -nb_iter_total 6 -_ampl_elapsed_time 0.173000 -_total_solve_time 0.078125 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_1900278357647775261' - -log_level_ampl INFO -log_level_knitro 2 -objective_choice 0 -ratio_voltage_target 0.500000 -coeff_alpha 1.000000 -Pnull 0.010000 -Znull 0.000100 -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 ALL -PQmax 9000.000000 -defaultPmax 1000.000000 -defaultPmin 0.000000 -defaultQmaxPmaxRatio 0.300000 -defaultQmin -300.000000 -defaultQmax 300.000000 -minimalQPrange 1.000000 -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 -nb_bus_in_ACDC_CC 3 -nb_bus_in_AC_CC 2 -nb_bus_in_ACDC_but_out_AC_CC 1 -nb_bus_with_voltage_value 0 -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 -nb_branch_with_zero_or_small_impedance 0 -nb_unit_in_data_file 2 -nb_unit_in_AC_CC 1 -nb_unit_up_and_running 1 -nb_unit_with_variable_reactive_power 1 -nb_unit_with_fixed_reactive_power 0 -nb_load_in_data_file 2 -nb_load_in_AC_CC 1 -nb_shunt_in_data_file 0 -nb_shunt_connectable_or_in_AC_CC 0 -nb_shunt_with_fixed_value 0 -nb_shunt_with_variable_value 0 -nb_transformers_with_variable_ratio 0 -nb_transformers_with_fixed_ratio 0 -nb_svc_in_data_file 0 -nb_svc_in_AC_CC 0 -nb_svc_up_and_operating 0 -nb_vsc_converter_in_data_file 0 -nb_vsc_converter_up_and_running 0 -nb_lcc_converter_in_data_file 2 -nb_lcc_converter_up_and_running 1 -nb_batteries 0 -sum_batteries_pmax 0.0 -sum_batteries_pmin 0.0 - -max_teta_dc 0.00 -max_teta_ac 0.00 -teta_max 3.00 -min_teta_dc 0.00 -min_teta_ac 0.00 -teta_min -3.00 -max_delta_teta_dc 0.000975 -max_delta_teta_ac 0.001211 -min_delta_teta_dc 0.000975 -min_delta_teta_ac 0.001211 - -nb_reactive_slacks 0 -nb_slacks_condensator 0 -sum_slacks_condensator 0.0 -nb_slacks_self 0 -sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/shunt-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/shunt-test/reactiveopf_results_indic.txt deleted file mode 100644 index 611ec18f..00000000 --- a/open-reac/src/test/resources/optimization/indicators/shunt-test/reactiveopf_results_indic.txt +++ /dev/null @@ -1,93 +0,0 @@ -final_status OK -dcopf_status OK - -ctime_start 'Wed Dec 04 18:32:41 2024' -last_solve_result_num 0 -nb_iter_last 35 -nb_iter_total 35 -_ampl_elapsed_time 0.108000 -_total_solve_time 0.031250 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_15990639329670156176' - -log_level_ampl INFO -log_level_knitro 2 -objective_choice 0 -ratio_voltage_target 0.500000 -coeff_alpha 1.000000 -Pnull 0.010000 -Znull 0.000100 -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 ALL -PQmax 9000.000000 -defaultPmax 1000.000000 -defaultPmin 0.000000 -defaultQmaxPmaxRatio 0.300000 -defaultQmin -300.000000 -defaultQmax 300.000000 -minimalQPrange 1.000000 -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 -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 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 -nb_branch_with_zero_or_small_impedance 0 -nb_unit_in_data_file 1 -nb_unit_in_AC_CC 1 -nb_unit_up_and_running 1 -nb_unit_with_variable_reactive_power 1 -nb_unit_with_fixed_reactive_power 0 -nb_load_in_data_file 1 -nb_load_in_AC_CC 1 -nb_shunt_in_data_file 3 -nb_shunt_connectable_or_in_AC_CC 3 -nb_shunt_with_fixed_value 1 -nb_shunt_with_variable_value 1 -nb_transformers_with_variable_ratio 0 -nb_transformers_with_fixed_ratio 0 -nb_svc_in_data_file 0 -nb_svc_in_AC_CC 0 -nb_svc_up_and_operating 0 -nb_vsc_converter_in_data_file 0 -nb_vsc_converter_up_and_running 0 -nb_lcc_converter_in_data_file 0 -nb_lcc_converter_up_and_running 0 -nb_batteries 0 -sum_batteries_pmax 0.0 -sum_batteries_pmin 0.0 - -max_teta_dc 0.00 -max_teta_ac 0.00 -teta_max 3.00 -min_teta_dc 0.00 -min_teta_ac -0.00 -teta_min -3.00 -max_delta_teta_dc 0.001894 -max_delta_teta_ac 0.001642 -min_delta_teta_dc 0.000000 -min_delta_teta_ac -0.000773 - -nb_reactive_slacks 0 -nb_slacks_condensator 0 -sum_slacks_condensator 0.0 -nb_slacks_self 0 -sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/svc-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/svc-test/reactiveopf_results_indic.txt deleted file mode 100644 index 6c681c4e..00000000 --- a/open-reac/src/test/resources/optimization/indicators/svc-test/reactiveopf_results_indic.txt +++ /dev/null @@ -1,93 +0,0 @@ -final_status OK -dcopf_status OK - -ctime_start 'Wed Dec 04 17:57:28 2024' -last_solve_result_num 0 -nb_iter_last 4 -nb_iter_total 4 -_ampl_elapsed_time 0.125000 -_total_solve_time 0.062500 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_2452729350162475477' - -log_level_ampl INFO -log_level_knitro 2 -objective_choice 0 -ratio_voltage_target 0.500000 -coeff_alpha 1.000000 -Pnull 0.010000 -Znull 0.000100 -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 ALL -PQmax 9000.000000 -defaultPmax 1000.000000 -defaultPmin 0.000000 -defaultQmaxPmaxRatio 0.300000 -defaultQmin -300.000000 -defaultQmax 300.000000 -minimalQPrange 1.000000 -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 -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 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 -nb_branch_with_zero_or_small_impedance 0 -nb_unit_in_data_file 1 -nb_unit_in_AC_CC 1 -nb_unit_up_and_running 1 -nb_unit_with_variable_reactive_power 1 -nb_unit_with_fixed_reactive_power 0 -nb_load_in_data_file 1 -nb_load_in_AC_CC 1 -nb_shunt_in_data_file 0 -nb_shunt_connectable_or_in_AC_CC 0 -nb_shunt_with_fixed_value 0 -nb_shunt_with_variable_value 0 -nb_transformers_with_variable_ratio 0 -nb_transformers_with_fixed_ratio 0 -nb_svc_in_data_file 2 -nb_svc_in_AC_CC 2 -nb_svc_up_and_operating 1 -nb_vsc_converter_in_data_file 0 -nb_vsc_converter_up_and_running 0 -nb_lcc_converter_in_data_file 0 -nb_lcc_converter_up_and_running 0 -nb_batteries 0 -sum_batteries_pmax 0.0 -sum_batteries_pmin 0.0 - -max_teta_dc 0.00 -max_teta_ac 0.00 -teta_max 3.00 -min_teta_dc 0.00 -min_teta_ac 0.00 -teta_min -3.00 -max_delta_teta_dc 0.001894 -max_delta_teta_ac 0.001258 -min_delta_teta_dc 0.001894 -min_delta_teta_ac 0.001258 - -nb_reactive_slacks 0 -nb_slacks_condensator 0 -sum_slacks_condensator 0.0 -nb_slacks_self 0 -sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/transfo-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/transfo-test/reactiveopf_results_indic.txt deleted file mode 100644 index 9fb65985..00000000 --- a/open-reac/src/test/resources/optimization/indicators/transfo-test/reactiveopf_results_indic.txt +++ /dev/null @@ -1,93 +0,0 @@ -final_status OK -dcopf_status OK - -ctime_start 'Wed Dec 04 17:57:26 2024' -last_solve_result_num 0 -nb_iter_last 4 -nb_iter_total 4 -_ampl_elapsed_time 0.142000 -_total_solve_time 0.046875 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_3953804062991735571' - -log_level_ampl INFO -log_level_knitro 2 -objective_choice 0 -ratio_voltage_target 0.500000 -coeff_alpha 1.000000 -Pnull 0.010000 -Znull 0.000100 -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 ALL -PQmax 9000.000000 -defaultPmax 1000.000000 -defaultPmin 0.000000 -defaultQmaxPmaxRatio 0.300000 -defaultQmin -300.000000 -defaultQmax 300.000000 -minimalQPrange 1.000000 -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 -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 3 -nb_bus_without_reactive_slacks 0 -nb_branch_in_data_file 3 -nb_branch_in_AC_CC 3 -nb_branch_with_nonsmall_impedance 3 -nb_branch_with_zero_or_small_impedance 0 -nb_unit_in_data_file 1 -nb_unit_in_AC_CC 1 -nb_unit_up_and_running 1 -nb_unit_with_variable_reactive_power 1 -nb_unit_with_fixed_reactive_power 0 -nb_load_in_data_file 2 -nb_load_in_AC_CC 2 -nb_shunt_in_data_file 0 -nb_shunt_connectable_or_in_AC_CC 0 -nb_shunt_with_fixed_value 0 -nb_shunt_with_variable_value 0 -nb_transformers_with_variable_ratio 1 -nb_transformers_with_fixed_ratio 1 -nb_svc_in_data_file 0 -nb_svc_in_AC_CC 0 -nb_svc_up_and_operating 0 -nb_vsc_converter_in_data_file 0 -nb_vsc_converter_up_and_running 0 -nb_lcc_converter_in_data_file 0 -nb_lcc_converter_up_and_running 0 -nb_batteries 0 -sum_batteries_pmax 0.0 -sum_batteries_pmin 0.0 - -max_teta_dc 0.01 -max_teta_ac 0.02 -teta_max 3.01 -min_teta_dc -0.02 -min_teta_ac -0.04 -teta_min -3.02 -max_delta_teta_dc 0.022957 -max_delta_teta_ac 0.037399 -min_delta_teta_dc 0.009298 -min_delta_teta_ac 0.016902 - -nb_reactive_slacks 0 -nb_slacks_condensator 0 -sum_slacks_condensator 0.0 -nb_slacks_self 0 -sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/vsc-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/vsc-test/reactiveopf_results_indic.txt deleted file mode 100644 index 882281eb..00000000 --- a/open-reac/src/test/resources/optimization/indicators/vsc-test/reactiveopf_results_indic.txt +++ /dev/null @@ -1,93 +0,0 @@ -final_status OK -dcopf_status OK - -ctime_start 'Wed Dec 04 17:15:42 2024' -last_solve_result_num 0 -nb_iter_last 5 -nb_iter_total 5 -_ampl_elapsed_time 0.093000 -_total_solve_time 0.062500 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_995048131625005748' - -log_level_ampl INFO -log_level_knitro 2 -objective_choice 0 -ratio_voltage_target 0.500000 -coeff_alpha 1.000000 -Pnull 0.010000 -Znull 0.000100 -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 ALL -PQmax 9000.000000 -defaultPmax 1000.000000 -defaultPmin 0.000000 -defaultQmaxPmaxRatio 0.300000 -defaultQmin -300.000000 -defaultQmax 300.000000 -minimalQPrange 1.000000 -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 -nb_bus_in_ACDC_CC 3 -nb_bus_in_AC_CC 2 -nb_bus_in_ACDC_but_out_AC_CC 1 -nb_bus_with_voltage_value 0 -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 -nb_branch_with_zero_or_small_impedance 0 -nb_unit_in_data_file 1 -nb_unit_in_AC_CC 1 -nb_unit_up_and_running 1 -nb_unit_with_variable_reactive_power 1 -nb_unit_with_fixed_reactive_power 0 -nb_load_in_data_file 2 -nb_load_in_AC_CC 1 -nb_shunt_in_data_file 0 -nb_shunt_connectable_or_in_AC_CC 0 -nb_shunt_with_fixed_value 0 -nb_shunt_with_variable_value 0 -nb_transformers_with_variable_ratio 0 -nb_transformers_with_fixed_ratio 0 -nb_svc_in_data_file 0 -nb_svc_in_AC_CC 0 -nb_svc_up_and_operating 0 -nb_vsc_converter_in_data_file 2 -nb_vsc_converter_up_and_running 1 -nb_lcc_converter_in_data_file 0 -nb_lcc_converter_up_and_running 0 -nb_batteries 0 -sum_batteries_pmax 0.0 -sum_batteries_pmin 0.0 - -max_teta_dc 0.00 -max_teta_ac 0.00 -teta_max 3.00 -min_teta_dc 0.00 -min_teta_ac 0.00 -teta_min -3.00 -max_delta_teta_dc 0.000975 -max_delta_teta_ac 0.001335 -min_delta_teta_dc 0.000975 -min_delta_teta_ac 0.001335 - -nb_reactive_slacks 0 -nb_slacks_condensator 0 -sum_slacks_condensator 0.0 -nb_slacks_self 0 -sum_slacks_self 0.0 From cd043e818f1488daedfed4ef5ce82bc025cf4ad0 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Thu, 12 Dec 2024 16:15:33 +0100 Subject: [PATCH 09/63] Clean Signed-off-by: p-arvy --- .../openreac/optimization/AbstractOpenReacRunnerTest.java | 3 ++- .../optimization/OpenReacOptimizationAndLoadFlowTest.java | 5 ----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java index a53d9720..c539f9b6 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java @@ -29,7 +29,6 @@ import java.io.InputStream; import java.nio.file.FileSystem; import java.nio.file.Path; -import java.util.ArrayList; import java.util.List; import java.util.Objects; import java.util.concurrent.ForkJoinPool; @@ -86,6 +85,8 @@ protected void testAllModifAndLoadFlow(Network network, String subFolder, OpenRe */ void runAndApplyAllModifications(Network network, String subFolder, OpenReacParameters parameters, boolean updateNetworkWithVoltages, ReportNode reportNode) throws IOException { + // set default voltage limits to every voltage levels of the network + setDefaultVoltageLimits(network); LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( List.of(subFolder + "/reactiveopf_results_generators.csv", subFolder + "/reactiveopf_results_indic.txt", diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java index 89eba645..25632d0d 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java @@ -14,8 +14,6 @@ import com.powsybl.computation.local.LocalComputationManager; import com.powsybl.ieeecdf.converter.IeeeCdfNetworkFactory; import com.powsybl.iidm.network.*; -import com.powsybl.loadflow.LoadFlow; -import com.powsybl.loadflow.LoadFlowResult; import com.powsybl.openreac.OpenReacConfig; import com.powsybl.openreac.OpenReacRunner; import com.powsybl.openreac.network.HvdcNetworkFactory; @@ -189,9 +187,6 @@ void testWarmStart() throws IOException { assertEquals(0, network.getBusBreakerView().getBus("BUS_2").getAngle()); assertEquals(22.935, network.getBusBreakerView().getBus("BUS_3").getV()); assertEquals(-4.698, network.getBusBreakerView().getBus("BUS_3").getAngle(), 0.001); - - LoadFlowResult loadFlowResult = LoadFlow.run(network); - assertTrue(loadFlowResult.isFullyConverged()); } public static Network create() { From d78e93d313813d37b7c387262e2b2551ceef2699 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Mon, 30 Dec 2024 12:21:48 +0100 Subject: [PATCH 10/63] Clean Signed-off-by: p-arvy --- .../powsybl/openreac/OpenReacResultsTest.java | 4 +- .../openreac/network/ShuntNetworkFactory.java | 85 +++++++++++++++++- .../AbstractOpenReacRunnerTest.java | 4 +- .../OpenReacOptimizationAndLoadFlowTest.java | 86 +------------------ .../ShuntCompensatorNetworkOutputTest.java | 10 +-- 5 files changed, 95 insertions(+), 94 deletions(-) diff --git a/open-reac/src/test/java/com/powsybl/openreac/OpenReacResultsTest.java b/open-reac/src/test/java/com/powsybl/openreac/OpenReacResultsTest.java index 3f736fdc..d63a89f9 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/OpenReacResultsTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/OpenReacResultsTest.java @@ -77,7 +77,7 @@ void testTransformerTargetVUpdateWithoutRegulationBus() throws IOException { @Test void testShuntTargetVUpdateWithoutVoltageResult() throws IOException { - Network network = ShuntNetworkFactory.create(); + Network network = ShuntNetworkFactory.createWithNonLinearModel(); ShuntCompensator shunt = network.getShuntCompensator("SHUNT"); String regulatedBusId = shunt.getRegulatingTerminal().getBusView().getBus().getId(); @@ -91,7 +91,7 @@ void testShuntTargetVUpdateWithoutVoltageResult() throws IOException { @Test void testShuntUpdateWithoutRegulationBus() throws IOException { - Network network = ShuntNetworkFactory.create(); + Network network = ShuntNetworkFactory.createWithNonLinearModel(); ShuntCompensator shunt = network.getShuntCompensator("SHUNT"); shunt.getRegulatingTerminal().disconnect(); diff --git a/open-reac/src/test/java/com/powsybl/openreac/network/ShuntNetworkFactory.java b/open-reac/src/test/java/com/powsybl/openreac/network/ShuntNetworkFactory.java index ecb1ba36..bc508014 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/network/ShuntNetworkFactory.java +++ b/open-reac/src/test/java/com/powsybl/openreac/network/ShuntNetworkFactory.java @@ -19,7 +19,88 @@ public final class ShuntNetworkFactory { private ShuntNetworkFactory() { } - public static Network create() { + public static Network createWithLinearModel() { + Network network = Network.create("svc", "test"); + Substation s1 = network.newSubstation() + .setId("S1") + .add(); + Substation s2 = network.newSubstation() + .setId("S2") + .add(); + VoltageLevel vl1 = s1.newVoltageLevel() + .setId("vl1") + .setNominalV(400) + .setHighVoltageLimit(420) + .setLowVoltageLimit(380) + .setTopologyKind(TopologyKind.BUS_BREAKER) + .add(); + vl1.getBusBreakerView().newBus() + .setId("b1") + .add(); + vl1.newGenerator() + .setId("g1") + .setConnectableBus("b1") + .setBus("b1") + .setTargetP(101.3664) + .setTargetV(390) + .setMinP(0) + .setMaxP(150) + .setVoltageRegulatorOn(true) + .add(); + VoltageLevel vl2 = s2.newVoltageLevel() + .setId("vl2") + .setNominalV(400) + .setTopologyKind(TopologyKind.BUS_BREAKER) + .add(); + vl2.getBusBreakerView().newBus() + .setId("b2") + .add(); + vl2.newLoad() + .setId("ld1") + .setConnectableBus("b2") + .setBus("b2") + .setP0(101) + .setQ0(150) + .add(); + VoltageLevel vl3 = s2.newVoltageLevel() + .setId("vl3") + .setNominalV(400) + .setTopologyKind(TopologyKind.BUS_BREAKER) + .add(); + vl3.getBusBreakerView().newBus() + .setId("b3") + .add(); + vl3.newShuntCompensator() + .setId("SHUNT") + // .setBus("b3") + .setConnectableBus("b3") + .setSectionCount(0) + .setVoltageRegulatorOn(true) + .setTargetV(393) + .setTargetDeadband(5.0) + .newLinearModel() + .setMaximumSectionCount(25) + .setBPerSection(1e-3) + .add() + .add(); + network.newLine() + .setId("l1") + .setBus1("b1") + .setBus2("b2") + .setR(1) + .setX(3) + .add(); + network.newLine() + .setId("l2") + .setBus1("b3") + .setBus2("b2") + .setR(1) + .setX(3) + .add(); + return network; + } + + public static Network createWithNonLinearModel() { Network network = Network.create("svc", "test"); Substation s1 = network.newSubstation() .setId("S1") @@ -105,7 +186,7 @@ public static Network create() { } public static Network createWithTwoShuntCompensators() { - Network network = create(); + Network network = createWithNonLinearModel(); VoltageLevel vl3 = network.getVoltageLevel("vl3"); vl3.newShuntCompensator() .setId("SHUNT2") diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java index c539f9b6..fa2db175 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java @@ -83,7 +83,7 @@ protected void testAllModifAndLoadFlow(Network network, String subFolder, OpenRe /** * Runs OpenReac and apply the results on the network. */ - void runAndApplyAllModifications(Network network, String subFolder, OpenReacParameters parameters, + protected void runAndApplyAllModifications(Network network, String subFolder, OpenReacParameters parameters, boolean updateNetworkWithVoltages, ReportNode reportNode) throws IOException { // set default voltage limits to every voltage levels of the network setDefaultVoltageLimits(network); @@ -112,7 +112,7 @@ void runAndApplyAllModifications(Network network, String subFolder, OpenReacPara * Add voltage limits to voltage levels with undefined limits. * OpenReac needs voltage limits to run optimization. */ - void setDefaultVoltageLimits(Network network) { + protected void setDefaultVoltageLimits(Network network) { for (VoltageLevel vl : network.getVoltageLevels()) { if (vl.getLowVoltageLimit() <= 0 || Double.isNaN(vl.getLowVoltageLimit())) { vl.setLowVoltageLimit(0.5 * vl.getNominalV()); diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java index 25632d0d..b7e5de6b 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java @@ -29,6 +29,7 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ForkJoinPool; +import static com.powsybl.openreac.network.ShuntNetworkFactory.createWithLinearModel; import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -92,7 +93,7 @@ void testSvc() throws IOException { @Test void testShunt() throws IOException { - Network network = create(); + Network network = createWithLinearModel(); ShuntCompensator shunt = network.getShuntCompensator("SHUNT"); assertFalse(shunt.getTerminal().isConnected()); assertEquals(393, shunt.getTargetV()); @@ -124,7 +125,7 @@ void testShunt() throws IOException { @Test void testShuntWithDeltaBetweenDiscretizedAndOptimalReactiveValueUnderThreshold() throws IOException { - Network network = create(); + Network network = createWithLinearModel(); ShuntCompensator shunt = network.getShuntCompensator("SHUNT"); assertFalse(shunt.getTerminal().isConnected()); assertEquals(393, shunt.getTargetV()); @@ -189,85 +190,4 @@ void testWarmStart() throws IOException { assertEquals(-4.698, network.getBusBreakerView().getBus("BUS_3").getAngle(), 0.001); } - public static Network create() { - Network network = Network.create("svc", "test"); - Substation s1 = network.newSubstation() - .setId("S1") - .add(); - Substation s2 = network.newSubstation() - .setId("S2") - .add(); - VoltageLevel vl1 = s1.newVoltageLevel() - .setId("vl1") - .setNominalV(400) - .setHighVoltageLimit(420) - .setLowVoltageLimit(380) - .setTopologyKind(TopologyKind.BUS_BREAKER) - .add(); - vl1.getBusBreakerView().newBus() - .setId("b1") - .add(); - vl1.newGenerator() - .setId("g1") - .setConnectableBus("b1") - .setBus("b1") - .setTargetP(101.3664) - .setTargetV(390) - .setMinP(0) - .setMaxP(150) - .setVoltageRegulatorOn(true) - .add(); - VoltageLevel vl2 = s2.newVoltageLevel() - .setId("vl2") - .setNominalV(400) - .setTopologyKind(TopologyKind.BUS_BREAKER) - .add(); - vl2.getBusBreakerView().newBus() - .setId("b2") - .add(); - vl2.newLoad() - .setId("ld1") - .setConnectableBus("b2") - .setBus("b2") - .setP0(101) - .setQ0(150) - .add(); - VoltageLevel vl3 = s2.newVoltageLevel() - .setId("vl3") - .setNominalV(400) - .setTopologyKind(TopologyKind.BUS_BREAKER) - .add(); - vl3.getBusBreakerView().newBus() - .setId("b3") - .add(); - vl3.newShuntCompensator() - .setId("SHUNT") - // .setBus("b3") - .setConnectableBus("b3") - .setSectionCount(0) - .setVoltageRegulatorOn(true) - .setTargetV(393) - .setTargetDeadband(5.0) - .newLinearModel() - .setMaximumSectionCount(25) - .setBPerSection(1e-3) - .add() - .add(); - network.newLine() - .setId("l1") - .setBus1("b1") - .setBus2("b2") - .setR(1) - .setX(3) - .add(); - network.newLine() - .setId("l2") - .setBus1("b3") - .setBus2("b2") - .setR(1) - .setX(3) - .add(); - return network; - } - } diff --git a/open-reac/src/test/java/com/powsybl/openreac/parameters/output/ShuntCompensatorNetworkOutputTest.java b/open-reac/src/test/java/com/powsybl/openreac/parameters/output/ShuntCompensatorNetworkOutputTest.java index fdc33f8b..1df695bf 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/parameters/output/ShuntCompensatorNetworkOutputTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/parameters/output/ShuntCompensatorNetworkOutputTest.java @@ -18,7 +18,7 @@ import java.io.InputStream; import java.io.InputStreamReader; -import static com.powsybl.openreac.network.ShuntNetworkFactory.create; +import static com.powsybl.openreac.network.ShuntNetworkFactory.createWithNonLinearModel; import static org.junit.jupiter.api.Assertions.*; /** @@ -27,7 +27,7 @@ class ShuntCompensatorNetworkOutputTest { @Test void read() throws IOException { - Network network = create(); + Network network = createWithNonLinearModel(); ShuntCompensatorNetworkOutput output = new ShuntCompensatorNetworkOutput(network, 0); StringToIntMapper mapper = new StringToIntMapper<>(AmplSubset.class); mapper.newInt(AmplSubset.SHUNT, "SHUNT"); @@ -47,7 +47,7 @@ void read() throws IOException { @Test void readNullShuntCompensator() throws IOException { - Network network = create(); + Network network = createWithNonLinearModel(); ShuntCompensatorNetworkOutput output = new ShuntCompensatorNetworkOutput(network, 0); StringToIntMapper mapper = new StringToIntMapper<>(AmplSubset.class); mapper.newInt(AmplSubset.SHUNT, "wrongId"); @@ -64,7 +64,7 @@ void readNullShuntCompensator() throws IOException { @Test void noShuntNumberInMapper() throws IOException { - Network network = create(); + Network network = createWithNonLinearModel(); ShuntCompensatorNetworkOutput output = new ShuntCompensatorNetworkOutput(network, 0); StringToIntMapper mapper = new StringToIntMapper<>(AmplSubset.class); try (InputStream input = getClass().getResourceAsStream("/mock_outputs/reactiveopf_results_shunts.csv"); @@ -76,7 +76,7 @@ void noShuntNumberInMapper() throws IOException { @Test void noBusNumberInMapper() throws IOException { - Network network = create(); + Network network = createWithNonLinearModel(); ShuntCompensatorNetworkOutput output = new ShuntCompensatorNetworkOutput(network, 0); StringToIntMapper mapper = new StringToIntMapper<>(AmplSubset.class); mapper.newInt(AmplSubset.SHUNT, "SHUNT"); From 724d6fe500a17668dd57328d9f6d4802770dd10f Mon Sep 17 00:00:00 2001 From: p-arvy Date: Tue, 17 Dec 2024 19:05:42 +0100 Subject: [PATCH 11/63] Put computer and time indicators as DEBUG indicators Signed-off-by: p-arvy --- .../resources/openreac/reactiveopfoutput.run | 32 +++---- .../optimization/OpenReacAmplIOTest.java | 37 +++++++- .../reactiveopf_results_indic.txt | 13 --- .../reactiveopf_results_indic.txt | 93 +++++++++++++++++++ .../reactiveopf_results_indic.txt | 13 --- .../reactiveopf_results_indic.txt | 13 --- .../reactiveopf_results_indic.txt | 13 --- .../reactiveopf_results_indic.txt | 13 --- .../reactiveopf_results_indic.txt | 13 --- 9 files changed, 142 insertions(+), 98 deletions(-) create mode 100644 open-reac/src/test/resources/optimization/indicators/debug-log-level-indicators/reactiveopf_results_indic.txt diff --git a/open-reac/src/main/resources/openreac/reactiveopfoutput.run b/open-reac/src/main/resources/openreac/reactiveopfoutput.run index 10b5edeb..c5469dc5 100644 --- a/open-reac/src/main/resources/openreac/reactiveopfoutput.run +++ b/open-reac/src/main/resources/openreac/reactiveopfoutput.run @@ -229,26 +229,26 @@ let fileOut := "reactiveopf_results_indic.txt"; printf "%s %s\n","final_status",final_status > (fileOut); printf "%s %s\n","dcopf_status",dcopf_status > (fileOut); -printf "\n" > (fileOut); -printf "%s %Q\n","ctime_start",ctime_start > (fileOut); -printf "%s %i\n","last_solve_result_num",solve_result_num > (fileOut); -printf "%s %i\n","nb_iter_last",nb_iter_last > (fileOut); -printf "%s %i\n","nb_iter_total",nb_iter_total > (fileOut); -printf "%s %f\n","_ampl_elapsed_time",_ampl_elapsed_time > (fileOut); -printf "%s %f\n","_total_solve_time",_total_solve_time > (fileOut); -printf "%s %i\n","total_time",_total_solve_time+_ampl_elapsed_time > (fileOut); - -printf "\n" > (fileOut); -printf "%s %s\n","operatingSystem",operatingSystem > (fileOut); +printf{LOG_DEBUG} "\n" > (fileOut); +printf{LOG_DEBUG} "%s %Q\n","ctime_start",ctime_start > (fileOut); +printf{LOG_DEBUG} "%s %i\n","last_solve_result_num",solve_result_num > (fileOut); +printf{LOG_DEBUG} "%s %i\n","nb_iter_last",nb_iter_last > (fileOut); +printf{LOG_DEBUG} "%s %i\n","nb_iter_total",nb_iter_total > (fileOut); +printf{LOG_DEBUG} "%s %f\n","_ampl_elapsed_time",_ampl_elapsed_time > (fileOut); +printf{LOG_DEBUG} "%s %f\n","_total_solve_time",_total_solve_time > (fileOut); +printf{LOG_DEBUG} "%s %i\n","total_time",_total_solve_time+_ampl_elapsed_time > (fileOut); + +printf{LOG_DEBUG} "\n" > (fileOut); +printf{LOG_DEBUG} "%s %s\n","operatingSystem",operatingSystem > (fileOut); if length($OS) > 0 then { - printf "%s %Q\n","OS",$OS > (fileOut); # Windows - printf "%s %Q\n","COMPUTERNAME",$COMPUTERNAME > (fileOut); + printf{LOG_DEBUG} "%s %Q\n","OS",$OS > (fileOut); # Windows + printf{LOG_DEBUG} "%s %Q\n","COMPUTERNAME",$COMPUTERNAME > (fileOut); } if length($SHELL) > 0 then { - printf "%s %Q\n","SHELL",$SHELL > (fileOut); # Linux - printf "%s %Q\n","HOSTNAME",$HOSTNAME > (fileOut); + printf{LOG_DEBUG} "%s %Q\n","SHELL",$SHELL > (fileOut); # Linux + printf{LOG_DEBUG} "%s %Q\n","HOSTNAME",$HOSTNAME > (fileOut); } -printf "%s %Q\n","directory",_cd > (fileOut); +printf{LOG_DEBUG} "%s %Q\n","directory",_cd > (fileOut); printf "\n" > (fileOut); printf "%s %s\n","log_level_ampl",log_level_ampl > (fileOut); diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacAmplIOTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacAmplIOTest.java index 20f6e00b..adedea29 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacAmplIOTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacAmplIOTest.java @@ -15,6 +15,7 @@ import com.powsybl.openreac.OpenReacConfig; import com.powsybl.openreac.OpenReacRunner; import com.powsybl.openreac.parameters.input.OpenReacParameters; +import com.powsybl.openreac.parameters.input.algo.OpenReacAmplLogLevel; import com.powsybl.openreac.parameters.input.algo.OpenReacOptimisationObjective; import com.powsybl.openreac.parameters.input.algo.ReactiveSlackBusesMode; import com.powsybl.openreac.parameters.output.OpenReacResult; @@ -27,8 +28,7 @@ import java.util.concurrent.ForkJoinPool; import java.util.stream.Collectors; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.*; /** * @author Geoffroy Jamgotchian {@literal } @@ -122,8 +122,10 @@ void testOutputFileParsing() throws IOException { "mock_outputs/reactiveopf_results_voltages.csv")); try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), localCommandExecutor, ForkJoinPool.commonPool())) { + OpenReacParameters parameters = new OpenReacParameters(); + parameters.setLogLevelAmpl(OpenReacAmplLogLevel.DEBUG); OpenReacResult openReacResult = OpenReacRunner.run(network, - network.getVariantManager().getWorkingVariantId(), new OpenReacParameters(), new OpenReacConfig(true), + network.getVariantManager().getWorkingVariantId(), parameters, new OpenReacConfig(true), computationManager); assertEquals(OpenReacStatus.OK, openReacResult.getStatus()); @@ -133,9 +135,36 @@ void testOutputFileParsing() throws IOException { assertEquals(1, openReacResult.getVscModifications().size()); assertEquals(7, openReacResult.getGeneratorModifications().size()); assertEquals(3, openReacResult.getVoltageProfile().size()); - assertEquals(87, openReacResult.getIndicators().size()); + assertEquals(76, openReacResult.getIndicators().size()); assertTrue(openReacResult.getReactiveSlacks().isEmpty()); } } + @Test + void testDebugIndicators() throws IOException { + Network network = IeeeCdfNetworkFactory.create14(); + setDefaultVoltageLimits(network); + LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor(List.of("optimization/indicators/debug-log-level-indicators/reactiveopf_results_indic.txt")); + try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), + localCommandExecutor, ForkJoinPool.commonPool())) { + OpenReacParameters parameters = new OpenReacParameters(); + parameters.setLogLevelAmpl(OpenReacAmplLogLevel.DEBUG); + OpenReacResult openReacResult = OpenReacRunner.run(network, + network.getVariantManager().getWorkingVariantId(), parameters, new OpenReacConfig(true), + computationManager); + assertEquals(87, openReacResult.getIndicators().size()); + assertEquals("Tue Dec 17 18:49:34 2024", openReacResult.getIndicators().get("ctime_start")); + assertEquals(0, Integer.parseInt(openReacResult.getIndicators().get("last_solve_result_num"))); + assertEquals(5, Integer.parseInt(openReacResult.getIndicators().get("nb_iter_last"))); + assertEquals(5, Integer.parseInt(openReacResult.getIndicators().get("nb_iter_total"))); + assertEquals(0.095, Double.parseDouble(openReacResult.getIndicators().get("_ampl_elapsed_time"))); + assertEquals(0.0625, Double.parseDouble(openReacResult.getIndicators().get("_total_solve_time"))); + assertEquals(0, Double.parseDouble(openReacResult.getIndicators().get("total_time"))); + assertEquals("windows", openReacResult.getIndicators().get("operatingSystem")); + assertEquals("Windows_NT", openReacResult.getIndicators().get("OS")); + assertEquals("A-COMPUTER-NAME", openReacResult.getIndicators().get("COMPUTERNAME")); + assertEquals("C:\\Users\\user\\AppData\\Local\\Temp\\ampl_tmp", openReacResult.getIndicators().get("directory")); + } + } + } 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 36fe7884..c41399de 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 @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Mon Apr 01 12:23:50 2024' -last_solve_result_num 0 -nb_iter_last 6 -nb_iter_total 6 -_ampl_elapsed_time 0.078000 -_total_solve_time 0.046875 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_13599896811417343310' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/indicators/debug-log-level-indicators/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/debug-log-level-indicators/reactiveopf_results_indic.txt new file mode 100644 index 00000000..06fcd429 --- /dev/null +++ b/open-reac/src/test/resources/optimization/indicators/debug-log-level-indicators/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Tue Dec 17 18:49:34 2024' +last_solve_result_num 0 +nb_iter_last 5 +nb_iter_total 5 +_ampl_elapsed_time 0.095000 +_total_solve_time 0.062500 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'A-COMPUTER-NAME' +directory 'C:\Users\user\AppData\Local\Temp\ampl_tmp' + +log_level_ampl DEBUG +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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 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 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 5 +nb_unit_in_AC_CC 5 +nb_unit_up_and_running 2 +nb_unit_with_variable_reactive_power 2 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 11 +nb_load_in_AC_CC 11 +nb_shunt_in_data_file 1 +nb_shunt_connectable_or_in_AC_CC 1 +nb_shunt_with_fixed_value 1 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.19 +max_teta_ac 0.09 +teta_max 3.19 +min_teta_dc -0.12 +min_teta_ac -0.05 +teta_min -3.12 +max_delta_teta_dc 0.159381 +max_delta_teta_ac 0.076647 +min_delta_teta_dc -0.041401 +min_delta_teta_ac -0.018540 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/loadflow/openreac-output-ieee14/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/loadflow/openreac-output-ieee14/reactiveopf_results_indic.txt index cbdccbc7..0dfd8e5f 100644 --- a/open-reac/src/test/resources/optimization/loadflow/openreac-output-ieee14/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/loadflow/openreac-output-ieee14/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -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.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_15080248147598462242' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/loadflow/openreac-output-real-network/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/loadflow/openreac-output-real-network/reactiveopf_results_indic.txt index ba6544bd..4e0a321e 100644 --- a/open-reac/src/test/resources/optimization/loadflow/openreac-output-real-network/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/loadflow/openreac-output-real-network/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -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.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_16419245349654459503' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/loadflow/openreac-output-shunt/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/loadflow/openreac-output-shunt/reactiveopf_results_indic.txt index 4b072890..953d87c5 100644 --- a/open-reac/src/test/resources/optimization/loadflow/openreac-output-shunt/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/loadflow/openreac-output-shunt/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Thu Jun 20 14:41:11 2024' -last_solve_result_num 0 -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_10955859460968685093' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/loadflow/openreac-output-svc/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/loadflow/openreac-output-svc/reactiveopf_results_indic.txt index 82d999e8..2abccb9d 100644 --- a/open-reac/src/test/resources/optimization/loadflow/openreac-output-svc/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/loadflow/openreac-output-svc/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -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.015625 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_11839740265781623806' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_indic.txt index e2d6706c..00b3ea7b 100644 --- a/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -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.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_4294773797099927510' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 From abfc91bc8a1048e4351d13d7b59af6171b6bd88f Mon Sep 17 00:00:00 2001 From: p-arvy Date: Thu, 19 Dec 2024 13:39:52 +0100 Subject: [PATCH 12/63] Clean Signed-off-by: p-arvy --- .../com/powsybl/openreac/optimization/OpenReacAmplIOTest.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacAmplIOTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacAmplIOTest.java index adedea29..b2fb76c6 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacAmplIOTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacAmplIOTest.java @@ -122,10 +122,8 @@ void testOutputFileParsing() throws IOException { "mock_outputs/reactiveopf_results_voltages.csv")); try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), localCommandExecutor, ForkJoinPool.commonPool())) { - OpenReacParameters parameters = new OpenReacParameters(); - parameters.setLogLevelAmpl(OpenReacAmplLogLevel.DEBUG); OpenReacResult openReacResult = OpenReacRunner.run(network, - network.getVariantManager().getWorkingVariantId(), parameters, new OpenReacConfig(true), + network.getVariantManager().getWorkingVariantId(), new OpenReacParameters(), new OpenReacConfig(true), computationManager); assertEquals(OpenReacStatus.OK, openReacResult.getStatus()); From 2afbe89825a0d52ce2b49cdda9d998bc522e6725 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Thu, 12 Dec 2024 16:33:45 +0100 Subject: [PATCH 13/63] Add indicators test for OpenReac Signed-off-by: p-arvy --- .../AbstractOpenReacRunnerTest.java | 56 +++- .../OpenReacOptimizationIndicatorsTest.java | 281 ++++++++++++++++++ .../reactiveopf_results_indic.txt | 93 ++++++ .../reactiveopf_results_indic.txt | 93 ++++++ .../bus-test/reactiveopf_results_indic.txt | 93 ++++++ .../reactiveopf_results_indic.txt | 93 ++++++ .../reactiveopf_results_indic.txt | 93 ++++++ .../lcc-test/reactiveopf_results_indic.txt | 93 ++++++ .../shunt-test/reactiveopf_results_indic.txt | 93 ++++++ .../svc-test/reactiveopf_results_indic.txt | 93 ++++++ .../reactiveopf_results_indic.txt | 93 ++++++ .../vsc-test/reactiveopf_results_indic.txt | 93 ++++++ 12 files changed, 1253 insertions(+), 14 deletions(-) create mode 100644 open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java create mode 100644 open-reac/src/test/resources/optimization/indicators/battery-test/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/indicators/branches-test/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/indicators/bus-test/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/indicators/generators-test/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/indicators/input-parameters-test/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/indicators/lcc-test/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/indicators/shunt-test/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/indicators/svc-test/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/indicators/transfo-test/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/indicators/vsc-test/reactiveopf_results_indic.txt diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java index fa2db175..f45e326b 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java @@ -29,6 +29,7 @@ import java.io.InputStream; import java.nio.file.FileSystem; import java.nio.file.Path; +import java.util.ArrayList; import java.util.List; import java.util.Objects; import java.util.concurrent.ForkJoinPool; @@ -82,29 +83,56 @@ protected void testAllModifAndLoadFlow(Network network, String subFolder, OpenRe /** * Runs OpenReac and apply the results on the network. + * The application of the voltage plan calculated by optimization is optional. */ protected void runAndApplyAllModifications(Network network, String subFolder, OpenReacParameters parameters, - boolean updateNetworkWithVoltages, ReportNode reportNode) throws IOException { + boolean updateNetworkWithVoltages, ReportNode reportNode) throws IOException { + OpenReacResult openReacResult = runOpenReac(network, subFolder, parameters, false, reportNode); + assertEquals(OpenReacStatus.OK, openReacResult.getStatus()); + openReacResult.setUpdateNetworkWithVoltages(updateNetworkWithVoltages); + openReacResult.applyAllModifications(network); + } + + /** + * Runs OpenReac and returns associated result. + */ + protected OpenReacResult runOpenReac(Network network, String subFolder, boolean onlyIndicators) throws IOException { + return runOpenReac(network, subFolder, new OpenReacParameters(), onlyIndicators); + } + + /** + * Runs OpenReac and returns associated result. + */ + protected OpenReacResult runOpenReac(Network network, String subFolder, OpenReacParameters parameters, boolean onlyIndicators) throws IOException { + return runOpenReac(network, subFolder, parameters, onlyIndicators, ReportNode.NO_OP); + } + + /** + * Runs OpenReac and returns associated result. + * Note that OpenReac is not really executed by default. If the execution line is not uncommented, + * the results are retrieved and stored in an {@link OpenReacResult} object. + */ + protected OpenReacResult runOpenReac(Network network, String subFolder, OpenReacParameters parameters, + boolean onlyIndicators, ReportNode reportNode) throws IOException { // set default voltage limits to every voltage levels of the network setDefaultVoltageLimits(network); - LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( - List.of(subFolder + "/reactiveopf_results_generators.csv", - subFolder + "/reactiveopf_results_indic.txt", - subFolder + "/reactiveopf_results_rtc.csv", - subFolder + "/reactiveopf_results_shunts.csv", - subFolder + "/reactiveopf_results_static_var_compensators.csv", - subFolder + "/reactiveopf_results_vsc_converter_stations.csv", - subFolder + "/reactiveopf_results_voltages.csv")); + List outputFileNames = new ArrayList<>(List.of(subFolder + "/reactiveopf_results_indic.txt")); + if (!onlyIndicators) { + outputFileNames.addAll(List.of( + subFolder + "/reactiveopf_results_rtc.csv", + subFolder + "/reactiveopf_results_shunts.csv", + subFolder + "/reactiveopf_results_static_var_compensators.csv", + subFolder + "/reactiveopf_results_vsc_converter_stations.csv", + subFolder + "/reactiveopf_results_voltages.csv" + )); + } + LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor(outputFileNames); // To really run open reac, use the commentede line below. Be sure that open-reac/src/test/resources/com/powsybl/config/test/config.yml contains your ampl path // try (ComputationManager computationManager = new LocalComputationManager()) { try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), localCommandExecutor, ForkJoinPool.commonPool())) { - OpenReacResult openReacResult = OpenReacRunner.run(network, - network.getVariantManager().getWorkingVariantId(), parameters, + return OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, new OpenReacConfig(true), computationManager, reportNode, null); - assertEquals(OpenReacStatus.OK, openReacResult.getStatus()); - openReacResult.setUpdateNetworkWithVoltages(updateNetworkWithVoltages); - openReacResult.applyAllModifications(network); } } diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java new file mode 100644 index 00000000..d98304e4 --- /dev/null +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java @@ -0,0 +1,281 @@ +/** + * Copyright (c) 2024, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 + */ +package com.powsybl.openreac.optimization; + +import com.powsybl.ieeecdf.converter.IeeeCdfNetworkFactory; +import com.powsybl.iidm.network.Network; +import com.powsybl.iidm.network.StaticVarCompensator; +import com.powsybl.openreac.network.HvdcNetworkFactory; +import com.powsybl.openreac.network.VoltageControlNetworkFactory; +import com.powsybl.openreac.parameters.input.OpenReacParameters; +import com.powsybl.openreac.parameters.input.algo.OpenReacAmplLogLevel; +import com.powsybl.openreac.parameters.input.algo.OpenReacOptimisationObjective; +import com.powsybl.openreac.parameters.input.algo.OpenReacSolverLogLevel; +import com.powsybl.openreac.parameters.input.algo.ReactiveSlackBusesMode; +import com.powsybl.openreac.parameters.output.OpenReacResult; +import com.powsybl.openreac.parameters.output.OpenReacStatus; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * Test the indicators returned by OpenReac optimization. + * Note that some indicators might depend on optimization process, + * and can not be tested in unit tests. + * + * @author Pierre ARVY {@literal } + */ +class OpenReacOptimizationIndicatorsTest extends AbstractOpenReacRunnerTest { + + @Test + void testParametrizationIndicators() throws IOException { + Network network = IeeeCdfNetworkFactory.create57(); + OpenReacParameters parameters = new OpenReacParameters() + .setObjective(OpenReacOptimisationObjective.SPECIFIC_VOLTAGE_PROFILE) + .setObjectiveDistance(70) + .setLogLevelAmpl(OpenReacAmplLogLevel.WARNING) + .setLogLevelSolver(OpenReacSolverLogLevel.ONLY_RESULTS) + .setMinPlausibleLowVoltageLimit(0.655) + .setMaxPlausibleHighVoltageLimit(1.425) + .setReactiveSlackBusesMode(ReactiveSlackBusesMode.NO_GENERATION) + .setActivePowerVariationRate(0.999) + .setMinPlausibleActivePowerThreshold(0.02) + .setLowImpedanceThreshold(1e-5) + .setMinNominalVoltageIgnoredBus(0.75) + .setMinNominalVoltageIgnoredVoltageBounds(0.85) + .setPQMax(4001) + .setLowActivePowerDefaultLimit(0.1) + .setHighActivePowerDefaultLimit(1001) + .setDefaultQmaxPmaxRatio(0.2) + .setDefaultMinimalQPRange(2.) + .setDefaultVariableScalingFactor(1.001) + .setDefaultConstraintScalingFactor(0.999) + .setReactiveSlackVariableScalingFactor(1e-2) + .setTwoWindingTransformerRatioVariableScalingFactor(2e-3) + .setShuntVariableScalingFactor(0.11); + OpenReacResult result = runOpenReac(network, "optimization/indicators/input-parameters-test", parameters, true); + + // verify buses outside main SC have been excluded + assertEquals("WARNING", result.getIndicators().get("log_level_ampl")); + assertEquals(1, Integer.parseInt(result.getIndicators().get("log_level_knitro"))); + assertEquals(2, Integer.parseInt(result.getIndicators().get("objective_choice"))); + assertEquals(0.7, Double.parseDouble(result.getIndicators().get("ratio_voltage_target"))); + assertEquals(0.999, Double.parseDouble(result.getIndicators().get("coeff_alpha"))); + assertEquals(0.02, Double.parseDouble(result.getIndicators().get("Pnull"))); + assertEquals(1e-5, Double.parseDouble(result.getIndicators().get("Znull"))); + assertEquals(0.75, Double.parseDouble(result.getIndicators().get("epsilon_nominal_voltage"))); + assertEquals(0.655, Double.parseDouble(result.getIndicators().get("min_plausible_low_voltage_limit"))); + assertEquals(1.425, Double.parseDouble(result.getIndicators().get("max_plausible_high_voltage_limit"))); + assertEquals(0.85, Double.parseDouble(result.getIndicators().get("ignore_voltage_bounds"))); + assertEquals("NO_GENERATION", result.getIndicators().get("buses_with_reactive_slacks")); + assertEquals(4001, Double.parseDouble(result.getIndicators().get("PQmax"))); + assertEquals(1001, Double.parseDouble(result.getIndicators().get("defaultPmax"))); + assertEquals(0.1, Double.parseDouble(result.getIndicators().get("defaultPmin"))); + assertEquals(0.2, Double.parseDouble(result.getIndicators().get("defaultQmaxPmaxRatio"))); + assertEquals(-200.2, Double.parseDouble(result.getIndicators().get("defaultQmin"))); + assertEquals(200.2, Double.parseDouble(result.getIndicators().get("defaultQmax"))); + assertEquals(2.0, Double.parseDouble(result.getIndicators().get("minimalQPrange"))); + assertEquals(1.001, Double.parseDouble(result.getIndicators().get("default_variable_scaling_factor"))); + assertEquals(0.999, Double.parseDouble(result.getIndicators().get("default_constraint_scaling_factor"))); + assertEquals(0.01, Double.parseDouble(result.getIndicators().get("reactive_slack_variable_scaling_factor"))); + assertEquals(0.002, Double.parseDouble(result.getIndicators().get("transformer_ratio_variable_scaling_factor"))); + assertEquals(0.11, Double.parseDouble(result.getIndicators().get("shunt_variable_scaling_factor"))); + } + + @Test + void testBusIndicators() throws IOException { + Network network = HvdcNetworkFactory.createLccWithBiggerComponents(); + network.getBusBreakerView().getBus("b1").setV(400); + OpenReacResult result = runOpenReac(network, "optimization/indicators/bus-test", true); + + assertEquals(OpenReacStatus.OK, result.getStatus()); + assertEquals(16, Integer.parseInt(result.getIndicators().get("nb_substations"))); + assertEquals(16, Integer.parseInt(result.getIndicators().get("nb_bus_in_data_file"))); + assertEquals(16, Integer.parseInt(result.getIndicators().get("nb_bus_in_ACDC_CC"))); + // verify buses outside main SC have been excluded + assertEquals(12, Integer.parseInt(result.getIndicators().get("nb_bus_in_AC_CC"))); + assertEquals(4, Integer.parseInt(result.getIndicators().get("nb_bus_in_ACDC_but_out_AC_CC"))); + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_bus_with_voltage_value"))); + } + + @Test + void testBranchesIndicators() throws IOException { + Network network = VoltageControlNetworkFactory.createWithSimpleRemoteControl(); + network.getLine("l12").getTerminal2().disconnect(); + network.getLine("l24").getTerminal1().disconnect(); + // due to disconnected lines, increase max P of generators in main CC + network.getGenerator("g3").setMaxP(3); + network.getGenerator("g4").setMaxP(3); + OpenReacResult result = runOpenReac(network, "optimization/indicators/branches-test", true); + + assertEquals(OpenReacStatus.OK, result.getStatus()); + assertEquals(4, Integer.parseInt(result.getIndicators().get("nb_branch_in_data_file"))); + // verify opened branches have been excluded + assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_branch_in_AC_CC"))); + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_with_nonsmall_impedance"))); + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_with_zero_or_small_impedance"))); + } + + @Test + void testGeneratorIndicators() throws IOException { + Network network = VoltageControlNetworkFactory.createWithGeneratorRemoteControl(); + network.getGenerator("g1").setTargetQ(50); + OpenReacParameters parameters = new OpenReacParameters(); + parameters.addConstantQGenerators(List.of("g1", "g3")); + OpenReacResult result = runOpenReac(network, "optimization/indicators/generators-test", parameters, true); + + assertEquals(OpenReacStatus.OK, result.getStatus()); + assertEquals(3, Integer.parseInt(result.getIndicators().get("nb_unit_in_data_file"))); + assertEquals(3, Integer.parseInt(result.getIndicators().get("nb_unit_in_AC_CC"))); + assertEquals(3, Integer.parseInt(result.getIndicators().get("nb_unit_up_and_running"))); + // verify that only the generators indicated as constant and with defined target Q are fixed in optimization + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_unit_with_fixed_reactive_power"))); + // verify other generators are optimized + assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_unit_with_variable_reactive_power"))); + } + + @Test + void testTransformersIndicators() throws IOException { + Network network = VoltageControlNetworkFactory.createNetworkWith2T2wt(); + OpenReacParameters parameters = new OpenReacParameters(); + parameters.addVariableTwoWindingsTransformers(List.of("T2wT1")); + OpenReacResult result = runOpenReac(network, "optimization/indicators/transfo-test", parameters, true); + + // verify only one rtc has been optimized + assertEquals(OpenReacStatus.OK, result.getStatus()); + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_transformers_with_variable_ratio"))); + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_transformers_with_fixed_ratio"))); + } + + @Test + void testVscIndicators() throws IOException { + Network network = HvdcNetworkFactory.createVsc(); + // FIXME : should not depend on P/Q values on terminal + network.getVscConverterStation("cs2").getTerminal().setP(2).setQ(1); + OpenReacResult result = runOpenReac(network, "optimization/indicators/vsc-test", true); + + assertEquals(OpenReacStatus.OK, result.getStatus()); + assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_vsc_converter_in_data_file"))); + // verify only vsc in main cc is optimized + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_vsc_converter_up_and_running"))); + } + + @Test + void testLccIndicators() throws IOException { + Network network = HvdcNetworkFactory.createLcc(); + // FIXME : should not depend on P/Q values on terminal + network.getLccConverterStation("cs2").getTerminal().setP(2).setQ(1); + OpenReacResult result = runOpenReac(network, "optimization/indicators/lcc-test", true); + + assertEquals(OpenReacStatus.OK, result.getStatus()); + assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_lcc_converter_in_data_file"))); + // verify only lcc in main cc is considered in optimization + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_lcc_converter_up_and_running"))); + } + + @Test + void testShuntsIndicators() throws IOException { + Network network = OpenReacOptimizationAndLoadFlowTest.create(); + // add one shunt that will be fixed in optimization + network.getVoltageLevel("vl3").newShuntCompensator() + .setId("SHUNT2") + .setBus("b3") + .setConnectableBus("b3") + .setSectionCount(0) + .setVoltageRegulatorOn(true) + .setTargetV(393) + .setTargetDeadband(5.0) + .newLinearModel() + .setMaximumSectionCount(25) + .setBPerSection(1e-3) + .add() + .add(); + // add one shunt that will not be considered in optimization, as it is neither optimized nor connected + network.getVoltageLevel("vl3").newShuntCompensator() + .setId("SHUNT3") + // .setBus("b3") + .setConnectableBus("b3") + .setSectionCount(0) + .setVoltageRegulatorOn(true) + .setTargetV(393) + .setTargetDeadband(5.0) + .newLinearModel() + .setMaximumSectionCount(25) + .setBPerSection(1e-3) + .add() + .add(); + OpenReacParameters parameters = new OpenReacParameters(); + parameters.addVariableShuntCompensators(List.of("SHUNT")); + OpenReacResult result = runOpenReac(network, "optimization/indicators/shunt-test", parameters, true); + + assertEquals(OpenReacStatus.OK, result.getStatus()); + assertEquals(3, Integer.parseInt(result.getIndicators().get("nb_shunt_in_data_file"))); + assertEquals(3, Integer.parseInt(result.getIndicators().get("nb_shunt_connectable_or_in_AC_CC"))); + // verify disconnected shunt, and not optimized, is not considered in shunts with fixed values + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_shunt_with_fixed_value"))); + // verify only one shunt has been optimized (even if it was disconnected) + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_shunt_with_variable_value"))); + } + + @Test + void testSvcIndicators() throws IOException { + Network network = VoltageControlNetworkFactory.createWithStaticVarCompensator(); + network.getVoltageLevel("vl2").newStaticVarCompensator() + .setId("svc2") + .setConnectableBus("b2") + .setBus("b2") + .setRegulationMode(StaticVarCompensator.RegulationMode.VOLTAGE) + .setVoltageSetpoint(400) + .setBmin(-0.008) + .setBmax(0.008) + .add(); + OpenReacResult result = runOpenReac(network, "optimization/indicators/svc-test", true); + + assertEquals(OpenReacStatus.OK, result.getStatus()); + assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_svc_in_data_file"))); + assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_svc_in_AC_CC"))); + // verify only one svc is regulating + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_svc_up_and_operating"))); + } + + @Test + void testBatteryIndicators() throws IOException { + Network network = VoltageControlNetworkFactory.createWithGeneratorRemoteControl(); + network.getVoltageLevel("vl4") + .newBattery() + .setId("bat1") + .setMinP(-10) + .setMaxP(10) + .setTargetP(2) + .setBus("b4") + .setConnectableBus("b4") + .setTargetQ(0) + .add(); + network.getVoltageLevel("vl1") + .newBattery() + .setId("bat2") + .setMinP(-9) + .setMaxP(11) + .setTargetP(1) + .setBus("b1") + .setConnectableBus("b1") + .setTargetQ(0.2) + .add(); + OpenReacResult result = runOpenReac(network, "optimization/indicators/battery-test", true); + + assertEquals(OpenReacStatus.OK, result.getStatus()); + assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_batteries"))); + // verify the sum of max and min active power of the batteries + assertEquals(21, Double.parseDouble(result.getIndicators().get("sum_batteries_pmax"))); + assertEquals(-19, Double.parseDouble(result.getIndicators().get("sum_batteries_pmin"))); + } + +} diff --git a/open-reac/src/test/resources/optimization/indicators/battery-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/battery-test/reactiveopf_results_indic.txt new file mode 100644 index 00000000..2f49c9cc --- /dev/null +++ b/open-reac/src/test/resources/optimization/indicators/battery-test/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 17:57:29 2024' +last_solve_result_num 0 +nb_iter_last 10 +nb_iter_total 10 +_ampl_elapsed_time 0.109000 +_total_solve_time 0.046875 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_8792994315745054563' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 4 +nb_bus_in_data_file 4 +nb_bus_in_ACDC_CC 4 +nb_bus_in_AC_CC 4 +nb_bus_in_ACDC_but_out_AC_CC 0 +nb_bus_with_voltage_value 0 +nb_bus_with_reactive_slacks 4 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 3 +nb_branch_in_AC_CC 3 +nb_branch_with_nonsmall_impedance 3 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 3 +nb_unit_up_and_running 3 +nb_unit_with_variable_reactive_power 3 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 2 +sum_batteries_pmax 21.0 +sum_batteries_pmin -19.0 + +max_teta_dc 0.03 +max_teta_ac 0.02 +teta_max 3.03 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.030896 +max_delta_teta_ac 0.015495 +min_delta_teta_dc 0.018725 +min_delta_teta_ac 0.009609 + +nb_reactive_slacks 1 +nb_slacks_condensator 1 +sum_slacks_condensator 25.4 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/branches-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/branches-test/reactiveopf_results_indic.txt new file mode 100644 index 00000000..93f59eb1 --- /dev/null +++ b/open-reac/src/test/resources/optimization/indicators/branches-test/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 17:57:29 2024' +last_solve_result_num 0 +nb_iter_last 8 +nb_iter_total 8 +_ampl_elapsed_time 0.141000 +_total_solve_time 0.015625 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_16228844043131338938' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 4 +nb_bus_in_data_file 4 +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 3 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 4 +nb_branch_in_AC_CC 2 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 1 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 2 +nb_unit_up_and_running 2 +nb_unit_with_variable_reactive_power 2 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 2 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.03 +max_teta_ac 0.01 +teta_max 3.03 +min_teta_dc -0.00 +min_teta_ac -0.00 +teta_min -3.00 +max_delta_teta_dc 0.030000 +max_delta_teta_ac 0.013386 +min_delta_teta_dc 0.000001 +min_delta_teta_ac 0.000000 + +nb_reactive_slacks 2 +nb_slacks_condensator 2 +sum_slacks_condensator 0.2 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/bus-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/bus-test/reactiveopf_results_indic.txt new file mode 100644 index 00000000..4fc11e98 --- /dev/null +++ b/open-reac/src/test/resources/optimization/indicators/bus-test/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 17:57:30 2024' +last_solve_result_num 0 +nb_iter_last 17 +nb_iter_total 17 +_ampl_elapsed_time 0.124000 +_total_solve_time 0.031250 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_4215184811660139075' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 16 +nb_bus_in_data_file 16 +nb_bus_in_ACDC_CC 16 +nb_bus_in_AC_CC 12 +nb_bus_in_ACDC_but_out_AC_CC 4 +nb_bus_with_voltage_value 1 +nb_bus_with_reactive_slacks 12 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 14 +nb_branch_in_AC_CC 11 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 10 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 2 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc -0.00 +min_teta_ac -0.00 +teta_min -3.00 +max_delta_teta_dc 0.000937 +max_delta_teta_ac 0.003363 +min_delta_teta_dc 0.000000 +min_delta_teta_ac -0.000000 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/generators-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/generators-test/reactiveopf_results_indic.txt new file mode 100644 index 00000000..c9c996ee --- /dev/null +++ b/open-reac/src/test/resources/optimization/indicators/generators-test/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 17:57:29 2024' +last_solve_result_num 0 +nb_iter_last 9 +nb_iter_total 9 +_ampl_elapsed_time 0.109000 +_total_solve_time 0.031250 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_4963164058041255301' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 4 +nb_bus_in_data_file 4 +nb_bus_in_ACDC_CC 4 +nb_bus_in_AC_CC 4 +nb_bus_in_ACDC_but_out_AC_CC 0 +nb_bus_with_voltage_value 0 +nb_bus_with_reactive_slacks 4 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 3 +nb_branch_in_AC_CC 3 +nb_branch_with_nonsmall_impedance 3 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 3 +nb_unit_up_and_running 3 +nb_unit_with_variable_reactive_power 2 +nb_unit_with_fixed_reactive_power 1 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.03 +max_teta_ac 0.02 +teta_max 3.03 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.031208 +max_delta_teta_ac 0.015617 +min_delta_teta_dc 0.018725 +min_delta_teta_ac 0.009685 + +nb_reactive_slacks 1 +nb_slacks_condensator 1 +sum_slacks_condensator 35.9 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/input-parameters-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/input-parameters-test/reactiveopf_results_indic.txt new file mode 100644 index 00000000..e7bb228a --- /dev/null +++ b/open-reac/src/test/resources/optimization/indicators/input-parameters-test/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 17:57:28 2024' +last_solve_result_num 0 +nb_iter_last 7 +nb_iter_total 7 +_ampl_elapsed_time 0.140000 +_total_solve_time 0.031250 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_10158983132520924590' + +log_level_ampl WARNING +log_level_knitro 1 +objective_choice 2 +ratio_voltage_target 0.700000 +coeff_alpha 0.999000 +Pnull 0.020000 +Znull 0.000010 +epsilon_nominal_voltage 0.750000 +min_plausible_low_voltage_limit 0.655000 +max_plausible_high_voltage_limit 1.425000 +ignore_voltage_bounds 0.850000 +buses_with_reactive_slacks NO_GENERATION +PQmax 4001.000000 +defaultPmax 1001.000000 +defaultPmin 0.100000 +defaultQmaxPmaxRatio 0.200000 +defaultQmin -200.200000 +defaultQmax 200.200000 +minimalQPrange 2.000000 +default_variable_scaling_factor 1.001000 +default_constraint_scaling_factor 0.999000 +reactive_slack_variable_scaling_factor 0.010000 +transformer_ratio_variable_scaling_factor 0.002000 +shunt_variable_scaling_factor 0.110000 + +nb_substations 42 +nb_bus_in_data_file 57 +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_branch_in_data_file 80 +nb_branch_in_AC_CC 80 +nb_branch_with_nonsmall_impedance 80 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 7 +nb_unit_in_AC_CC 7 +nb_unit_up_and_running 4 +nb_unit_with_variable_reactive_power 4 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 42 +nb_load_in_AC_CC 42 +nb_shunt_in_data_file 3 +nb_shunt_connectable_or_in_AC_CC 3 +nb_shunt_with_fixed_value 3 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.21 +max_teta_ac 0.13 +teta_max 3.21 +min_teta_dc -0.17 +min_teta_ac -0.17 +teta_min -3.17 +max_delta_teta_dc 0.146072 +max_delta_teta_ac 0.105543 +min_delta_teta_dc -0.144911 +min_delta_teta_ac -0.088988 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/lcc-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/lcc-test/reactiveopf_results_indic.txt new file mode 100644 index 00000000..04782c22 --- /dev/null +++ b/open-reac/src/test/resources/optimization/indicators/lcc-test/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 17:57:27 2024' +last_solve_result_num 0 +nb_iter_last 6 +nb_iter_total 6 +_ampl_elapsed_time 0.173000 +_total_solve_time 0.078125 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_1900278357647775261' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +nb_bus_in_ACDC_CC 3 +nb_bus_in_AC_CC 2 +nb_bus_in_ACDC_but_out_AC_CC 1 +nb_bus_with_voltage_value 0 +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 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 2 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 2 +nb_lcc_converter_up_and_running 1 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.000975 +max_delta_teta_ac 0.001211 +min_delta_teta_dc 0.000975 +min_delta_teta_ac 0.001211 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/shunt-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/shunt-test/reactiveopf_results_indic.txt new file mode 100644 index 00000000..611ec18f --- /dev/null +++ b/open-reac/src/test/resources/optimization/indicators/shunt-test/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 18:32:41 2024' +last_solve_result_num 0 +nb_iter_last 35 +nb_iter_total 35 +_ampl_elapsed_time 0.108000 +_total_solve_time 0.031250 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_15990639329670156176' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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 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 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 3 +nb_shunt_connectable_or_in_AC_CC 3 +nb_shunt_with_fixed_value 1 +nb_shunt_with_variable_value 1 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc 0.00 +min_teta_ac -0.00 +teta_min -3.00 +max_delta_teta_dc 0.001894 +max_delta_teta_ac 0.001642 +min_delta_teta_dc 0.000000 +min_delta_teta_ac -0.000773 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/svc-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/svc-test/reactiveopf_results_indic.txt new file mode 100644 index 00000000..6c681c4e --- /dev/null +++ b/open-reac/src/test/resources/optimization/indicators/svc-test/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 17:57:28 2024' +last_solve_result_num 0 +nb_iter_last 4 +nb_iter_total 4 +_ampl_elapsed_time 0.125000 +_total_solve_time 0.062500 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_2452729350162475477' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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 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 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 2 +nb_svc_in_AC_CC 2 +nb_svc_up_and_operating 1 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.001894 +max_delta_teta_ac 0.001258 +min_delta_teta_dc 0.001894 +min_delta_teta_ac 0.001258 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/transfo-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/transfo-test/reactiveopf_results_indic.txt new file mode 100644 index 00000000..9fb65985 --- /dev/null +++ b/open-reac/src/test/resources/optimization/indicators/transfo-test/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 17:57:26 2024' +last_solve_result_num 0 +nb_iter_last 4 +nb_iter_total 4 +_ampl_elapsed_time 0.142000 +_total_solve_time 0.046875 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_3953804062991735571' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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 3 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 3 +nb_branch_in_AC_CC 3 +nb_branch_with_nonsmall_impedance 3 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 2 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 1 +nb_transformers_with_fixed_ratio 1 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.01 +max_teta_ac 0.02 +teta_max 3.01 +min_teta_dc -0.02 +min_teta_ac -0.04 +teta_min -3.02 +max_delta_teta_dc 0.022957 +max_delta_teta_ac 0.037399 +min_delta_teta_dc 0.009298 +min_delta_teta_ac 0.016902 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/indicators/vsc-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/vsc-test/reactiveopf_results_indic.txt new file mode 100644 index 00000000..882281eb --- /dev/null +++ b/open-reac/src/test/resources/optimization/indicators/vsc-test/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 17:15:42 2024' +last_solve_result_num 0 +nb_iter_last 5 +nb_iter_total 5 +_ampl_elapsed_time 0.093000 +_total_solve_time 0.062500 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_995048131625005748' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +nb_bus_in_ACDC_CC 3 +nb_bus_in_AC_CC 2 +nb_bus_in_ACDC_but_out_AC_CC 1 +nb_bus_with_voltage_value 0 +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 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 2 +nb_vsc_converter_up_and_running 1 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.000975 +max_delta_teta_ac 0.001335 +min_delta_teta_dc 0.000975 +min_delta_teta_ac 0.001335 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 From e11a2f6c0a3c76a770d2f979eaf7bfce6779feab Mon Sep 17 00:00:00 2001 From: p-arvy Date: Thu, 12 Dec 2024 16:49:17 +0100 Subject: [PATCH 14/63] Add tests for bounds Signed-off-by: p-arvy --- .../OpecReacOptimizationBoundsTest.java | 69 ++++++++++++++ .../reactiveopf_results_indic.txt | 94 +++++++++++++++++++ .../reactiveopf_results_indic.txt | 93 ++++++++++++++++++ .../reactiveopf_results_indic.txt | 94 +++++++++++++++++++ .../reactiveopf_results_indic.txt | 93 ++++++++++++++++++ .../reactiveopf_results_indic.txt | 94 +++++++++++++++++++ 6 files changed, 537 insertions(+) create mode 100644 open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java create mode 100644 open-reac/src/test/resources/optimization/bounds/generators-pmax-too-small/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generators-pmax/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generators-pmin-too-high/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generators-pmin/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generators-target-p-too-close-pmax/reactiveopf_results_indic.txt diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java new file mode 100644 index 00000000..a362a790 --- /dev/null +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) 2024, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 + */ +package com.powsybl.openreac.optimization; + +import com.powsybl.iidm.network.Network; +import com.powsybl.openreac.network.VoltageControlNetworkFactory; +import com.powsybl.openreac.parameters.output.OpenReacResult; +import com.powsybl.openreac.parameters.output.OpenReacStatus; +import org.junit.jupiter.api.Test; + +import java.io.IOException; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * Test the equipment bounds in OpenReac optimization. + * + * @author Pierre ARVY {@literal } + */ +class OpecReacOptimizationBoundsTest extends AbstractOpenReacRunnerTest { + + @Test + void testGeneratorsMaxPBounds() throws IOException { + Network network = VoltageControlNetworkFactory.createWithTwoVoltageControls(); + // due to the disconnection, the network is now imbalanced + // and max p of generators is not enough to provide balance + network.getLine("l45").getTerminal2().disconnect(); + OpenReacResult result = runOpenReac(network, "optimization/bounds/generators-pmax-too-small", true); + assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); + + // increase max p of generators to allow power balance + network.getGenerator("g2").setMaxP(2.5); + network.getGenerator("g3").setMaxP(2.5); + result = runOpenReac(network, "optimization/bounds/generators-pmax", true); + assertEquals(OpenReacStatus.OK, result.getStatus()); + } + + @Test + void testGeneratorsMinPBounds() throws IOException { + Network network = VoltageControlNetworkFactory.createWithTwoVoltageControls(); + // due to the modifications, the network is now imbalanced + // and min p of generators is not small enough to provide balance + network.getLine("l45").getTerminal2().disconnect(); + network.getLoad("l4").setP0(3); + network.getGenerator("g2").setMinP(2); + network.getGenerator("g3").setMinP(2); + OpenReacResult result = runOpenReac(network, "optimization/bounds/generators-pmin-too-high", true); + assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); + + // decrease min p of generators to allow power balance + // but targetP will be fixed in optimization, because it is too close of maxP + network.getGenerator("g2").setMinP(1); + network.getGenerator("g3").setMinP(1); + result = runOpenReac(network, "optimization/bounds/generators-target-p-too-close-pmax", true); + assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); + + // increase max p of generators to allow modification of targetP in optimization + network.getGenerator("g2").setMaxP(2.5); + network.getGenerator("g3").setMaxP(2.5); + result = runOpenReac(network, "optimization/bounds/generators-pmin", true); + assertEquals(OpenReacStatus.OK, result.getStatus()); + } + +} diff --git a/open-reac/src/test/resources/optimization/bounds/generators-pmax-too-small/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generators-pmax-too-small/reactiveopf_results_indic.txt new file mode 100644 index 00000000..edad4c5b --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generators-pmax-too-small/reactiveopf_results_indic.txt @@ -0,0 +1,94 @@ +final_status NOK +dcopf_status OK + +ctime_start 'Wed Dec 04 18:39:06 2024' +last_solve_result_num 200 +nb_iter_last 67 +nb_iter_total 67 +_ampl_elapsed_time 0.140000 +_total_solve_time 0.046875 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_16806244976153640704' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 5 +nb_bus_in_data_file 5 +nb_bus_in_ACDC_CC 4 +nb_bus_in_AC_CC 4 +nb_bus_in_ACDC_but_out_AC_CC 0 +nb_bus_with_voltage_value 0 +nb_bus_with_reactive_slacks 4 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 4 +nb_branch_in_AC_CC 3 +nb_branch_with_nonsmall_impedance 3 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 2 +nb_unit_up_and_running 2 +nb_unit_with_variable_reactive_power 2 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.02 +max_teta_ac 0.01 +teta_max 3.02 +min_teta_dc -0.05 +min_teta_ac -0.03 +teta_min -3.05 +max_delta_teta_dc 0.050000 +max_delta_teta_ac 0.030638 +min_delta_teta_dc -0.025000 +min_delta_teta_ac -0.014361 + +nb_reactive_slacks 4 +nb_slacks_condensator 4 +sum_slacks_condensator 2.6 +nb_slacks_self 4 +sum_slacks_self 2.5 +messageInfo1 'Acopf optimization was ***not*** successfull - Convergence to an infeasible solution' diff --git a/open-reac/src/test/resources/optimization/bounds/generators-pmax/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generators-pmax/reactiveopf_results_indic.txt new file mode 100644 index 00000000..aefdeae1 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generators-pmax/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 18:39:06 2024' +last_solve_result_num 0 +nb_iter_last 7 +nb_iter_total 7 +_ampl_elapsed_time 0.139000 +_total_solve_time 0.031250 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_7246203715336309657' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 5 +nb_bus_in_data_file 5 +nb_bus_in_ACDC_CC 4 +nb_bus_in_AC_CC 4 +nb_bus_in_ACDC_but_out_AC_CC 0 +nb_bus_with_voltage_value 0 +nb_bus_with_reactive_slacks 4 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 4 +nb_branch_in_AC_CC 3 +nb_branch_with_nonsmall_impedance 3 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 2 +nb_unit_up_and_running 2 +nb_unit_with_variable_reactive_power 2 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.02 +max_teta_ac 0.03 +teta_max 3.02 +min_teta_dc -0.05 +min_teta_ac -0.05 +teta_min -3.05 +max_delta_teta_dc 0.050000 +max_delta_teta_ac 0.051670 +min_delta_teta_dc -0.025000 +min_delta_teta_ac -0.025352 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/bounds/generators-pmin-too-high/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generators-pmin-too-high/reactiveopf_results_indic.txt new file mode 100644 index 00000000..b213826c --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generators-pmin-too-high/reactiveopf_results_indic.txt @@ -0,0 +1,94 @@ +final_status NOK +dcopf_status OK + +ctime_start 'Wed Dec 04 18:39:05 2024' +last_solve_result_num 200 +nb_iter_last 60 +nb_iter_total 60 +_ampl_elapsed_time 0.155000 +_total_solve_time 0.046875 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_14708682651458660614' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 5 +nb_bus_in_data_file 5 +nb_bus_in_ACDC_CC 4 +nb_bus_in_AC_CC 4 +nb_bus_in_ACDC_but_out_AC_CC 0 +nb_bus_with_voltage_value 0 +nb_bus_with_reactive_slacks 4 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 4 +nb_branch_in_AC_CC 3 +nb_branch_with_nonsmall_impedance 3 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 2 +nb_unit_up_and_running 2 +nb_unit_with_variable_reactive_power 2 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.01 +max_teta_ac 0.02 +teta_max 3.01 +min_teta_dc -0.03 +min_teta_ac -0.04 +teta_min -3.03 +max_delta_teta_dc 0.030000 +max_delta_teta_ac 0.035331 +min_delta_teta_dc -0.015000 +min_delta_teta_ac -0.018693 + +nb_reactive_slacks 4 +nb_slacks_condensator 4 +sum_slacks_condensator 1.3 +nb_slacks_self 4 +sum_slacks_self 1.2 +messageInfo1 'Acopf optimization was ***not*** successfull - Convergence to an infeasible solution' diff --git a/open-reac/src/test/resources/optimization/bounds/generators-pmin/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generators-pmin/reactiveopf_results_indic.txt new file mode 100644 index 00000000..b3a69be6 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generators-pmin/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Wed Dec 04 18:39:05 2024' +last_solve_result_num 0 +nb_iter_last 7 +nb_iter_total 7 +_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_5930746422974926450' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 5 +nb_bus_in_data_file 5 +nb_bus_in_ACDC_CC 4 +nb_bus_in_AC_CC 4 +nb_bus_in_ACDC_but_out_AC_CC 0 +nb_bus_with_voltage_value 0 +nb_bus_with_reactive_slacks 4 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 4 +nb_branch_in_AC_CC 3 +nb_branch_with_nonsmall_impedance 3 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 2 +nb_unit_up_and_running 2 +nb_unit_with_variable_reactive_power 2 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.01 +max_teta_ac 0.03 +teta_max 3.01 +min_teta_dc -0.03 +min_teta_ac -0.05 +teta_min -3.03 +max_delta_teta_dc 0.030000 +max_delta_teta_ac 0.054735 +min_delta_teta_dc -0.015000 +min_delta_teta_ac -0.026527 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/bounds/generators-target-p-too-close-pmax/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generators-target-p-too-close-pmax/reactiveopf_results_indic.txt new file mode 100644 index 00000000..edce49c4 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generators-target-p-too-close-pmax/reactiveopf_results_indic.txt @@ -0,0 +1,94 @@ +final_status NOK +dcopf_status OK + +ctime_start 'Wed Dec 04 18:39:05 2024' +last_solve_result_num 200 +nb_iter_last 60 +nb_iter_total 60 +_ampl_elapsed_time 0.109000 +_total_solve_time 0.046875 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_3318717096223947573' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 5 +nb_bus_in_data_file 5 +nb_bus_in_ACDC_CC 4 +nb_bus_in_AC_CC 4 +nb_bus_in_ACDC_but_out_AC_CC 0 +nb_bus_with_voltage_value 0 +nb_bus_with_reactive_slacks 4 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 4 +nb_branch_in_AC_CC 3 +nb_branch_with_nonsmall_impedance 3 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 2 +nb_unit_up_and_running 2 +nb_unit_with_variable_reactive_power 2 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.01 +max_teta_ac 0.02 +teta_max 3.01 +min_teta_dc -0.03 +min_teta_ac -0.04 +teta_min -3.03 +max_delta_teta_dc 0.030000 +max_delta_teta_ac 0.035331 +min_delta_teta_dc -0.015000 +min_delta_teta_ac -0.018693 + +nb_reactive_slacks 4 +nb_slacks_condensator 4 +sum_slacks_condensator 1.3 +nb_slacks_self 4 +sum_slacks_self 1.2 +messageInfo1 'Acopf optimization was ***not*** successfull - Convergence to an infeasible solution' From 6f4612b7d88fa317560ed2554da7d21c7cb97466 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Fri, 13 Dec 2024 17:40:47 +0100 Subject: [PATCH 15/63] Add TUs on Q bounds Signed-off-by: p-arvy --- .../OpecReacOptimizationBoundsTest.java | 64 ++++++++++++- .../reactiveopf_results_indic.txt | 93 +++++++++++++++++++ .../reactiveopf_results_indic.txt | 93 +++++++++++++++++++ .../reactiveopf_results_indic.txt | 93 +++++++++++++++++++ 4 files changed, 340 insertions(+), 3 deletions(-) create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-rectangular-bounds/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/qmax-pmax-default-ratio/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/same-qmax-pmax/reactiveopf_results_indic.txt diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java index a362a790..fdfeecab 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java @@ -9,13 +9,14 @@ import com.powsybl.iidm.network.Network; import com.powsybl.openreac.network.VoltageControlNetworkFactory; +import com.powsybl.openreac.parameters.input.OpenReacParameters; import com.powsybl.openreac.parameters.output.OpenReacResult; import com.powsybl.openreac.parameters.output.OpenReacStatus; import org.junit.jupiter.api.Test; import java.io.IOException; -import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.*; /** * Test the equipment bounds in OpenReac optimization. @@ -29,7 +30,7 @@ void testGeneratorsMaxPBounds() throws IOException { Network network = VoltageControlNetworkFactory.createWithTwoVoltageControls(); // due to the disconnection, the network is now imbalanced // and max p of generators is not enough to provide balance - network.getLine("l45").getTerminal2().disconnect(); + network.getLine("l45").disconnect(); OpenReacResult result = runOpenReac(network, "optimization/bounds/generators-pmax-too-small", true); assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); @@ -45,7 +46,7 @@ void testGeneratorsMinPBounds() throws IOException { Network network = VoltageControlNetworkFactory.createWithTwoVoltageControls(); // due to the modifications, the network is now imbalanced // and min p of generators is not small enough to provide balance - network.getLine("l45").getTerminal2().disconnect(); + network.getLine("l45").disconnect(); network.getLoad("l4").setP0(3); network.getGenerator("g2").setMinP(2); network.getGenerator("g3").setMinP(2); @@ -66,4 +67,61 @@ void testGeneratorsMinPBounds() throws IOException { assertEquals(OpenReacStatus.OK, result.getStatus()); } + @Test + void testGeneratorRectangularQBounds() throws IOException { + Network network = VoltageControlNetworkFactory.createWithTwoVoltageControls(); + network.getLine("l45").disconnect(); + network.getLoad("l4").setP0(4).setQ0(2); + + // set reactive limits to both generators + network.getGenerator("g2").newReactiveCapabilityCurve() + .beginPoint() + .setP(0) + .setMinQ(-0.25) + .setMaxQ(0.25) + .endPoint() + .beginPoint() + .setP(2) + .setMinQ(-2) + .setMaxQ(2) + .endPoint() + .add(); + network.getGenerator("g3").newReactiveCapabilityCurve() + .beginPoint() + .setP(0) + .setMinQ(-0.25) + .setMaxQ(0.25) + .endPoint() + .beginPoint() + .setP(2) + .setMinQ(-2) + .setMaxQ(2) + .endPoint() + .add(); + + OpenReacResult result = runOpenReac(network, "optimization/bounds/generator-rectangular-bounds", true); + assertEquals(OpenReacStatus.OK, result.getStatus()); + // rectangular bounds in ACOPF implies Q bounds are not large enough to remove reactive slacks in optimization + assertTrue(Integer.parseInt(result.getIndicators().get("nb_reactive_slacks")) > 0); + } + + @Test + void testGeneratorQmaxPmaxRatioBounds() throws IOException { + Network network = VoltageControlNetworkFactory.createWithTwoVoltageControls(); + network.getLine("l45").disconnect(); + network.getLoad("l4").setP0(4).setQ0(2); + + OpenReacParameters parameters = new OpenReacParameters(); + OpenReacResult result = runOpenReac(network, "optimization/bounds/qmax-pmax-default-ratio", parameters, true); + assertEquals(OpenReacStatus.OK, result.getStatus()); + // there are slacks as Q bounds are not large enough + assertTrue(Integer.parseInt(result.getIndicators().get("nb_reactive_slacks")) > 0); + + parameters.setDefaultQmaxPmaxRatio(1); + result = runOpenReac(network, "optimization/bounds/same-qmax-pmax", parameters, true); + assertEquals(OpenReacStatus.OK, result.getStatus()); + // Q bounds are large enough to remove reactive slacks in optimization + assertEquals(0, Integer.parseInt(result.getIndicators().get("nb_reactive_slacks"))); + } + } diff --git a/open-reac/src/test/resources/optimization/bounds/generator-rectangular-bounds/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generator-rectangular-bounds/reactiveopf_results_indic.txt new file mode 100644 index 00000000..d1ab988d --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-rectangular-bounds/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Fri Dec 13 17:11:19 2024' +last_solve_result_num 0 +nb_iter_last 16 +nb_iter_total 16 +_ampl_elapsed_time 0.110000 +_total_solve_time 0.031250 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_16986647128066492619' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 5 +nb_bus_in_data_file 5 +nb_bus_in_ACDC_CC 4 +nb_bus_in_AC_CC 4 +nb_bus_in_ACDC_but_out_AC_CC 0 +nb_bus_with_voltage_value 0 +nb_bus_with_reactive_slacks 4 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 4 +nb_branch_in_AC_CC 3 +nb_branch_with_nonsmall_impedance 3 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 2 +nb_unit_up_and_running 2 +nb_unit_with_variable_reactive_power 2 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.02 +max_teta_ac 0.01 +teta_max 3.02 +min_teta_dc -0.04 +min_teta_ac -0.02 +teta_min -3.04 +max_delta_teta_dc 0.040000 +max_delta_teta_ac 0.017957 +min_delta_teta_dc -0.020000 +min_delta_teta_ac -0.008898 + +nb_reactive_slacks 2 +nb_slacks_condensator 2 +sum_slacks_condensator 1.6 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/bounds/qmax-pmax-default-ratio/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/qmax-pmax-default-ratio/reactiveopf_results_indic.txt new file mode 100644 index 00000000..4ab43795 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/qmax-pmax-default-ratio/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Fri Dec 13 17:28:32 2024' +last_solve_result_num 0 +nb_iter_last 11 +nb_iter_total 11 +_ampl_elapsed_time 0.158000 +_total_solve_time 0.031250 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_5023287104601431718' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 5 +nb_bus_in_data_file 5 +nb_bus_in_ACDC_CC 4 +nb_bus_in_AC_CC 4 +nb_bus_in_ACDC_but_out_AC_CC 0 +nb_bus_with_voltage_value 0 +nb_bus_with_reactive_slacks 4 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 4 +nb_branch_in_AC_CC 3 +nb_branch_with_nonsmall_impedance 3 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 2 +nb_unit_up_and_running 2 +nb_unit_with_variable_reactive_power 2 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.02 +max_teta_ac 0.01 +teta_max 3.02 +min_teta_dc -0.04 +min_teta_ac -0.02 +teta_min -3.04 +max_delta_teta_dc 0.040000 +max_delta_teta_ac 0.017964 +min_delta_teta_dc -0.020000 +min_delta_teta_ac -0.008913 + +nb_reactive_slacks 1 +nb_slacks_condensator 1 +sum_slacks_condensator 0.9 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/bounds/same-qmax-pmax/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/same-qmax-pmax/reactiveopf_results_indic.txt new file mode 100644 index 00000000..74646fb6 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/same-qmax-pmax/reactiveopf_results_indic.txt @@ -0,0 +1,93 @@ +final_status OK +dcopf_status OK + +ctime_start 'Fri Dec 13 17:39:45 2024' +last_solve_result_num 0 +nb_iter_last 6 +nb_iter_total 6 +_ampl_elapsed_time 0.064000 +_total_solve_time 0.046875 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_13860690371447850895' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 1.000000 +defaultQmin -1000.000000 +defaultQmax 1000.000000 +minimalQPrange 1.000000 +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 5 +nb_bus_in_data_file 5 +nb_bus_in_ACDC_CC 4 +nb_bus_in_AC_CC 4 +nb_bus_in_ACDC_but_out_AC_CC 0 +nb_bus_with_voltage_value 0 +nb_bus_with_reactive_slacks 4 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 4 +nb_branch_in_AC_CC 3 +nb_branch_with_nonsmall_impedance 3 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 2 +nb_unit_up_and_running 2 +nb_unit_with_variable_reactive_power 2 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.02 +max_teta_ac 0.01 +teta_max 3.02 +min_teta_dc -0.04 +min_teta_ac -0.02 +teta_min -3.04 +max_delta_teta_dc 0.040000 +max_delta_teta_ac 0.018117 +min_delta_teta_dc -0.020000 +min_delta_teta_ac -0.008933 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 From 8aa0e871d16269fb59943b369fc0c21933cc079a Mon Sep 17 00:00:00 2001 From: p-arvy Date: Fri, 13 Dec 2024 17:42:24 +0100 Subject: [PATCH 16/63] Small clean Signed-off-by: p-arvy --- .../openreac/optimization/OpecReacOptimizationBoundsTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java index fdfeecab..33c27b80 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java @@ -19,7 +19,7 @@ import static org.junit.jupiter.api.Assertions.*; /** - * Test the equipment bounds in OpenReac optimization. + * Test the generator bounds in OpenReac optimization. * * @author Pierre ARVY {@literal } */ From 104442452351fe26404d6cf8331ceedcc7893e10 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Tue, 17 Dec 2024 19:11:46 +0100 Subject: [PATCH 17/63] Update resources Signed-off-by: p-arvy --- .../reactiveopf_results_indic.txt | 13 ------------- .../reactiveopf_results_indic.txt | 13 ------------- .../generators-pmax/reactiveopf_results_indic.txt | 13 ------------- .../reactiveopf_results_indic.txt | 13 ------------- .../generators-pmin/reactiveopf_results_indic.txt | 13 ------------- .../reactiveopf_results_indic.txt | 13 ------------- .../reactiveopf_results_indic.txt | 13 ------------- .../same-qmax-pmax/reactiveopf_results_indic.txt | 13 ------------- .../battery-test/reactiveopf_results_indic.txt | 13 ------------- .../branches-test/reactiveopf_results_indic.txt | 13 ------------- .../bus-test/reactiveopf_results_indic.txt | 13 ------------- .../generators-test/reactiveopf_results_indic.txt | 13 ------------- .../reactiveopf_results_indic.txt | 13 ------------- .../lcc-test/reactiveopf_results_indic.txt | 13 ------------- .../shunt-test/reactiveopf_results_indic.txt | 13 ------------- .../svc-test/reactiveopf_results_indic.txt | 13 ------------- .../transfo-test/reactiveopf_results_indic.txt | 13 ------------- .../vsc-test/reactiveopf_results_indic.txt | 13 ------------- 18 files changed, 234 deletions(-) diff --git a/open-reac/src/test/resources/optimization/bounds/generator-rectangular-bounds/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generator-rectangular-bounds/reactiveopf_results_indic.txt index d1ab988d..09e8c47b 100644 --- a/open-reac/src/test/resources/optimization/bounds/generator-rectangular-bounds/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/bounds/generator-rectangular-bounds/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Fri Dec 13 17:11:19 2024' -last_solve_result_num 0 -nb_iter_last 16 -nb_iter_total 16 -_ampl_elapsed_time 0.110000 -_total_solve_time 0.031250 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_16986647128066492619' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/bounds/generators-pmax-too-small/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generators-pmax-too-small/reactiveopf_results_indic.txt index edad4c5b..05fa077c 100644 --- a/open-reac/src/test/resources/optimization/bounds/generators-pmax-too-small/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/bounds/generators-pmax-too-small/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status NOK dcopf_status OK -ctime_start 'Wed Dec 04 18:39:06 2024' -last_solve_result_num 200 -nb_iter_last 67 -nb_iter_total 67 -_ampl_elapsed_time 0.140000 -_total_solve_time 0.046875 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_16806244976153640704' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/bounds/generators-pmax/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generators-pmax/reactiveopf_results_indic.txt index aefdeae1..55fc4313 100644 --- a/open-reac/src/test/resources/optimization/bounds/generators-pmax/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/bounds/generators-pmax/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Wed Dec 04 18:39:06 2024' -last_solve_result_num 0 -nb_iter_last 7 -nb_iter_total 7 -_ampl_elapsed_time 0.139000 -_total_solve_time 0.031250 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_7246203715336309657' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/bounds/generators-pmin-too-high/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generators-pmin-too-high/reactiveopf_results_indic.txt index b213826c..2b8c5047 100644 --- a/open-reac/src/test/resources/optimization/bounds/generators-pmin-too-high/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/bounds/generators-pmin-too-high/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status NOK dcopf_status OK -ctime_start 'Wed Dec 04 18:39:05 2024' -last_solve_result_num 200 -nb_iter_last 60 -nb_iter_total 60 -_ampl_elapsed_time 0.155000 -_total_solve_time 0.046875 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_14708682651458660614' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/bounds/generators-pmin/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generators-pmin/reactiveopf_results_indic.txt index b3a69be6..d78f4798 100644 --- a/open-reac/src/test/resources/optimization/bounds/generators-pmin/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/bounds/generators-pmin/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Wed Dec 04 18:39:05 2024' -last_solve_result_num 0 -nb_iter_last 7 -nb_iter_total 7 -_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_5930746422974926450' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/bounds/generators-target-p-too-close-pmax/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generators-target-p-too-close-pmax/reactiveopf_results_indic.txt index edce49c4..2b8c5047 100644 --- a/open-reac/src/test/resources/optimization/bounds/generators-target-p-too-close-pmax/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/bounds/generators-target-p-too-close-pmax/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status NOK dcopf_status OK -ctime_start 'Wed Dec 04 18:39:05 2024' -last_solve_result_num 200 -nb_iter_last 60 -nb_iter_total 60 -_ampl_elapsed_time 0.109000 -_total_solve_time 0.046875 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_3318717096223947573' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/bounds/qmax-pmax-default-ratio/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/qmax-pmax-default-ratio/reactiveopf_results_indic.txt index 4ab43795..11ef51d6 100644 --- a/open-reac/src/test/resources/optimization/bounds/qmax-pmax-default-ratio/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/bounds/qmax-pmax-default-ratio/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Fri Dec 13 17:28:32 2024' -last_solve_result_num 0 -nb_iter_last 11 -nb_iter_total 11 -_ampl_elapsed_time 0.158000 -_total_solve_time 0.031250 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_5023287104601431718' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/bounds/same-qmax-pmax/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/same-qmax-pmax/reactiveopf_results_indic.txt index 74646fb6..95dfe618 100644 --- a/open-reac/src/test/resources/optimization/bounds/same-qmax-pmax/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/bounds/same-qmax-pmax/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Fri Dec 13 17:39:45 2024' -last_solve_result_num 0 -nb_iter_last 6 -nb_iter_total 6 -_ampl_elapsed_time 0.064000 -_total_solve_time 0.046875 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_13860690371447850895' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/indicators/battery-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/battery-test/reactiveopf_results_indic.txt index 2f49c9cc..fbff2832 100644 --- a/open-reac/src/test/resources/optimization/indicators/battery-test/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/indicators/battery-test/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Wed Dec 04 17:57:29 2024' -last_solve_result_num 0 -nb_iter_last 10 -nb_iter_total 10 -_ampl_elapsed_time 0.109000 -_total_solve_time 0.046875 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_8792994315745054563' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/indicators/branches-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/branches-test/reactiveopf_results_indic.txt index 93f59eb1..22f2bbae 100644 --- a/open-reac/src/test/resources/optimization/indicators/branches-test/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/indicators/branches-test/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Wed Dec 04 17:57:29 2024' -last_solve_result_num 0 -nb_iter_last 8 -nb_iter_total 8 -_ampl_elapsed_time 0.141000 -_total_solve_time 0.015625 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_16228844043131338938' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/indicators/bus-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/bus-test/reactiveopf_results_indic.txt index 4fc11e98..dd20c88f 100644 --- a/open-reac/src/test/resources/optimization/indicators/bus-test/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/indicators/bus-test/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Wed Dec 04 17:57:30 2024' -last_solve_result_num 0 -nb_iter_last 17 -nb_iter_total 17 -_ampl_elapsed_time 0.124000 -_total_solve_time 0.031250 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_4215184811660139075' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/indicators/generators-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/generators-test/reactiveopf_results_indic.txt index c9c996ee..fc02cf9d 100644 --- a/open-reac/src/test/resources/optimization/indicators/generators-test/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/indicators/generators-test/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Wed Dec 04 17:57:29 2024' -last_solve_result_num 0 -nb_iter_last 9 -nb_iter_total 9 -_ampl_elapsed_time 0.109000 -_total_solve_time 0.031250 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_4963164058041255301' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/indicators/input-parameters-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/input-parameters-test/reactiveopf_results_indic.txt index e7bb228a..34df3341 100644 --- a/open-reac/src/test/resources/optimization/indicators/input-parameters-test/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/indicators/input-parameters-test/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Wed Dec 04 17:57:28 2024' -last_solve_result_num 0 -nb_iter_last 7 -nb_iter_total 7 -_ampl_elapsed_time 0.140000 -_total_solve_time 0.031250 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_10158983132520924590' - log_level_ampl WARNING log_level_knitro 1 objective_choice 2 diff --git a/open-reac/src/test/resources/optimization/indicators/lcc-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/lcc-test/reactiveopf_results_indic.txt index 04782c22..3add2771 100644 --- a/open-reac/src/test/resources/optimization/indicators/lcc-test/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/indicators/lcc-test/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Wed Dec 04 17:57:27 2024' -last_solve_result_num 0 -nb_iter_last 6 -nb_iter_total 6 -_ampl_elapsed_time 0.173000 -_total_solve_time 0.078125 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_1900278357647775261' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/indicators/shunt-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/shunt-test/reactiveopf_results_indic.txt index 611ec18f..f735ad7a 100644 --- a/open-reac/src/test/resources/optimization/indicators/shunt-test/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/indicators/shunt-test/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Wed Dec 04 18:32:41 2024' -last_solve_result_num 0 -nb_iter_last 35 -nb_iter_total 35 -_ampl_elapsed_time 0.108000 -_total_solve_time 0.031250 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_15990639329670156176' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/indicators/svc-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/svc-test/reactiveopf_results_indic.txt index 6c681c4e..78fe35f3 100644 --- a/open-reac/src/test/resources/optimization/indicators/svc-test/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/indicators/svc-test/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Wed Dec 04 17:57:28 2024' -last_solve_result_num 0 -nb_iter_last 4 -nb_iter_total 4 -_ampl_elapsed_time 0.125000 -_total_solve_time 0.062500 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_2452729350162475477' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/indicators/transfo-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/transfo-test/reactiveopf_results_indic.txt index 9fb65985..7e932de7 100644 --- a/open-reac/src/test/resources/optimization/indicators/transfo-test/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/indicators/transfo-test/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Wed Dec 04 17:57:26 2024' -last_solve_result_num 0 -nb_iter_last 4 -nb_iter_total 4 -_ampl_elapsed_time 0.142000 -_total_solve_time 0.046875 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_3953804062991735571' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/indicators/vsc-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/vsc-test/reactiveopf_results_indic.txt index 882281eb..42a8e2fa 100644 --- a/open-reac/src/test/resources/optimization/indicators/vsc-test/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/indicators/vsc-test/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Wed Dec 04 17:15:42 2024' -last_solve_result_num 0 -nb_iter_last 5 -nb_iter_total 5 -_ampl_elapsed_time 0.093000 -_total_solve_time 0.062500 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_995048131625005748' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 From 7070e0e1eee0ff3a8625cf4738bd9450d47f4be6 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Thu, 19 Dec 2024 17:15:38 +0100 Subject: [PATCH 18/63] Clean Signed-off-by: p-arvy --- .../optimization/OpenReacOptimizationIndicatorsTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java index d98304e4..f0969568 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java @@ -63,7 +63,6 @@ void testParametrizationIndicators() throws IOException { .setShuntVariableScalingFactor(0.11); OpenReacResult result = runOpenReac(network, "optimization/indicators/input-parameters-test", parameters, true); - // verify buses outside main SC have been excluded assertEquals("WARNING", result.getIndicators().get("log_level_ampl")); assertEquals(1, Integer.parseInt(result.getIndicators().get("log_level_knitro"))); assertEquals(2, Integer.parseInt(result.getIndicators().get("objective_choice"))); From f5149f3586ffa5177876d5beb3bba5e9a871a40d Mon Sep 17 00:00:00 2001 From: p-arvy Date: Mon, 30 Dec 2024 12:40:57 +0100 Subject: [PATCH 19/63] Clean after rebase Signed-off-by: p-arvy --- .../optimization/OpenReacOptimizationIndicatorsTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java index f0969568..ceff1c4c 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java @@ -11,6 +11,7 @@ import com.powsybl.iidm.network.Network; import com.powsybl.iidm.network.StaticVarCompensator; import com.powsybl.openreac.network.HvdcNetworkFactory; +import com.powsybl.openreac.network.ShuntNetworkFactory; import com.powsybl.openreac.network.VoltageControlNetworkFactory; import com.powsybl.openreac.parameters.input.OpenReacParameters; import com.powsybl.openreac.parameters.input.algo.OpenReacAmplLogLevel; @@ -182,7 +183,7 @@ void testLccIndicators() throws IOException { @Test void testShuntsIndicators() throws IOException { - Network network = OpenReacOptimizationAndLoadFlowTest.create(); + Network network = ShuntNetworkFactory.createWithLinearModel(); // add one shunt that will be fixed in optimization network.getVoltageLevel("vl3").newShuntCompensator() .setId("SHUNT2") From ac830a4cb31bd54e410a9d89487a02a2f78e5f7c Mon Sep 17 00:00:00 2001 From: p-arvy Date: Thu, 12 Dec 2024 16:33:45 +0100 Subject: [PATCH 20/63] Add indicators test for OpenReac Signed-off-by: p-arvy --- .../optimization/OpenReacOptimizationIndicatorsTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java index ceff1c4c..2dacba95 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java @@ -64,6 +64,7 @@ void testParametrizationIndicators() throws IOException { .setShuntVariableScalingFactor(0.11); OpenReacResult result = runOpenReac(network, "optimization/indicators/input-parameters-test", parameters, true); + // verify buses outside main SC have been excluded assertEquals("WARNING", result.getIndicators().get("log_level_ampl")); assertEquals(1, Integer.parseInt(result.getIndicators().get("log_level_knitro"))); assertEquals(2, Integer.parseInt(result.getIndicators().get("objective_choice"))); From d08278b7c10fdc0ad831ac4032fdfb68cb76057d Mon Sep 17 00:00:00 2001 From: p-arvy Date: Tue, 17 Sep 2024 17:51:34 +0200 Subject: [PATCH 21/63] line opened on one side Signed-off-by: p-arvy --- .../src/main/resources/openreac/acopf.mod | 125 ++++++++++++------ .../src/main/resources/openreac/commons.mod | 37 +++--- .../src/main/resources/openreac/dcopf.run | 2 +- 3 files changed, 108 insertions(+), 56 deletions(-) diff --git a/open-reac/src/main/resources/openreac/acopf.mod b/open-reac/src/main/resources/openreac/acopf.mod index 4c3e35c7..dcfa29af 100644 --- a/open-reac/src/main/resources/openreac/acopf.mod +++ b/open-reac/src/main/resources/openreac/acopf.mod @@ -132,26 +132,72 @@ var Red_Tran_Rea_Inv{(qq,m,n) in BRANCHCC } = + V[n] * (branch_admi[qq,m,n]*cos(branch_angper[qq,m,n])-branch_Bex_mod[qq,m,n]) ; +# Penalized active/reactive power on branches with one side opened +var act_power_bus2_opened{(qq,m,n) in BRANCH_WITH_SIDE_2_OPENED} = +(branch_Ror[qq,m,n])**2 * V[m] * +(branch_Gor_mod[qq,m,n] + (branch_admi[qq,m,n])**2 * branch_Gex_mod[qq,m,n] +/ ( (branch_Gex_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 ++ (- branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) # Shunt ++ ((branch_Bex_mod[qq,m,n])**2 + (branch_Gex_mod[qq,m,n])**2) * branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]) +/ ( (branch_Gex_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 ++ (- branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) # Shunt +); + +var rea_power_bus2_opened{(qq,m,n) in BRANCH_WITH_SIDE_2_OPENED} = +- (branch_Ror[qq,m,n])**2 * V[m] * +(branch_Bor_mod[qq,m,n] + (branch_admi[qq,m,n])**2 * branch_Bex_mod[qq,m,n] +/ ( (branch_Gex_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 ++ (- branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) # Shunt +- ((branch_Bex_mod[qq,m,n])**2 + (branch_Gex_mod[qq,m,n])**2) * branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]) +/ ( (branch_Gex_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 ++ (-branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) # Shunt +); + +var act_power_bus1_opened{(qq,m,n) in BRANCH_WITH_SIDE_1_OPENED} = +V[n] * +(branch_Gex_mod[qq,m,n] ++ (branch_admi[qq,m,n])**2 * branch_Gor_mod[qq,m,n] +/ ( (branch_Gor_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 ++ (- branch_Bor_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) # Shunt ++ ((branch_Bor_mod[qq,m,n])**2 + (branch_Gor_mod[qq,m,n])**2) * branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]) +/ ( (branch_Gor_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 ++ (- branch_Bor_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) # Shunt +); + +var rea_power_bus1_opened{(qq,m,n) in BRANCH_WITH_SIDE_1_OPENED} = +- V[n] * +(branch_Bex_mod[qq,m,n] ++ (branch_admi[qq,m,n])**2 * branch_Bor_mod[qq,m,n] +/ ( (branch_Gor_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 ++ (- branch_Bor_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) # Shunt +- ((branch_Bor_mod[qq,m,n])**2 + (branch_Gor_mod[qq,m,n])**2) * branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]) +/ ( (branch_Gor_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 ++ (- branch_Bor_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) # Shunt +); + # # Active Balance # subject to ctr_balance_P{PROBLEM_ACOPF,k in BUSCC}: - # Flows - sum{(qq,k,n) in BRANCHCC} base100MVA * V[k] * Red_Tran_Act_Dir[qq,k,n] - + sum{(qq,m,k) in BRANCHCC} base100MVA * V[k] * Red_Tran_Act_Inv[qq,m,k] - # Generating units - - sum{(g,k) in UNITON} P[g,k] - # Batteries - - sum{(b,k) in BATTERYCC} battery_p0[1,b,k] - # Loads - + sum{(c,k) in LOADCC} load_PFix[1,c,k] # Fixed value - # VSC converters - + sum{(v,k) in VSCCONVON} vscconv_P0[1,v,k] # Fixed value - # LCC converters - + sum{(l,k) in LCCCONVON} lccconv_P0[1,l,k] # Fixed value - = 0; # No slack variables for active power. If data are really too bad, may not converge. +# Flows +sum{(qq,k,n) in BRANCHCC} base100MVA * V[k] * Red_Tran_Act_Dir[qq,k,n] ++ sum{(qq,m,k) in BRANCHCC} base100MVA * V[k] * Red_Tran_Act_Inv[qq,m,k] +# Flows on branches with one side opened ++ sum{(qq,k,n) in BRANCH_WITH_SIDE_2_OPENED} base100MVA * V[k] * act_power_bus2_opened[qq,k,n] ++ sum{(qq,m,k) in BRANCH_WITH_SIDE_1_OPENED} base100MVA * V[k] * act_power_bus1_opened[qq,m,k] +# Generating units +- sum{(g,k) in UNITON} P[g,k] +# Batteries +- sum{(b,k) in BATTERYCC} battery_p0[1,b,k] +# Loads ++ sum{(c,k) in LOADCC} load_PFix[1,c,k] # Fixed value +# VSC converters ++ sum{(v,k) in VSCCONVON} vscconv_P0[1,v,k] # Fixed value +# LCC converters ++ sum{(l,k) in LCCCONVON} lccconv_P0[1,l,k] # Fixed value += 0; # No slack variables for active power. If data are really too bad, may not converge. # @@ -167,30 +213,33 @@ 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}: - # Flows - sum{(qq,k,n) in BRANCHCC} base100MVA * V[k] * Red_Tran_Rea_Dir[qq,k,n] - + sum{(qq,m,k) in BRANCHCC} base100MVA * V[k] * Red_Tran_Rea_Inv[qq,m,k] - # Generating units - - sum{(g,k) in UNITON: (g,k) not in UNIT_FIXQ } Q[g,k] - - sum{(g,k) in UNIT_FIXQ} unit_Qc[1,g,k] - # Batteries - - sum{(b,k) in BATTERYCC} battery_q0[1,b,k] - # Loads - + sum{(c,k) in LOADCC} load_QFix[1,c,k] - # Shunts - - sum{(shunt,k) in SHUNT_FIX} base100MVA * shunt_valnom[1,shunt,k] * V[k]^2 - - sum{(shunt,k) in SHUNT_VAR} base100MVA * shunt_var[shunt,k] * V[k]^2 - # SVC - - sum{(svc,k) in SVCON} base100MVA * svc_qvar[svc,k] * V[k]^2 - # VSC converters - - sum{(v,k) in VSCCONVON} vscconv_qvar[v,k] - # LCC converters - + sum{(l,k) in LCCCONVON} lccconv_Q0[1,l,k] # Fixed value - # Slack variables - + if k in BUSCC_SLACK then - (- 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; +# Flows +sum{(qq,k,n) in BRANCHCC} base100MVA * V[k] * Red_Tran_Rea_Dir[qq,k,n] ++ sum{(qq,m,k) in BRANCHCC} base100MVA * V[k] * Red_Tran_Rea_Inv[qq,m,k] +# Flows on branches with one side opened ++ sum{(qq,k,n) in BRANCH_WITH_SIDE_2_OPENED} base100MVA * V[k] * rea_power_bus2_opened[qq,k,n] ++ sum{(qq,m,k) in BRANCH_WITH_SIDE_1_OPENED} base100MVA * V[k] * rea_power_bus1_opened[qq,m,k] +# Generating units +- sum{(g,k) in UNITON: (g,k) not in UNIT_FIXQ } Q[g,k] +- sum{(g,k) in UNIT_FIXQ} unit_Qc[1,g,k] +# Batteries +- sum{(b,k) in BATTERYCC} battery_q0[1,b,k] +# Loads ++ sum{(c,k) in LOADCC} load_QFix[1,c,k] +# Shunts +- sum{(shunt,k) in SHUNT_FIX} base100MVA * shunt_valnom[1,shunt,k] * V[k]^2 +- sum{(shunt,k) in SHUNT_VAR} base100MVA * shunt_var[shunt,k] * V[k]^2 +# SVC +- sum{(svc,k) in SVCON} base100MVA * svc_qvar[svc,k] * V[k]^2 +# VSC converters +- sum{(v,k) in VSCCONVON} vscconv_qvar[v,k] +# LCC converters ++ sum{(l,k) in LCCCONVON} lccconv_Q0[1,l,k] # Fixed value +# Slack variables ++ if k in BUSCC_SLACK then +(- 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; # diff --git a/open-reac/src/main/resources/openreac/commons.mod b/open-reac/src/main/resources/openreac/commons.mod index 9d0f6d18..57be88c2 100644 --- a/open-reac/src/main/resources/openreac/commons.mod +++ b/open-reac/src/main/resources/openreac/commons.mod @@ -48,6 +48,9 @@ set BRANCH2:= setof {(1,qq,m,n) in BRANCH: m in BUS2 and n in BUS2} (qq,m,n); set BUSCC dimen 1 default {}; set BRANCHCC := {(qq,m,n) in BRANCH2: m in BUSCC and n in BUSCC}; +set BRANCH_WITH_SIDE_2_OPENED := setof {(1,qq,m,n) in BRANCH: m in BUSCC and n == -1 and m != n} (qq,m,n); +set BRANCH_WITH_SIDE_1_OPENED := setof {(1,qq,m,n) in BRANCH: m == -1 and n in BUSCC and m != n} (qq,m,n); +set ALL_BRANCH_TO_CONSIDER:= BRANCHCC union BRANCH_WITH_SIDE_2_OPENED union BRANCH_WITH_SIDE_1_OPENED; ############################################################################### @@ -94,30 +97,30 @@ set LCCCONVON := setof{(t,l,n) in LCCCONV: # Branches with zero or near zero impedances # Notice: module of Z is equal to square root of (R^2+X^2) -set BRANCHZNULL := {(qq,m,n) in BRANCHCC: branch_R[1,qq,m,n]^2+branch_X[1,qq,m,n]^2 <= Znull^2}; +set BRANCHZNULL := {(qq,m,n) in ALL_BRANCH_TO_CONSIDER: branch_R[1,qq,m,n]^2+branch_X[1,qq,m,n]^2 <= Znull^2}; # If in BRANCHZNULL, then set X to ZNULL -param branch_X_mod{(qq,m,n) in BRANCHCC} := +param branch_X_mod{(qq,m,n) in ALL_BRANCH_TO_CONSIDER} := if (qq,m,n) in BRANCHZNULL then Znull else branch_X[1,qq,m,n]; -check {(qq,m,n) in BRANCHCC}: abs(branch_X_mod[qq,m,n]) > 0; +check {(qq,m,n) in ALL_BRANCH_TO_CONSIDER}: abs(branch_X_mod[qq,m,n]) > 0; # If in BRANCHZNULL, then set Gor/Gex/Bor/Bex to 0 -param branch_Gor_mod{(qq,m,n) in BRANCHCC} := - if (qq,m,n) in BRANCHZNULL then 0 +param branch_Gor_mod{(qq,m,n) in ALL_BRANCH_TO_CONSIDER} := + if (qq,m,n) in BRANCHCC and (qq,m,n) in BRANCHZNULL then 0 else branch_Gor[1,qq,m,n]; -param branch_Gex_mod{(qq,m,n) in BRANCHCC} := - if (qq,m,n) in BRANCHZNULL then 0 +param branch_Gex_mod{(qq,m,n) in ALL_BRANCH_TO_CONSIDER} := + if (qq,m,n) in BRANCHCC and (qq,m,n) in BRANCHZNULL then 0 else branch_Gex[1,qq,m,n]; -param branch_Bor_mod{(qq,m,n) in BRANCHCC} := - if (qq,m,n) in BRANCHZNULL then 0 +param branch_Bor_mod{(qq,m,n) in ALL_BRANCH_TO_CONSIDER} := + if (qq,m,n) in BRANCHCC and (qq,m,n) in BRANCHZNULL then 0 else branch_Bor[1,qq,m,n]; -param branch_Bex_mod{(qq,m,n) in BRANCHCC} := - if (qq,m,n) in BRANCHZNULL then 0 +param branch_Bex_mod{(qq,m,n) in ALL_BRANCH_TO_CONSIDER} := + if (qq,m,n) in BRANCHCC and (qq,m,n) in BRANCHZNULL then 0 else branch_Bex[1,qq,m,n]; # Busses with valid voltage value @@ -184,18 +187,18 @@ param branch_Rdeph{(qq,m,n) in BRANCHCC_DEPH} = else branch_R[1,qq,m,n] ; -param branch_angper{(qq,m,n) in BRANCHCC} = +param branch_angper{(qq,m,n) in ALL_BRANCH_TO_CONSIDER} = if (qq,m,n) in BRANCHCC_DEPH then atan2(branch_Rdeph[qq,m,n], branch_Xdeph[qq,m,n]) else atan2(branch_R[1,qq,m,n] , branch_X_mod[qq,m,n] ); -param branch_admi {(qq,m,n) in BRANCHCC} = +param branch_admi {(qq,m,n) in ALL_BRANCH_TO_CONSIDER} = if (qq,m,n) in BRANCHCC_DEPH then 1./sqrt(branch_Rdeph[qq,m,n]^2 + branch_Xdeph[qq,m,n]^2 ) else 1./sqrt(branch_R[1,qq,m,n]^2 + branch_X_mod[qq,m,n]^2 ); # Later in this file, a variable branch_Ror_var will be created, to replace branch_Ror when it is not variable -param branch_Ror {(qq,m,n) in BRANCHCC} = +param branch_Ror {(qq,m,n) in ALL_BRANCH_TO_CONSIDER} = ( if ((qq,m,n) in BRANCHCC_REGL) then tap_ratio[1,regl_table[1,branch_ptrRegl[1,qq,m,n]],regl_tap0[1,branch_ptrRegl[1,qq,m,n]]] else 1.0 @@ -205,13 +208,13 @@ param branch_Ror {(qq,m,n) in BRANCHCC} = else 1.0 ) * (branch_cstratio[1,qq,m,n]); -param branch_Rex {(q,m,n) in BRANCHCC} = 1; # In IIDM, everything is in bus1 so ratio at bus2 is always 1 +param branch_Rex {(q,m,n) in ALL_BRANCH_TO_CONSIDER} = 1; # In IIDM, everything is in bus1 so ratio at bus2 is always 1 -param branch_dephor {(qq,m,n) in BRANCHCC} = +param branch_dephor {(qq,m,n) in ALL_BRANCH_TO_CONSIDER} = if ((qq,m,n) in BRANCHCC_DEPH) then tap_angle [1,deph_table[1,branch_ptrDeph[1,qq,m,n]],deph_tap0[1,branch_ptrDeph[1,qq,m,n]]] else 0; -param branch_dephex {(qq,m,n) in BRANCHCC} = 0; # In IIDM, everything is in bus1 so dephase at bus2 is always 0 +param branch_dephex {(qq,m,n) in ALL_BRANCH_TO_CONSIDER} = 0; # In IIDM, everything is in bus1 so dephase at bus2 is always 0 ############################################################################### diff --git a/open-reac/src/main/resources/openreac/dcopf.run b/open-reac/src/main/resources/openreac/dcopf.run index 41a47db4..a1056497 100644 --- a/open-reac/src/main/resources/openreac/dcopf.run +++ b/open-reac/src/main/resources/openreac/dcopf.run @@ -88,7 +88,7 @@ printf{LOG_INFO} "OK all slack variables for DCOPF are null\n"; let dcopf_status := "OK"; # Print flows on branches with zero impedance -for{(qq,m,n) in BRANCHZNULL} printf{LOG_INFO} "Flow on zero impedance branch %Q: %.f MW\n",branch_id[1,qq,m,n],activeflow[qq,m,n]; +#for{(qq,m,n) in BRANCHZNULL} printf{LOG_INFO} "Flow on zero impedance branch %Q: %.f MW\n",branch_id[1,qq,m,n],activeflow[qq,m,n]; # Print flows on most loaded lines let temp1 := max{(qq,m,n) in BRANCHCC}abs(activeflow[qq,m,n]); From 2bd42283be7a49575c43d9dea7a54df1341c02d4 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Wed, 27 Nov 2024 11:32:12 +0100 Subject: [PATCH 22/63] wip Signed-off-by: p-arvy --- open-reac/README.md | 5 + .../src/main/resources/openreac/acopf.mod | 78 +-- .../src/main/resources/openreac/commons.mod | 35 +- .../resources/openreac/reactiveopfoutput.run | 38 +- .../OpenReacBranchOneSideOpenTest.java | 6 + .../powsybl/openreac/OpenReacRunnerTest.java | 627 ++++++++++++++++++ .../AbstractLoadFlowNetworkFactory.java | 12 +- .../network/OneSideOpenNetworkFactory.java | 39 ++ .../com/powsybl/config/test/config.yml | 2 +- 9 files changed, 776 insertions(+), 66 deletions(-) create mode 100644 open-reac/src/test/java/com/powsybl/openreac/OpenReacBranchOneSideOpenTest.java create mode 100644 open-reac/src/test/java/com/powsybl/openreac/OpenReacRunnerTest.java create mode 100644 open-reac/src/test/java/com/powsybl/openreac/network/OneSideOpenNetworkFactory.java diff --git a/open-reac/README.md b/open-reac/README.md index 5f6db1d6..e4f3e8cd 100644 --- a/open-reac/README.md +++ b/open-reac/README.md @@ -5,3 +5,8 @@ Have a look at the powsybl-optimizer [README](https://github.com/powsybl/powsybl Visit our [readthedocs](https://powsybl.readthedocs.io/projects/powsybl-optimizer/en/stable/) page to find the functional documentation! + +TODO +Should ratio tap changers on branch with one side opened be optimized? +Clarify if they should be taken into account on branches with side 1 opened +Surement une erreur dans le code AMPL. QUand G1 est non nul alors il y a des problèmes \ No newline at end of file diff --git a/open-reac/src/main/resources/openreac/acopf.mod b/open-reac/src/main/resources/openreac/acopf.mod index dcfa29af..a2c717a6 100644 --- a/open-reac/src/main/resources/openreac/acopf.mod +++ b/open-reac/src/main/resources/openreac/acopf.mod @@ -132,48 +132,34 @@ var Red_Tran_Rea_Inv{(qq,m,n) in BRANCHCC } = + V[n] * (branch_admi[qq,m,n]*cos(branch_angper[qq,m,n])-branch_Bex_mod[qq,m,n]) ; -# Penalized active/reactive power on branches with one side opened -var act_power_bus2_opened{(qq,m,n) in BRANCH_WITH_SIDE_2_OPENED} = -(branch_Ror[qq,m,n])**2 * V[m] * -(branch_Gor_mod[qq,m,n] + (branch_admi[qq,m,n])**2 * branch_Gex_mod[qq,m,n] -/ ( (branch_Gex_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 -+ (- branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) # Shunt -+ ((branch_Bex_mod[qq,m,n])**2 + (branch_Gex_mod[qq,m,n])**2) * branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]) -/ ( (branch_Gex_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 -+ (- branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) # Shunt -); - -var rea_power_bus2_opened{(qq,m,n) in BRANCH_WITH_SIDE_2_OPENED} = -- (branch_Ror[qq,m,n])**2 * V[m] * -(branch_Bor_mod[qq,m,n] + (branch_admi[qq,m,n])**2 * branch_Bex_mod[qq,m,n] -/ ( (branch_Gex_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 -+ (- branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) # Shunt -- ((branch_Bex_mod[qq,m,n])**2 + (branch_Gex_mod[qq,m,n])**2) * branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]) -/ ( (branch_Gex_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 -+ (-branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) # Shunt -); - -var act_power_bus1_opened{(qq,m,n) in BRANCH_WITH_SIDE_1_OPENED} = -V[n] * -(branch_Gex_mod[qq,m,n] -+ (branch_admi[qq,m,n])**2 * branch_Gor_mod[qq,m,n] -/ ( (branch_Gor_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 -+ (- branch_Bor_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) # Shunt -+ ((branch_Bor_mod[qq,m,n])**2 + (branch_Gor_mod[qq,m,n])**2) * branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]) -/ ( (branch_Gor_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 -+ (- branch_Bor_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) # Shunt -); - -var rea_power_bus1_opened{(qq,m,n) in BRANCH_WITH_SIDE_1_OPENED} = -- V[n] * -(branch_Bex_mod[qq,m,n] -+ (branch_admi[qq,m,n])**2 * branch_Bor_mod[qq,m,n] -/ ( (branch_Gor_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 -+ (- branch_Bor_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) # Shunt -- ((branch_Bor_mod[qq,m,n])**2 + (branch_Gor_mod[qq,m,n])**2) * branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]) -/ ( (branch_Gor_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 -+ (- branch_Bor_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) # Shunt -); +var Red_Tran_Act_Dir_Side_2_Opened{(qq,m,n) in BRANCHCC_WITH_SIDE_2_OPENED} = + (branch_Ror[qq,m,n])**2 * V[m] * (branch_Gor_mod[qq,m,n] + (branch_admi[qq,m,n])**2 * branch_Gex_mod[qq,m,n] / ( (branch_Gex_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 + + (- branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) + + ((branch_Bex_mod[qq,m,n])**2 + (branch_Gex_mod[qq,m,n])**2) * branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]) / ( (branch_Gex_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 + + (- branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 )) + ; + +var Red_Tran_Rea_Dir_Side_2_Opened{(qq,m,n) in BRANCHCC_WITH_SIDE_2_OPENED} = + - (branch_Ror[qq,m,n])**2 * V[m] * (branch_Bor_mod[qq,m,n] + (branch_admi[qq,m,n])**2 * branch_Bex_mod[qq,m,n] / ( (branch_Gex_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 + + (- branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) + - ((branch_Bex_mod[qq,m,n])**2 + (branch_Gex_mod[qq,m,n])**2) * branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]) / ( (branch_Gex_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 + + (-branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 )) + ; + +var Red_Tran_Act_Inv_Side_1_Opened{(qq,m,n) in BRANCHCC_WITH_SIDE_1_OPENED} = + V[n] * (branch_Gex_mod[qq,m,n] + (branch_admi[qq,m,n])**2 * branch_Gor_mod[qq,m,n] / ( (branch_Gor_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 + + (- branch_Bor_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) + + ((branch_Bor_mod[qq,m,n])**2 + (branch_Gor_mod[qq,m,n])**2) * branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]) / ( (branch_Gor_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 + + (- branch_Bor_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 )) + ; + +var Red_Tran_Rea_Inv_Side_1_Opened{(qq,m,n) in BRANCHCC_WITH_SIDE_1_OPENED} = + - V[n] * (branch_Bex_mod[qq,m,n] + + (branch_admi[qq,m,n])**2 * branch_Bor_mod[qq,m,n] / ( (branch_Gor_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 + + (- branch_Bor_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) + - ((branch_Bor_mod[qq,m,n])**2 + (branch_Gor_mod[qq,m,n])**2) * branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]) / ( (branch_Gor_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 + + (- branch_Bor_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 )) + ; # @@ -185,8 +171,8 @@ subject to ctr_balance_P{PROBLEM_ACOPF,k in BUSCC}: sum{(qq,k,n) in BRANCHCC} base100MVA * V[k] * Red_Tran_Act_Dir[qq,k,n] + sum{(qq,m,k) in BRANCHCC} base100MVA * V[k] * Red_Tran_Act_Inv[qq,m,k] # Flows on branches with one side opened -+ sum{(qq,k,n) in BRANCH_WITH_SIDE_2_OPENED} base100MVA * V[k] * act_power_bus2_opened[qq,k,n] -+ sum{(qq,m,k) in BRANCH_WITH_SIDE_1_OPENED} base100MVA * V[k] * act_power_bus1_opened[qq,m,k] ++ sum{(qq,k,n) in BRANCHCC_WITH_SIDE_2_OPENED} base100MVA * V[k] * Red_Tran_Act_Dir_Side_2_Opened[qq,k,n] ++ sum{(qq,m,k) in BRANCHCC_WITH_SIDE_1_OPENED} base100MVA * V[k] * Red_Tran_Act_Inv_Side_1_Opened[qq,m,k] # Generating units - sum{(g,k) in UNITON} P[g,k] # Batteries @@ -217,8 +203,8 @@ subject to ctr_balance_Q{PROBLEM_ACOPF,k in BUSCC}: sum{(qq,k,n) in BRANCHCC} base100MVA * V[k] * Red_Tran_Rea_Dir[qq,k,n] + sum{(qq,m,k) in BRANCHCC} base100MVA * V[k] * Red_Tran_Rea_Inv[qq,m,k] # Flows on branches with one side opened -+ sum{(qq,k,n) in BRANCH_WITH_SIDE_2_OPENED} base100MVA * V[k] * rea_power_bus2_opened[qq,k,n] -+ sum{(qq,m,k) in BRANCH_WITH_SIDE_1_OPENED} base100MVA * V[k] * rea_power_bus1_opened[qq,m,k] ++ sum{(qq,k,n) in BRANCHCC_WITH_SIDE_2_OPENED} base100MVA * V[k] * Red_Tran_Rea_Dir_Side_2_Opened[qq,k,n] ++ sum{(qq,m,k) in BRANCHCC_WITH_SIDE_1_OPENED} base100MVA * V[k] * Red_Tran_Rea_Inv_Side_1_Opened[qq,m,k] # Generating units - sum{(g,k) in UNITON: (g,k) not in UNIT_FIXQ } Q[g,k] - sum{(g,k) in UNIT_FIXQ} unit_Qc[1,g,k] diff --git a/open-reac/src/main/resources/openreac/commons.mod b/open-reac/src/main/resources/openreac/commons.mod index 57be88c2..63092138 100644 --- a/open-reac/src/main/resources/openreac/commons.mod +++ b/open-reac/src/main/resources/openreac/commons.mod @@ -47,10 +47,13 @@ set BUS2:= setof {(1,n) in BUS: set BRANCH2:= setof {(1,qq,m,n) in BRANCH: m in BUS2 and n in BUS2} (qq,m,n); set BUSCC dimen 1 default {}; +# Branches with bus on side 1 and 2 in CC set BRANCHCC := {(qq,m,n) in BRANCH2: m in BUSCC and n in BUSCC}; -set BRANCH_WITH_SIDE_2_OPENED := setof {(1,qq,m,n) in BRANCH: m in BUSCC and n == -1 and m != n} (qq,m,n); -set BRANCH_WITH_SIDE_1_OPENED := setof {(1,qq,m,n) in BRANCH: m == -1 and n in BUSCC and m != n} (qq,m,n); -set ALL_BRANCH_TO_CONSIDER:= BRANCHCC union BRANCH_WITH_SIDE_2_OPENED union BRANCH_WITH_SIDE_1_OPENED; +# Branches with disconnected bus on side 2 +set BRANCHCC_WITH_SIDE_2_OPENED := setof {(1,qq,m,n) in BRANCH: m in BUSCC and n == -1 and m != n} (qq,m,n); +# Branches with disconnected bus on side 1 +set BRANCHCC_WITH_SIDE_1_OPENED := setof {(1,qq,m,n) in BRANCH: m == -1 and n in BUSCC and m != n} (qq,m,n); +set ALL_BRANCHCC := BRANCHCC union BRANCHCC_WITH_SIDE_2_OPENED union BRANCHCC_WITH_SIDE_1_OPENED; ############################################################################### @@ -97,29 +100,29 @@ set LCCCONVON := setof{(t,l,n) in LCCCONV: # Branches with zero or near zero impedances # Notice: module of Z is equal to square root of (R^2+X^2) -set BRANCHZNULL := {(qq,m,n) in ALL_BRANCH_TO_CONSIDER: branch_R[1,qq,m,n]^2+branch_X[1,qq,m,n]^2 <= Znull^2}; +set BRANCHZNULL := {(qq,m,n) in ALL_BRANCHCC: branch_R[1,qq,m,n]^2+branch_X[1,qq,m,n]^2 <= Znull^2}; # If in BRANCHZNULL, then set X to ZNULL -param branch_X_mod{(qq,m,n) in ALL_BRANCH_TO_CONSIDER} := +param branch_X_mod{(qq,m,n) in ALL_BRANCHCC} := if (qq,m,n) in BRANCHZNULL then Znull else branch_X[1,qq,m,n]; -check {(qq,m,n) in ALL_BRANCH_TO_CONSIDER}: abs(branch_X_mod[qq,m,n]) > 0; +check {(qq,m,n) in ALL_BRANCHCC}: abs(branch_X_mod[qq,m,n]) > 0; # If in BRANCHZNULL, then set Gor/Gex/Bor/Bex to 0 -param branch_Gor_mod{(qq,m,n) in ALL_BRANCH_TO_CONSIDER} := +param branch_Gor_mod{(qq,m,n) in ALL_BRANCHCC} := if (qq,m,n) in BRANCHCC and (qq,m,n) in BRANCHZNULL then 0 else branch_Gor[1,qq,m,n]; -param branch_Gex_mod{(qq,m,n) in ALL_BRANCH_TO_CONSIDER} := +param branch_Gex_mod{(qq,m,n) in ALL_BRANCHCC} := if (qq,m,n) in BRANCHCC and (qq,m,n) in BRANCHZNULL then 0 else branch_Gex[1,qq,m,n]; -param branch_Bor_mod{(qq,m,n) in ALL_BRANCH_TO_CONSIDER} := +param branch_Bor_mod{(qq,m,n) in ALL_BRANCHCC} := if (qq,m,n) in BRANCHCC and (qq,m,n) in BRANCHZNULL then 0 else branch_Bor[1,qq,m,n]; -param branch_Bex_mod{(qq,m,n) in ALL_BRANCH_TO_CONSIDER} := +param branch_Bex_mod{(qq,m,n) in ALL_BRANCHCC} := if (qq,m,n) in BRANCHCC and (qq,m,n) in BRANCHZNULL then 0 else branch_Bex[1,qq,m,n]; @@ -187,18 +190,18 @@ param branch_Rdeph{(qq,m,n) in BRANCHCC_DEPH} = else branch_R[1,qq,m,n] ; -param branch_angper{(qq,m,n) in ALL_BRANCH_TO_CONSIDER} = +param branch_angper{(qq,m,n) in ALL_BRANCHCC} = if (qq,m,n) in BRANCHCC_DEPH then atan2(branch_Rdeph[qq,m,n], branch_Xdeph[qq,m,n]) else atan2(branch_R[1,qq,m,n] , branch_X_mod[qq,m,n] ); -param branch_admi {(qq,m,n) in ALL_BRANCH_TO_CONSIDER} = +param branch_admi {(qq,m,n) in ALL_BRANCHCC} = if (qq,m,n) in BRANCHCC_DEPH then 1./sqrt(branch_Rdeph[qq,m,n]^2 + branch_Xdeph[qq,m,n]^2 ) else 1./sqrt(branch_R[1,qq,m,n]^2 + branch_X_mod[qq,m,n]^2 ); # Later in this file, a variable branch_Ror_var will be created, to replace branch_Ror when it is not variable -param branch_Ror {(qq,m,n) in ALL_BRANCH_TO_CONSIDER} = +param branch_Ror {(qq,m,n) in ALL_BRANCHCC} = ( if ((qq,m,n) in BRANCHCC_REGL) then tap_ratio[1,regl_table[1,branch_ptrRegl[1,qq,m,n]],regl_tap0[1,branch_ptrRegl[1,qq,m,n]]] else 1.0 @@ -208,13 +211,13 @@ param branch_Ror {(qq,m,n) in ALL_BRANCH_TO_CONSIDER} = else 1.0 ) * (branch_cstratio[1,qq,m,n]); -param branch_Rex {(q,m,n) in ALL_BRANCH_TO_CONSIDER} = 1; # In IIDM, everything is in bus1 so ratio at bus2 is always 1 +param branch_Rex {(q,m,n) in ALL_BRANCHCC} = 1; # In IIDM, everything is in bus1 so ratio at bus2 is always 1 -param branch_dephor {(qq,m,n) in ALL_BRANCH_TO_CONSIDER} = +param branch_dephor {(qq,m,n) in ALL_BRANCHCC} = if ((qq,m,n) in BRANCHCC_DEPH) then tap_angle [1,deph_table[1,branch_ptrDeph[1,qq,m,n]],deph_tap0[1,branch_ptrDeph[1,qq,m,n]]] else 0; -param branch_dephex {(qq,m,n) in ALL_BRANCH_TO_CONSIDER} = 0; # In IIDM, everything is in bus1 so dephase at bus2 is always 0 +param branch_dephex {(qq,m,n) in ALL_BRANCHCC} = 0; # In IIDM, everything is in bus1 so dephase at bus2 is always 0 ############################################################################### diff --git a/open-reac/src/main/resources/openreac/reactiveopfoutput.run b/open-reac/src/main/resources/openreac/reactiveopfoutput.run index c5469dc5..bb9bc357 100644 --- a/open-reac/src/main/resources/openreac/reactiveopfoutput.run +++ b/open-reac/src/main/resources/openreac/reactiveopfoutput.run @@ -286,7 +286,9 @@ printf "%s %i\n","nb_bus_with_voltage_value",card(BUSVV) > (fileOut); printf "%s %i\n","nb_bus_with_reactive_slacks",card(BUSCC_SLACK) > (fileOut); printf "%s %i\n","nb_bus_without_reactive_slacks",card(BUSCC diff BUSCC_SLACK) > (fileOut); printf "%s %i\n","nb_branch_in_data_file",card(BRANCH) > (fileOut); -printf "%s %i\n","nb_branch_in_AC_CC",card(BRANCHCC) > (fileOut); +printf "%s %i\n","nb_branch_in_AC_CC",card(ALL_BRANCHCC) > (fileOut); +printf "%s %i\n","nb_branch_in_AC_CC_side_1_opened",card(BRANCHCC_WITH_SIDE_1_OPENED) > (fileOut); +printf "%s %i\n","nb_branch_in_AC_CC_side_2_opened",card(BRANCHCC_WITH_SIDE_2_OPENED) > (fileOut); printf "%s %i\n","nb_branch_with_nonsmall_impedance",card(BRANCHCC diff BRANCHZNULL) > (fileOut); printf "%s %i\n","nb_branch_with_zero_or_small_impedance",card(BRANCHZNULL) > (fileOut); printf "%s %i\n","nb_unit_in_data_file",card(UNIT) > (fileOut); @@ -376,3 +378,37 @@ for {(g,n) in UNITCC diff UNITON} '"' & bus_id[1,n] & '"' > (fileOut); close (fileOut); + +# write flows on the branches +let fileOut := "reactiveopf_results_branches.csv"; +printf{LOG_DEBUG} "#qq;m;n;P1;Q1;P2;Q2;branch_id;\n" > (fileOut); +for {(qq,m,n) in ALL_BRANCHCC} + printf{LOG_DEBUG} "%i;%i;%i;%.3f;%.3f;%.3f;%.3f;%s;\n", + qq,m,n, + # p1 flow + if (qq,m,n) in BRANCHCC + then base100MVA * V[m] * Red_Tran_Act_Dir[qq,m,n] + else if (qq,m,n) in BRANCHCC_WITH_SIDE_2_OPENED + then base100MVA * V[m] * Red_Tran_Act_Dir_Side_2_Opened[qq,m,n] + else 0, # no flow as branch is opened on side 1 + # q1 flow + if (qq,m,n) in BRANCHCC + then base100MVA * V[m] * Red_Tran_Rea_Dir[qq,m,n] + else if (qq,m,n) in BRANCHCC_WITH_SIDE_2_OPENED + then base100MVA * V[m] * Red_Tran_Rea_Dir_Side_2_Opened[qq,m,n] + else 0, # no flow as branch is opened on side 1 + # p2 flow + if (qq,m,n) in BRANCHCC + then base100MVA * V[n] * Red_Tran_Act_Inv[qq,m,n] + else if (qq,m,n) in BRANCHCC_WITH_SIDE_1_OPENED + then base100MVA * V[n] * Red_Tran_Act_Inv_Side_1_Opened[qq,m,n] + else 0, # no flow as branch is opened on side 2 + # q2 flow + if (qq,m,n) in BRANCHCC + then base100MVA * V[n] * Red_Tran_Rea_Inv[qq,m,n] + else if (qq,m,n) in BRANCHCC_WITH_SIDE_1_OPENED + then base100MVA * V[n] * Red_Tran_Rea_Inv_Side_1_Opened[qq,m,n] + else 0, # no flow as branch is opened on side 2 + '"' & branch_id[1,qq,m,n] & '"' + > (fileOut); +close (fileOut); \ No newline at end of file diff --git a/open-reac/src/test/java/com/powsybl/openreac/OpenReacBranchOneSideOpenTest.java b/open-reac/src/test/java/com/powsybl/openreac/OpenReacBranchOneSideOpenTest.java new file mode 100644 index 00000000..5b4284e4 --- /dev/null +++ b/open-reac/src/test/java/com/powsybl/openreac/OpenReacBranchOneSideOpenTest.java @@ -0,0 +1,6 @@ +package com.powsybl.openreac; + +import org.junit.jupiter.api.Test; + +public class OpenReacBranchOneSideOpenTest { +} diff --git a/open-reac/src/test/java/com/powsybl/openreac/OpenReacRunnerTest.java b/open-reac/src/test/java/com/powsybl/openreac/OpenReacRunnerTest.java new file mode 100644 index 00000000..02f12c95 --- /dev/null +++ b/open-reac/src/test/java/com/powsybl/openreac/OpenReacRunnerTest.java @@ -0,0 +1,627 @@ +/** + * Copyright (c) 2023, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package com.powsybl.openreac; + +import com.google.common.jimfs.Configuration; +import com.google.common.jimfs.Jimfs; +import com.powsybl.commons.report.ReportNode; +import com.powsybl.commons.report.TypedValue; +import com.powsybl.commons.test.ComparisonUtils; +import com.powsybl.computation.ComputationManager; +import com.powsybl.computation.local.LocalCommandExecutor; +import com.powsybl.computation.local.LocalComputationConfig; +import com.powsybl.computation.local.LocalComputationManager; +import com.powsybl.ieeecdf.converter.IeeeCdfNetworkFactory; +import com.powsybl.iidm.network.*; +import com.powsybl.loadflow.LoadFlow; +import com.powsybl.loadflow.LoadFlowResult; +import com.powsybl.openreac.network.HvdcNetworkFactory; +import com.powsybl.openreac.network.VoltageControlNetworkFactory; +import com.powsybl.openreac.parameters.input.OpenReacParameters; +import com.powsybl.openreac.parameters.input.algo.OpenReacAmplLogLevel; +import com.powsybl.openreac.parameters.input.algo.ReactiveSlackBusesMode; +import com.powsybl.openreac.parameters.input.algo.OpenReacOptimisationObjective; +import com.powsybl.openreac.parameters.input.algo.OpenReacSolverLogLevel; +import com.powsybl.openreac.parameters.output.OpenReacResult; +import com.powsybl.openreac.parameters.output.OpenReacStatus; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.FileSystem; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ForkJoinPool; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.*; + +/** + * @author Geoffroy Jamgotchian {@literal } + * @author Nicolas PIERRE {@literal } + */ +class OpenReacRunnerTest { + protected FileSystem fileSystem; + protected Path tmpDir; + + @BeforeEach + public void setUp() throws IOException { + fileSystem = Jimfs.newFileSystem(Configuration.unix()); + tmpDir = Files.createDirectory(fileSystem.getPath("tmp")); + } + + @AfterEach + void tearDown() throws IOException { + fileSystem.close(); + } + + private void assertEqualsToRef(Path p, String refFileName) throws IOException { + try (InputStream actual = Files.newInputStream(p)) { + ComparisonUtils.assertTxtEquals(Objects.requireNonNull(getClass().getResourceAsStream(refFileName)), actual); + } + } + + private Path getAmplExecPath() throws IOException { + Path execFolder; + try (Stream walk = Files.walk(tmpDir)) { + execFolder = walk.limit(2).collect(Collectors.toList()).get(1); + } + return execFolder; + } + + @Test + void testDefaultParamAlgoExport() throws IOException { + Network network = IeeeCdfNetworkFactory.create57(); + setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network + OpenReacParameters parameters = new OpenReacParameters(); + + LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( + List.of("empty_case/reactiveopf_results_indic.txt")); + try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), + localCommandExecutor, ForkJoinPool.commonPool())) { + OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, + new OpenReacConfig(true), computationManager); + Path execFolder = getAmplExecPath(); + assertEqualsToRef(execFolder.resolve("param_algo.txt"), "/openreac-input-algo-parameters/default.txt"); + } + } + + @Test + 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() + .setObjective(OpenReacOptimisationObjective.SPECIFIC_VOLTAGE_PROFILE) + .setObjectiveDistance(69) + .setLogLevelAmpl(OpenReacAmplLogLevel.WARNING) + .setLogLevelSolver(OpenReacSolverLogLevel.ONLY_RESULTS) + .setMinPlausibleLowVoltageLimit(0.7888) + .setMaxPlausibleHighVoltageLimit(1.3455) + .setReactiveSlackBusesMode(ReactiveSlackBusesMode.NO_GENERATION) + .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) + .setTwoWindingTransformerRatioVariableScalingFactor(0.0045) + .setShuntVariableScalingFactor(0.101); + + LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( + List.of("empty_case/reactiveopf_results_indic.txt")); + try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), + localCommandExecutor, ForkJoinPool.commonPool())) { + OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, + new OpenReacConfig(true), computationManager); + Path execFolder = getAmplExecPath(); + assertEqualsToRef(execFolder.resolve("param_algo.txt"), "/openreac-input-algo-parameters/modified_param_algo.txt"); + } + } + + @Test + void testInputFile() throws IOException { + Network network = IeeeCdfNetworkFactory.create57(); + setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network + + OpenReacParameters parameters = new OpenReacParameters().setObjective( + OpenReacOptimisationObjective.BETWEEN_HIGH_AND_LOW_VOLTAGE_LIMIT) + .setObjectiveDistance(70) + .setReactiveSlackBusesMode(ReactiveSlackBusesMode.CONFIGURED) + .addVariableTwoWindingsTransformers(network.getTwoWindingsTransformerStream() + .limit(1) + .map(TwoWindingsTransformer::getId) + .collect(Collectors.toList())) + .addConstantQGenerators( + network.getGeneratorStream().limit(1).map(Generator::getId).collect(Collectors.toList())) + .addVariableShuntCompensators( + network.getShuntCompensatorStream().limit(1).map(ShuntCompensator::getId).collect(Collectors.toList())) + .addConfiguredReactiveSlackBuses( + network.getBusView().getBusStream().limit(1).map(Bus::getId).collect(Collectors.toList())); + + LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( + List.of("empty_case/reactiveopf_results_indic.txt")); + try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), + localCommandExecutor, ForkJoinPool.commonPool())) { + OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, + new OpenReacConfig(true), computationManager); + Path execFolder = getAmplExecPath(); + assertEqualsToRef(execFolder.resolve("param_algo.txt"), "/expected_inputs/param_algo.txt"); + assertEqualsToRef(execFolder.resolve("param_generators_reactive.txt"), "/expected_inputs/param_generators_reactive.txt"); + assertEqualsToRef(execFolder.resolve("param_shunts.txt"), "/expected_inputs/param_shunts.txt"); + assertEqualsToRef(execFolder.resolve("param_transformers.txt"), "/expected_inputs/param_transformers.txt"); + assertEqualsToRef(execFolder.resolve("param_buses_with_reactive_slack.txt"), "/expected_inputs/param_buses_with_reactive_slack.txt"); + } + } + + @Test + void testOutputFileParsing() throws IOException { + Network network = IeeeCdfNetworkFactory.create57(); + setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network + // To parse correctly data from output files, there must be an ID in the Ampl mapper + // For this we add dummy elements to the network, + // they will get exported, but the ampl mapper will have IDs for them. + // All the values are bad, and they are not used. + // RTC + network.getTwoWindingsTransformerStream() + .forEach(t -> t.newRatioTapChanger() + .setLowTapPosition(0) + .setTapPosition(0) + .beginStep() + .setR(0.01) + .setX(0.0001) + .setB(0) + .setG(0) + .setRho(1.1) + .endStep() + .add()); + // SVC + VoltageLevel vl = network.getVoltageLevelStream().iterator().next(); + vl.getBusBreakerView().newBus().setId("bus-1").add(); + vl.newStaticVarCompensator() + .setId("dummyStaticVarCompensator") + .setBus("bus-1") + .setBmin(1.1) + .setBmax(1.3) + .setRegulationMode(StaticVarCompensator.RegulationMode.OFF) + .add(); + // VSC + vl.newVscConverterStation() + .setId("dummyVscConverterStation") + .setConnectableBus("bus-1") + .setBus("bus-1") + .setLossFactor(1.1f) + .setVoltageSetpoint(405.0) + .setVoltageRegulatorOn(true) + .add(); + + LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( + List.of("mock_outputs/reactiveopf_results_generators.csv", + "mock_outputs/reactiveopf_results_indic.txt", + "mock_outputs/reactiveopf_results_rtc.csv", + "mock_outputs/reactiveopf_results_shunts.csv", + "mock_outputs/reactiveopf_results_static_var_compensators.csv", + "mock_outputs/reactiveopf_results_vsc_converter_stations.csv", + "mock_outputs/reactiveopf_results_voltages.csv")); + try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), + localCommandExecutor, ForkJoinPool.commonPool())) { + OpenReacResult openReacResult = OpenReacRunner.run(network, + network.getVariantManager().getWorkingVariantId(), new OpenReacParameters(), new OpenReacConfig(true), + computationManager); + + assertEquals(OpenReacStatus.OK, openReacResult.getStatus()); + assertEquals(1, openReacResult.getShuntsModifications().size()); + assertEquals(2, openReacResult.getTapPositionModifications().size()); + assertEquals(1, openReacResult.getSvcModifications().size()); + assertEquals(1, openReacResult.getVscModifications().size()); + assertEquals(7, openReacResult.getGeneratorModifications().size()); + assertEquals(3, openReacResult.getVoltageProfile().size()); + assertEquals(87, openReacResult.getIndicators().size()); + assertTrue(openReacResult.getReactiveSlacks().isEmpty()); + } + } + + @Test + void testRunAsync() throws IOException { + Network network = IeeeCdfNetworkFactory.create14(); + String subFolder = "openreac-output-ieee14"; + OpenReacParameters parameters = new OpenReacParameters(); + setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network + LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( + List.of(subFolder + "/reactiveopf_results_generators.csv", + subFolder + "/reactiveopf_results_indic.txt", + subFolder + "/reactiveopf_results_rtc.csv", + subFolder + "/reactiveopf_results_shunts.csv", + subFolder + "/reactiveopf_results_static_var_compensators.csv", + subFolder + "/reactiveopf_results_vsc_converter_stations.csv", + subFolder + "/reactiveopf_results_voltages.csv")); + // To really run open reac, use the commented line below. Be sure that open-reac/src/test/resources/com/powsybl/config/test/config.yml contains your ampl path +// try (ComputationManager computationManager = new LocalComputationManager()) { + try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), + localCommandExecutor, ForkJoinPool.commonPool())) { + CompletableFuture openReacResults = OpenReacRunner.runAsync(network, + network.getVariantManager().getWorkingVariantId(), parameters, new OpenReacConfig(true), + computationManager); + OpenReacResult openReacResult = openReacResults.join(); + assertEquals(OpenReacStatus.OK, openReacResult.getStatus()); + } + } + + private void testAllModifAndLoadFlow(Network network, String subFolder, OpenReacParameters parameters, ReportNode reportNode) throws IOException { + runAndApplyAllModifications(network, subFolder, parameters, true, reportNode); + LoadFlowResult loadFlowResult = LoadFlow.run(network); + assertTrue(loadFlowResult.isFullyConverged()); + } + + @Test + void testOnlyGenerator() throws IOException { + Network network = IeeeCdfNetworkFactory.create14(); + setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network + testAllModifAndLoadFlow(network, "openreac-output-ieee14", new OpenReacParameters(), ReportNode.NO_OP); + } + + @Test + void testHvdc() throws IOException { + Network network = HvdcNetworkFactory.createNetworkWithGenerators2(); + setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network + network.getVscConverterStation("cs3").getTerminal().setP(0.0); + network.getVscConverterStation("cs4").getTerminal().setP(0.0); + OpenReacParameters parameters = new OpenReacParameters(); + parameters.addConstantQGenerators(List.of("g1", "g2", "g5", "g6")); + testAllModifAndLoadFlow(network, "openreac-output-vsc", parameters, ReportNode.NO_OP); + } + + @Test + void testSvc() throws IOException { + Network network = VoltageControlNetworkFactory.createWithStaticVarCompensator(); + setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network + network.getVoltageLevelStream().forEach(vl -> vl.setLowVoltageLimit(380).setHighVoltageLimit(420)); + network.getStaticVarCompensator("svc1").setVoltageSetpoint(390).setRegulationMode(StaticVarCompensator.RegulationMode.VOLTAGE); + OpenReacParameters parameters = new OpenReacParameters(); + parameters.addConstantQGenerators(List.of("g1")); + testAllModifAndLoadFlow(network, "openreac-output-svc", parameters, ReportNode.NO_OP); + } + + @Test + void testShunt() throws IOException { + Network network = create(); + setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network + ShuntCompensator shunt = network.getShuntCompensator("SHUNT"); + assertFalse(shunt.getTerminal().isConnected()); + assertEquals(393, shunt.getTargetV()); + + OpenReacParameters parameters = new OpenReacParameters(); + parameters.addVariableShuntCompensators(List.of(shunt.getId())); + ReportNode reportNode = ReportNode.newRootReportNode().withMessageTemplate("openReac", "openReac").build(); + testAllModifAndLoadFlow(network, "openreac-output-shunt", parameters, reportNode); + + assertEquals(3, reportNode.getChildren().size()); + ReportNode reportShunts = reportNode.getChildren().get(2); + assertEquals(2, reportShunts.getChildren().size()); + assertEquals("shuntCompensatorDeltaOverThresholdCount", reportShunts.getChildren().get(0).getMessageKey()); + Map values = reportShunts.getChildren().get(0).getValues(); + assertEquals("1", values.get("shuntsCount").toString()); + assertEquals(TypedValue.INFO_SEVERITY.getValue(), values.get("reportSeverity").toString()); + + assertEquals("shuntCompensatorDeltaDiscretizedOptimizedOverThreshold", reportShunts.getChildren().get(1).getMessageKey()); + values = reportShunts.getChildren().get(1).getValues(); + assertEquals("SHUNT", values.get("shuntCompensatorId").toString()); + assertEquals("25", values.get("maxSectionCount").toString()); + assertEquals("160.0", values.get("discretizedValue").toString()); + assertEquals("123.4", values.get("optimalValue").toString()); + assertEquals(TypedValue.TRACE_SEVERITY.getValue(), values.get("reportSeverity").toString()); + + assertTrue(shunt.getTerminal().isConnected()); // shunt has been reconnected + assertEquals(420.8, shunt.getTargetV()); // targetV has been updated + } + + @Test + void testShuntWithDeltaBetweenDiscretizedAndOptimalReactiveValueUnderThreshold() throws IOException { + Network network = create(); + setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network + ShuntCompensator shunt = network.getShuntCompensator("SHUNT"); + assertFalse(shunt.getTerminal().isConnected()); + assertEquals(393, shunt.getTargetV()); + + OpenReacParameters parameters = new OpenReacParameters(); + parameters.setShuntCompensatorActivationAlertThreshold(100.); + parameters.addVariableShuntCompensators(List.of(shunt.getId())); + ReportNode reportNode = ReportNode.newRootReportNode().withMessageTemplate("openReac", "openReac").build(); + testAllModifAndLoadFlow(network, "openreac-output-shunt", parameters, reportNode); + + assertEquals(2, reportNode.getChildren().size()); + + assertTrue(shunt.getTerminal().isConnected()); // shunt has been reconnected + assertEquals(420.8, shunt.getTargetV()); // targetV has been updated + } + + @Test + void testTransformer() throws IOException { + Network network = VoltageControlNetworkFactory.createNetworkWithT2wt(); + setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network + RatioTapChanger rtc = network.getTwoWindingsTransformer("T2wT").getRatioTapChanger() + .setTapPosition(2) + .setTargetDeadband(0) + .setRegulating(true); + assertEquals(2, rtc.getTapPosition()); + assertEquals(33.0, rtc.getTargetV()); + + OpenReacParameters parameters = new OpenReacParameters(); + parameters.addConstantQGenerators(List.of("GEN_1")); + parameters.addVariableTwoWindingsTransformers(List.of("T2wT")); + testAllModifAndLoadFlow(network, "openreac-output-transfo", parameters, ReportNode.NO_OP); + assertEquals(0, rtc.getTapPosition()); + assertEquals(22.935, rtc.getTargetV()); + } + + @Test + void testRealNetwork() throws IOException { + Network network = IeeeCdfNetworkFactory.create57(); + setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network + OpenReacParameters parameters = new OpenReacParameters(); + testAllModifAndLoadFlow(network, "openreac-output-real-network", parameters, ReportNode.NO_OP); + } + + @Test + void testWarmStart() throws IOException { + Network network = VoltageControlNetworkFactory.createNetworkWithT2wt(); + setDefaultVoltageLimits(network); + String subFolder = "openreac-output-warm-start"; + OpenReacParameters parameters = new OpenReacParameters(); + + runAndApplyAllModifications(network, subFolder, parameters, false, ReportNode.NO_OP); // without warm start, no update + assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_1").getV()); + assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_1").getAngle()); + assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_2").getV()); + assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_2").getAngle()); + assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_3").getV()); + assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_3").getAngle()); + + runAndApplyAllModifications(network, subFolder, parameters, true, ReportNode.NO_OP); + assertEquals(119.592, network.getBusBreakerView().getBus("BUS_1").getV()); + assertEquals(0.802, network.getBusBreakerView().getBus("BUS_1").getAngle(), 0.001); + assertEquals(118.8, network.getBusBreakerView().getBus("BUS_2").getV()); + assertEquals(0, network.getBusBreakerView().getBus("BUS_2").getAngle()); + assertEquals(22.935, network.getBusBreakerView().getBus("BUS_3").getV()); + assertEquals(-4.698, network.getBusBreakerView().getBus("BUS_3").getAngle(), 0.001); + } + + /** + * Runs OpenReac and apply the results on the network. + * The application of the voltage plan calculated by optimization is optional. + */ + private void runAndApplyAllModifications(Network network, String subFolder, OpenReacParameters parameters, + boolean updateNetworkWithVoltages, ReportNode reportNode) throws IOException { + OpenReacResult openReacResult = runOpenReac(network, subFolder, parameters, reportNode); + assertEquals(OpenReacStatus.OK, openReacResult.getStatus()); + openReacResult.setUpdateNetworkWithVoltages(updateNetworkWithVoltages); + openReacResult.applyAllModifications(network); + } + + /** + * Runs OpenReac and returns associated result. + * Note that OpenReac is not really executed by default. If the execution line is not uncommented, + * the results are retrieved and stored in an {@link OpenReacResult} object. + */ + private OpenReacResult runOpenReac(Network network, String subFolder, OpenReacParameters parameters, ReportNode reportNode) throws IOException { + LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( + List.of(subFolder + "/reactiveopf_results_generators.csv", + subFolder + "/reactiveopf_results_indic.txt", + subFolder + "/reactiveopf_results_rtc.csv", + subFolder + "/reactiveopf_results_shunts.csv", + subFolder + "/reactiveopf_results_static_var_compensators.csv", + subFolder + "/reactiveopf_results_vsc_converter_stations.csv", + subFolder + "/reactiveopf_results_voltages.csv")); + // To really run open reac, use the commentede line below. Be sure that open-reac/src/test/resources/com/powsybl/config/test/config.yml contains your ampl path + try (ComputationManager computationManager = new LocalComputationManager()) { +// try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), +// localCommandExecutor, ForkJoinPool.commonPool())) { + return OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, + new OpenReacConfig(true), computationManager, reportNode, null); + } + } + + // TODO : add more tests for indicators and rebase on this + // TODO : for no impedance lines, use the same network + @Test + void testBranchesIndicators() throws IOException { + Network network = VoltageControlNetworkFactory.createWithSimpleRemoteControl(); + network.getLine("l24").getTerminal2().disconnect(); + network.getLine("l43").getTerminal1().disconnect(); + setDefaultVoltageLimits(network); + OpenReacResult result = runOpenReac(network, "openreac-output-branches-opened", new OpenReacParameters(), ReportNode.NO_OP); + assertEquals("4", result.getIndicators().get("nb_branch_in_data_file")); + assertEquals("4", result.getIndicators().get("nb_branch_in_AC_CC")); + assertEquals("1", result.getIndicators().get("nb_branch_in_AC_CC_side_1_opened")); + assertEquals("1", result.getIndicators().get("nb_branch_in_AC_CC_side_2_opened")); + } + + @Test + void testLinesOpenedSide1OpenReac() throws IOException { + Network network = VoltageControlNetworkFactory.createWithSimpleRemoteControl(); + network.getLine("l43") + .setG2(0.1f) + .setB2(0.1f) + .getTerminal1().disconnect(); + setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network + testAllModifAndLoadFlow(network, "openreac-output-real-network", new OpenReacParameters(), ReportNode.NO_OP); + } + + @Test + void testLinesOpenedSide2OpenReac() throws IOException { + Network network = VoltageControlNetworkFactory.createWithSimpleRemoteControl(); + network.getLine("l24") + .setG1(0.1f) + .setB1(0.1f) + .getTerminal2().disconnect(); + setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network + testAllModifAndLoadFlow(network, "openreac-output-real-network", new OpenReacParameters(), ReportNode.NO_OP); + } + + @Test + void testBranchZeroImpedanceSide1OpenedOpenReac() throws IOException { + Network network = VoltageControlNetworkFactory.createWithSimpleRemoteControl(); + network.getLine("l43") + .setX(0.0) + .getTerminal2().disconnect(); + setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network + testAllModifAndLoadFlow(network, "openreac-output-real-network", new OpenReacParameters(), ReportNode.NO_OP); + } + + @Test + void testBranchZeroImpedanceSide2OpenedOpenReac() throws IOException { + Network network = VoltageControlNetworkFactory.createWithSimpleRemoteControl(); + network.getLine("l43") + .setX(0.0) + .getTerminal1().disconnect(); + setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network + testAllModifAndLoadFlow(network, "openreac-output-real-network", new OpenReacParameters(), ReportNode.NO_OP); + } + + @Test + void testBranchWithRatioTapChangerSide1OpenedOpenReac() { + // TODO + } + + @Test + void testBranchWithPhaseTapChangerSide1OpenedOpenReac() { + // TODO + } + + @Test + void testBranchWithRatioTapChangerSide2OpenedOpenReac() { + // TODO + } + + @Test + void testBranchWithPhaseTapChangerSide2OpenedOpenReac() { + // TODO + } + + @Test + // TODO : to be clarified if we take into account the ratio tap changers on branches that are opened... + void testRatioTapChangerNotOptimizedIfOpenSide2() throws IOException { + Network network = VoltageControlNetworkFactory.createNetworkWith2T2wt(); + network.getTwoWindingsTransformer("T2wT1").getTerminal2().disconnect(); + setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network + + OpenReacParameters parameters = new OpenReacParameters(); + parameters.addVariableTwoWindingsTransformers(List.of("T2wT1", "T2wT2")); + OpenReacResult result = runOpenReac(network, "", parameters, ReportNode.NO_OP); + + // verify only one rtc has been optimized + assertEquals("1", result.getIndicators().get("nb_transformers_with_variable_ratio")); + assertEquals("1", result.getIndicators().get("nb_transformers_with_fixed_ratio")); + + // verify tap of optimized rtc has changed + assertEquals(); + } + + public static Network create() { + Network network = Network.create("svc", "test"); + Substation s1 = network.newSubstation() + .setId("S1") + .add(); + Substation s2 = network.newSubstation() + .setId("S2") + .add(); + VoltageLevel vl1 = s1.newVoltageLevel() + .setId("vl1") + .setNominalV(400) + .setHighVoltageLimit(420) + .setLowVoltageLimit(380) + .setTopologyKind(TopologyKind.BUS_BREAKER) + .add(); + vl1.getBusBreakerView().newBus() + .setId("b1") + .add(); + vl1.newGenerator() + .setId("g1") + .setConnectableBus("b1") + .setBus("b1") + .setTargetP(101.3664) + .setTargetV(390) + .setMinP(0) + .setMaxP(150) + .setVoltageRegulatorOn(true) + .add(); + VoltageLevel vl2 = s2.newVoltageLevel() + .setId("vl2") + .setNominalV(400) + .setTopologyKind(TopologyKind.BUS_BREAKER) + .add(); + vl2.getBusBreakerView().newBus() + .setId("b2") + .add(); + vl2.newLoad() + .setId("ld1") + .setConnectableBus("b2") + .setBus("b2") + .setP0(101) + .setQ0(150) + .add(); + VoltageLevel vl3 = s2.newVoltageLevel() + .setId("vl3") + .setNominalV(400) + .setTopologyKind(TopologyKind.BUS_BREAKER) + .add(); + vl3.getBusBreakerView().newBus() + .setId("b3") + .add(); + vl3.newShuntCompensator() + .setId("SHUNT") + // .setBus("b3") + .setConnectableBus("b3") + .setSectionCount(0) + .setVoltageRegulatorOn(true) + .setTargetV(393) + .setTargetDeadband(5.0) + .newLinearModel() + .setMaximumSectionCount(25) + .setBPerSection(1e-3) + .add() + .add(); + network.newLine() + .setId("l1") + .setBus1("b1") + .setBus2("b2") + .setR(1) + .setX(3) + .add(); + network.newLine() + .setId("l2") + .setBus1("b3") + .setBus2("b2") + .setR(1) + .setX(3) + .add(); + return network; + } + + // TODO : to be moved so that it is used by default when we run a network + void setDefaultVoltageLimits(Network network) { + for (VoltageLevel vl : network.getVoltageLevels()) { + if (vl.getLowVoltageLimit() <= 0 || Double.isNaN(vl.getLowVoltageLimit())) { + vl.setLowVoltageLimit(0.5 * vl.getNominalV()); + } + if (Double.isNaN(vl.getHighVoltageLimit())) { + vl.setHighVoltageLimit(1.5 * vl.getNominalV()); + } + } + } +} diff --git a/open-reac/src/test/java/com/powsybl/openreac/network/AbstractLoadFlowNetworkFactory.java b/open-reac/src/test/java/com/powsybl/openreac/network/AbstractLoadFlowNetworkFactory.java index 4baf9161..aac300c0 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/network/AbstractLoadFlowNetworkFactory.java +++ b/open-reac/src/test/java/com/powsybl/openreac/network/AbstractLoadFlowNetworkFactory.java @@ -62,7 +62,7 @@ protected static Generator createGenerator(Bus b, String id, double p, double v) .setConnectableBus(b.getId()) .setEnergySource(EnergySource.OTHER) .setMinP(0) - .setMaxP(p) + .setMaxP(2 * p) .setTargetP(p) .setTargetV(v) .setVoltageRegulatorOn(true) @@ -101,14 +101,22 @@ protected static Load createLoad(Bus b, String id, double p, double q) { } protected static Line createLine(Network network, Bus b1, Bus b2, String id, double x) { + return createLine(network, b1, b2, id, 0, x, 0, 0); + } + + protected static Line createLine(Network network, Bus b1, Bus b2, String id, double r, double x, double halfG, double halfB) { return network.newLine() .setId(id) .setBus1(b1.getId()) .setConnectableBus1(b1.getId()) .setBus2(b2.getId()) .setConnectableBus2(b2.getId()) - .setR(0) + .setR(r) .setX(x) + .setG1(halfG) + .setB1(halfB) + .setG2(halfG) + .setB2(halfB) .add(); } diff --git a/open-reac/src/test/java/com/powsybl/openreac/network/OneSideOpenNetworkFactory.java b/open-reac/src/test/java/com/powsybl/openreac/network/OneSideOpenNetworkFactory.java new file mode 100644 index 00000000..35d6fa7c --- /dev/null +++ b/open-reac/src/test/java/com/powsybl/openreac/network/OneSideOpenNetworkFactory.java @@ -0,0 +1,39 @@ +package com.powsybl.openreac.network; + +import com.powsybl.iidm.network.Bus; +import com.powsybl.iidm.network.Network; + +public class OneSideOpenNetworkFactory extends AbstractLoadFlowNetworkFactory { + + public static Network createWithOpenedOnSide1() { + Network network = create(); + Bus b0 = createBus(network, "b0"); + Bus b1 = network.getBusView().getBus("b1"); + createLine(network, b0, b1, "l01", 0, 0.1f, 0.1f, 0.1f); + network.getLine("l01").getTerminal1().disconnect(); + return network; + } + + + /** + * 0 MW, 0 MVar + * 1 ===== 1pu + * | + * | + * | 0.1j + * | + * | + * 2 ===== 1pu + * 200 MW, 100 MVar + */ + public static Network create() { + Network network = Network.create("2-bus", "code"); + Bus b1 = createBus(network, "b1"); + Bus b2 = createBus(network, "b2"); + createGenerator(b1, "g1", 2, 1); + createLoad(b2, "l1", 2, 1); + createLine(network, b1, b2, "l12", 0.1f); + return network; + } + +} diff --git a/open-reac/src/test/resources/com/powsybl/config/test/config.yml b/open-reac/src/test/resources/com/powsybl/config/test/config.yml index 1acd4f0d..9d797384 100644 --- a/open-reac/src/test/resources/com/powsybl/config/test/config.yml +++ b/open-reac/src/test/resources/com/powsybl/config/test/config.yml @@ -1,2 +1,2 @@ ampl: - homeDir: ??? + homeDir: D:\AMPL-13.1.20220703-Win-64 From 68edf3af983ac0825d6dc23de3e2da6043b1cd0c Mon Sep 17 00:00:00 2001 From: p-arvy Date: Wed, 27 Nov 2024 17:26:23 +0100 Subject: [PATCH 23/63] Add RTC on opened branch and associated TUs Signed-off-by: p-arvy --- open-reac/README.md | 5 -- .../src/main/resources/openreac/commons.mod | 3 +- .../powsybl/openreac/OpenReacRunnerTest.java | 85 +++++++++---------- 3 files changed, 44 insertions(+), 49 deletions(-) diff --git a/open-reac/README.md b/open-reac/README.md index e4f3e8cd..5f6db1d6 100644 --- a/open-reac/README.md +++ b/open-reac/README.md @@ -5,8 +5,3 @@ Have a look at the powsybl-optimizer [README](https://github.com/powsybl/powsybl Visit our [readthedocs](https://powsybl.readthedocs.io/projects/powsybl-optimizer/en/stable/) page to find the functional documentation! - -TODO -Should ratio tap changers on branch with one side opened be optimized? -Clarify if they should be taken into account on branches with side 1 opened -Surement une erreur dans le code AMPL. QUand G1 est non nul alors il y a des problèmes \ No newline at end of file diff --git a/open-reac/src/main/resources/openreac/commons.mod b/open-reac/src/main/resources/openreac/commons.mod index 63092138..000a36a8 100644 --- a/open-reac/src/main/resources/openreac/commons.mod +++ b/open-reac/src/main/resources/openreac/commons.mod @@ -131,7 +131,7 @@ set BUSVV := {n in BUSCC : bus_V0[1,n] >= min_plausible_low_voltage_limit}; # Reactive set SHUNTCC := {(1,s,n) in SHUNT: n in BUSCC or shunt_possiblebus[1,s,n] in BUSCC}; # We want to be able to reconnect shunts -set BRANCHCC_REGL := {(qq,m,n) in BRANCHCC diff BRANCHZNULL: branch_ptrRegl[1,qq,m,n] != -1 }; +set BRANCHCC_REGL := {(qq,m,n) in BRANCHCC union BRANCHCC_WITH_SIDE_2_OPENED diff BRANCHZNULL: branch_ptrRegl[1,qq,m,n] != -1 }; # ratio tap changers have impact on lines with side 1 opened set BRANCHCC_DEPH := {(qq,m,n) in BRANCHCC diff BRANCHZNULL: branch_ptrDeph[1,qq,m,n] != -1 }; set SVCCC := {(1,svc,n) in SVC: n in BUSCC}; @@ -170,6 +170,7 @@ set UNIT_FIXQ := {(g,n) in UNITON: g in PARAM_UNIT_FIXQ and abs(unit_Qc[1,g,n])< set BRANCHCC_REGL_VAR := { (qq,m,n) in BRANCHCC_REGL: qq in PARAM_TRANSFORMERS_RATIO_VARIABLE + and (qq,m,n) not in BRANCHCC_WITH_SIDE_2_OPENED # ratio tap changers on branch with side 2 opened are not optimized and regl_ratio_min[1,branch_ptrRegl[1,qq,m,n]] < regl_ratio_max[1,branch_ptrRegl[1,qq,m,n]] }; set BRANCHCC_REGL_FIX := BRANCHCC_REGL diff BRANCHCC_REGL_VAR; 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 02f12c95..9cc66ff2 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/OpenReacRunnerTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/OpenReacRunnerTest.java @@ -452,72 +452,69 @@ void testBranchesIndicators() throws IOException { } @Test - void testLinesOpenedSide1OpenReac() throws IOException { + void testOpenLineSide1OpenReac() throws IOException { Network network = VoltageControlNetworkFactory.createWithSimpleRemoteControl(); - network.getLine("l43") - .setG2(0.1f) - .setB2(0.1f) - .getTerminal1().disconnect(); + network.getLine("l43").setG2(0.1f).setB2(0.1f).getTerminal1().disconnect(); setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network testAllModifAndLoadFlow(network, "openreac-output-real-network", new OpenReacParameters(), ReportNode.NO_OP); } - @Test - void testLinesOpenedSide2OpenReac() throws IOException { - Network network = VoltageControlNetworkFactory.createWithSimpleRemoteControl(); - network.getLine("l24") - .setG1(0.1f) - .setB1(0.1f) - .getTerminal2().disconnect(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - testAllModifAndLoadFlow(network, "openreac-output-real-network", new OpenReacParameters(), ReportNode.NO_OP); - } + + @Test - void testBranchZeroImpedanceSide1OpenedOpenReac() throws IOException { - Network network = VoltageControlNetworkFactory.createWithSimpleRemoteControl(); - network.getLine("l43") - .setX(0.0) - .getTerminal2().disconnect(); + void testZeroImpedanceOpenBranchSide1OpenReac() throws IOException { + Network network = VoltageControlNetworkFactory.createWithTwoVoltageControls(); + network.getLine("l45").setX(1e-8).setB1(1).setG1(0.1).getTerminal2().disconnect(); setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - testAllModifAndLoadFlow(network, "openreac-output-real-network", new OpenReacParameters(), ReportNode.NO_OP); + + OpenReacResult result = runOpenReac(network, "", new OpenReacParameters(), ReportNode.NO_OP); + // opened branch is considered as non impedant + assertEquals("1", result.getIndicators().get("nb_branch_with_zero_or_small_impedance")); + + assertEquals(OpenReacStatus.OK, result.getStatus()); + result.applyAllModifications(network); + LoadFlowResult loadFlowResult = LoadFlow.run(network); + assertTrue(loadFlowResult.isFullyConverged()); } @Test - void testBranchZeroImpedanceSide2OpenedOpenReac() throws IOException { - Network network = VoltageControlNetworkFactory.createWithSimpleRemoteControl(); - network.getLine("l43") - .setX(0.0) - .getTerminal1().disconnect(); + void testZeroImpedanceOpenBranchSide2OpenReac() throws IOException { + Network network = VoltageControlNetworkFactory.createNetworkWith2T2wt(); + network.getTwoWindingsTransformer("T2wT2").setR(0.0).setX(1e-8).setG(0.01).setB(0.1).getTerminal1().disconnect(); setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - testAllModifAndLoadFlow(network, "openreac-output-real-network", new OpenReacParameters(), ReportNode.NO_OP); - } - @Test - void testBranchWithRatioTapChangerSide1OpenedOpenReac() { - // TODO - } + OpenReacResult result = runOpenReac(network, "", new OpenReacParameters(), ReportNode.NO_OP); + // opened branch is considered as non impedant + assertEquals("1", result.getIndicators().get("nb_branch_with_zero_or_small_impedance")); - @Test - void testBranchWithPhaseTapChangerSide1OpenedOpenReac() { - // TODO + assertEquals(OpenReacStatus.OK, result.getStatus()); + result.applyAllModifications(network); + LoadFlowResult loadFlowResult = LoadFlow.run(network); + assertTrue(loadFlowResult.isFullyConverged()); } @Test - void testBranchWithRatioTapChangerSide2OpenedOpenReac() { - // TODO + void testRatioTapChangerOpenSide1OpenReac() throws IOException { + Network network = VoltageControlNetworkFactory.createNetworkWithT2wt(); + network.getTwoWindingsTransformer("T2wT").getTerminal2().disconnect(); + setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network + testAllModifAndLoadFlow(network, "", new OpenReacParameters(), ReportNode.NO_OP); } @Test - void testBranchWithPhaseTapChangerSide2OpenedOpenReac() { - // TODO + void testRatioTapChangerOpenSide2OpenReac() throws IOException { + Network network = VoltageControlNetworkFactory.createNetworkWithT2wt(); + network.getTwoWindingsTransformer("T2wT").getTerminal2().disconnect(); + setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network + testAllModifAndLoadFlow(network, "", new OpenReacParameters(), ReportNode.NO_OP); } @Test - // TODO : to be clarified if we take into account the ratio tap changers on branches that are opened... - void testRatioTapChangerNotOptimizedIfOpenSide2() throws IOException { + void testRatioTapChangerNotOptimizedOnOpenBranchSide2() throws IOException { Network network = VoltageControlNetworkFactory.createNetworkWith2T2wt(); network.getTwoWindingsTransformer("T2wT1").getTerminal2().disconnect(); + network.getTwoWindingsTransformer("T2wT2").getRatioTapChanger().setTapPosition(3); setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network OpenReacParameters parameters = new OpenReacParameters(); @@ -528,8 +525,10 @@ void testRatioTapChangerNotOptimizedIfOpenSide2() throws IOException { assertEquals("1", result.getIndicators().get("nb_transformers_with_variable_ratio")); assertEquals("1", result.getIndicators().get("nb_transformers_with_fixed_ratio")); - // verify tap of optimized rtc has changed - assertEquals(); + // verify only tap of optimized rtc has changed + result.applyAllModifications(network); + assertEquals(0, network.getTwoWindingsTransformer("T2wT1").getRatioTapChanger().getTapPosition()); + assertEquals(0, network.getTwoWindingsTransformer("T2wT2").getRatioTapChanger().getTapPosition()); } public static Network create() { From 75a1d48d5a2c5fab19f11ad4b9306a2ad14d58e7 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Mon, 16 Dec 2024 11:22:01 +0100 Subject: [PATCH 24/63] Fix indicators on opened branches Signed-off-by: p-arvy --- .../resources/openreac/reactiveopfoutput.run | 2 +- .../powsybl/openreac/OpenReacRunnerTest.java | 626 ------------------ .../OpenReacBranchWithOneSideOpenedTest.java | 2 + .../OpenReacOptimizationIndicatorsTest.java | 11 +- 4 files changed, 10 insertions(+), 631 deletions(-) delete mode 100644 open-reac/src/test/java/com/powsybl/openreac/OpenReacRunnerTest.java create mode 100644 open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacBranchWithOneSideOpenedTest.java diff --git a/open-reac/src/main/resources/openreac/reactiveopfoutput.run b/open-reac/src/main/resources/openreac/reactiveopfoutput.run index bb9bc357..09cabee5 100644 --- a/open-reac/src/main/resources/openreac/reactiveopfoutput.run +++ b/open-reac/src/main/resources/openreac/reactiveopfoutput.run @@ -289,7 +289,7 @@ printf "%s %i\n","nb_branch_in_data_file",card(BRANCH) > (fileOut); printf "%s %i\n","nb_branch_in_AC_CC",card(ALL_BRANCHCC) > (fileOut); printf "%s %i\n","nb_branch_in_AC_CC_side_1_opened",card(BRANCHCC_WITH_SIDE_1_OPENED) > (fileOut); printf "%s %i\n","nb_branch_in_AC_CC_side_2_opened",card(BRANCHCC_WITH_SIDE_2_OPENED) > (fileOut); -printf "%s %i\n","nb_branch_with_nonsmall_impedance",card(BRANCHCC diff BRANCHZNULL) > (fileOut); +printf "%s %i\n","nb_branch_with_nonsmall_impedance",card(ALL_BRANCHCC diff BRANCHZNULL) > (fileOut); printf "%s %i\n","nb_branch_with_zero_or_small_impedance",card(BRANCHZNULL) > (fileOut); printf "%s %i\n","nb_unit_in_data_file",card(UNIT) > (fileOut); printf "%s %i\n","nb_unit_in_AC_CC",card(UNITCC) > (fileOut); diff --git a/open-reac/src/test/java/com/powsybl/openreac/OpenReacRunnerTest.java b/open-reac/src/test/java/com/powsybl/openreac/OpenReacRunnerTest.java deleted file mode 100644 index 9cc66ff2..00000000 --- a/open-reac/src/test/java/com/powsybl/openreac/OpenReacRunnerTest.java +++ /dev/null @@ -1,626 +0,0 @@ -/** - * Copyright (c) 2023, RTE (http://www.rte-france.com) - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -package com.powsybl.openreac; - -import com.google.common.jimfs.Configuration; -import com.google.common.jimfs.Jimfs; -import com.powsybl.commons.report.ReportNode; -import com.powsybl.commons.report.TypedValue; -import com.powsybl.commons.test.ComparisonUtils; -import com.powsybl.computation.ComputationManager; -import com.powsybl.computation.local.LocalCommandExecutor; -import com.powsybl.computation.local.LocalComputationConfig; -import com.powsybl.computation.local.LocalComputationManager; -import com.powsybl.ieeecdf.converter.IeeeCdfNetworkFactory; -import com.powsybl.iidm.network.*; -import com.powsybl.loadflow.LoadFlow; -import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.openreac.network.HvdcNetworkFactory; -import com.powsybl.openreac.network.VoltageControlNetworkFactory; -import com.powsybl.openreac.parameters.input.OpenReacParameters; -import com.powsybl.openreac.parameters.input.algo.OpenReacAmplLogLevel; -import com.powsybl.openreac.parameters.input.algo.ReactiveSlackBusesMode; -import com.powsybl.openreac.parameters.input.algo.OpenReacOptimisationObjective; -import com.powsybl.openreac.parameters.input.algo.OpenReacSolverLogLevel; -import com.powsybl.openreac.parameters.output.OpenReacResult; -import com.powsybl.openreac.parameters.output.OpenReacStatus; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.FileSystem; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ForkJoinPool; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import static org.junit.jupiter.api.Assertions.*; - -/** - * @author Geoffroy Jamgotchian {@literal } - * @author Nicolas PIERRE {@literal } - */ -class OpenReacRunnerTest { - protected FileSystem fileSystem; - protected Path tmpDir; - - @BeforeEach - public void setUp() throws IOException { - fileSystem = Jimfs.newFileSystem(Configuration.unix()); - tmpDir = Files.createDirectory(fileSystem.getPath("tmp")); - } - - @AfterEach - void tearDown() throws IOException { - fileSystem.close(); - } - - private void assertEqualsToRef(Path p, String refFileName) throws IOException { - try (InputStream actual = Files.newInputStream(p)) { - ComparisonUtils.assertTxtEquals(Objects.requireNonNull(getClass().getResourceAsStream(refFileName)), actual); - } - } - - private Path getAmplExecPath() throws IOException { - Path execFolder; - try (Stream walk = Files.walk(tmpDir)) { - execFolder = walk.limit(2).collect(Collectors.toList()).get(1); - } - return execFolder; - } - - @Test - void testDefaultParamAlgoExport() throws IOException { - Network network = IeeeCdfNetworkFactory.create57(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - OpenReacParameters parameters = new OpenReacParameters(); - - LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( - List.of("empty_case/reactiveopf_results_indic.txt")); - try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), - localCommandExecutor, ForkJoinPool.commonPool())) { - OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, - new OpenReacConfig(true), computationManager); - Path execFolder = getAmplExecPath(); - assertEqualsToRef(execFolder.resolve("param_algo.txt"), "/openreac-input-algo-parameters/default.txt"); - } - } - - @Test - 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() - .setObjective(OpenReacOptimisationObjective.SPECIFIC_VOLTAGE_PROFILE) - .setObjectiveDistance(69) - .setLogLevelAmpl(OpenReacAmplLogLevel.WARNING) - .setLogLevelSolver(OpenReacSolverLogLevel.ONLY_RESULTS) - .setMinPlausibleLowVoltageLimit(0.7888) - .setMaxPlausibleHighVoltageLimit(1.3455) - .setReactiveSlackBusesMode(ReactiveSlackBusesMode.NO_GENERATION) - .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) - .setTwoWindingTransformerRatioVariableScalingFactor(0.0045) - .setShuntVariableScalingFactor(0.101); - - LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( - List.of("empty_case/reactiveopf_results_indic.txt")); - try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), - localCommandExecutor, ForkJoinPool.commonPool())) { - OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, - new OpenReacConfig(true), computationManager); - Path execFolder = getAmplExecPath(); - assertEqualsToRef(execFolder.resolve("param_algo.txt"), "/openreac-input-algo-parameters/modified_param_algo.txt"); - } - } - - @Test - void testInputFile() throws IOException { - Network network = IeeeCdfNetworkFactory.create57(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - - OpenReacParameters parameters = new OpenReacParameters().setObjective( - OpenReacOptimisationObjective.BETWEEN_HIGH_AND_LOW_VOLTAGE_LIMIT) - .setObjectiveDistance(70) - .setReactiveSlackBusesMode(ReactiveSlackBusesMode.CONFIGURED) - .addVariableTwoWindingsTransformers(network.getTwoWindingsTransformerStream() - .limit(1) - .map(TwoWindingsTransformer::getId) - .collect(Collectors.toList())) - .addConstantQGenerators( - network.getGeneratorStream().limit(1).map(Generator::getId).collect(Collectors.toList())) - .addVariableShuntCompensators( - network.getShuntCompensatorStream().limit(1).map(ShuntCompensator::getId).collect(Collectors.toList())) - .addConfiguredReactiveSlackBuses( - network.getBusView().getBusStream().limit(1).map(Bus::getId).collect(Collectors.toList())); - - LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( - List.of("empty_case/reactiveopf_results_indic.txt")); - try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), - localCommandExecutor, ForkJoinPool.commonPool())) { - OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, - new OpenReacConfig(true), computationManager); - Path execFolder = getAmplExecPath(); - assertEqualsToRef(execFolder.resolve("param_algo.txt"), "/expected_inputs/param_algo.txt"); - assertEqualsToRef(execFolder.resolve("param_generators_reactive.txt"), "/expected_inputs/param_generators_reactive.txt"); - assertEqualsToRef(execFolder.resolve("param_shunts.txt"), "/expected_inputs/param_shunts.txt"); - assertEqualsToRef(execFolder.resolve("param_transformers.txt"), "/expected_inputs/param_transformers.txt"); - assertEqualsToRef(execFolder.resolve("param_buses_with_reactive_slack.txt"), "/expected_inputs/param_buses_with_reactive_slack.txt"); - } - } - - @Test - void testOutputFileParsing() throws IOException { - Network network = IeeeCdfNetworkFactory.create57(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - // To parse correctly data from output files, there must be an ID in the Ampl mapper - // For this we add dummy elements to the network, - // they will get exported, but the ampl mapper will have IDs for them. - // All the values are bad, and they are not used. - // RTC - network.getTwoWindingsTransformerStream() - .forEach(t -> t.newRatioTapChanger() - .setLowTapPosition(0) - .setTapPosition(0) - .beginStep() - .setR(0.01) - .setX(0.0001) - .setB(0) - .setG(0) - .setRho(1.1) - .endStep() - .add()); - // SVC - VoltageLevel vl = network.getVoltageLevelStream().iterator().next(); - vl.getBusBreakerView().newBus().setId("bus-1").add(); - vl.newStaticVarCompensator() - .setId("dummyStaticVarCompensator") - .setBus("bus-1") - .setBmin(1.1) - .setBmax(1.3) - .setRegulationMode(StaticVarCompensator.RegulationMode.OFF) - .add(); - // VSC - vl.newVscConverterStation() - .setId("dummyVscConverterStation") - .setConnectableBus("bus-1") - .setBus("bus-1") - .setLossFactor(1.1f) - .setVoltageSetpoint(405.0) - .setVoltageRegulatorOn(true) - .add(); - - LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( - List.of("mock_outputs/reactiveopf_results_generators.csv", - "mock_outputs/reactiveopf_results_indic.txt", - "mock_outputs/reactiveopf_results_rtc.csv", - "mock_outputs/reactiveopf_results_shunts.csv", - "mock_outputs/reactiveopf_results_static_var_compensators.csv", - "mock_outputs/reactiveopf_results_vsc_converter_stations.csv", - "mock_outputs/reactiveopf_results_voltages.csv")); - try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), - localCommandExecutor, ForkJoinPool.commonPool())) { - OpenReacResult openReacResult = OpenReacRunner.run(network, - network.getVariantManager().getWorkingVariantId(), new OpenReacParameters(), new OpenReacConfig(true), - computationManager); - - assertEquals(OpenReacStatus.OK, openReacResult.getStatus()); - assertEquals(1, openReacResult.getShuntsModifications().size()); - assertEquals(2, openReacResult.getTapPositionModifications().size()); - assertEquals(1, openReacResult.getSvcModifications().size()); - assertEquals(1, openReacResult.getVscModifications().size()); - assertEquals(7, openReacResult.getGeneratorModifications().size()); - assertEquals(3, openReacResult.getVoltageProfile().size()); - assertEquals(87, openReacResult.getIndicators().size()); - assertTrue(openReacResult.getReactiveSlacks().isEmpty()); - } - } - - @Test - void testRunAsync() throws IOException { - Network network = IeeeCdfNetworkFactory.create14(); - String subFolder = "openreac-output-ieee14"; - OpenReacParameters parameters = new OpenReacParameters(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( - List.of(subFolder + "/reactiveopf_results_generators.csv", - subFolder + "/reactiveopf_results_indic.txt", - subFolder + "/reactiveopf_results_rtc.csv", - subFolder + "/reactiveopf_results_shunts.csv", - subFolder + "/reactiveopf_results_static_var_compensators.csv", - subFolder + "/reactiveopf_results_vsc_converter_stations.csv", - subFolder + "/reactiveopf_results_voltages.csv")); - // To really run open reac, use the commented line below. Be sure that open-reac/src/test/resources/com/powsybl/config/test/config.yml contains your ampl path -// try (ComputationManager computationManager = new LocalComputationManager()) { - try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), - localCommandExecutor, ForkJoinPool.commonPool())) { - CompletableFuture openReacResults = OpenReacRunner.runAsync(network, - network.getVariantManager().getWorkingVariantId(), parameters, new OpenReacConfig(true), - computationManager); - OpenReacResult openReacResult = openReacResults.join(); - assertEquals(OpenReacStatus.OK, openReacResult.getStatus()); - } - } - - private void testAllModifAndLoadFlow(Network network, String subFolder, OpenReacParameters parameters, ReportNode reportNode) throws IOException { - runAndApplyAllModifications(network, subFolder, parameters, true, reportNode); - LoadFlowResult loadFlowResult = LoadFlow.run(network); - assertTrue(loadFlowResult.isFullyConverged()); - } - - @Test - void testOnlyGenerator() throws IOException { - Network network = IeeeCdfNetworkFactory.create14(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - testAllModifAndLoadFlow(network, "openreac-output-ieee14", new OpenReacParameters(), ReportNode.NO_OP); - } - - @Test - void testHvdc() throws IOException { - Network network = HvdcNetworkFactory.createNetworkWithGenerators2(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - network.getVscConverterStation("cs3").getTerminal().setP(0.0); - network.getVscConverterStation("cs4").getTerminal().setP(0.0); - OpenReacParameters parameters = new OpenReacParameters(); - parameters.addConstantQGenerators(List.of("g1", "g2", "g5", "g6")); - testAllModifAndLoadFlow(network, "openreac-output-vsc", parameters, ReportNode.NO_OP); - } - - @Test - void testSvc() throws IOException { - Network network = VoltageControlNetworkFactory.createWithStaticVarCompensator(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - network.getVoltageLevelStream().forEach(vl -> vl.setLowVoltageLimit(380).setHighVoltageLimit(420)); - network.getStaticVarCompensator("svc1").setVoltageSetpoint(390).setRegulationMode(StaticVarCompensator.RegulationMode.VOLTAGE); - OpenReacParameters parameters = new OpenReacParameters(); - parameters.addConstantQGenerators(List.of("g1")); - testAllModifAndLoadFlow(network, "openreac-output-svc", parameters, ReportNode.NO_OP); - } - - @Test - void testShunt() throws IOException { - Network network = create(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - ShuntCompensator shunt = network.getShuntCompensator("SHUNT"); - assertFalse(shunt.getTerminal().isConnected()); - assertEquals(393, shunt.getTargetV()); - - OpenReacParameters parameters = new OpenReacParameters(); - parameters.addVariableShuntCompensators(List.of(shunt.getId())); - ReportNode reportNode = ReportNode.newRootReportNode().withMessageTemplate("openReac", "openReac").build(); - testAllModifAndLoadFlow(network, "openreac-output-shunt", parameters, reportNode); - - assertEquals(3, reportNode.getChildren().size()); - ReportNode reportShunts = reportNode.getChildren().get(2); - assertEquals(2, reportShunts.getChildren().size()); - assertEquals("shuntCompensatorDeltaOverThresholdCount", reportShunts.getChildren().get(0).getMessageKey()); - Map values = reportShunts.getChildren().get(0).getValues(); - assertEquals("1", values.get("shuntsCount").toString()); - assertEquals(TypedValue.INFO_SEVERITY.getValue(), values.get("reportSeverity").toString()); - - assertEquals("shuntCompensatorDeltaDiscretizedOptimizedOverThreshold", reportShunts.getChildren().get(1).getMessageKey()); - values = reportShunts.getChildren().get(1).getValues(); - assertEquals("SHUNT", values.get("shuntCompensatorId").toString()); - assertEquals("25", values.get("maxSectionCount").toString()); - assertEquals("160.0", values.get("discretizedValue").toString()); - assertEquals("123.4", values.get("optimalValue").toString()); - assertEquals(TypedValue.TRACE_SEVERITY.getValue(), values.get("reportSeverity").toString()); - - assertTrue(shunt.getTerminal().isConnected()); // shunt has been reconnected - assertEquals(420.8, shunt.getTargetV()); // targetV has been updated - } - - @Test - void testShuntWithDeltaBetweenDiscretizedAndOptimalReactiveValueUnderThreshold() throws IOException { - Network network = create(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - ShuntCompensator shunt = network.getShuntCompensator("SHUNT"); - assertFalse(shunt.getTerminal().isConnected()); - assertEquals(393, shunt.getTargetV()); - - OpenReacParameters parameters = new OpenReacParameters(); - parameters.setShuntCompensatorActivationAlertThreshold(100.); - parameters.addVariableShuntCompensators(List.of(shunt.getId())); - ReportNode reportNode = ReportNode.newRootReportNode().withMessageTemplate("openReac", "openReac").build(); - testAllModifAndLoadFlow(network, "openreac-output-shunt", parameters, reportNode); - - assertEquals(2, reportNode.getChildren().size()); - - assertTrue(shunt.getTerminal().isConnected()); // shunt has been reconnected - assertEquals(420.8, shunt.getTargetV()); // targetV has been updated - } - - @Test - void testTransformer() throws IOException { - Network network = VoltageControlNetworkFactory.createNetworkWithT2wt(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - RatioTapChanger rtc = network.getTwoWindingsTransformer("T2wT").getRatioTapChanger() - .setTapPosition(2) - .setTargetDeadband(0) - .setRegulating(true); - assertEquals(2, rtc.getTapPosition()); - assertEquals(33.0, rtc.getTargetV()); - - OpenReacParameters parameters = new OpenReacParameters(); - parameters.addConstantQGenerators(List.of("GEN_1")); - parameters.addVariableTwoWindingsTransformers(List.of("T2wT")); - testAllModifAndLoadFlow(network, "openreac-output-transfo", parameters, ReportNode.NO_OP); - assertEquals(0, rtc.getTapPosition()); - assertEquals(22.935, rtc.getTargetV()); - } - - @Test - void testRealNetwork() throws IOException { - Network network = IeeeCdfNetworkFactory.create57(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - OpenReacParameters parameters = new OpenReacParameters(); - testAllModifAndLoadFlow(network, "openreac-output-real-network", parameters, ReportNode.NO_OP); - } - - @Test - void testWarmStart() throws IOException { - Network network = VoltageControlNetworkFactory.createNetworkWithT2wt(); - setDefaultVoltageLimits(network); - String subFolder = "openreac-output-warm-start"; - OpenReacParameters parameters = new OpenReacParameters(); - - runAndApplyAllModifications(network, subFolder, parameters, false, ReportNode.NO_OP); // without warm start, no update - assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_1").getV()); - assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_1").getAngle()); - assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_2").getV()); - assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_2").getAngle()); - assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_3").getV()); - assertEquals(Double.NaN, network.getBusBreakerView().getBus("BUS_3").getAngle()); - - runAndApplyAllModifications(network, subFolder, parameters, true, ReportNode.NO_OP); - assertEquals(119.592, network.getBusBreakerView().getBus("BUS_1").getV()); - assertEquals(0.802, network.getBusBreakerView().getBus("BUS_1").getAngle(), 0.001); - assertEquals(118.8, network.getBusBreakerView().getBus("BUS_2").getV()); - assertEquals(0, network.getBusBreakerView().getBus("BUS_2").getAngle()); - assertEquals(22.935, network.getBusBreakerView().getBus("BUS_3").getV()); - assertEquals(-4.698, network.getBusBreakerView().getBus("BUS_3").getAngle(), 0.001); - } - - /** - * Runs OpenReac and apply the results on the network. - * The application of the voltage plan calculated by optimization is optional. - */ - private void runAndApplyAllModifications(Network network, String subFolder, OpenReacParameters parameters, - boolean updateNetworkWithVoltages, ReportNode reportNode) throws IOException { - OpenReacResult openReacResult = runOpenReac(network, subFolder, parameters, reportNode); - assertEquals(OpenReacStatus.OK, openReacResult.getStatus()); - openReacResult.setUpdateNetworkWithVoltages(updateNetworkWithVoltages); - openReacResult.applyAllModifications(network); - } - - /** - * Runs OpenReac and returns associated result. - * Note that OpenReac is not really executed by default. If the execution line is not uncommented, - * the results are retrieved and stored in an {@link OpenReacResult} object. - */ - private OpenReacResult runOpenReac(Network network, String subFolder, OpenReacParameters parameters, ReportNode reportNode) throws IOException { - LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor( - List.of(subFolder + "/reactiveopf_results_generators.csv", - subFolder + "/reactiveopf_results_indic.txt", - subFolder + "/reactiveopf_results_rtc.csv", - subFolder + "/reactiveopf_results_shunts.csv", - subFolder + "/reactiveopf_results_static_var_compensators.csv", - subFolder + "/reactiveopf_results_vsc_converter_stations.csv", - subFolder + "/reactiveopf_results_voltages.csv")); - // To really run open reac, use the commentede line below. Be sure that open-reac/src/test/resources/com/powsybl/config/test/config.yml contains your ampl path - try (ComputationManager computationManager = new LocalComputationManager()) { -// try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), -// localCommandExecutor, ForkJoinPool.commonPool())) { - return OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, - new OpenReacConfig(true), computationManager, reportNode, null); - } - } - - // TODO : add more tests for indicators and rebase on this - // TODO : for no impedance lines, use the same network - @Test - void testBranchesIndicators() throws IOException { - Network network = VoltageControlNetworkFactory.createWithSimpleRemoteControl(); - network.getLine("l24").getTerminal2().disconnect(); - network.getLine("l43").getTerminal1().disconnect(); - setDefaultVoltageLimits(network); - OpenReacResult result = runOpenReac(network, "openreac-output-branches-opened", new OpenReacParameters(), ReportNode.NO_OP); - assertEquals("4", result.getIndicators().get("nb_branch_in_data_file")); - assertEquals("4", result.getIndicators().get("nb_branch_in_AC_CC")); - assertEquals("1", result.getIndicators().get("nb_branch_in_AC_CC_side_1_opened")); - assertEquals("1", result.getIndicators().get("nb_branch_in_AC_CC_side_2_opened")); - } - - @Test - void testOpenLineSide1OpenReac() throws IOException { - Network network = VoltageControlNetworkFactory.createWithSimpleRemoteControl(); - network.getLine("l43").setG2(0.1f).setB2(0.1f).getTerminal1().disconnect(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - testAllModifAndLoadFlow(network, "openreac-output-real-network", new OpenReacParameters(), ReportNode.NO_OP); - } - - - - - @Test - void testZeroImpedanceOpenBranchSide1OpenReac() throws IOException { - Network network = VoltageControlNetworkFactory.createWithTwoVoltageControls(); - network.getLine("l45").setX(1e-8).setB1(1).setG1(0.1).getTerminal2().disconnect(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - - OpenReacResult result = runOpenReac(network, "", new OpenReacParameters(), ReportNode.NO_OP); - // opened branch is considered as non impedant - assertEquals("1", result.getIndicators().get("nb_branch_with_zero_or_small_impedance")); - - assertEquals(OpenReacStatus.OK, result.getStatus()); - result.applyAllModifications(network); - LoadFlowResult loadFlowResult = LoadFlow.run(network); - assertTrue(loadFlowResult.isFullyConverged()); - } - - @Test - void testZeroImpedanceOpenBranchSide2OpenReac() throws IOException { - Network network = VoltageControlNetworkFactory.createNetworkWith2T2wt(); - network.getTwoWindingsTransformer("T2wT2").setR(0.0).setX(1e-8).setG(0.01).setB(0.1).getTerminal1().disconnect(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - - OpenReacResult result = runOpenReac(network, "", new OpenReacParameters(), ReportNode.NO_OP); - // opened branch is considered as non impedant - assertEquals("1", result.getIndicators().get("nb_branch_with_zero_or_small_impedance")); - - assertEquals(OpenReacStatus.OK, result.getStatus()); - result.applyAllModifications(network); - LoadFlowResult loadFlowResult = LoadFlow.run(network); - assertTrue(loadFlowResult.isFullyConverged()); - } - - @Test - void testRatioTapChangerOpenSide1OpenReac() throws IOException { - Network network = VoltageControlNetworkFactory.createNetworkWithT2wt(); - network.getTwoWindingsTransformer("T2wT").getTerminal2().disconnect(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - testAllModifAndLoadFlow(network, "", new OpenReacParameters(), ReportNode.NO_OP); - } - - @Test - void testRatioTapChangerOpenSide2OpenReac() throws IOException { - Network network = VoltageControlNetworkFactory.createNetworkWithT2wt(); - network.getTwoWindingsTransformer("T2wT").getTerminal2().disconnect(); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - testAllModifAndLoadFlow(network, "", new OpenReacParameters(), ReportNode.NO_OP); - } - - @Test - void testRatioTapChangerNotOptimizedOnOpenBranchSide2() throws IOException { - Network network = VoltageControlNetworkFactory.createNetworkWith2T2wt(); - network.getTwoWindingsTransformer("T2wT1").getTerminal2().disconnect(); - network.getTwoWindingsTransformer("T2wT2").getRatioTapChanger().setTapPosition(3); - setDefaultVoltageLimits(network); // set default voltage limits to every voltage levels of the network - - OpenReacParameters parameters = new OpenReacParameters(); - parameters.addVariableTwoWindingsTransformers(List.of("T2wT1", "T2wT2")); - OpenReacResult result = runOpenReac(network, "", parameters, ReportNode.NO_OP); - - // verify only one rtc has been optimized - assertEquals("1", result.getIndicators().get("nb_transformers_with_variable_ratio")); - assertEquals("1", result.getIndicators().get("nb_transformers_with_fixed_ratio")); - - // verify only tap of optimized rtc has changed - result.applyAllModifications(network); - assertEquals(0, network.getTwoWindingsTransformer("T2wT1").getRatioTapChanger().getTapPosition()); - assertEquals(0, network.getTwoWindingsTransformer("T2wT2").getRatioTapChanger().getTapPosition()); - } - - public static Network create() { - Network network = Network.create("svc", "test"); - Substation s1 = network.newSubstation() - .setId("S1") - .add(); - Substation s2 = network.newSubstation() - .setId("S2") - .add(); - VoltageLevel vl1 = s1.newVoltageLevel() - .setId("vl1") - .setNominalV(400) - .setHighVoltageLimit(420) - .setLowVoltageLimit(380) - .setTopologyKind(TopologyKind.BUS_BREAKER) - .add(); - vl1.getBusBreakerView().newBus() - .setId("b1") - .add(); - vl1.newGenerator() - .setId("g1") - .setConnectableBus("b1") - .setBus("b1") - .setTargetP(101.3664) - .setTargetV(390) - .setMinP(0) - .setMaxP(150) - .setVoltageRegulatorOn(true) - .add(); - VoltageLevel vl2 = s2.newVoltageLevel() - .setId("vl2") - .setNominalV(400) - .setTopologyKind(TopologyKind.BUS_BREAKER) - .add(); - vl2.getBusBreakerView().newBus() - .setId("b2") - .add(); - vl2.newLoad() - .setId("ld1") - .setConnectableBus("b2") - .setBus("b2") - .setP0(101) - .setQ0(150) - .add(); - VoltageLevel vl3 = s2.newVoltageLevel() - .setId("vl3") - .setNominalV(400) - .setTopologyKind(TopologyKind.BUS_BREAKER) - .add(); - vl3.getBusBreakerView().newBus() - .setId("b3") - .add(); - vl3.newShuntCompensator() - .setId("SHUNT") - // .setBus("b3") - .setConnectableBus("b3") - .setSectionCount(0) - .setVoltageRegulatorOn(true) - .setTargetV(393) - .setTargetDeadband(5.0) - .newLinearModel() - .setMaximumSectionCount(25) - .setBPerSection(1e-3) - .add() - .add(); - network.newLine() - .setId("l1") - .setBus1("b1") - .setBus2("b2") - .setR(1) - .setX(3) - .add(); - network.newLine() - .setId("l2") - .setBus1("b3") - .setBus2("b2") - .setR(1) - .setX(3) - .add(); - return network; - } - - // TODO : to be moved so that it is used by default when we run a network - void setDefaultVoltageLimits(Network network) { - for (VoltageLevel vl : network.getVoltageLevels()) { - if (vl.getLowVoltageLimit() <= 0 || Double.isNaN(vl.getLowVoltageLimit())) { - vl.setLowVoltageLimit(0.5 * vl.getNominalV()); - } - if (Double.isNaN(vl.getHighVoltageLimit())) { - vl.setHighVoltageLimit(1.5 * vl.getNominalV()); - } - } - } -} diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacBranchWithOneSideOpenedTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacBranchWithOneSideOpenedTest.java new file mode 100644 index 00000000..60f36e1d --- /dev/null +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacBranchWithOneSideOpenedTest.java @@ -0,0 +1,2 @@ +package com.powsybl.openreac.optimization;public class OpenReacBranchWithOneSideOpenedTest { +} diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java index 2dacba95..4195834f 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java @@ -119,10 +119,13 @@ void testBranchesIndicators() throws IOException { assertEquals(OpenReacStatus.OK, result.getStatus()); assertEquals(4, Integer.parseInt(result.getIndicators().get("nb_branch_in_data_file"))); - // verify opened branches have been excluded - assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_branch_in_AC_CC"))); - assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_with_nonsmall_impedance"))); - assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_with_zero_or_small_impedance"))); + // verify opened branch are considered in optimization + assertEquals(4, Integer.parseInt(result.getIndicators().get("nb_branch_in_AC_CC"))); + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_in_AC_CC_side_1_opened"))); + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_in_AC_CC_side_2_opened"))); + // verify opened branch can be considered as zero impedance branches + assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_branch_with_nonsmall_impedance"))); + assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_branch_with_zero_or_small_impedance"))); } @Test From 2e2f10232cea43f50367022d90166c0a7bb05332 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Mon, 16 Dec 2024 12:26:07 +0100 Subject: [PATCH 25/63] Add TUs on opened branches Signed-off-by: p-arvy --- .../OpenReacBranchOneSideOpenTest.java | 6 - .../network/OneSideOpenNetworkFactory.java | 39 ------ .../AbstractOpenReacRunnerTest.java | 15 ++- .../OpenReacBranchWithOneSideOpenedTest.java | 126 +++++++++++++++++- 4 files changed, 135 insertions(+), 51 deletions(-) delete mode 100644 open-reac/src/test/java/com/powsybl/openreac/OpenReacBranchOneSideOpenTest.java delete mode 100644 open-reac/src/test/java/com/powsybl/openreac/network/OneSideOpenNetworkFactory.java diff --git a/open-reac/src/test/java/com/powsybl/openreac/OpenReacBranchOneSideOpenTest.java b/open-reac/src/test/java/com/powsybl/openreac/OpenReacBranchOneSideOpenTest.java deleted file mode 100644 index 5b4284e4..00000000 --- a/open-reac/src/test/java/com/powsybl/openreac/OpenReacBranchOneSideOpenTest.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.powsybl.openreac; - -import org.junit.jupiter.api.Test; - -public class OpenReacBranchOneSideOpenTest { -} diff --git a/open-reac/src/test/java/com/powsybl/openreac/network/OneSideOpenNetworkFactory.java b/open-reac/src/test/java/com/powsybl/openreac/network/OneSideOpenNetworkFactory.java deleted file mode 100644 index 35d6fa7c..00000000 --- a/open-reac/src/test/java/com/powsybl/openreac/network/OneSideOpenNetworkFactory.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.powsybl.openreac.network; - -import com.powsybl.iidm.network.Bus; -import com.powsybl.iidm.network.Network; - -public class OneSideOpenNetworkFactory extends AbstractLoadFlowNetworkFactory { - - public static Network createWithOpenedOnSide1() { - Network network = create(); - Bus b0 = createBus(network, "b0"); - Bus b1 = network.getBusView().getBus("b1"); - createLine(network, b0, b1, "l01", 0, 0.1f, 0.1f, 0.1f); - network.getLine("l01").getTerminal1().disconnect(); - return network; - } - - - /** - * 0 MW, 0 MVar - * 1 ===== 1pu - * | - * | - * | 0.1j - * | - * | - * 2 ===== 1pu - * 200 MW, 100 MVar - */ - public static Network create() { - Network network = Network.create("2-bus", "code"); - Bus b1 = createBus(network, "b1"); - Bus b2 = createBus(network, "b2"); - createGenerator(b1, "g1", 2, 1); - createLoad(b2, "l1", 2, 1); - createLine(network, b1, b2, "l12", 0.1f); - return network; - } - -} diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java index f45e326b..7e152ab0 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java @@ -12,7 +12,6 @@ import com.powsybl.commons.test.ComparisonUtils; import com.powsybl.computation.ComputationManager; import com.powsybl.computation.local.LocalCommandExecutor; -import com.powsybl.computation.local.LocalComputationConfig; import com.powsybl.computation.local.LocalComputationManager; import com.powsybl.iidm.network.*; import com.powsybl.loadflow.LoadFlow; @@ -32,7 +31,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; -import java.util.concurrent.ForkJoinPool; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -93,6 +91,13 @@ protected void runAndApplyAllModifications(Network network, String subFolder, Op openReacResult.applyAllModifications(network); } + /** + * Runs OpenReac and returns associated result. + */ + protected OpenReacResult runOpenReac(Network network, String subFolder) throws IOException { + return runOpenReac(network, subFolder, false); + } + /** * Runs OpenReac and returns associated result. */ @@ -128,9 +133,9 @@ protected OpenReacResult runOpenReac(Network network, String subFolder, OpenReac } LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor(outputFileNames); // To really run open reac, use the commentede line below. Be sure that open-reac/src/test/resources/com/powsybl/config/test/config.yml contains your ampl path -// try (ComputationManager computationManager = new LocalComputationManager()) { - try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), - localCommandExecutor, ForkJoinPool.commonPool())) { + try (ComputationManager computationManager = new LocalComputationManager()) { +// try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), +// localCommandExecutor, ForkJoinPool.commonPool())) { return OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, new OpenReacConfig(true), computationManager, reportNode, null); } diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacBranchWithOneSideOpenedTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacBranchWithOneSideOpenedTest.java index 60f36e1d..3bd4b0d1 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacBranchWithOneSideOpenedTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacBranchWithOneSideOpenedTest.java @@ -1,2 +1,126 @@ -package com.powsybl.openreac.optimization;public class OpenReacBranchWithOneSideOpenedTest { +/** + * Copyright (c) 2024, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 + */ +package com.powsybl.openreac.optimization; + +import com.powsybl.commons.report.ReportNode; +import com.powsybl.iidm.network.Network; +import com.powsybl.loadflow.LoadFlow; +import com.powsybl.loadflow.LoadFlowResult; +import com.powsybl.openreac.network.VoltageControlNetworkFactory; +import com.powsybl.openreac.parameters.input.OpenReacParameters; +import com.powsybl.openreac.parameters.output.OpenReacResult; +import com.powsybl.openreac.parameters.output.OpenReacStatus; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Test OpenReac optimization with branches opened on one side. + * + * @author Pierre ARVY {@literal } + */ +public class OpenReacBranchWithOneSideOpenedTest extends AbstractOpenReacRunnerTest { + + @Test + void testOpenLineSide1OpenReac() throws IOException { + Network network = VoltageControlNetworkFactory.createWithSimpleRemoteControl(); + network.getLine("l43").setG2(0.1f).setB2(0.1f).getTerminal1().disconnect(); + testAllModifAndLoadFlow(network, "openreac-output-real-network", new OpenReacParameters(), ReportNode.NO_OP); + } + + @Test + void testZeroImpedanceOpenBranchSide2OpenReac() throws IOException { + Network network = VoltageControlNetworkFactory.createWithTwoVoltageControls(); + network.getLine("l45").setX(1e-8).setB1(1).setG1(0.1).getTerminal2().disconnect(); + + OpenReacResult result = runOpenReac(network, ""); + // opened branch is considered as non impedant + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_in_AC_CC_side_2_opened"))); + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_with_zero_or_small_impedance"))); + + assertEquals(OpenReacStatus.OK, result.getStatus()); + result.applyAllModifications(network); + LoadFlowResult loadFlowResult = LoadFlow.run(network); + assertTrue(loadFlowResult.isFullyConverged()); + } + + @Test + void testZeroImpedanceOpenBranchSide1OpenReac() throws IOException { + Network network = VoltageControlNetworkFactory.createNetworkWith2T2wt(); + network.getTwoWindingsTransformer("T2wT2").setR(0.0).setX(1e-8).setG(0.01).setB(0.1).getTerminal1().disconnect(); + + OpenReacResult result = runOpenReac(network, ""); + // opened branch is considered as non impedance branch + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_in_AC_CC_side_1_opened"))); + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_with_zero_or_small_impedance"))); + + assertEquals(OpenReacStatus.OK, result.getStatus()); + result.applyAllModifications(network); + LoadFlowResult loadFlowResult = LoadFlow.run(network); + assertTrue(loadFlowResult.isFullyConverged()); + } + + @Test + void testRatioTapChangerOpenSide2OpenReac() throws IOException { + Network network = VoltageControlNetworkFactory.createNetworkWithT2wt(); + network.getTwoWindingsTransformer("T2wT").getTerminal2().disconnect(); + + OpenReacResult result = runOpenReac(network, ""); + // verify ratio tap changer is considered in optimization + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_in_AC_CC_side_2_opened"))); + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_transformers_with_fixed_ratio"))); + + assertEquals(OpenReacStatus.OK, result.getStatus()); + result.applyAllModifications(network); + LoadFlowResult loadFlowResult = LoadFlow.run(network); + assertTrue(loadFlowResult.isFullyConverged()); + } + + @Test + void testRatioTapChangerOpenSide1OpenReac() throws IOException { + Network network = VoltageControlNetworkFactory.createNetworkWith2T2wt(); + network.getTwoWindingsTransformer("T2wT1").getTerminal1().disconnect(); + + OpenReacResult result = runOpenReac(network, ""); + // verify ratio tap changer on T2wT1 is ignored in optimization + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_in_AC_CC_side_1_opened"))); + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_transformers_with_fixed_ratio"))); + + assertEquals(OpenReacStatus.OK, result.getStatus()); + result.applyAllModifications(network); + LoadFlowResult loadFlowResult = LoadFlow.run(network); + assertTrue(loadFlowResult.isFullyConverged()); + } + + @Test + void testRatioTapChangerNotOptimizedOnOpenBranch() throws IOException { + Network network = VoltageControlNetworkFactory.createNetworkWith2T2wt(); + network.getTwoWindingsTransformer("T2wT1").getTerminal2().disconnect(); + network.getTwoWindingsTransformer("T2wT1").getRatioTapChanger().setTapPosition(0); + network.getTwoWindingsTransformer("T2wT2").getRatioTapChanger().setTapPosition(3); + + OpenReacParameters parameters = new OpenReacParameters(); + // try to optimize both ratio tap changers + parameters.addVariableTwoWindingsTransformers(List.of("T2wT1", "T2wT2")); + OpenReacResult result = runOpenReac(network, "", parameters, false); + + // verify only one rtc has been optimized + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_transformers_with_variable_ratio"))); + assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_transformers_with_fixed_ratio"))); + + // verify only tap of optimized rtc has changed + result.applyAllModifications(network); + assertEquals(0, network.getTwoWindingsTransformer("T2wT1").getRatioTapChanger().getTapPosition()); + assertEquals(0, network.getTwoWindingsTransformer("T2wT2").getRatioTapChanger().getTapPosition()); + } + } From 4785e9636bbc7eb69802550af47d50427e3bfc15 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Mon, 16 Dec 2024 16:00:43 +0100 Subject: [PATCH 26/63] Add resources for branches tests Signed-off-by: p-arvy --- .../AbstractOpenReacRunnerTest.java | 8 +- .../OpenReacBranchWithOneSideOpenedTest.java | 12 +-- .../reactiveopf_results_indic.txt | 8 +- .../reactiveopf_results_generators.csv | 4 + .../reactiveopf_results_indic.txt | 95 +++++++++++++++++++ .../reactiveopf_results_rtc.csv | 1 + .../reactiveopf_results_shunts.csv | 1 + ...iveopf_results_static_var_compensators.csv | 1 + .../reactiveopf_results_voltages.csv | 5 + ...tiveopf_results_vsc_converter_stations.csv | 1 + .../reactiveopf_results_generators.csv | 2 + .../reactiveopf_results_indic.txt | 95 +++++++++++++++++++ .../reactiveopf_results_rtc.csv | 2 + .../reactiveopf_results_shunts.csv | 1 + ...iveopf_results_static_var_compensators.csv | 1 + .../reactiveopf_results_voltages.csv | 4 + ...tiveopf_results_vsc_converter_stations.csv | 1 + .../reactiveopf_results_generators.csv | 2 + .../reactiveopf_results_indic.txt | 95 +++++++++++++++++++ .../reactiveopf_results_rtc.csv | 1 + .../reactiveopf_results_shunts.csv | 1 + ...iveopf_results_static_var_compensators.csv | 1 + .../reactiveopf_results_voltages.csv | 4 + ...tiveopf_results_vsc_converter_stations.csv | 1 + .../reactiveopf_results_generators.csv | 2 + .../reactiveopf_results_indic.txt | 95 +++++++++++++++++++ .../reactiveopf_results_rtc.csv | 1 + .../reactiveopf_results_shunts.csv | 1 + ...iveopf_results_static_var_compensators.csv | 1 + .../reactiveopf_results_voltages.csv | 3 + ...tiveopf_results_vsc_converter_stations.csv | 1 + .../reactiveopf_results_generators.csv | 2 + .../reactiveopf_results_indic.txt | 95 +++++++++++++++++++ .../reactiveopf_results_reactive_slacks.csv | 2 + .../reactiveopf_results_rtc.csv | 1 + .../reactiveopf_results_shunts.csv | 1 + ...iveopf_results_static_var_compensators.csv | 1 + .../reactiveopf_results_voltages.csv | 4 + ...tiveopf_results_vsc_converter_stations.csv | 1 + .../reactiveopf_results_generators.csv | 3 + .../reactiveopf_results_indic.txt | 95 +++++++++++++++++++ .../reactiveopf_results_rtc.csv | 1 + .../reactiveopf_results_shunts.csv | 1 + ...iveopf_results_static_var_compensators.csv | 1 + .../reactiveopf_results_voltages.csv | 5 + ...tiveopf_results_vsc_converter_stations.csv | 1 + 46 files changed, 653 insertions(+), 12 deletions(-) create mode 100644 open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_generators.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_rtc.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_shunts.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_static_var_compensators.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_voltages.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_vsc_converter_stations.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_generators.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_rtc.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_shunts.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_static_var_compensators.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_voltages.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_vsc_converter_stations.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_generators.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_rtc.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_shunts.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_static_var_compensators.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_voltages.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_vsc_converter_stations.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_generators.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_rtc.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_shunts.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_static_var_compensators.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_voltages.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_vsc_converter_stations.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_generators.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_reactive_slacks.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_rtc.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_shunts.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_static_var_compensators.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_voltages.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_vsc_converter_stations.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_generators.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_rtc.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_shunts.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_static_var_compensators.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_voltages.csv create mode 100644 open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_vsc_converter_stations.csv diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java index 7e152ab0..ad57d445 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java @@ -12,6 +12,7 @@ import com.powsybl.commons.test.ComparisonUtils; import com.powsybl.computation.ComputationManager; import com.powsybl.computation.local.LocalCommandExecutor; +import com.powsybl.computation.local.LocalComputationConfig; import com.powsybl.computation.local.LocalComputationManager; import com.powsybl.iidm.network.*; import com.powsybl.loadflow.LoadFlow; @@ -31,6 +32,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.concurrent.ForkJoinPool; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -133,9 +135,9 @@ protected OpenReacResult runOpenReac(Network network, String subFolder, OpenReac } LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor(outputFileNames); // To really run open reac, use the commentede line below. Be sure that open-reac/src/test/resources/com/powsybl/config/test/config.yml contains your ampl path - try (ComputationManager computationManager = new LocalComputationManager()) { -// try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), -// localCommandExecutor, ForkJoinPool.commonPool())) { +// try (ComputationManager computationManager = new LocalComputationManager()) { + try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), + localCommandExecutor, ForkJoinPool.commonPool())) { return OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, new OpenReacConfig(true), computationManager, reportNode, null); } diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacBranchWithOneSideOpenedTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacBranchWithOneSideOpenedTest.java index 3bd4b0d1..70b2d89d 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacBranchWithOneSideOpenedTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacBranchWithOneSideOpenedTest.java @@ -34,7 +34,7 @@ public class OpenReacBranchWithOneSideOpenedTest extends AbstractOpenReacRunnerT void testOpenLineSide1OpenReac() throws IOException { Network network = VoltageControlNetworkFactory.createWithSimpleRemoteControl(); network.getLine("l43").setG2(0.1f).setB2(0.1f).getTerminal1().disconnect(); - testAllModifAndLoadFlow(network, "openreac-output-real-network", new OpenReacParameters(), ReportNode.NO_OP); + testAllModifAndLoadFlow(network, "optimization/opened-branches/line-open-side-1", new OpenReacParameters(), ReportNode.NO_OP); } @Test @@ -42,7 +42,7 @@ void testZeroImpedanceOpenBranchSide2OpenReac() throws IOException { Network network = VoltageControlNetworkFactory.createWithTwoVoltageControls(); network.getLine("l45").setX(1e-8).setB1(1).setG1(0.1).getTerminal2().disconnect(); - OpenReacResult result = runOpenReac(network, ""); + OpenReacResult result = runOpenReac(network, "optimization/opened-branches/zero-impedance-open-side-2"); // opened branch is considered as non impedant assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_in_AC_CC_side_2_opened"))); assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_with_zero_or_small_impedance"))); @@ -58,7 +58,7 @@ void testZeroImpedanceOpenBranchSide1OpenReac() throws IOException { Network network = VoltageControlNetworkFactory.createNetworkWith2T2wt(); network.getTwoWindingsTransformer("T2wT2").setR(0.0).setX(1e-8).setG(0.01).setB(0.1).getTerminal1().disconnect(); - OpenReacResult result = runOpenReac(network, ""); + OpenReacResult result = runOpenReac(network, "optimization/opened-branches/zero-impedance-open-side-1"); // opened branch is considered as non impedance branch assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_in_AC_CC_side_1_opened"))); assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_with_zero_or_small_impedance"))); @@ -74,7 +74,7 @@ void testRatioTapChangerOpenSide2OpenReac() throws IOException { Network network = VoltageControlNetworkFactory.createNetworkWithT2wt(); network.getTwoWindingsTransformer("T2wT").getTerminal2().disconnect(); - OpenReacResult result = runOpenReac(network, ""); + OpenReacResult result = runOpenReac(network, "optimization/opened-branches/rtc-open-side-2"); // verify ratio tap changer is considered in optimization assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_in_AC_CC_side_2_opened"))); assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_transformers_with_fixed_ratio"))); @@ -90,7 +90,7 @@ void testRatioTapChangerOpenSide1OpenReac() throws IOException { Network network = VoltageControlNetworkFactory.createNetworkWith2T2wt(); network.getTwoWindingsTransformer("T2wT1").getTerminal1().disconnect(); - OpenReacResult result = runOpenReac(network, ""); + OpenReacResult result = runOpenReac(network, "optimization/opened-branches/rtc-open-side-1"); // verify ratio tap changer on T2wT1 is ignored in optimization assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_in_AC_CC_side_1_opened"))); assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_transformers_with_fixed_ratio"))); @@ -111,7 +111,7 @@ void testRatioTapChangerNotOptimizedOnOpenBranch() throws IOException { OpenReacParameters parameters = new OpenReacParameters(); // try to optimize both ratio tap changers parameters.addVariableTwoWindingsTransformers(List.of("T2wT1", "T2wT2")); - OpenReacResult result = runOpenReac(network, "", parameters, false); + OpenReacResult result = runOpenReac(network, "optimization/opened-branches/rtc-not-optimized", parameters, false); // verify only one rtc has been optimized assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_transformers_with_variable_ratio"))); diff --git a/open-reac/src/test/resources/optimization/indicators/branches-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/branches-test/reactiveopf_results_indic.txt index 22f2bbae..f71b31d5 100644 --- a/open-reac/src/test/resources/optimization/indicators/branches-test/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/indicators/branches-test/reactiveopf_results_indic.txt @@ -35,9 +35,11 @@ nb_bus_with_voltage_value 0 nb_bus_with_reactive_slacks 3 nb_bus_without_reactive_slacks 0 nb_branch_in_data_file 4 -nb_branch_in_AC_CC 2 -nb_branch_with_nonsmall_impedance 1 -nb_branch_with_zero_or_small_impedance 1 +nb_branch_in_AC_CC 4 +nb_branch_in_AC_CC_side_1_opened 1 +nb_branch_in_AC_CC_side_2_opened 1 +nb_branch_with_nonsmall_impedance 2 +nb_branch_with_zero_or_small_impedance 2 nb_unit_in_data_file 3 nb_unit_in_AC_CC 2 nb_unit_up_and_running 2 diff --git a/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_generators.csv new file mode 100644 index 00000000..41d62fad --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_generators.csv @@ -0,0 +1,4 @@ +#variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW); +1;1;2;'true';0.500;2.0;0.7;-2.0;-0.7; +1;2;3;'true';0.500;2.0;0.7;-2.0;-0.7; +1;3;4;'true';0.512;2.0;0.7;-2.0;-0.7; diff --git a/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_indic.txt new file mode 100644 index 00000000..7a452132 --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_indic.txt @@ -0,0 +1,95 @@ +final_status OK +dcopf_status OK + +ctime_start 'Mon Dec 16 14:48:51 2024' +last_solve_result_num 0 +nb_iter_last 6 +nb_iter_total 6 +_ampl_elapsed_time 0.109000 +_total_solve_time 0.015625 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_14517614006499333001' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 4 +nb_bus_in_data_file 4 +nb_bus_in_ACDC_CC 4 +nb_bus_in_AC_CC 4 +nb_bus_in_ACDC_but_out_AC_CC 0 +nb_bus_with_voltage_value 0 +nb_bus_with_reactive_slacks 4 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 4 +nb_branch_in_AC_CC 4 +nb_branch_in_AC_CC_side_1_opened 1 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 2 +nb_branch_with_zero_or_small_impedance 2 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 3 +nb_unit_up_and_running 3 +nb_unit_with_variable_reactive_power 3 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 2 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.02 +max_teta_ac 0.08 +teta_max 3.02 +min_teta_dc -0.00 +min_teta_ac -0.00 +teta_min -3.00 +max_delta_teta_dc -0.000003 +max_delta_teta_ac -0.000012 +min_delta_teta_dc -0.020000 +min_delta_teta_ac -0.078526 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_rtc.csv new file mode 100644 index 00000000..9a62a138 --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_rtc.csv @@ -0,0 +1 @@ +#variant;num;tap; diff --git a/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_shunts.csv new file mode 100644 index 00000000..8d515fde --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_shunts.csv @@ -0,0 +1 @@ +#variant;num;bus;b(pu);Q(Mvar);section; diff --git a/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_static_var_compensators.csv new file mode 100644 index 00000000..6792ddb9 --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_static_var_compensators.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;V(pu);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_voltages.csv new file mode 100644 index 00000000..5e4b9e90 --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_voltages.csv @@ -0,0 +1,5 @@ +#variant;bus;V(pu);theta(rad);id; +1;1;0.500;-0.000;"b1_vl_0"; +1;2;0.500;0.000;"b2_vl_0"; +1;3;0.500;-0.000;"b3_vl_0"; +1;4;0.512;0.079;"b4_vl_0"; diff --git a/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_vsc_converter_stations.csv new file mode 100644 index 00000000..aa24858c --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_vsc_converter_stations.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;targetV(pu);targetQ(Mvar);P(MW);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_generators.csv new file mode 100644 index 00000000..9948de7b --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_generators.csv @@ -0,0 +1,2 @@ +#variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW); +1;1;1;'true';0.906;25.0;7.6;-25.3;-7.6; diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_indic.txt new file mode 100644 index 00000000..895d49be --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_indic.txt @@ -0,0 +1,95 @@ +final_status OK +dcopf_status OK + +ctime_start 'Mon Dec 16 14:51:03 2024' +last_solve_result_num 0 +nb_iter_last 6 +nb_iter_total 6 +_ampl_elapsed_time 0.078000 +_total_solve_time 0.046875 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_11159029444846276223' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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 3 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 3 +nb_branch_in_AC_CC 3 +nb_branch_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 1 +nb_branch_with_nonsmall_impedance 3 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 2 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 1 +nb_transformers_with_fixed_ratio 1 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.01 +max_teta_ac 0.02 +teta_max 3.01 +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 +min_delta_teta_dc 0.009298 +min_delta_teta_ac 0.017208 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_rtc.csv new file mode 100644 index 00000000..9797b226 --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_rtc.csv @@ -0,0 +1,2 @@ +#variant;num;tap; +1;3;1; diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_shunts.csv new file mode 100644 index 00000000..8d515fde --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_shunts.csv @@ -0,0 +1 @@ +#variant;num;bus;b(pu);Q(Mvar);section; diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_static_var_compensators.csv new file mode 100644 index 00000000..6792ddb9 --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_static_var_compensators.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;V(pu);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_voltages.csv new file mode 100644 index 00000000..152bf5d8 --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_voltages.csv @@ -0,0 +1,4 @@ +#variant;bus;V(pu);theta(rad);id; +1;1;0.906;0.017;"VL_1_0"; +1;2;0.900;0.000;"VL_2_0"; +1;3;0.695;-0.082;"VL_3_0"; diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_vsc_converter_stations.csv new file mode 100644 index 00000000..aa24858c --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_vsc_converter_stations.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;targetV(pu);targetQ(Mvar);P(MW);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_generators.csv new file mode 100644 index 00000000..e6570861 --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_generators.csv @@ -0,0 +1,2 @@ +#variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW); +1;1;1;'true';0.907;25.0;8.7;-24.7;-8.7; diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_indic.txt new file mode 100644 index 00000000..25daa3ac --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_indic.txt @@ -0,0 +1,95 @@ +final_status OK +dcopf_status OK + +ctime_start 'Mon Dec 16 14:51:02 2024' +last_solve_result_num 0 +nb_iter_last 5 +nb_iter_total 5 +_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_13911448580587003038' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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 3 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 3 +nb_branch_in_AC_CC 3 +nb_branch_in_AC_CC_side_1_opened 1 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 3 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 2 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 1 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.01 +max_teta_ac 0.02 +teta_max 3.01 +min_teta_dc -0.05 +min_teta_ac -0.13 +teta_min -3.05 +max_delta_teta_dc 0.045914 +max_delta_teta_ac 0.134565 +min_delta_teta_dc 0.009298 +min_delta_teta_ac 0.016707 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_rtc.csv new file mode 100644 index 00000000..9a62a138 --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_rtc.csv @@ -0,0 +1 @@ +#variant;num;tap; diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_shunts.csv new file mode 100644 index 00000000..8d515fde --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_shunts.csv @@ -0,0 +1 @@ +#variant;num;bus;b(pu);Q(Mvar);section; diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_static_var_compensators.csv new file mode 100644 index 00000000..6792ddb9 --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_static_var_compensators.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;V(pu);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_voltages.csv new file mode 100644 index 00000000..6446ecfb --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_voltages.csv @@ -0,0 +1,4 @@ +#variant;bus;V(pu);theta(rad);id; +1;1;0.907;0.017;"VL_1_0"; +1;2;0.900;0.000;"VL_2_0"; +1;3;0.623;-0.135;"VL_3_0"; diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_vsc_converter_stations.csv new file mode 100644 index 00000000..aa24858c --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_vsc_converter_stations.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;targetV(pu);targetQ(Mvar);P(MW);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_generators.csv new file mode 100644 index 00000000..7d490269 --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_generators.csv @@ -0,0 +1,2 @@ +#variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW); +1;1;1;'true';0.906;25.0;7.3;-15.3;-7.3; diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_indic.txt new file mode 100644 index 00000000..8309362f --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_indic.txt @@ -0,0 +1,95 @@ +final_status OK +dcopf_status OK + +ctime_start 'Mon Dec 16 14:51:01 2024' +last_solve_result_num 0 +nb_iter_last 4 +nb_iter_total 4 +_ampl_elapsed_time 0.094000 +_total_solve_time 0.031250 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_13276652158585298030' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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 2 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 2 +nb_branch_in_AC_CC 2 +nb_branch_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 1 +nb_branch_with_nonsmall_impedance 2 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 1 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.01 +max_teta_ac 0.01 +teta_max 3.01 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.006428 +max_delta_teta_ac 0.010250 +min_delta_teta_dc 0.006428 +min_delta_teta_ac 0.010250 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_rtc.csv new file mode 100644 index 00000000..9a62a138 --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_rtc.csv @@ -0,0 +1 @@ +#variant;num;tap; diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_shunts.csv new file mode 100644 index 00000000..8d515fde --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_shunts.csv @@ -0,0 +1 @@ +#variant;num;bus;b(pu);Q(Mvar);section; diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_static_var_compensators.csv new file mode 100644 index 00000000..6792ddb9 --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_static_var_compensators.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;V(pu);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_voltages.csv new file mode 100644 index 00000000..c5548f48 --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_voltages.csv @@ -0,0 +1,3 @@ +#variant;bus;V(pu);theta(rad);id; +1;1;0.906;0.010;"VL_1_0"; +1;2;0.900;0.000;"VL_2_0"; diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_vsc_converter_stations.csv new file mode 100644 index 00000000..aa24858c --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_vsc_converter_stations.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;targetV(pu);targetQ(Mvar);P(MW);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_generators.csv new file mode 100644 index 00000000..64dd62e1 --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_generators.csv @@ -0,0 +1,2 @@ +#variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW); +1;1;1;'true';1.100;25.0;10.1;-70.2;-10.1; diff --git a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_indic.txt new file mode 100644 index 00000000..36cc5067 --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_indic.txt @@ -0,0 +1,95 @@ +final_status OK +dcopf_status OK + +ctime_start 'Mon Dec 16 14:51:03 2024' +last_solve_result_num 0 +nb_iter_last 25 +nb_iter_total 25 +_ampl_elapsed_time 0.095000 +_total_solve_time 0.031250 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_14088349731220672307' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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 3 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 3 +nb_branch_in_AC_CC 3 +nb_branch_in_AC_CC_side_1_opened 1 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 2 +nb_branch_with_zero_or_small_impedance 1 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 2 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 1 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.01 +max_teta_ac 0.03 +teta_max 3.01 +min_teta_dc -0.05 +min_teta_ac -1.29 +teta_min -3.05 +max_delta_teta_dc 0.045914 +max_delta_teta_ac 1.293683 +min_delta_teta_dc 0.009298 +min_delta_teta_ac 0.033076 + +nb_reactive_slacks 1 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 1 +sum_slacks_self 1.5 diff --git a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_reactive_slacks.csv b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_reactive_slacks.csv new file mode 100644 index 00000000..559564c9 --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_reactive_slacks.csv @@ -0,0 +1,2 @@ +#variant;bus;slack_condensator(Mvar);slack_self(Mvar);id;substation; +1;3;0.00;1.51;"VL_3_0";"VL_3"; diff --git a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_rtc.csv new file mode 100644 index 00000000..9a62a138 --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_rtc.csv @@ -0,0 +1 @@ +#variant;num;tap; diff --git a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_shunts.csv new file mode 100644 index 00000000..8d515fde --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_shunts.csv @@ -0,0 +1 @@ +#variant;num;bus;b(pu);Q(Mvar);section; diff --git a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_static_var_compensators.csv new file mode 100644 index 00000000..6792ddb9 --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_static_var_compensators.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;V(pu);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_voltages.csv new file mode 100644 index 00000000..95df08ea --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_voltages.csv @@ -0,0 +1,4 @@ +#variant;bus;V(pu);theta(rad);id; +1;1;1.100;0.033;"VL_1_0"; +1;2;1.092;0.000;"VL_2_0"; +1;3;0.500;-1.294;"VL_3_0"; diff --git a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_vsc_converter_stations.csv new file mode 100644 index 00000000..aa24858c --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_vsc_converter_stations.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;targetV(pu);targetQ(Mvar);P(MW);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_generators.csv new file mode 100644 index 00000000..3fdc35ae --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_generators.csv @@ -0,0 +1,3 @@ +#variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW); +1;1;2;'true';0.774;2.0;0.5;-2.5;-0.5; +1;2;3;'true';0.774;2.0;0.5;-2.5;-0.5; diff --git a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_indic.txt new file mode 100644 index 00000000..9881c946 --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_indic.txt @@ -0,0 +1,95 @@ +final_status OK +dcopf_status OK + +ctime_start 'Mon Dec 16 14:51:02 2024' +last_solve_result_num 0 +nb_iter_last 6 +nb_iter_total 6 +_ampl_elapsed_time 0.078000 +_total_solve_time 0.015625 +total_time 0 + +operatingSystem windows +OS 'Windows_NT' +COMPUTERNAME 'ARTELYS-PC253' +directory 'C:\Users\parvy\AppData\Local\Temp\ampl_910703953351669228' + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 5 +nb_bus_in_data_file 5 +nb_bus_in_ACDC_CC 4 +nb_bus_in_AC_CC 4 +nb_bus_in_ACDC_but_out_AC_CC 0 +nb_bus_with_voltage_value 0 +nb_bus_with_reactive_slacks 4 +nb_bus_without_reactive_slacks 0 +nb_branch_in_data_file 4 +nb_branch_in_AC_CC 4 +nb_branch_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 1 +nb_branch_with_nonsmall_impedance 3 +nb_branch_with_zero_or_small_impedance 1 +nb_unit_in_data_file 3 +nb_unit_in_AC_CC 2 +nb_unit_up_and_running 2 +nb_unit_with_variable_reactive_power 2 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.02 +max_teta_ac 0.04 +teta_max 3.02 +min_teta_dc -0.05 +min_teta_ac -0.09 +teta_min -3.05 +max_delta_teta_dc 0.050000 +max_delta_teta_ac 0.086887 +min_delta_teta_dc -0.025000 +min_delta_teta_ac -0.042570 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_rtc.csv new file mode 100644 index 00000000..9a62a138 --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_rtc.csv @@ -0,0 +1 @@ +#variant;num;tap; diff --git a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_shunts.csv new file mode 100644 index 00000000..8d515fde --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_shunts.csv @@ -0,0 +1 @@ +#variant;num;bus;b(pu);Q(Mvar);section; diff --git a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_static_var_compensators.csv new file mode 100644 index 00000000..6792ddb9 --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_static_var_compensators.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;V(pu);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_voltages.csv new file mode 100644 index 00000000..8e5a2f5b --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_voltages.csv @@ -0,0 +1,5 @@ +#variant;bus;V(pu);theta(rad);id; +1;1;0.768;0.000;"b1_vl_0"; +1;2;0.774;0.043;"b2_vl_0"; +1;3;0.774;0.043;"b3_vl_0"; +1;4;0.759;-0.087;"b4_vl_0"; diff --git a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_vsc_converter_stations.csv new file mode 100644 index 00000000..aa24858c --- /dev/null +++ b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_vsc_converter_stations.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;targetV(pu);targetQ(Mvar);P(MW);Q(Mvar); From da38e46d8c6bcfbff37149b2d40eabcf6c9dff69 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Mon, 16 Dec 2024 16:10:49 +0100 Subject: [PATCH 27/63] Clean Signed-off-by: p-arvy --- .../network/AbstractLoadFlowNetworkFactory.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/open-reac/src/test/java/com/powsybl/openreac/network/AbstractLoadFlowNetworkFactory.java b/open-reac/src/test/java/com/powsybl/openreac/network/AbstractLoadFlowNetworkFactory.java index aac300c0..4baf9161 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/network/AbstractLoadFlowNetworkFactory.java +++ b/open-reac/src/test/java/com/powsybl/openreac/network/AbstractLoadFlowNetworkFactory.java @@ -62,7 +62,7 @@ protected static Generator createGenerator(Bus b, String id, double p, double v) .setConnectableBus(b.getId()) .setEnergySource(EnergySource.OTHER) .setMinP(0) - .setMaxP(2 * p) + .setMaxP(p) .setTargetP(p) .setTargetV(v) .setVoltageRegulatorOn(true) @@ -101,22 +101,14 @@ protected static Load createLoad(Bus b, String id, double p, double q) { } protected static Line createLine(Network network, Bus b1, Bus b2, String id, double x) { - return createLine(network, b1, b2, id, 0, x, 0, 0); - } - - protected static Line createLine(Network network, Bus b1, Bus b2, String id, double r, double x, double halfG, double halfB) { return network.newLine() .setId(id) .setBus1(b1.getId()) .setConnectableBus1(b1.getId()) .setBus2(b2.getId()) .setConnectableBus2(b2.getId()) - .setR(r) + .setR(0) .setX(x) - .setG1(halfG) - .setB1(halfB) - .setG2(halfG) - .setB2(halfB) .add(); } From cc66e6a946ab8ccd12bbb66c820b8e723de9f6de Mon Sep 17 00:00:00 2001 From: p-arvy Date: Mon, 16 Dec 2024 16:39:44 +0100 Subject: [PATCH 28/63] Small clean Signed-off-by: p-arvy --- .../optimization/OpenReacBranchWithOneSideOpenedTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacBranchWithOneSideOpenedTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacBranchWithOneSideOpenedTest.java index 70b2d89d..843c9dc1 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacBranchWithOneSideOpenedTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacBranchWithOneSideOpenedTest.java @@ -28,7 +28,7 @@ * * @author Pierre ARVY {@literal } */ -public class OpenReacBranchWithOneSideOpenedTest extends AbstractOpenReacRunnerTest { +class OpenReacBranchWithOneSideOpenedTest extends AbstractOpenReacRunnerTest { @Test void testOpenLineSide1OpenReac() throws IOException { From e01c18d19664bdea2d2753a48978f109e21d8631 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Wed, 18 Dec 2024 15:25:01 +0100 Subject: [PATCH 29/63] Update TUs Signed-off-by: p-arvy --- .../OpenReacBranchWithOneSideOpenedTest.java | 2 ++ .../com/powsybl/config/test/config.yml | 2 +- .../reactiveopf_results_generators.csv | 6 +++--- .../reactiveopf_results_indic.txt | 15 +------------ .../reactiveopf_results_voltages.csv | 2 +- .../reactiveopf_results_indic.txt | 13 ------------ .../reactiveopf_results_indic.txt | 13 ------------ .../reactiveopf_results_indic.txt | 13 ------------ .../reactiveopf_results_indic.txt | 13 ------------ .../reactiveopf_results_generators.csv | 4 ++-- .../reactiveopf_results_indic.txt | 21 ++++--------------- .../reactiveopf_results_voltages.csv | 8 +++---- 12 files changed, 18 insertions(+), 94 deletions(-) diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacBranchWithOneSideOpenedTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacBranchWithOneSideOpenedTest.java index 843c9dc1..1f5e2ad7 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacBranchWithOneSideOpenedTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacBranchWithOneSideOpenedTest.java @@ -34,6 +34,7 @@ class OpenReacBranchWithOneSideOpenedTest extends AbstractOpenReacRunnerTest { void testOpenLineSide1OpenReac() throws IOException { Network network = VoltageControlNetworkFactory.createWithSimpleRemoteControl(); network.getLine("l43").setG2(0.1f).setB2(0.1f).getTerminal1().disconnect(); + network.getGenerator("g3").setMaxP(4); testAllModifAndLoadFlow(network, "optimization/opened-branches/line-open-side-1", new OpenReacParameters(), ReportNode.NO_OP); } @@ -41,6 +42,7 @@ void testOpenLineSide1OpenReac() throws IOException { void testZeroImpedanceOpenBranchSide2OpenReac() throws IOException { Network network = VoltageControlNetworkFactory.createWithTwoVoltageControls(); network.getLine("l45").setX(1e-8).setB1(1).setG1(0.1).getTerminal2().disconnect(); + network.getGenerator("g3").setMaxP(4); OpenReacResult result = runOpenReac(network, "optimization/opened-branches/zero-impedance-open-side-2"); // opened branch is considered as non impedant diff --git a/open-reac/src/test/resources/com/powsybl/config/test/config.yml b/open-reac/src/test/resources/com/powsybl/config/test/config.yml index 9d797384..1acd4f0d 100644 --- a/open-reac/src/test/resources/com/powsybl/config/test/config.yml +++ b/open-reac/src/test/resources/com/powsybl/config/test/config.yml @@ -1,2 +1,2 @@ ampl: - homeDir: D:\AMPL-13.1.20220703-Win-64 + homeDir: ??? diff --git a/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_generators.csv index 41d62fad..2cc9c054 100644 --- a/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_generators.csv +++ b/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_generators.csv @@ -1,4 +1,4 @@ #variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW); -1;1;2;'true';0.500;2.0;0.7;-2.0;-0.7; -1;2;3;'true';0.500;2.0;0.7;-2.0;-0.7; -1;3;4;'true';0.512;2.0;0.7;-2.0;-0.7; +1;1;2;'true';0.500;2.0;0.6;-2.0;-0.6; +1;2;3;'true';0.500;2.0;0.9;-2.0;-0.9; +1;3;4;'true';0.510;2.0;0.6;-2.0;-0.6; diff --git a/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_indic.txt index 7a452132..b2a59f57 100644 --- a/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Mon Dec 16 14:48:51 2024' -last_solve_result_num 0 -nb_iter_last 6 -nb_iter_total 6 -_ampl_elapsed_time 0.109000 -_total_solve_time 0.015625 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_14517614006499333001' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 @@ -86,7 +73,7 @@ teta_min -3.00 max_delta_teta_dc -0.000003 max_delta_teta_ac -0.000012 min_delta_teta_dc -0.020000 -min_delta_teta_ac -0.078526 +min_delta_teta_ac -0.078480 nb_reactive_slacks 0 nb_slacks_condensator 0 diff --git a/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_voltages.csv index 5e4b9e90..136f5e28 100644 --- a/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_voltages.csv +++ b/open-reac/src/test/resources/optimization/opened-branches/line-open-side-1/reactiveopf_results_voltages.csv @@ -2,4 +2,4 @@ 1;1;0.500;-0.000;"b1_vl_0"; 1;2;0.500;0.000;"b2_vl_0"; 1;3;0.500;-0.000;"b3_vl_0"; -1;4;0.512;0.079;"b4_vl_0"; +1;4;0.510;0.078;"b4_vl_0"; diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_indic.txt index 895d49be..8459e658 100644 --- a/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-not-optimized/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Mon Dec 16 14:51:03 2024' -last_solve_result_num 0 -nb_iter_last 6 -nb_iter_total 6 -_ampl_elapsed_time 0.078000 -_total_solve_time 0.046875 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_11159029444846276223' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_indic.txt index 25daa3ac..cc7f50c2 100644 --- a/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-1/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Mon Dec 16 14:51:02 2024' -last_solve_result_num 0 -nb_iter_last 5 -nb_iter_total 5 -_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_13911448580587003038' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_indic.txt index 8309362f..92bc52d8 100644 --- a/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/opened-branches/rtc-open-side-2/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Mon Dec 16 14:51:01 2024' -last_solve_result_num 0 -nb_iter_last 4 -nb_iter_total 4 -_ampl_elapsed_time 0.094000 -_total_solve_time 0.031250 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_13276652158585298030' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_indic.txt index 36cc5067..5bc88c61 100644 --- a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-1/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Mon Dec 16 14:51:03 2024' -last_solve_result_num 0 -nb_iter_last 25 -nb_iter_total 25 -_ampl_elapsed_time 0.095000 -_total_solve_time 0.031250 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_14088349731220672307' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 diff --git a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_generators.csv index 3fdc35ae..999b659d 100644 --- a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_generators.csv +++ b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_generators.csv @@ -1,3 +1,3 @@ #variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW); -1;1;2;'true';0.774;2.0;0.5;-2.5;-0.5; -1;2;3;'true';0.774;2.0;0.5;-2.5;-0.5; +1;1;2;'true';0.803;2.0;0.4;-2.0;-0.4; +1;2;3;'true';0.805;2.0;0.6;-3.1;-0.6; diff --git a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_indic.txt index 9881c946..efd81ab3 100644 --- a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_indic.txt @@ -1,19 +1,6 @@ final_status OK dcopf_status OK -ctime_start 'Mon Dec 16 14:51:02 2024' -last_solve_result_num 0 -nb_iter_last 6 -nb_iter_total 6 -_ampl_elapsed_time 0.078000 -_total_solve_time 0.015625 -total_time 0 - -operatingSystem windows -OS 'Windows_NT' -COMPUTERNAME 'ARTELYS-PC253' -directory 'C:\Users\parvy\AppData\Local\Temp\ampl_910703953351669228' - log_level_ampl INFO log_level_knitro 2 objective_choice 0 @@ -78,15 +65,15 @@ sum_batteries_pmax 0.0 sum_batteries_pmin 0.0 max_teta_dc 0.02 -max_teta_ac 0.04 +max_teta_ac 0.05 teta_max 3.02 min_teta_dc -0.05 -min_teta_ac -0.09 +min_teta_ac -0.08 teta_min -3.05 max_delta_teta_dc 0.050000 -max_delta_teta_ac 0.086887 +max_delta_teta_ac 0.080167 min_delta_teta_dc -0.025000 -min_delta_teta_ac -0.042570 +min_delta_teta_ac -0.047639 nb_reactive_slacks 0 nb_slacks_condensator 0 diff --git a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_voltages.csv index 8e5a2f5b..a37e219a 100644 --- a/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_voltages.csv +++ b/open-reac/src/test/resources/optimization/opened-branches/zero-impedance-open-side-2/reactiveopf_results_voltages.csv @@ -1,5 +1,5 @@ #variant;bus;V(pu);theta(rad);id; -1;1;0.768;0.000;"b1_vl_0"; -1;2;0.774;0.043;"b2_vl_0"; -1;3;0.774;0.043;"b3_vl_0"; -1;4;0.759;-0.087;"b4_vl_0"; +1;1;0.799;0.000;"b1_vl_0"; +1;2;0.803;0.031;"b2_vl_0"; +1;3;0.805;0.048;"b3_vl_0"; +1;4;0.791;-0.080;"b4_vl_0"; From 287b62bdd6fc9900a9af3e84ab3a4bf7a4214be1 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Thu, 19 Dec 2024 17:44:38 +0100 Subject: [PATCH 30/63] Clean Signed-off-by: p-arvy --- open-reac/src/main/resources/openreac/commons.mod | 4 ++-- open-reac/src/main/resources/openreac/dcopf.run | 2 +- .../optimization/OpenReacOptimizationIndicatorsTest.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/open-reac/src/main/resources/openreac/commons.mod b/open-reac/src/main/resources/openreac/commons.mod index 000a36a8..d34ad388 100644 --- a/open-reac/src/main/resources/openreac/commons.mod +++ b/open-reac/src/main/resources/openreac/commons.mod @@ -131,7 +131,7 @@ set BUSVV := {n in BUSCC : bus_V0[1,n] >= min_plausible_low_voltage_limit}; # Reactive set SHUNTCC := {(1,s,n) in SHUNT: n in BUSCC or shunt_possiblebus[1,s,n] in BUSCC}; # We want to be able to reconnect shunts -set BRANCHCC_REGL := {(qq,m,n) in BRANCHCC union BRANCHCC_WITH_SIDE_2_OPENED diff BRANCHZNULL: branch_ptrRegl[1,qq,m,n] != -1 }; # ratio tap changers have impact on lines with side 1 opened +set BRANCHCC_REGL := {(qq,m,n) in BRANCHCC union BRANCHCC_WITH_SIDE_2_OPENED diff BRANCHZNULL: branch_ptrRegl[1,qq,m,n] != -1 }; # ratio tap changers also have impact on lines with side 2 opened set BRANCHCC_DEPH := {(qq,m,n) in BRANCHCC diff BRANCHZNULL: branch_ptrDeph[1,qq,m,n] != -1 }; set SVCCC := {(1,svc,n) in SVC: n in BUSCC}; @@ -170,7 +170,7 @@ set UNIT_FIXQ := {(g,n) in UNITON: g in PARAM_UNIT_FIXQ and abs(unit_Qc[1,g,n])< set BRANCHCC_REGL_VAR := { (qq,m,n) in BRANCHCC_REGL: qq in PARAM_TRANSFORMERS_RATIO_VARIABLE - and (qq,m,n) not in BRANCHCC_WITH_SIDE_2_OPENED # ratio tap changers on branch with side 2 opened are not optimized + and (qq,m,n) not in BRANCHCC_WITH_SIDE_2_OPENED # ratio tap changers on opened branches are not optimized and regl_ratio_min[1,branch_ptrRegl[1,qq,m,n]] < regl_ratio_max[1,branch_ptrRegl[1,qq,m,n]] }; set BRANCHCC_REGL_FIX := BRANCHCC_REGL diff BRANCHCC_REGL_VAR; diff --git a/open-reac/src/main/resources/openreac/dcopf.run b/open-reac/src/main/resources/openreac/dcopf.run index a1056497..77c8f471 100644 --- a/open-reac/src/main/resources/openreac/dcopf.run +++ b/open-reac/src/main/resources/openreac/dcopf.run @@ -88,7 +88,7 @@ printf{LOG_INFO} "OK all slack variables for DCOPF are null\n"; let dcopf_status := "OK"; # Print flows on branches with zero impedance -#for{(qq,m,n) in BRANCHZNULL} printf{LOG_INFO} "Flow on zero impedance branch %Q: %.f MW\n",branch_id[1,qq,m,n],activeflow[qq,m,n]; +for{(qq,m,n) in BRANCHCC inter BRANCHZNULL} printf{LOG_INFO} "Flow on zero impedance branch %Q: %.f MW\n",branch_id[1,qq,m,n],activeflow[qq,m,n]; # Print flows on most loaded lines let temp1 := max{(qq,m,n) in BRANCHCC}abs(activeflow[qq,m,n]); diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java index 4195834f..0b3ae806 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java @@ -119,11 +119,11 @@ void testBranchesIndicators() throws IOException { assertEquals(OpenReacStatus.OK, result.getStatus()); assertEquals(4, Integer.parseInt(result.getIndicators().get("nb_branch_in_data_file"))); - // verify opened branch are considered in optimization + // verify opened branches are considered in optimization assertEquals(4, Integer.parseInt(result.getIndicators().get("nb_branch_in_AC_CC"))); assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_in_AC_CC_side_1_opened"))); assertEquals(1, Integer.parseInt(result.getIndicators().get("nb_branch_in_AC_CC_side_2_opened"))); - // verify opened branch can be considered as zero impedance branches + // verify opened branches can be considered as zero impedance branches assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_branch_with_nonsmall_impedance"))); assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_branch_with_zero_or_small_impedance"))); } From 2063122d8f05c67c9347e0756ba5ea7aac7bff86 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Thu, 19 Dec 2024 18:00:25 +0100 Subject: [PATCH 31/63] Add doc Signed-off-by: p-arvy --- docs/optimizer/acOptimalPowerflow.md | 1 + docs/optimizer/inputs.md | 12 ++++++------ open-reac/src/main/resources/openreac/commons.mod | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/optimizer/acOptimalPowerflow.md b/docs/optimizer/acOptimalPowerflow.md index 16d59424..57a62b7a 100644 --- a/docs/optimizer/acOptimalPowerflow.md +++ b/docs/optimizer/acOptimalPowerflow.md @@ -16,6 +16,7 @@ Please note that: even if the user designates these generators as fixed in the parameter file `param_generators_reactive.txt` (see [Configuration of the run](inputs.md#configuration-of-the-run)). Therefore, when the optimization results are exported, **these generators are exported with a reactive power target of $0$**. - **Neither current limits nor power limits** on branches are considered in the optimization. +- Branches with one side open are considered in optimization. ## Constraints diff --git a/docs/optimizer/inputs.md b/docs/optimizer/inputs.md index 0393e07f..56e289a3 100644 --- a/docs/optimizer/inputs.md +++ b/docs/optimizer/inputs.md @@ -42,12 +42,12 @@ Please note that for these parameters, the AMPL code defines default values whic In addition to the previous parameters, the user can specify which parameters will be variable or fixed in the ACOPF solving (see [AC optimal powerflow](acOptimalPowerflow.md)). This is done using the following files: -| File | Description | Default behavior of modified values | -|---------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------| -| `param_transformers.txt` | Ratio tap changers with a variable transformation ratio (real variable) | Transformation ratios are fixed | -| `param_shunt.txt` | Shunts with a continuous variable susceptance and which can be modified and/or connected (only if possible bus is defined in `ampl_network_shunts.txt`) | Shunt susceptances are fixed | -| `param_generators_reactive.txt` | Generators with a constant reactive power production. If this value is not consistent (> PQmax), the reactive power production stays variable | Coherent reactive power productions (see [P/Q unit domain](preprocessing.md#pq-unit-domain)) are variable | -| `param_buses_with_reactive_slack.txt` | Buses with attached reactive slacks if configurable parameter buses_with_reactive_slacks = "CONFIGURED" | Only buses with no reactive power production have reactive slacks attached | +| File | Description | Default behavior of modified values | +|---------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------| +| `param_transformers.txt` | Ratio tap changers with a variable transformation ratio (real variable). Note that ratio tap changers on branches with one side open are not optimized. | Transformation ratios are fixed | +| `param_shunt.txt` | Shunts with a continuous variable susceptance and which can be modified and/or connected (only if possible bus is defined in `ampl_network_shunts.txt`) | Shunt susceptances are fixed | +| `param_generators_reactive.txt` | Generators with a constant reactive power production. If this value is not consistent (> PQmax), the reactive power production stays variable | Coherent reactive power productions (see [P/Q unit domain](preprocessing.md#pq-unit-domain)) are variable | +| `param_buses_with_reactive_slack.txt` | Buses with attached reactive slacks if configurable parameter buses_with_reactive_slacks = "CONFIGURED" | Only buses with no reactive power production have reactive slacks attached | All of these files share the same format: 2 columns #"num" "id". diff --git a/open-reac/src/main/resources/openreac/commons.mod b/open-reac/src/main/resources/openreac/commons.mod index d34ad388..01d1409a 100644 --- a/open-reac/src/main/resources/openreac/commons.mod +++ b/open-reac/src/main/resources/openreac/commons.mod @@ -131,7 +131,7 @@ set BUSVV := {n in BUSCC : bus_V0[1,n] >= min_plausible_low_voltage_limit}; # Reactive set SHUNTCC := {(1,s,n) in SHUNT: n in BUSCC or shunt_possiblebus[1,s,n] in BUSCC}; # We want to be able to reconnect shunts -set BRANCHCC_REGL := {(qq,m,n) in BRANCHCC union BRANCHCC_WITH_SIDE_2_OPENED diff BRANCHZNULL: branch_ptrRegl[1,qq,m,n] != -1 }; # ratio tap changers also have impact on lines with side 2 opened +set BRANCHCC_REGL := {(qq,m,n) in BRANCHCC union BRANCHCC_WITH_SIDE_2_OPENED diff BRANCHZNULL: branch_ptrRegl[1,qq,m,n] != -1 }; # ratio tap changers also have impact on lines with side 2 open set BRANCHCC_DEPH := {(qq,m,n) in BRANCHCC diff BRANCHZNULL: branch_ptrDeph[1,qq,m,n] != -1 }; set SVCCC := {(1,svc,n) in SVC: n in BUSCC}; @@ -170,7 +170,7 @@ set UNIT_FIXQ := {(g,n) in UNITON: g in PARAM_UNIT_FIXQ and abs(unit_Qc[1,g,n])< set BRANCHCC_REGL_VAR := { (qq,m,n) in BRANCHCC_REGL: qq in PARAM_TRANSFORMERS_RATIO_VARIABLE - and (qq,m,n) not in BRANCHCC_WITH_SIDE_2_OPENED # ratio tap changers on opened branches are not optimized + and (qq,m,n) not in BRANCHCC_WITH_SIDE_2_OPENED # ratio tap changers on open branches are not optimized and regl_ratio_min[1,branch_ptrRegl[1,qq,m,n]] < regl_ratio_max[1,branch_ptrRegl[1,qq,m,n]] }; set BRANCHCC_REGL_FIX := BRANCHCC_REGL diff BRANCHCC_REGL_VAR; From 9d951c1383f1dafb1fbe9f1b3d7db5afea13c736 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Mon, 30 Dec 2024 12:49:06 +0100 Subject: [PATCH 32/63] Improve comment Signed-off-by: p-arvy --- open-reac/src/main/resources/openreac/commons.mod | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/open-reac/src/main/resources/openreac/commons.mod b/open-reac/src/main/resources/openreac/commons.mod index 01d1409a..60223172 100644 --- a/open-reac/src/main/resources/openreac/commons.mod +++ b/open-reac/src/main/resources/openreac/commons.mod @@ -49,9 +49,9 @@ set BRANCH2:= setof {(1,qq,m,n) in BRANCH: m in BUS2 and n in BUS2} (qq,m,n); set BUSCC dimen 1 default {}; # Branches with bus on side 1 and 2 in CC set BRANCHCC := {(qq,m,n) in BRANCH2: m in BUSCC and n in BUSCC}; -# Branches with disconnected bus on side 2 +# Branches with bus on side 1 in CC, and disconnected bus on side 2 set BRANCHCC_WITH_SIDE_2_OPENED := setof {(1,qq,m,n) in BRANCH: m in BUSCC and n == -1 and m != n} (qq,m,n); -# Branches with disconnected bus on side 1 +# Branches with bus on side 2 in CC, and disconnected bus on side 1 set BRANCHCC_WITH_SIDE_1_OPENED := setof {(1,qq,m,n) in BRANCH: m == -1 and n in BUSCC and m != n} (qq,m,n); set ALL_BRANCHCC := BRANCHCC union BRANCHCC_WITH_SIDE_2_OPENED union BRANCHCC_WITH_SIDE_1_OPENED; From bb65393186405447a2ea8a83b4ccb8908c91743f Mon Sep 17 00:00:00 2001 From: p-arvy Date: Wed, 18 Dec 2024 14:48:29 +0100 Subject: [PATCH 33/63] Wip Signed-off-by: p-arvy --- open-reac/src/main/resources/openreac/commons.mod | 14 +++++++------- .../optimization/AbstractOpenReacRunnerTest.java | 8 +++----- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/open-reac/src/main/resources/openreac/commons.mod b/open-reac/src/main/resources/openreac/commons.mod index 60223172..513ee227 100644 --- a/open-reac/src/main/resources/openreac/commons.mod +++ b/open-reac/src/main/resources/openreac/commons.mod @@ -111,19 +111,19 @@ check {(qq,m,n) in ALL_BRANCHCC}: abs(branch_X_mod[qq,m,n]) > 0; # If in BRANCHZNULL, then set Gor/Gex/Bor/Bex to 0 param branch_Gor_mod{(qq,m,n) in ALL_BRANCHCC} := - if (qq,m,n) in BRANCHCC and (qq,m,n) in BRANCHZNULL then 0 + if (qq,m,n) in BRANCHCC and (qq,m,n) in BRANCHZNULL and substation_Vnomi[1,bus_substation[1,m]] != substation_Vnomi[1,bus_substation[1,n]] then 0 else branch_Gor[1,qq,m,n]; param branch_Gex_mod{(qq,m,n) in ALL_BRANCHCC} := - if (qq,m,n) in BRANCHCC and (qq,m,n) in BRANCHZNULL then 0 + if (qq,m,n) in BRANCHCC and (qq,m,n) in BRANCHZNULL and substation_Vnomi[1,bus_substation[1,m]] != substation_Vnomi[1,bus_substation[1,n]] then 0 else branch_Gex[1,qq,m,n]; param branch_Bor_mod{(qq,m,n) in ALL_BRANCHCC} := - if (qq,m,n) in BRANCHCC and (qq,m,n) in BRANCHZNULL then 0 + if (qq,m,n) in BRANCHCC and (qq,m,n) in BRANCHZNULL and substation_Vnomi[1,bus_substation[1,m]] != substation_Vnomi[1,bus_substation[1,n]] then 0 else branch_Bor[1,qq,m,n]; param branch_Bex_mod{(qq,m,n) in ALL_BRANCHCC} := - if (qq,m,n) in BRANCHCC and (qq,m,n) in BRANCHZNULL then 0 + if (qq,m,n) in BRANCHCC and (qq,m,n) in BRANCHZNULL and substation_Vnomi[1,bus_substation[1,m]] != substation_Vnomi[1,bus_substation[1,n]] then 0 else branch_Bex[1,qq,m,n]; # Busses with valid voltage value @@ -203,11 +203,11 @@ param branch_admi {(qq,m,n) in ALL_BRANCHCC} = # Later in this file, a variable branch_Ror_var will be created, to replace branch_Ror when it is not variable param branch_Ror {(qq,m,n) in ALL_BRANCHCC} = - ( if ((qq,m,n) in BRANCHCC_REGL) + ( if (branch_ptrRegl[1,qq,m,n] != -1) then tap_ratio[1,regl_table[1,branch_ptrRegl[1,qq,m,n]],regl_tap0[1,branch_ptrRegl[1,qq,m,n]]] else 1.0 ) - * ( if ((qq,m,n) in BRANCHCC_DEPH) + * ( if (branch_ptrDeph[1,qq,m,n] != -1) then tap_ratio[1,deph_table[1,branch_ptrDeph[1,qq,m,n]],deph_tap0[1,branch_ptrDeph[1,qq,m,n]]] else 1.0 ) @@ -215,7 +215,7 @@ param branch_Ror {(qq,m,n) in ALL_BRANCHCC} = param branch_Rex {(q,m,n) in ALL_BRANCHCC} = 1; # In IIDM, everything is in bus1 so ratio at bus2 is always 1 param branch_dephor {(qq,m,n) in ALL_BRANCHCC} = - if ((qq,m,n) in BRANCHCC_DEPH) + if (branch_ptrDeph[1,qq,m,n] != -1) then tap_angle [1,deph_table[1,branch_ptrDeph[1,qq,m,n]],deph_tap0[1,branch_ptrDeph[1,qq,m,n]]] else 0; param branch_dephex {(qq,m,n) in ALL_BRANCHCC} = 0; # In IIDM, everything is in bus1 so dephase at bus2 is always 0 diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java index ad57d445..7e152ab0 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java @@ -12,7 +12,6 @@ import com.powsybl.commons.test.ComparisonUtils; import com.powsybl.computation.ComputationManager; import com.powsybl.computation.local.LocalCommandExecutor; -import com.powsybl.computation.local.LocalComputationConfig; import com.powsybl.computation.local.LocalComputationManager; import com.powsybl.iidm.network.*; import com.powsybl.loadflow.LoadFlow; @@ -32,7 +31,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; -import java.util.concurrent.ForkJoinPool; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -135,9 +133,9 @@ protected OpenReacResult runOpenReac(Network network, String subFolder, OpenReac } LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor(outputFileNames); // To really run open reac, use the commentede line below. Be sure that open-reac/src/test/resources/com/powsybl/config/test/config.yml contains your ampl path -// try (ComputationManager computationManager = new LocalComputationManager()) { - try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), - localCommandExecutor, ForkJoinPool.commonPool())) { + try (ComputationManager computationManager = new LocalComputationManager()) { +// try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), +// localCommandExecutor, ForkJoinPool.commonPool())) { return OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, new OpenReacConfig(true), computationManager, reportNode, null); } From 6e7a9c9752b9680bd20c8fe245b413eba156e6e1 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Wed, 18 Dec 2024 15:34:40 +0100 Subject: [PATCH 34/63] Clean Signed-off-by: p-arvy --- .../openreac/optimization/AbstractOpenReacRunnerTest.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java index 7e152ab0..ad57d445 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java @@ -12,6 +12,7 @@ import com.powsybl.commons.test.ComparisonUtils; import com.powsybl.computation.ComputationManager; import com.powsybl.computation.local.LocalCommandExecutor; +import com.powsybl.computation.local.LocalComputationConfig; import com.powsybl.computation.local.LocalComputationManager; import com.powsybl.iidm.network.*; import com.powsybl.loadflow.LoadFlow; @@ -31,6 +32,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.concurrent.ForkJoinPool; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -133,9 +135,9 @@ protected OpenReacResult runOpenReac(Network network, String subFolder, OpenReac } LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor(outputFileNames); // To really run open reac, use the commentede line below. Be sure that open-reac/src/test/resources/com/powsybl/config/test/config.yml contains your ampl path - try (ComputationManager computationManager = new LocalComputationManager()) { -// try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), -// localCommandExecutor, ForkJoinPool.commonPool())) { +// try (ComputationManager computationManager = new LocalComputationManager()) { + try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), + localCommandExecutor, ForkJoinPool.commonPool())) { return OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, new OpenReacConfig(true), computationManager, reportNode, null); } From 1f9960c655b3075ae351d3afc1c3bbc6f67bfda7 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Mon, 30 Dec 2024 13:04:25 +0100 Subject: [PATCH 35/63] Add comments/doc Signed-off-by: p-arvy --- docs/optimizer/preprocessing.md | 1 + open-reac/src/main/resources/openreac/commons.mod | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/optimizer/preprocessing.md b/docs/optimizer/preprocessing.md index 3c311b43..77143ade 100644 --- a/docs/optimizer/preprocessing.md +++ b/docs/optimizer/preprocessing.md @@ -14,6 +14,7 @@ Let $V_{s}^{min}$ (resp. $V_{s}^{max}$) be the low (resp. high) voltage limit of Branches with an impedance magnitude, **calculated in per unit**, lower than the configurable threshold `Znull` (see section [Configuration of the run](inputs.md#configuration-of-the-run)) are considered as non-impedant. These branches will have their reactance replaced by the threshold `Znull` (in p.u.), **even if the reactance specified in `ampl_network_branches.txt` is negative**. +Note that for lines considered as non-impedant and connecting two different nominal voltage levels, the conductances and susceptances are cancelled in order to avoid numerical instabilities. ## Impedance of transformers diff --git a/open-reac/src/main/resources/openreac/commons.mod b/open-reac/src/main/resources/openreac/commons.mod index 513ee227..5280dc3b 100644 --- a/open-reac/src/main/resources/openreac/commons.mod +++ b/open-reac/src/main/resources/openreac/commons.mod @@ -109,7 +109,7 @@ param branch_X_mod{(qq,m,n) in ALL_BRANCHCC} := else branch_X[1,qq,m,n]; check {(qq,m,n) in ALL_BRANCHCC}: abs(branch_X_mod[qq,m,n]) > 0; -# If in BRANCHZNULL, then set Gor/Gex/Bor/Bex to 0 +# If in BRANCHZNULL and Vnom1 != Vnom2, then set Gor/Gex/Bor/Bex to 0 param branch_Gor_mod{(qq,m,n) in ALL_BRANCHCC} := if (qq,m,n) in BRANCHCC and (qq,m,n) in BRANCHZNULL and substation_Vnomi[1,bus_substation[1,m]] != substation_Vnomi[1,bus_substation[1,n]] then 0 else branch_Gor[1,qq,m,n]; From 8fdccf62b3d253998c8a3cb528aab4da69094e2c Mon Sep 17 00:00:00 2001 From: p-arvy Date: Mon, 30 Dec 2024 14:18:32 +0100 Subject: [PATCH 36/63] Update doc Signed-off-by: p-arvy --- docs/optimizer/preprocessing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/optimizer/preprocessing.md b/docs/optimizer/preprocessing.md index 77143ade..f51c711e 100644 --- a/docs/optimizer/preprocessing.md +++ b/docs/optimizer/preprocessing.md @@ -18,7 +18,7 @@ Note that for lines considered as non-impedant and connecting two different nomi ## Impedance of transformers -In the calculations of the ACOPF (see [AC optimal powerflow](acOptimalPowerflow.md)), the transformers with an impedance (specified in `ampl_network_branches.txt`) considered as null (see [Zero-impedance threshold](#zero-impedance-threshold)) **are treated as lines**. Then, the transformation ratios/phase shifts are ignored, as well as the impedance specified in the tap changer table `ampl_network_tct.txt`. +In the calculations of the ACOPF (see [AC optimal powerflow](acOptimalPowerflow.md)), the impedance specified in tap changer table `ampl_network_tct.txt` is ignored for transformers with an impedance (specified in `ampl_network_branches.txt`) considered as null (see [Zero-impedance threshold](#zero-impedance-threshold)). Note that the transformer ratios and phase shiftings are considered anyway. For phase shifters transformers considered as impedant, the reactance values from the tap changer table (in `ampl_network_tct.txt`) replace the reactance specified in `ampl_network_branches.txt`. The resistance is then calculated proportionally. For the ratio tap changers, the impedance stays as specified in `ampl_network_branches.txt`. **Please notice there is no specified handling for cases where resistance and/or reactance is negative or if there is both a ratio tap changer and a phase shift transformer on the same branch.** From db3f852a741becdf7a36b36607e63759ab36fbf9 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Wed, 18 Dec 2024 19:37:43 +0100 Subject: [PATCH 37/63] Add 6 points diagrams for generators Signed-off-by: p-arvy --- .../openreac/acopf_preprocessing.run | 72 ++++-- .../src/main/resources/openreac/commons.mod | 2 + .../main/resources/openreac/iidm_importer.mod | 2 +- .../AbstractLoadFlowNetworkFactory.java | 2 +- .../network/VoltageControlNetworkFactory.java | 37 ++-- .../AbstractOpenReacRunnerTest.java | 14 +- .../OpecReacOptimizationBoundsTest.java | 205 ++++++++++++++---- .../com/powsybl/config/test/config.yml | 2 +- 8 files changed, 253 insertions(+), 83 deletions(-) diff --git a/open-reac/src/main/resources/openreac/acopf_preprocessing.run b/open-reac/src/main/resources/openreac/acopf_preprocessing.run index 59fd08fd..1ddc6dc8 100644 --- a/open-reac/src/main/resources/openreac/acopf_preprocessing.run +++ b/open-reac/src/main/resources/openreac/acopf_preprocessing.run @@ -175,10 +175,17 @@ for {(g,n) in UNITON} { } if abs(unit_qp[1,g,n]) >= PQmax then { - let corrected_unit_qp[g,n] := -defaultQmaxPmaxRatio * corrected_unit_Pmax[g,n]; - printf{LOG_DEBUG} "%Q for %Q is %Q -> corrected to %Q\n","unit_qp",unit_id[1,g,n],unit_qp[1,g,n],corrected_unit_qp[g,n]; - } - else let corrected_unit_qp[g,n] := unit_qp[1,g,n]; + let corrected_unit_qp[g,n] := -defaultQmaxPmaxRatio * corrected_unit_Pmax[g,n]; + printf{LOG_DEBUG} "%Q for %Q is %Q -> corrected to %Q\n","unit_qp",unit_id[1,g,n],unit_qp[1,g,n],corrected_unit_qp[g,n]; + } + else let corrected_unit_qp[g,n] := unit_qp[1,g,n]; + + # TODO : update print + if abs(unit_qp0[1,g,n]) >= PQmax then { + let corrected_unit_q0[g,n] := -defaultQmaxPmaxRatio * corrected_unit_Pmax[g,n]; + printf{LOG_DEBUG} "%Q for %Q is %Q -> corrected to %Q\n","unit_qp",unit_id[1,g,n],unit_qp[1,g,n],corrected_unit_qp[g,n]; + } + else let corrected_unit_q0[g,n] := unit_qp0[1,g,n]; if abs(unit_qP[1,g,n]) >= PQmax then { let corrected_unit_qP[g,n] := -defaultQmaxPmaxRatio * corrected_unit_Pmax[g,n]; @@ -187,10 +194,17 @@ for {(g,n) in UNITON} { else let corrected_unit_qP[g,n] := unit_qP[1,g,n]; if abs(unit_Qp[1,g,n]) >= PQmax then { - let corrected_unit_Qp[g,n] := defaultQmaxPmaxRatio * corrected_unit_Pmax[g,n]; - printf{LOG_DEBUG} "%Q for %Q is %Q -> corrected to %Q\n","unit_Qp",unit_id[1,g,n],unit_Qp[1,g,n],corrected_unit_Qp[g,n]; - } - else let corrected_unit_Qp[g,n] := unit_Qp[1,g,n]; + let corrected_unit_Qp[g,n] := defaultQmaxPmaxRatio * corrected_unit_Pmax[g,n]; + printf{LOG_DEBUG} "%Q for %Q is %Q -> corrected to %Q\n","unit_Qp",unit_id[1,g,n],unit_Qp[1,g,n],corrected_unit_Qp[g,n]; + } + else let corrected_unit_Qp[g,n] := unit_Qp[1,g,n]; + + # TODO : update print + if abs(unit_Qp0[1,g,n]) >= PQmax then { + let corrected_unit_Q0[g,n] := defaultQmaxPmaxRatio * corrected_unit_Pmax[g,n]; + printf{LOG_DEBUG} "%Q for %Q is %Q -> corrected to %Q\n","unit_Qp",unit_id[1,g,n],unit_Qp[1,g,n],corrected_unit_Qp[g,n]; + } + else let corrected_unit_Q0[g,n] := unit_Qp0[1,g,n]; if abs(unit_QP[1,g,n]) >= PQmax then { let corrected_unit_QP[g,n] := defaultQmaxPmaxRatio * corrected_unit_Pmax[g,n]; @@ -206,12 +220,20 @@ for {(g,n) in UNITON} { } if corrected_unit_qP[g,n] > corrected_unit_QP[g,n] then { - printf{LOG_WARNING} "Warning unit %Q : unit_qP > unit_QP -> we invert them",unit_id[1,g,n]; - let tempo := corrected_unit_qP[g,n]; - let corrected_unit_qP[g,n] := corrected_unit_QP[g,n]; - let corrected_unit_QP[g,n] := tempo; - } + printf{LOG_WARNING} "Warning unit %Q : unit_qP > unit_QP -> we invert them",unit_id[1,g,n]; + let tempo := corrected_unit_qP[g,n]; + let corrected_unit_qP[g,n] := corrected_unit_QP[g,n]; + let corrected_unit_QP[g,n] := tempo; + } + + if corrected_unit_q0[g,n] > corrected_unit_Q0[g,n] then { + printf{LOG_WARNING} "Warning unit %Q : unit_qP > unit_QP -> we invert them",unit_id[1,g,n]; + let tempo := corrected_unit_q0[g,n]; + let corrected_unit_q0[g,n] := corrected_unit_Q0[g,n]; + let corrected_unit_Q0[g,n] := tempo; + } + # TODO : add corner cases here if abs(corrected_unit_qP[g,n]-corrected_unit_QP[g,n]) <= minimalQPrange and abs(corrected_unit_qp[g,n]-corrected_unit_Qp[g,n]) <= minimalQPrange and abs(corrected_unit_QP[g,n]-corrected_unit_qp[g,n]) <= minimalQPrange @@ -225,8 +247,28 @@ for {(g,n) in UNITON} { let corrected_unit_Qp[g,n] := tempo; } - let corrected_unit_Qmin[g,n] := min(corrected_unit_qP[g,n],corrected_unit_qp[g,n]); - let corrected_unit_Qmax[g,n] := min(corrected_unit_QP[g,n],corrected_unit_Qp[g,n]); + # cases when Qmin/Qmax are taken between Pmin and Pmax + if (unit_Pc[1,g,n] >= corrected_unit_Pmin[g,n] and unit_Pc[1,g,n] <= corrected_unit_Pmax[g,n] and (corrected_unit_Pmin[g,n] > 0 or corrected_unit_Pmax[g,n] < 0)) then { + let corrected_unit_Qmin[g,n] := corrected_unit_qp[g,n] + (unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) / (corrected_unit_Pmax[g,n] - corrected_unit_Pmin[g,n]) * (corrected_unit_qP[g,n] - corrected_unit_qp[g,n]); + let corrected_unit_Qmax[g,n] := corrected_unit_Qp[g,n] + (unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) / (corrected_unit_Pmax[g,n] - corrected_unit_Pmin[g,n]) * (corrected_unit_QP[g,n] - corrected_unit_Qp[g,n]); + + # cases when Qmin/Qmax are taken between 0 and Pmax + } else if ((unit_Pc[1,g,n] >= corrected_unit_Pmin[g,n] and unit_Pc[1,g,n] <= corrected_unit_Pmax[g,n] and unit_Pc[1,g,n] > 0) + or (unit_Pc[1,g,n] < 0 and unit_Pc[1,g,n] >= corrected_unit_Pmax[g,n])) then { + let corrected_unit_Qmin[g,n] := corrected_unit_q0[g,n] + (unit_Pc[1,g,n] - 0) / (corrected_unit_Pmax[g,n] - 0) * (corrected_unit_qP[g,n] - corrected_unit_q0[g,n]); + let corrected_unit_Qmax[g,n] := corrected_unit_Q0[g,n] + (unit_Pc[1,g,n] - 0) / (corrected_unit_Pmax[g,n] - 0) * (corrected_unit_QP[g,n] - corrected_unit_Q0[g,n]); + + # cases when Qmin/Qmax are taken between 0 and Pmin + } else if ((unit_Pc[1,g,n] >= corrected_unit_Pmin[g,n] and unit_Pc[1,g,n] <= corrected_unit_Pmax[g,n] and unit_Pc[1,g,n] < 0) + or (unit_Pc[1,g,n] > 0 and unit_Pc[1,g,n] <= corrected_unit_Pmin[g,n])) then { + let corrected_unit_Qmin[g,n] := corrected_unit_qp[g,n] + (unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) / (0 - corrected_unit_Pmin[g,n]) * (corrected_unit_q0[g,n] - corrected_unit_qp[g,n]); + let corrected_unit_Qmax[g,n] := corrected_unit_Qp[g,n] + (unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) / (0 - corrected_unit_Pmin[g,n]) * (corrected_unit_Q0[g,n] - corrected_unit_Qp[g,n]); + } else { + # TODO : add case when P_t is not in ramp up/down or in the diagram + # TODO : same when diagram has only 4 points... + let corrected_unit_Qmin[g,n] := min(corrected_unit_qP[g,n],corrected_unit_qp[g,n]); + let corrected_unit_Qmax[g,n] := min(corrected_unit_QP[g,n],corrected_unit_Qp[g,n]); + } if unit_Pc[1,g,n] > corrected_unit_Pmax[g,n] or unit_Pc[1,g,n] < corrected_unit_Pmin[g,n] then printf{LOG_WARNING} "Warning unit %Q Pc=%Q not in bounds [ Pmin=%Q ; Pmax=%Q ]\n", diff --git a/open-reac/src/main/resources/openreac/commons.mod b/open-reac/src/main/resources/openreac/commons.mod index 5280dc3b..ed51c3a5 100644 --- a/open-reac/src/main/resources/openreac/commons.mod +++ b/open-reac/src/main/resources/openreac/commons.mod @@ -228,7 +228,9 @@ param corrected_unit_Pmin{UNITON} default defaultPmin; param corrected_unit_Pmax{UNITON} default defaultPmax; param corrected_unit_qP {UNITON} default defaultQmin; param corrected_unit_qp {UNITON} default defaultQmin; +param corrected_unit_q0 {UNITON} default defaultQmin; param corrected_unit_QP {UNITON} default defaultQmax; param corrected_unit_Qp {UNITON} default defaultQmax; +param corrected_unit_Q0 {UNITON} default defaultQmax; param corrected_unit_Qmin{UNITON} default defaultQmin; param corrected_unit_Qmax{UNITON} default defaultQmax; \ No newline at end of file diff --git a/open-reac/src/main/resources/openreac/iidm_importer.mod b/open-reac/src/main/resources/openreac/iidm_importer.mod index eb902755..c1a4bb59 100644 --- a/open-reac/src/main/resources/openreac/iidm_importer.mod +++ b/open-reac/src/main/resources/openreac/iidm_importer.mod @@ -124,7 +124,7 @@ check {(t,g,n) in UNIT}: t in TIME; check {(t,g,n) in UNIT}: (t,n) in BUS or n==-1; check {(t,g,n) in UNIT}: (t,unit_substation[t,g,n]) in SUBSTATIONS; check {(t,g,n) in UNIT}: (t,unit_vregul_bus[t,g,n]) in BUS or unit_vregul_bus[t,g,n] == -1; -check {(t,g,n) in UNIT}: unit_Pmax[t,g,n] >= -Pnull; +#check {(t,g,n) in UNIT}: unit_Pmax[t,g,n] >= -Pnull; check {(t,g,n) in UNIT}: unit_Pmax[t,g,n] >= unit_Pmin[t,g,n]; # Checks below are useless since values will be corrected for units in UNITON #check {(t,g,n) in UNIT}: unit_Qp[t,g,n] >= unit_qp[t,g,n]; diff --git a/open-reac/src/test/java/com/powsybl/openreac/network/AbstractLoadFlowNetworkFactory.java b/open-reac/src/test/java/com/powsybl/openreac/network/AbstractLoadFlowNetworkFactory.java index 4baf9161..a266874d 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/network/AbstractLoadFlowNetworkFactory.java +++ b/open-reac/src/test/java/com/powsybl/openreac/network/AbstractLoadFlowNetworkFactory.java @@ -62,7 +62,7 @@ protected static Generator createGenerator(Bus b, String id, double p, double v) .setConnectableBus(b.getId()) .setEnergySource(EnergySource.OTHER) .setMinP(0) - .setMaxP(p) + .setMaxP(2) .setTargetP(p) .setTargetV(v) .setVoltageRegulatorOn(true) diff --git a/open-reac/src/test/java/com/powsybl/openreac/network/VoltageControlNetworkFactory.java b/open-reac/src/test/java/com/powsybl/openreac/network/VoltageControlNetworkFactory.java index f93c5337..1c038cc3 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/network/VoltageControlNetworkFactory.java +++ b/open-reac/src/test/java/com/powsybl/openreac/network/VoltageControlNetworkFactory.java @@ -915,15 +915,12 @@ public static Network createWithShuntSharedRemoteControl() { } /** - * SVC test case. - * * g1 ld1 * | | * b1---------b2 - * l1 | - * svc1 + * l1 */ - public static Network createWithStaticVarCompensator() { + public static Network createWithTwoBuses() { Network network = Network.create("svc", "test"); Substation s1 = network.newSubstation() .setId("S1") @@ -964,14 +961,6 @@ public static Network createWithStaticVarCompensator() { .setP0(101) .setQ0(150) .add(); - vl2.newStaticVarCompensator() - .setId("svc1") - .setConnectableBus("b2") - .setBus("b2") - .setRegulationMode(StaticVarCompensator.RegulationMode.OFF) - .setBmin(-0.008) - .setBmax(0.008) - .add(); network.newLine() .setId("l1") .setBus1("b1") @@ -982,6 +971,28 @@ public static Network createWithStaticVarCompensator() { return network; } + /** + * SVC test case. + * + * g1 ld1 + * | | + * b1---------b2 + * l1 | + * svc1 + */ + public static Network createWithStaticVarCompensator() { + Network network = createWithTwoBuses(); + network.getVoltageLevel("vl2").newStaticVarCompensator() + .setId("svc1") + .setConnectableBus("b2") + .setBus("b2") + .setRegulationMode(StaticVarCompensator.RegulationMode.OFF) + .setBmin(-0.008) + .setBmax(0.008) + .add(); + return network; + } + /** * l1 - b1 ================ b2 - g2 * || | diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java index ad57d445..8177ddcc 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java @@ -12,7 +12,6 @@ import com.powsybl.commons.test.ComparisonUtils; import com.powsybl.computation.ComputationManager; import com.powsybl.computation.local.LocalCommandExecutor; -import com.powsybl.computation.local.LocalComputationConfig; import com.powsybl.computation.local.LocalComputationManager; import com.powsybl.iidm.network.*; import com.powsybl.loadflow.LoadFlow; @@ -20,6 +19,7 @@ import com.powsybl.openreac.OpenReacConfig; import com.powsybl.openreac.OpenReacRunner; import com.powsybl.openreac.parameters.input.OpenReacParameters; +import com.powsybl.openreac.parameters.input.algo.OpenReacAmplLogLevel; import com.powsybl.openreac.parameters.output.OpenReacResult; import com.powsybl.openreac.parameters.output.OpenReacStatus; import org.junit.jupiter.api.AfterEach; @@ -32,7 +32,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; -import java.util.concurrent.ForkJoinPool; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -135,11 +134,14 @@ protected OpenReacResult runOpenReac(Network network, String subFolder, OpenReac } LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor(outputFileNames); // To really run open reac, use the commentede line below. Be sure that open-reac/src/test/resources/com/powsybl/config/test/config.yml contains your ampl path -// try (ComputationManager computationManager = new LocalComputationManager()) { - try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), - localCommandExecutor, ForkJoinPool.commonPool())) { - return OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, + try (ComputationManager computationManager = new LocalComputationManager()) { +// try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), +// localCommandExecutor, ForkJoinPool.commonPool())) { + parameters.setLogLevelAmpl(OpenReacAmplLogLevel.DEBUG); + OpenReacResult result = OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, new OpenReacConfig(true), computationManager, reportNode, null); + System.out.println(result.getIndicators().get("directory")); + return result; } } diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java index 33c27b80..ceb3619a 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java @@ -7,9 +7,12 @@ */ package com.powsybl.openreac.optimization; -import com.powsybl.iidm.network.Network; +import com.powsybl.iidm.network.*; +import com.powsybl.loadflow.LoadFlow; +import com.powsybl.loadflow.LoadFlowResult; import com.powsybl.openreac.network.VoltageControlNetworkFactory; import com.powsybl.openreac.parameters.input.OpenReacParameters; +import com.powsybl.openreac.parameters.input.algo.ReactiveSlackBusesMode; import com.powsybl.openreac.parameters.output.OpenReacResult; import com.powsybl.openreac.parameters.output.OpenReacStatus; import org.junit.jupiter.api.Test; @@ -67,61 +70,171 @@ void testGeneratorsMinPBounds() throws IOException { assertEquals(OpenReacStatus.OK, result.getStatus()); } +// @Test +// void testGeneratorQmaxPmaxRatioBounds() throws IOException { +// Network network = VoltageControlNetworkFactory.createWithTwoVoltageControls(); +// network.getLine("l45").disconnect(); +// network.getLoad("l4").setP0(4).setQ0(2); +// +// OpenReacParameters parameters = new OpenReacParameters(); +// OpenReacResult result = runOpenReac(network, "optimization/bounds/qmax-pmax-default-ratio", parameters, true); +// assertEquals(OpenReacStatus.OK, result.getStatus()); +// // there are slacks as Q bounds are not large enough +// assertTrue(Integer.parseInt(result.getIndicators().get("nb_reactive_slacks")) > 0); +// +// parameters.setDefaultQmaxPmaxRatio(1); +// result = runOpenReac(network, "optimization/bounds/same-qmax-pmax", parameters, true); +// assertEquals(OpenReacStatus.OK, result.getStatus()); +// // Q bounds are large enough to remove reactive slacks in optimization +// assertEquals(0, Integer.parseInt(result.getIndicators().get("nb_reactive_slacks"))); +// } + @Test - void testGeneratorRectangularQBounds() throws IOException { - Network network = VoltageControlNetworkFactory.createWithTwoVoltageControls(); - network.getLine("l45").disconnect(); - network.getLoad("l4").setP0(4).setQ0(2); + void testGeneratorQBoundsTargetPInsidePminPmax() throws IOException { + Network network = createWithTwoBuses(101, 50, 150, 0, -100, 100, 150, -200, 200, 150); + assertConvergence(network); + network = createWithTwoBuses(101, 50, 150, 0, -100, 100, 150, -150, 150, 150); + assertDivergence(network); + } - // set reactive limits to both generators - network.getGenerator("g2").newReactiveCapabilityCurve() - .beginPoint() - .setP(0) - .setMinQ(-0.25) - .setMaxQ(0.25) - .endPoint() - .beginPoint() - .setP(2) - .setMinQ(-2) - .setMaxQ(2) - .endPoint() - .add(); - network.getGenerator("g3").newReactiveCapabilityCurve() - .beginPoint() - .setP(0) - .setMinQ(-0.25) - .setMaxQ(0.25) - .endPoint() - .beginPoint() - .setP(2) - .setMinQ(-2) - .setMaxQ(2) - .endPoint() - .add(); + @Test + void testGeneratorQBoundsTargetPInsidePminPmax2() throws IOException { + Network network = createWithTwoBuses(-10, -20, -5, -20, -30, 30, -5, -5, 5, -10); + assertConvergence(network); + network = createWithTwoBuses(-10, -20, -5, -20, -18, 18, -5, -5, 5, -10); + assertDivergence(network); + } - OpenReacResult result = runOpenReac(network, "optimization/bounds/generator-rectangular-bounds", true); - assertEquals(OpenReacStatus.OK, result.getStatus()); - // rectangular bounds in ACOPF implies Q bounds are not large enough to remove reactive slacks in optimization - assertTrue(Integer.parseInt(result.getIndicators().get("nb_reactive_slacks")) > 0); + @Test + void testGeneratorQBoundsTargetPInside0Pmax() throws IOException { + Network network = createWithTwoBuses(101, -50, 150, 0, -0, 0, 150, -300, 300, 150); + assertConvergence(network); + network = createWithTwoBuses(101, -50, 150, 0, -0, 0, 150, -100, 100, 150); + assertDivergence(network); } @Test - void testGeneratorQmaxPmaxRatioBounds() throws IOException { - Network network = VoltageControlNetworkFactory.createWithTwoVoltageControls(); - network.getLine("l45").disconnect(); - network.getLoad("l4").setP0(4).setQ0(2); + void testGeneratorQBoundsTargetPInside0Pmax2() throws IOException { + Network network = createWithTwoBuses(-4, -20, -5, -5, -5, 5, 0, -1, 1, -4); + assertConvergence(network); + network = createWithTwoBuses(-4, -20, -5, -5, -4.25, 4.25, 0, -1, 1, -4); + assertDivergence(network); + } + + @Test + void testGeneratorQBoundsTargetPInside0Pmin() throws IOException { + Network network = createWithTwoBuses(101, 150, 200, + 0, -0, 0, + 150, -150, 150, 100); + assertConvergence(network); + network = createWithTwoBuses(101, 150, 200, + 0, -0, 0, + 150, -140, 140, 100); + assertDivergence(network); + } + @Test + void testGeneratorQBoundsTargetPInside0Pmin2() throws IOException { + Network network = createWithTwoBuses(-5.1, -10, 10, + 0, -0, 0, + -10, -4, 4, + -2); + assertConvergence(network); + network = createWithTwoBuses(-5.1, -10, 10, + 0, -0, 0, + -10, -3.8, 3.8, + -2); + assertDivergence(network); + } + + void assertConvergence(Network network) throws IOException { OpenReacParameters parameters = new OpenReacParameters(); - OpenReacResult result = runOpenReac(network, "optimization/bounds/qmax-pmax-default-ratio", parameters, true); + parameters.setMinPlausibleLowVoltageLimit(0.4); + parameters.setMaxPlausibleHighVoltageLimit(1.6); + parameters.setReactiveSlackBusesMode(ReactiveSlackBusesMode.CONFIGURED); + OpenReacResult result = runOpenReac(network, "", parameters, false); assertEquals(OpenReacStatus.OK, result.getStatus()); - // there are slacks as Q bounds are not large enough - assertTrue(Integer.parseInt(result.getIndicators().get("nb_reactive_slacks")) > 0); + LoadFlowResult loadFlowResult = LoadFlow.run(network); + assertTrue(loadFlowResult.isFullyConverged()); + } - parameters.setDefaultQmaxPmaxRatio(1); - result = runOpenReac(network, "optimization/bounds/same-qmax-pmax", parameters, true); - assertEquals(OpenReacStatus.OK, result.getStatus()); - // Q bounds are large enough to remove reactive slacks in optimization - assertEquals(0, Integer.parseInt(result.getIndicators().get("nb_reactive_slacks"))); + void assertDivergence(Network network) throws IOException { + OpenReacParameters parameters = new OpenReacParameters(); + parameters.setReactiveSlackBusesMode(ReactiveSlackBusesMode.CONFIGURED); + OpenReacResult result = runOpenReac(network, "", parameters, false); + assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); + } + + /** + * g1 ld1 + * | | + * b1---------b2 + * l1 + */ + public static Network createWithTwoBuses(double g1TargetP, double g1PMin, double g1PMax, + double pValue1, double g1QMin1, double g1QMax1, + double pValue2, double g1QMin2, double g1QMax2, + double ld1TargetQ) { + Network network = Network.create("q-bounds", "test"); + Substation s1 = network.newSubstation() + .setId("S1") + .add(); + Substation s2 = network.newSubstation() + .setId("S2") + .add(); + VoltageLevel vl1 = s1.newVoltageLevel() + .setId("vl1") + .setNominalV(400) + .setTopologyKind(TopologyKind.BUS_BREAKER) + .add(); + vl1.getBusBreakerView().newBus() + .setId("b1") + .add(); + vl1.newGenerator() + .setId("g1") + .setConnectableBus("b1") + .setBus("b1") + .setTargetP(g1TargetP) + .setTargetV(390) + .setMinP(g1PMin) + .setMaxP(g1PMax) + .setVoltageRegulatorOn(true) + .add(); + network.getGenerator("g1").newReactiveCapabilityCurve() + .beginPoint() + .setP(pValue1) + .setMinQ(g1QMin1) + .setMaxQ(g1QMax1) + .endPoint() + .beginPoint() + .setP(pValue2) + .setMinQ(g1QMin2) + .setMaxQ(g1QMax2) + .endPoint() + .add(); + VoltageLevel vl2 = s2.newVoltageLevel() + .setId("vl2") + .setNominalV(400) + .setTopologyKind(TopologyKind.BUS_BREAKER) + .add(); + vl2.getBusBreakerView().newBus() + .setId("b2") + .add(); + vl2.newLoad() + .setId("ld1") + .setConnectableBus("b2") + .setBus("b2") + .setP0(g1TargetP) + .setQ0(ld1TargetQ) + .add(); + network.newLine() + .setId("l1") + .setBus1("b1") + .setBus2("b2") + .setR(0.1) + .setX(3) + .add(); + return network; } } diff --git a/open-reac/src/test/resources/com/powsybl/config/test/config.yml b/open-reac/src/test/resources/com/powsybl/config/test/config.yml index 1acd4f0d..9d797384 100644 --- a/open-reac/src/test/resources/com/powsybl/config/test/config.yml +++ b/open-reac/src/test/resources/com/powsybl/config/test/config.yml @@ -1,2 +1,2 @@ ampl: - homeDir: ??? + homeDir: D:\AMPL-13.1.20220703-Win-64 From 4d14b8b09c03a817fce9e1137ceb0588e789e9ab Mon Sep 17 00:00:00 2001 From: p-arvy Date: Fri, 20 Dec 2024 17:47:28 +0100 Subject: [PATCH 38/63] wip Signed-off-by: p-arvy --- .../openreac/acopf_preprocessing.run | 110 +++++++++++------- .../src/main/resources/openreac/commons.mod | 4 +- .../AbstractLoadFlowNetworkFactory.java | 2 +- .../network/VoltageControlNetworkFactory.java | 37 +++--- 4 files changed, 84 insertions(+), 69 deletions(-) diff --git a/open-reac/src/main/resources/openreac/acopf_preprocessing.run b/open-reac/src/main/resources/openreac/acopf_preprocessing.run index 1ddc6dc8..9e42298e 100644 --- a/open-reac/src/main/resources/openreac/acopf_preprocessing.run +++ b/open-reac/src/main/resources/openreac/acopf_preprocessing.run @@ -174,44 +174,49 @@ for {(g,n) in UNITON} { let corrected_unit_Pmax[g,n] := unit_Pc[1,g,n]; } + # correct qp value of generator if needed if abs(unit_qp[1,g,n]) >= PQmax then { - let corrected_unit_qp[g,n] := -defaultQmaxPmaxRatio * corrected_unit_Pmax[g,n]; - printf{LOG_DEBUG} "%Q for %Q is %Q -> corrected to %Q\n","unit_qp",unit_id[1,g,n],unit_qp[1,g,n],corrected_unit_qp[g,n]; - } - else let corrected_unit_qp[g,n] := unit_qp[1,g,n]; - - # TODO : update print - if abs(unit_qp0[1,g,n]) >= PQmax then { - let corrected_unit_q0[g,n] := -defaultQmaxPmaxRatio * corrected_unit_Pmax[g,n]; - printf{LOG_DEBUG} "%Q for %Q is %Q -> corrected to %Q\n","unit_qp",unit_id[1,g,n],unit_qp[1,g,n],corrected_unit_qp[g,n]; - } - else let corrected_unit_q0[g,n] := unit_qp0[1,g,n]; + let corrected_unit_qp[g,n] := -defaultQmaxPmaxRatio * corrected_unit_Pmax[g,n]; + printf{LOG_DEBUG} "%Q for %Q is %Q -> corrected to %Q\n","unit_qp",unit_id[1,g,n],unit_qp[1,g,n],corrected_unit_qp[g,n]; + } + else let corrected_unit_qp[g,n] := unit_qp[1,g,n]; + # correct qP value of generator if needed if abs(unit_qP[1,g,n]) >= PQmax then { let corrected_unit_qP[g,n] := -defaultQmaxPmaxRatio * corrected_unit_Pmax[g,n]; printf{LOG_DEBUG} "%Q for %Q is %Q -> corrected to %Q\n","unit_qP",unit_id[1,g,n],unit_qP[1,g,n],corrected_unit_qP[g,n]; } else let corrected_unit_qP[g,n] := unit_qP[1,g,n]; - if abs(unit_Qp[1,g,n]) >= PQmax then { - let corrected_unit_Qp[g,n] := defaultQmaxPmaxRatio * corrected_unit_Pmax[g,n]; - printf{LOG_DEBUG} "%Q for %Q is %Q -> corrected to %Q\n","unit_Qp",unit_id[1,g,n],unit_Qp[1,g,n],corrected_unit_Qp[g,n]; - } - else let corrected_unit_Qp[g,n] := unit_Qp[1,g,n]; + # correct qp0 value of generator if needed + if abs(unit_qp0[1,g,n]) >= PQmax then { + let corrected_unit_qp0[g,n] := -defaultQmaxPmaxRatio * corrected_unit_Pmax[g,n]; + printf{LOG_DEBUG} "%Q for %Q is %Q -> corrected to %Q\n","unit_qp",unit_id[1,g,n],unit_qp0[1,g,n],corrected_unit_qp0[g,n]; + } + else let corrected_unit_qp0[g,n] := unit_qp0[1,g,n]; - # TODO : update print - if abs(unit_Qp0[1,g,n]) >= PQmax then { - let corrected_unit_Q0[g,n] := defaultQmaxPmaxRatio * corrected_unit_Pmax[g,n]; - printf{LOG_DEBUG} "%Q for %Q is %Q -> corrected to %Q\n","unit_Qp",unit_id[1,g,n],unit_Qp[1,g,n],corrected_unit_Qp[g,n]; - } - else let corrected_unit_Q0[g,n] := unit_Qp0[1,g,n]; + # correct Qp value of generator if needed + if abs(unit_Qp[1,g,n]) >= PQmax then { + let corrected_unit_Qp[g,n] := defaultQmaxPmaxRatio * corrected_unit_Pmax[g,n]; + printf{LOG_DEBUG} "%Q for %Q is %Q -> corrected to %Q\n","unit_Qp",unit_id[1,g,n],unit_Qp[1,g,n],corrected_unit_Qp[g,n]; + } + else let corrected_unit_Qp[g,n] := unit_Qp[1,g,n]; + # correct QP value of generator if needed if abs(unit_QP[1,g,n]) >= PQmax then { let corrected_unit_QP[g,n] := defaultQmaxPmaxRatio * corrected_unit_Pmax[g,n]; printf{LOG_DEBUG} "%Q for %Q is %Q -> corrected to %Q\n","unit_QP",unit_id[1,g,n],unit_QP[1,g,n],corrected_unit_QP[g,n]; } else let corrected_unit_QP[g,n] := unit_QP[1,g,n]; + # correct Qp0 value of generator if needed + if abs(unit_Qp0[1,g,n]) >= PQmax then { + let corrected_unit_Qp0[g,n] := defaultQmaxPmaxRatio * corrected_unit_Pmax[g,n]; + printf{LOG_DEBUG} "%Q for %Q is %Q -> corrected to %Q\n","unit_Qp",unit_id[1,g,n],unit_Qp0[1,g,n],corrected_unit_Qp0[g,n]; + } + else let corrected_unit_Qp0[g,n] := unit_Qp0[1,g,n]; + + # invert qp and Qp values if needed if corrected_unit_qp[g,n] > corrected_unit_Qp[g,n] then { printf{LOG_WARNING} "Warning unit %Q : unit_qp > unit_Qp -> we invert them",unit_id[1,g,n]; let tempo := corrected_unit_qp[g,n]; @@ -219,19 +224,21 @@ for {(g,n) in UNITON} { let corrected_unit_Qp[g,n] := tempo; } + # invert qP and QP values if needed if corrected_unit_qP[g,n] > corrected_unit_QP[g,n] then { - printf{LOG_WARNING} "Warning unit %Q : unit_qP > unit_QP -> we invert them",unit_id[1,g,n]; - let tempo := corrected_unit_qP[g,n]; - let corrected_unit_qP[g,n] := corrected_unit_QP[g,n]; - let corrected_unit_QP[g,n] := tempo; - } + printf{LOG_WARNING} "Warning unit %Q : unit_qP > unit_QP -> we invert them",unit_id[1,g,n]; + let tempo := corrected_unit_qP[g,n]; + let corrected_unit_qP[g,n] := corrected_unit_QP[g,n]; + let corrected_unit_QP[g,n] := tempo; + } - if corrected_unit_q0[g,n] > corrected_unit_Q0[g,n] then { - printf{LOG_WARNING} "Warning unit %Q : unit_qP > unit_QP -> we invert them",unit_id[1,g,n]; - let tempo := corrected_unit_q0[g,n]; - let corrected_unit_q0[g,n] := corrected_unit_Q0[g,n]; - let corrected_unit_Q0[g,n] := tempo; - } + # invert qp0 and Qp0 value if needed + if corrected_unit_qp0[g,n] > corrected_unit_Qp0[g,n] then { + printf{LOG_WARNING} "Warning unit %Q : unit_qp0 > unit_Qp0 -> we invert them",unit_id[1,g,n]; + let tempo := corrected_unit_qp0[g,n]; + let corrected_unit_qp0[g,n] := corrected_unit_Qp0[g,n]; + let corrected_unit_Qp0[g,n] := tempo; + } # TODO : add corner cases here if abs(corrected_unit_qP[g,n]-corrected_unit_QP[g,n]) <= minimalQPrange @@ -247,22 +254,41 @@ for {(g,n) in UNITON} { let corrected_unit_Qp[g,n] := tempo; } - # cases when Qmin/Qmax are taken between Pmin and Pmax + # cases when Qmin/Qmax are interpolated between Pmin and Pmax if (unit_Pc[1,g,n] >= corrected_unit_Pmin[g,n] and unit_Pc[1,g,n] <= corrected_unit_Pmax[g,n] and (corrected_unit_Pmin[g,n] > 0 or corrected_unit_Pmax[g,n] < 0)) then { - let corrected_unit_Qmin[g,n] := corrected_unit_qp[g,n] + (unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) / (corrected_unit_Pmax[g,n] - corrected_unit_Pmin[g,n]) * (corrected_unit_qP[g,n] - corrected_unit_qp[g,n]); - let corrected_unit_Qmax[g,n] := corrected_unit_Qp[g,n] + (unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) / (corrected_unit_Pmax[g,n] - corrected_unit_Pmin[g,n]) * (corrected_unit_QP[g,n] - corrected_unit_Qp[g,n]); + # if Pmin/Pmax are too close, compute Qmin/Qmax as the mean of diagram values + if (abs((corrected_unit_Pmax[g,n] - corrected_unit_Pmin[g,n])) < 1e-4) then { + let corrected_unit_Qmin[g,n] := (corrected_unit_qp[g,n] + corrected_unit_qP[g,n]) / 2; + let corrected_unit_Qmax[g,n] := (corrected_unit_Qp[g,n] + corrected_unit_QP[g,n]) / 2; + } else { + let corrected_unit_Qmin[g,n] := corrected_unit_qp[g,n] + (unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) / (corrected_unit_Pmax[g,n] - corrected_unit_Pmin[g,n]) * (corrected_unit_qP[g,n] - corrected_unit_qp[g,n]); + let corrected_unit_Qmax[g,n] := corrected_unit_Qp[g,n] + (unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) / (corrected_unit_Pmax[g,n] - corrected_unit_Pmin[g,n]) * (corrected_unit_QP[g,n] - corrected_unit_Qp[g,n]); + } - # cases when Qmin/Qmax are taken between 0 and Pmax + # cases when Qmin/Qmax are interpolated between 0 and Pmax } else if ((unit_Pc[1,g,n] >= corrected_unit_Pmin[g,n] and unit_Pc[1,g,n] <= corrected_unit_Pmax[g,n] and unit_Pc[1,g,n] > 0) or (unit_Pc[1,g,n] < 0 and unit_Pc[1,g,n] >= corrected_unit_Pmax[g,n])) then { - let corrected_unit_Qmin[g,n] := corrected_unit_q0[g,n] + (unit_Pc[1,g,n] - 0) / (corrected_unit_Pmax[g,n] - 0) * (corrected_unit_qP[g,n] - corrected_unit_q0[g,n]); - let corrected_unit_Qmax[g,n] := corrected_unit_Q0[g,n] + (unit_Pc[1,g,n] - 0) / (corrected_unit_Pmax[g,n] - 0) * (corrected_unit_QP[g,n] - corrected_unit_Q0[g,n]); + # if 0/Pmax are too close, compute Qmin/Qmax as the mean of diagram values + if (abs(corrected_unit_Pmax[g,n]) < 1e-4) then { + let corrected_unit_Qmin[g,n] := (corrected_unit_qp0[g,n] + corrected_unit_qP[g,n]) / 2; + let corrected_unit_Qmax[g,n] := (corrected_unit_Qp0[g,n] + corrected_unit_QP[g,n]) / 2; + } else { + let corrected_unit_Qmin[g,n] := corrected_unit_q0[g,n] + (unit_Pc[1,g,n] - 0) / (corrected_unit_Pmax[g,n] - 0) * (corrected_unit_qP[g,n] - corrected_unit_q0[g,n]); + let corrected_unit_Qmax[g,n] := corrected_unit_Q0[g,n] + (unit_Pc[1,g,n] - 0) / (corrected_unit_Pmax[g,n] - 0) * (corrected_unit_QP[g,n] - corrected_unit_Q0[g,n]); + } - # cases when Qmin/Qmax are taken between 0 and Pmin + # cases when Qmin/Qmax are interpolated between 0 and Pmin } else if ((unit_Pc[1,g,n] >= corrected_unit_Pmin[g,n] and unit_Pc[1,g,n] <= corrected_unit_Pmax[g,n] and unit_Pc[1,g,n] < 0) or (unit_Pc[1,g,n] > 0 and unit_Pc[1,g,n] <= corrected_unit_Pmin[g,n])) then { - let corrected_unit_Qmin[g,n] := corrected_unit_qp[g,n] + (unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) / (0 - corrected_unit_Pmin[g,n]) * (corrected_unit_q0[g,n] - corrected_unit_qp[g,n]); - let corrected_unit_Qmax[g,n] := corrected_unit_Qp[g,n] + (unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) / (0 - corrected_unit_Pmin[g,n]) * (corrected_unit_Q0[g,n] - corrected_unit_Qp[g,n]); + # if Pmin/0 are too close, compute Qmin/Qmax as the mean of diagram values + if (abs(corrected_unit_Pmin[g,n]) < 1e-4) then { + let corrected_unit_Qmin[g,n] := (corrected_unit_qp0[g,n] + corrected_unit_qp[g,n]) / 2; + let corrected_unit_Qmax[g,n] := (corrected_unit_Qp0[g,n] + corrected_unit_Qp[g,n]) / 2; + } else { + let corrected_unit_Qmin[g,n] := corrected_unit_qp[g,n] + (unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) / (0 - corrected_unit_Pmin[g,n]) * (corrected_unit_q0[g,n] - corrected_unit_qp[g,n]); + let corrected_unit_Qmax[g,n] := corrected_unit_Qp[g,n] + (unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) / (0 - corrected_unit_Pmin[g,n]) * (corrected_unit_Q0[g,n] - corrected_unit_Qp[g,n]); + } + } else { # TODO : add case when P_t is not in ramp up/down or in the diagram # TODO : same when diagram has only 4 points... diff --git a/open-reac/src/main/resources/openreac/commons.mod b/open-reac/src/main/resources/openreac/commons.mod index ed51c3a5..85b3500a 100644 --- a/open-reac/src/main/resources/openreac/commons.mod +++ b/open-reac/src/main/resources/openreac/commons.mod @@ -228,9 +228,9 @@ param corrected_unit_Pmin{UNITON} default defaultPmin; param corrected_unit_Pmax{UNITON} default defaultPmax; param corrected_unit_qP {UNITON} default defaultQmin; param corrected_unit_qp {UNITON} default defaultQmin; -param corrected_unit_q0 {UNITON} default defaultQmin; +param corrected_unit_qp0 {UNITON} default defaultQmin; param corrected_unit_QP {UNITON} default defaultQmax; param corrected_unit_Qp {UNITON} default defaultQmax; -param corrected_unit_Q0 {UNITON} default defaultQmax; +param corrected_unit_Qp0 {UNITON} default defaultQmax; param corrected_unit_Qmin{UNITON} default defaultQmin; param corrected_unit_Qmax{UNITON} default defaultQmax; \ No newline at end of file diff --git a/open-reac/src/test/java/com/powsybl/openreac/network/AbstractLoadFlowNetworkFactory.java b/open-reac/src/test/java/com/powsybl/openreac/network/AbstractLoadFlowNetworkFactory.java index a266874d..4baf9161 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/network/AbstractLoadFlowNetworkFactory.java +++ b/open-reac/src/test/java/com/powsybl/openreac/network/AbstractLoadFlowNetworkFactory.java @@ -62,7 +62,7 @@ protected static Generator createGenerator(Bus b, String id, double p, double v) .setConnectableBus(b.getId()) .setEnergySource(EnergySource.OTHER) .setMinP(0) - .setMaxP(2) + .setMaxP(p) .setTargetP(p) .setTargetV(v) .setVoltageRegulatorOn(true) diff --git a/open-reac/src/test/java/com/powsybl/openreac/network/VoltageControlNetworkFactory.java b/open-reac/src/test/java/com/powsybl/openreac/network/VoltageControlNetworkFactory.java index 1c038cc3..f93c5337 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/network/VoltageControlNetworkFactory.java +++ b/open-reac/src/test/java/com/powsybl/openreac/network/VoltageControlNetworkFactory.java @@ -915,12 +915,15 @@ public static Network createWithShuntSharedRemoteControl() { } /** + * SVC test case. + * * g1 ld1 * | | * b1---------b2 - * l1 + * l1 | + * svc1 */ - public static Network createWithTwoBuses() { + public static Network createWithStaticVarCompensator() { Network network = Network.create("svc", "test"); Substation s1 = network.newSubstation() .setId("S1") @@ -961,28 +964,7 @@ public static Network createWithTwoBuses() { .setP0(101) .setQ0(150) .add(); - network.newLine() - .setId("l1") - .setBus1("b1") - .setBus2("b2") - .setR(1) - .setX(3) - .add(); - return network; - } - - /** - * SVC test case. - * - * g1 ld1 - * | | - * b1---------b2 - * l1 | - * svc1 - */ - public static Network createWithStaticVarCompensator() { - Network network = createWithTwoBuses(); - network.getVoltageLevel("vl2").newStaticVarCompensator() + vl2.newStaticVarCompensator() .setId("svc1") .setConnectableBus("b2") .setBus("b2") @@ -990,6 +972,13 @@ public static Network createWithStaticVarCompensator() { .setBmin(-0.008) .setBmax(0.008) .add(); + network.newLine() + .setId("l1") + .setBus1("b1") + .setBus2("b2") + .setR(1) + .setX(3) + .add(); return network; } From f4c4212ec5f44340dc0ec65f0760081cff37efc9 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Mon, 30 Dec 2024 15:37:41 +0100 Subject: [PATCH 39/63] wip Signed-off-by: p-arvy --- .../openreac/acopf_preprocessing.run | 25 ++-- .../OpecReacOptimizationBoundsTest.java | 111 ++++++++++++------ 2 files changed, 90 insertions(+), 46 deletions(-) diff --git a/open-reac/src/main/resources/openreac/acopf_preprocessing.run b/open-reac/src/main/resources/openreac/acopf_preprocessing.run index 9e42298e..a51f0ec8 100644 --- a/open-reac/src/main/resources/openreac/acopf_preprocessing.run +++ b/open-reac/src/main/resources/openreac/acopf_preprocessing.run @@ -191,7 +191,7 @@ for {(g,n) in UNITON} { # correct qp0 value of generator if needed if abs(unit_qp0[1,g,n]) >= PQmax then { let corrected_unit_qp0[g,n] := -defaultQmaxPmaxRatio * corrected_unit_Pmax[g,n]; - printf{LOG_DEBUG} "%Q for %Q is %Q -> corrected to %Q\n","unit_qp",unit_id[1,g,n],unit_qp0[1,g,n],corrected_unit_qp0[g,n]; + printf{LOG_DEBUG} "%Q for %Q is %Q -> corrected to %Q\n","unit_qp0",unit_id[1,g,n],unit_qp0[1,g,n],corrected_unit_qp0[g,n]; } else let corrected_unit_qp0[g,n] := unit_qp0[1,g,n]; @@ -212,7 +212,7 @@ for {(g,n) in UNITON} { # correct Qp0 value of generator if needed if abs(unit_Qp0[1,g,n]) >= PQmax then { let corrected_unit_Qp0[g,n] := defaultQmaxPmaxRatio * corrected_unit_Pmax[g,n]; - printf{LOG_DEBUG} "%Q for %Q is %Q -> corrected to %Q\n","unit_Qp",unit_id[1,g,n],unit_Qp0[1,g,n],corrected_unit_Qp0[g,n]; + printf{LOG_DEBUG} "%Q for %Q is %Q -> corrected to %Q\n","unit_Qp0",unit_id[1,g,n],unit_Qp0[1,g,n],corrected_unit_Qp0[g,n]; } else let corrected_unit_Qp0[g,n] := unit_Qp0[1,g,n]; @@ -273,8 +273,8 @@ for {(g,n) in UNITON} { let corrected_unit_Qmin[g,n] := (corrected_unit_qp0[g,n] + corrected_unit_qP[g,n]) / 2; let corrected_unit_Qmax[g,n] := (corrected_unit_Qp0[g,n] + corrected_unit_QP[g,n]) / 2; } else { - let corrected_unit_Qmin[g,n] := corrected_unit_q0[g,n] + (unit_Pc[1,g,n] - 0) / (corrected_unit_Pmax[g,n] - 0) * (corrected_unit_qP[g,n] - corrected_unit_q0[g,n]); - let corrected_unit_Qmax[g,n] := corrected_unit_Q0[g,n] + (unit_Pc[1,g,n] - 0) / (corrected_unit_Pmax[g,n] - 0) * (corrected_unit_QP[g,n] - corrected_unit_Q0[g,n]); + let corrected_unit_Qmin[g,n] := corrected_unit_qp0[g,n] + (unit_Pc[1,g,n] - 0) / (corrected_unit_Pmax[g,n] - 0) * (corrected_unit_qP[g,n] - corrected_unit_qp0[g,n]); + let corrected_unit_Qmax[g,n] := corrected_unit_Qp0[g,n] + (unit_Pc[1,g,n] - 0) / (corrected_unit_Pmax[g,n] - 0) * (corrected_unit_QP[g,n] - corrected_unit_Qp0[g,n]); } # cases when Qmin/Qmax are interpolated between 0 and Pmin @@ -285,13 +285,22 @@ for {(g,n) in UNITON} { let corrected_unit_Qmin[g,n] := (corrected_unit_qp0[g,n] + corrected_unit_qp[g,n]) / 2; let corrected_unit_Qmax[g,n] := (corrected_unit_Qp0[g,n] + corrected_unit_Qp[g,n]) / 2; } else { - let corrected_unit_Qmin[g,n] := corrected_unit_qp[g,n] + (unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) / (0 - corrected_unit_Pmin[g,n]) * (corrected_unit_q0[g,n] - corrected_unit_qp[g,n]); - let corrected_unit_Qmax[g,n] := corrected_unit_Qp[g,n] + (unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) / (0 - corrected_unit_Pmin[g,n]) * (corrected_unit_Q0[g,n] - corrected_unit_Qp[g,n]); + let corrected_unit_Qmin[g,n] := corrected_unit_qp[g,n] + (unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) / (0 - corrected_unit_Pmin[g,n]) * (corrected_unit_qp0[g,n] - corrected_unit_qp[g,n]); + let corrected_unit_Qmax[g,n] := corrected_unit_Qp[g,n] + (unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) / (0 - corrected_unit_Pmin[g,n]) * (corrected_unit_Qp0[g,n] - corrected_unit_Qp[g,n]); } + # cases when Qmin/Qmax are equals to qP/QP + } else if (unit_Pc[1,g,n] > corrected_unit_Pmax[g,n] and corrected_unit_Pmax[g,n] > 0) then { + let corrected_unit_Qmin[g,n] := corrected_unit_qP[g,n]; + let corrected_unit_Qmax[g,n] := corrected_unit_QP[g,n]; + + # cases when Qmin/Qmax are equals to qp/Qp + } else if (unit_Pc[1,g,n] < corrected_unit_Pmin[g,n] and corrected_unit_Pmin[g,n] < 0) then { + let corrected_unit_Qmin[g,n] := corrected_unit_qp[g,n]; + let corrected_unit_Qmax[g,n] := corrected_unit_Qp[g,n]; + + # default case } else { - # TODO : add case when P_t is not in ramp up/down or in the diagram - # TODO : same when diagram has only 4 points... let corrected_unit_Qmin[g,n] := min(corrected_unit_qP[g,n],corrected_unit_qp[g,n]); let corrected_unit_Qmax[g,n] := min(corrected_unit_QP[g,n],corrected_unit_Qp[g,n]); } diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java index ceb3619a..4c0b1201 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java @@ -23,6 +23,9 @@ /** * Test the generator bounds in OpenReac optimization. + * Note that depending on the solver, the results may vary. Only the feasibility is tested, + * meaning that it verifies whether the generator bounds allow for finding + * a feasible solution or not. * * @author Pierre ARVY {@literal } */ @@ -70,59 +73,58 @@ void testGeneratorsMinPBounds() throws IOException { assertEquals(OpenReacStatus.OK, result.getStatus()); } -// @Test -// void testGeneratorQmaxPmaxRatioBounds() throws IOException { -// Network network = VoltageControlNetworkFactory.createWithTwoVoltageControls(); -// network.getLine("l45").disconnect(); -// network.getLoad("l4").setP0(4).setQ0(2); -// -// OpenReacParameters parameters = new OpenReacParameters(); -// OpenReacResult result = runOpenReac(network, "optimization/bounds/qmax-pmax-default-ratio", parameters, true); -// assertEquals(OpenReacStatus.OK, result.getStatus()); -// // there are slacks as Q bounds are not large enough -// assertTrue(Integer.parseInt(result.getIndicators().get("nb_reactive_slacks")) > 0); -// -// parameters.setDefaultQmaxPmaxRatio(1); -// result = runOpenReac(network, "optimization/bounds/same-qmax-pmax", parameters, true); -// assertEquals(OpenReacStatus.OK, result.getStatus()); -// // Q bounds are large enough to remove reactive slacks in optimization -// assertEquals(0, Integer.parseInt(result.getIndicators().get("nb_reactive_slacks"))); -// } + @Test + void testGeneratorQmaxPmaxRatioBounds() throws IOException { + Network network = VoltageControlNetworkFactory.createWithTwoVoltageControls(); + network.getLine("l45").disconnect(); + network.getLoad("l4").setP0(4).setQ0(2); + + OpenReacParameters parameters = new OpenReacParameters(); + OpenReacResult result = runOpenReac(network, "optimization/bounds/qmax-pmax-default-ratio", parameters, true); + assertEquals(OpenReacStatus.OK, result.getStatus()); + // there are slacks as Q bounds are not large enough + assertTrue(Integer.parseInt(result.getIndicators().get("nb_reactive_slacks")) > 0); + + parameters.setDefaultQmaxPmaxRatio(1); + result = runOpenReac(network, "optimization/bounds/same-qmax-pmax", parameters, true); + assertEquals(OpenReacStatus.OK, result.getStatus()); + // Q bounds are large enough to remove reactive slacks in optimization + assertEquals(0, Integer.parseInt(result.getIndicators().get("nb_reactive_slacks"))); + } @Test - void testGeneratorQBoundsTargetPInsidePminPmax() throws IOException { + void testGeneratorQBoundsInterpolatedBetweenMinPMaxP() throws IOException { + // 0 < minP < targetP < maxP Network network = createWithTwoBuses(101, 50, 150, 0, -100, 100, 150, -200, 200, 150); assertConvergence(network); network = createWithTwoBuses(101, 50, 150, 0, -100, 100, 150, -150, 150, 150); assertDivergence(network); - } - @Test - void testGeneratorQBoundsTargetPInsidePminPmax2() throws IOException { - Network network = createWithTwoBuses(-10, -20, -5, -20, -30, 30, -5, -5, 5, -10); + // minP < targetP < maxP < 0 + network = createWithTwoBuses(-10, -20, -5, -20, -30, 30, -5, -5, 5, -10); assertConvergence(network); network = createWithTwoBuses(-10, -20, -5, -20, -18, 18, -5, -5, 5, -10); assertDivergence(network); } @Test - void testGeneratorQBoundsTargetPInside0Pmax() throws IOException { + void testGeneratorQBoundsInterpolatedBetweenP0MaxP() throws IOException { + // minP < 0 < targetP < maxP Network network = createWithTwoBuses(101, -50, 150, 0, -0, 0, 150, -300, 300, 150); assertConvergence(network); network = createWithTwoBuses(101, -50, 150, 0, -0, 0, 150, -100, 100, 150); assertDivergence(network); - } - @Test - void testGeneratorQBoundsTargetPInside0Pmax2() throws IOException { - Network network = createWithTwoBuses(-4, -20, -5, -5, -5, 5, 0, -1, 1, -4); + // maxP < targetP < 0 + network = createWithTwoBuses(-4, -20, -5, -5, -5, 5, 0, -1, 1, -4); assertConvergence(network); network = createWithTwoBuses(-4, -20, -5, -5, -4.25, 4.25, 0, -1, 1, -4); assertDivergence(network); } @Test - void testGeneratorQBoundsTargetPInside0Pmin() throws IOException { + void testGeneratorQBoundsInterpolatedBetweenMinPP0() throws IOException { + // 0 < targetP < minP Network network = createWithTwoBuses(101, 150, 200, 0, -0, 0, 150, -150, 150, 100); @@ -131,11 +133,9 @@ void testGeneratorQBoundsTargetPInside0Pmin() throws IOException { 0, -0, 0, 150, -140, 140, 100); assertDivergence(network); - } - @Test - void testGeneratorQBoundsTargetPInside0Pmin2() throws IOException { - Network network = createWithTwoBuses(-5.1, -10, 10, + // minP < targetP < 0 < maxP + network = createWithTwoBuses(-5.1, -10, 10, 0, -0, 0, -10, -4, 4, -2); @@ -147,6 +147,41 @@ void testGeneratorQBoundsTargetPInside0Pmin2() throws IOException { assertDivergence(network); } + @Test + void testGeneratorQBoundsTakenAtPmax() throws IOException { + // 0 < maxP < targetP + Network network = createWithTwoBuses(102, 50, 100, 50, -100, 100, 100, -155, 155, 150); + network.getVoltageLevel("vl1").newGenerator() + .setId("g2") + .setConnectableBus("b1") + .setBus("b1") + .setTargetP(1) + .setTargetV(390) + .setMinP(0) + .setMaxP(2) + .setVoltageRegulatorOn(true) + .add(); + + assertConvergence(network); + network = createWithTwoBuses(155, 50, 150, 0, -100, 100, 150, -125, 125, 150); + assertDivergence(network); + } + + @Test + void testGeneratorQBoundsTakenAtPmin() throws IOException { + // targetP < minP < 0 + Network network = createWithTwoBuses(-11, -10, 10, + 0, -0, 0, + -10, -2.5, 2.5, + -2); + assertConvergence(network); + network = createWithTwoBuses(-11, -10, 10, + 0, -0, 0, + -10, -1.95, 1.95, + -2); + assertDivergence(network); + } + void assertConvergence(Network network) throws IOException { OpenReacParameters parameters = new OpenReacParameters(); parameters.setMinPlausibleLowVoltageLimit(0.4); @@ -171,7 +206,7 @@ void assertDivergence(Network network) throws IOException { * b1---------b2 * l1 */ - public static Network createWithTwoBuses(double g1TargetP, double g1PMin, double g1PMax, + public static Network createWithTwoBuses(double targetP, double minP, double maxP, double pValue1, double g1QMin1, double g1QMax1, double pValue2, double g1QMin2, double g1QMax2, double ld1TargetQ) { @@ -194,10 +229,10 @@ public static Network createWithTwoBuses(double g1TargetP, double g1PMin, double .setId("g1") .setConnectableBus("b1") .setBus("b1") - .setTargetP(g1TargetP) + .setTargetP(targetP) .setTargetV(390) - .setMinP(g1PMin) - .setMaxP(g1PMax) + .setMinP(minP) + .setMaxP(maxP) .setVoltageRegulatorOn(true) .add(); network.getGenerator("g1").newReactiveCapabilityCurve() @@ -224,7 +259,7 @@ public static Network createWithTwoBuses(double g1TargetP, double g1PMin, double .setId("ld1") .setConnectableBus("b2") .setBus("b2") - .setP0(g1TargetP) + .setP0(targetP) .setQ0(ld1TargetQ) .add(); network.newLine() From 4023c034fcf327f1f0b3750926ecc62eb1fb7ca3 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Thu, 2 Jan 2025 10:54:16 +0100 Subject: [PATCH 40/63] Upadte TUs Signed-off-by: p-arvy --- .../openreac/acopf_preprocessing.run | 10 +- .../AbstractOpenReacRunnerTest.java | 15 +- .../OpecReacOptimizationBoundsTest.java | 382 +++++++++++++----- 3 files changed, 299 insertions(+), 108 deletions(-) diff --git a/open-reac/src/main/resources/openreac/acopf_preprocessing.run b/open-reac/src/main/resources/openreac/acopf_preprocessing.run index a51f0ec8..b4952790 100644 --- a/open-reac/src/main/resources/openreac/acopf_preprocessing.run +++ b/open-reac/src/main/resources/openreac/acopf_preprocessing.run @@ -254,8 +254,14 @@ for {(g,n) in UNITON} { let corrected_unit_Qp[g,n] := tempo; } - # cases when Qmin/Qmax are interpolated between Pmin and Pmax - if (unit_Pc[1,g,n] >= corrected_unit_Pmin[g,n] and unit_Pc[1,g,n] <= corrected_unit_Pmax[g,n] and (corrected_unit_Pmin[g,n] > 0 or corrected_unit_Pmax[g,n] < 0)) then { + if (abs(unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) < Pnull) then { + let corrected_unit_Qmin[g,n] := corrected_unit_qp[g,n]; + let corrected_unit_Qmax[g,n] := corrected_unit_Qp[g,n]; + } else if (abs(unit_Pc[1,g,n] - corrected_unit_Pmax[g,n]) < Pnull) then { + let corrected_unit_Qmin[g,n] := corrected_unit_qP[g,n]; + let corrected_unit_Qmax[g,n] := corrected_unit_QP[g,n]; + # cases when Qmin/Qmax are interpolated between Pmin and Pmax + } else if (unit_Pc[1,g,n] >= corrected_unit_Pmin[g,n] and unit_Pc[1,g,n] <= corrected_unit_Pmax[g,n] and (corrected_unit_Pmin[g,n] >= 0 or corrected_unit_Pmax[g,n] <= 0)) then { # if Pmin/Pmax are too close, compute Qmin/Qmax as the mean of diagram values if (abs((corrected_unit_Pmax[g,n] - corrected_unit_Pmin[g,n])) < 1e-4) then { let corrected_unit_Qmin[g,n] := (corrected_unit_qp[g,n] + corrected_unit_qP[g,n]) / 2; diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java index 8177ddcc..ce4d3c1b 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java @@ -19,7 +19,6 @@ import com.powsybl.openreac.OpenReacConfig; import com.powsybl.openreac.OpenReacRunner; import com.powsybl.openreac.parameters.input.OpenReacParameters; -import com.powsybl.openreac.parameters.input.algo.OpenReacAmplLogLevel; import com.powsybl.openreac.parameters.output.OpenReacResult; import com.powsybl.openreac.parameters.output.OpenReacStatus; import org.junit.jupiter.api.AfterEach; @@ -137,25 +136,29 @@ protected OpenReacResult runOpenReac(Network network, String subFolder, OpenReac try (ComputationManager computationManager = new LocalComputationManager()) { // try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), // localCommandExecutor, ForkJoinPool.commonPool())) { - parameters.setLogLevelAmpl(OpenReacAmplLogLevel.DEBUG); +// parameters.setLogLevelAmpl(OpenReacAmplLogLevel.DEBUG); OpenReacResult result = OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, new OpenReacConfig(true), computationManager, reportNode, null); - System.out.println(result.getIndicators().get("directory")); +// System.out.println(result.getIndicators().get("directory")); return result; } } + protected void setDefaultVoltageLimits(Network network) { + setDefaultVoltageLimits(network, 0.5, 1.5); + } + /** * Add voltage limits to voltage levels with undefined limits. * OpenReac needs voltage limits to run optimization. */ - protected void setDefaultVoltageLimits(Network network) { + protected void setDefaultVoltageLimits(Network network, double thresholdMin, double thresholdMax) { for (VoltageLevel vl : network.getVoltageLevels()) { if (vl.getLowVoltageLimit() <= 0 || Double.isNaN(vl.getLowVoltageLimit())) { - vl.setLowVoltageLimit(0.5 * vl.getNominalV()); + vl.setLowVoltageLimit(thresholdMin * vl.getNominalV()); } if (Double.isNaN(vl.getHighVoltageLimit())) { - vl.setHighVoltageLimit(1.5 * vl.getNominalV()); + vl.setHighVoltageLimit(thresholdMax * vl.getNominalV()); } } } diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java index 4c0b1201..c8c9d652 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java @@ -7,14 +7,14 @@ */ package com.powsybl.openreac.optimization; +import com.powsybl.commons.report.ReportNode; import com.powsybl.iidm.network.*; -import com.powsybl.loadflow.LoadFlow; -import com.powsybl.loadflow.LoadFlowResult; import com.powsybl.openreac.network.VoltageControlNetworkFactory; import com.powsybl.openreac.parameters.input.OpenReacParameters; import com.powsybl.openreac.parameters.input.algo.ReactiveSlackBusesMode; import com.powsybl.openreac.parameters.output.OpenReacResult; import com.powsybl.openreac.parameters.output.OpenReacStatus; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import java.io.IOException; @@ -31,6 +31,17 @@ */ class OpecReacOptimizationBoundsTest extends AbstractOpenReacRunnerTest { + private OpenReacParameters parameters; + + @Override + @BeforeEach + public void setUp() throws IOException { + super.setUp(); + parameters = new OpenReacParameters(); + // remove reactive slacks to ensure non convergence in case of infeasibility + parameters.setReactiveSlackBusesMode(ReactiveSlackBusesMode.CONFIGURED); + } + @Test void testGeneratorsMaxPBounds() throws IOException { Network network = VoltageControlNetworkFactory.createWithTwoVoltageControls(); @@ -79,8 +90,7 @@ void testGeneratorQmaxPmaxRatioBounds() throws IOException { network.getLine("l45").disconnect(); network.getLoad("l4").setP0(4).setQ0(2); - OpenReacParameters parameters = new OpenReacParameters(); - OpenReacResult result = runOpenReac(network, "optimization/bounds/qmax-pmax-default-ratio", parameters, true); + OpenReacResult result = runOpenReac(network, "optimization/bounds/qmax-pmax-default-ratio", true); assertEquals(OpenReacStatus.OK, result.getStatus()); // there are slacks as Q bounds are not large enough assertTrue(Integer.parseInt(result.getIndicators().get("nb_reactive_slacks")) > 0); @@ -94,63 +104,235 @@ void testGeneratorQmaxPmaxRatioBounds() throws IOException { @Test void testGeneratorQBoundsInterpolatedBetweenMinPMaxP() throws IOException { - // 0 < minP < targetP < maxP - Network network = createWithTwoBuses(101, 50, 150, 0, -100, 100, 150, -200, 200, 150); - assertConvergence(network); - network = createWithTwoBuses(101, 50, 150, 0, -100, 100, 150, -150, 150, 150); - assertDivergence(network); + // verify feasibility when minQ/maxQ are interpolated between bounds at MinP and MaxP (0 < minP < targetP < maxP) + Network network = create(101, 50, 150, 150); + network.getGenerator("g1").newReactiveCapabilityCurve() + .beginPoint() + .setP(0) + .setMinQ(-100) + .setMaxQ(100) + .endPoint() + .beginPoint() + .setP(150) + .setMinQ(-200) + .setMaxQ(200) + .endPoint() + .add(); + testAllModifAndLoadFlow(network, "", parameters, ReportNode.NO_OP); - // minP < targetP < maxP < 0 - network = createWithTwoBuses(-10, -20, -5, -20, -30, 30, -5, -5, 5, -10); - assertConvergence(network); - network = createWithTwoBuses(-10, -20, -5, -20, -18, 18, -5, -5, 5, -10); - assertDivergence(network); + // verify non convergence due to insufficient bounds + network = create(101, 50, 150, 150); + network.getGenerator("g1").newReactiveCapabilityCurve() + .beginPoint() + .setP(0) + .setMinQ(-100) + .setMaxQ(100) + .endPoint() + .beginPoint() + .setP(150) + .setMinQ(-150) + .setMaxQ(150) + .endPoint() + .add(); + OpenReacResult result = runOpenReac(network, "", parameters, false); + assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); + } + + @Test + void testGeneratorQBoundsInterpolatedBetweenMinPMaxP2() throws IOException { + // verify feasibility when minQ/maxQ are interpolated between bounds at MinP and MaxP (minP < targetP < maxP < 0) + Network network = create(-10, -20, -5, -10); + setDefaultVoltageLimits(network, 0.85, 1.15); + network.getGenerator("g1").newReactiveCapabilityCurve() + .beginPoint() + .setP(-20) + .setMinQ(-30) + .setMaxQ(30) + .endPoint() + .beginPoint() + .setP(-5) + .setMinQ(-5) + .setMaxQ(5) + .endPoint() + .add(); + testAllModifAndLoadFlow(network, "", parameters, ReportNode.NO_OP); + + // verify non convergence due to insufficient bounds + network.getGenerator("g1").newReactiveCapabilityCurve() + .beginPoint() + .setP(-20) + .setMinQ(-18) + .setMaxQ(18) + .endPoint() + .beginPoint() + .setP(-5) + .setMinQ(-5) + .setMaxQ(5) + .endPoint() + .add(); + OpenReacResult result = runOpenReac(network, "", parameters, false); + assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); } @Test void testGeneratorQBoundsInterpolatedBetweenP0MaxP() throws IOException { - // minP < 0 < targetP < maxP - Network network = createWithTwoBuses(101, -50, 150, 0, -0, 0, 150, -300, 300, 150); - assertConvergence(network); - network = createWithTwoBuses(101, -50, 150, 0, -0, 0, 150, -100, 100, 150); - assertDivergence(network); + // verify feasibility when minQ/maxQ are interpolated between bounds at MinP and P0 (minP < 0 < targetP < maxP) + Network network = create(101, -50, 150, 150); + network.getGenerator("g1").newReactiveCapabilityCurve() + .beginPoint() + .setP(0) + .setMinQ(0) + .setMaxQ(0) + .endPoint() + .beginPoint() + .setP(150) + .setMinQ(-300) + .setMaxQ(300) + .endPoint() + .add(); + testAllModifAndLoadFlow(network, "", parameters, ReportNode.NO_OP); + + // verify non convergence due to insufficient bounds + network.getGenerator("g1").newReactiveCapabilityCurve() + .beginPoint() + .setP(0) + .setMinQ(0) + .setMaxQ(0) + .endPoint() + .beginPoint() + .setP(150) + .setMinQ(-100) + .setMaxQ(100) + .endPoint() + .add(); + OpenReacResult result = runOpenReac(network, "", parameters, false); + assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); + } + + @Test + void testGeneratorQBoundsInterpolatedBetweenP0MaxP2() throws IOException { + // verify feasibility when minQ/maxQ are interpolated between bounds at MinP and P0 (maxP < targetP < 0) + Network network = create(-4, -20, -5, -4); + setDefaultVoltageLimits(network, 0.85, 1.15); + network.getGenerator("g1").newReactiveCapabilityCurve() + .beginPoint() + .setP(-5) + .setMinQ(-5) + .setMaxQ(5) + .endPoint() + .beginPoint() + .setP(0) + .setMinQ(-1) + .setMaxQ(1) + .endPoint() + .add(); + testAllModifAndLoadFlow(network, "", parameters, ReportNode.NO_OP); + + // verify non convergence due to insufficient bounds + network.getGenerator("g1").newReactiveCapabilityCurve() + .beginPoint() + .setP(-5) + .setMinQ(-4.25) + .setMaxQ(4.25) + .endPoint() + .beginPoint() + .setP(0) + .setMinQ(-1) + .setMaxQ(1) + .endPoint() + .add(); + OpenReacResult result = runOpenReac(network, "", parameters, false); + assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); + } - // maxP < targetP < 0 - network = createWithTwoBuses(-4, -20, -5, -5, -5, 5, 0, -1, 1, -4); - assertConvergence(network); - network = createWithTwoBuses(-4, -20, -5, -5, -4.25, 4.25, 0, -1, 1, -4); - assertDivergence(network); + @Test + void testGeneratorQBoundsInterpolatedBetweenP0MinP() throws IOException { + // verify feasibility when minQ/maxQ are interpolated between bounds at MinP and P0 (0 < targetP < minP) + Network network = create(101, 150, 200, 100); + network.getGenerator("g1").newReactiveCapabilityCurve() + .beginPoint() + .setP(0) + .setMinQ(0) + .setMaxQ(0) + .endPoint() + .beginPoint() + .setP(150) + .setMinQ(-150) + .setMaxQ(150) + .endPoint() + .add(); + testAllModifAndLoadFlow(network, "", parameters, ReportNode.NO_OP); + + // verify non convergence due to insufficient bounds + network.getGenerator("g1").newReactiveCapabilityCurve() + .beginPoint() + .setP(0) + .setMinQ(0) + .setMaxQ(0) + .endPoint() + .beginPoint() + .setP(150) + .setMinQ(-140) + .setMaxQ(140) + .endPoint() + .add(); + OpenReacResult result = runOpenReac(network, "", parameters, false); + assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); } @Test - void testGeneratorQBoundsInterpolatedBetweenMinPP0() throws IOException { - // 0 < targetP < minP - Network network = createWithTwoBuses(101, 150, 200, - 0, -0, 0, - 150, -150, 150, 100); - assertConvergence(network); - network = createWithTwoBuses(101, 150, 200, - 0, -0, 0, - 150, -140, 140, 100); - assertDivergence(network); + void testGeneratorQBoundsInterpolatedBetweenP0MinP2() throws IOException { + // verify feasibility when minQ/maxQ are interpolated between bounds at MinP and P0 (minP < targetP < 0 < maxP) + Network network = create(-5.1, -10, 10, -2); + setDefaultVoltageLimits(network, 0.85, 1.15); + network.getGenerator("g1").newReactiveCapabilityCurve() + .beginPoint() + .setP(0) + .setMinQ(-0) + .setMaxQ(0) + .endPoint() + .beginPoint() + .setP(-10) + .setMinQ(-4) + .setMaxQ(4) + .endPoint() + .add(); + testAllModifAndLoadFlow(network, "", parameters, ReportNode.NO_OP); - // minP < targetP < 0 < maxP - network = createWithTwoBuses(-5.1, -10, 10, - 0, -0, 0, - -10, -4, 4, - -2); - assertConvergence(network); - network = createWithTwoBuses(-5.1, -10, 10, - 0, -0, 0, - -10, -3.8, 3.8, - -2); - assertDivergence(network); + // verify non convergence due to insufficient bounds + network.getGenerator("g1").newReactiveCapabilityCurve() + .beginPoint() + .setP(0) + .setMinQ(0) + .setMaxQ(0) + .endPoint() + .beginPoint() + .setP(-10) + .setMinQ(-3) + .setMaxQ(3) + .endPoint() + .add(); + OpenReacResult result = runOpenReac(network, "", parameters, false); + assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); } @Test - void testGeneratorQBoundsTakenAtPmax() throws IOException { - // 0 < maxP < targetP - Network network = createWithTwoBuses(102, 50, 100, 50, -100, 100, 100, -155, 155, 150); + void testGeneratorQBoundsTakenAtMaxP() throws IOException { + // verify feasibility when minQ/maxQ are taken at maxP (0 < maxP < targetP) + Network network = create(102, 50, 100, 150); + network.getGenerator("g1").newReactiveCapabilityCurve() + .beginPoint() + .setP(50) + .setMinQ(0) + .setMaxQ(0) + .endPoint() + .beginPoint() + .setP(100) + .setMinQ(-152) + .setMaxQ(152) + .endPoint() + .add(); + // add a generator to allow convergence, as variable P of g1 will be fixed to 102 in optimization network.getVoltageLevel("vl1").newGenerator() .setId("g2") .setConnectableBus("b1") @@ -161,55 +343,68 @@ void testGeneratorQBoundsTakenAtPmax() throws IOException { .setMaxP(2) .setVoltageRegulatorOn(true) .add(); + testAllModifAndLoadFlow(network, "", parameters, ReportNode.NO_OP); - assertConvergence(network); - network = createWithTwoBuses(155, 50, 150, 0, -100, 100, 150, -125, 125, 150); - assertDivergence(network); + // verify non convergence due to insufficient bounds + network.getGenerator("g1").newReactiveCapabilityCurve() + .beginPoint() + .setP(50) + .setMinQ(0) + .setMaxQ(0) + .endPoint() + .beginPoint() + .setP(100) + .setMinQ(-149) + .setMaxQ(149) + .endPoint() + .add(); + OpenReacResult result = runOpenReac(network, "", parameters, false); + assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); } @Test - void testGeneratorQBoundsTakenAtPmin() throws IOException { - // targetP < minP < 0 - Network network = createWithTwoBuses(-11, -10, 10, - 0, -0, 0, - -10, -2.5, 2.5, - -2); - assertConvergence(network); - network = createWithTwoBuses(-11, -10, 10, - 0, -0, 0, - -10, -1.95, 1.95, - -2); - assertDivergence(network); - } - - void assertConvergence(Network network) throws IOException { - OpenReacParameters parameters = new OpenReacParameters(); - parameters.setMinPlausibleLowVoltageLimit(0.4); - parameters.setMaxPlausibleHighVoltageLimit(1.6); - parameters.setReactiveSlackBusesMode(ReactiveSlackBusesMode.CONFIGURED); - OpenReacResult result = runOpenReac(network, "", parameters, false); - assertEquals(OpenReacStatus.OK, result.getStatus()); - LoadFlowResult loadFlowResult = LoadFlow.run(network); - assertTrue(loadFlowResult.isFullyConverged()); - } + void testGeneratorQBoundsTakenAtMinP() throws IOException { + // verify feasibility when minQ/maxQ are taken at minP (targetP < minP < 0) + Network network = create(-0.5, 0, 10, -0.25); + setDefaultVoltageLimits(network, 0.85, 1.15); + network.getGenerator("g1").newReactiveCapabilityCurve() + .beginPoint() + .setP(0) + .setMinQ(-100) + .setMaxQ(100) + .endPoint() + .beginPoint() + .setP(2) + .setMinQ(-10) + .setMaxQ(10) + .endPoint() + .add(); + testAllModifAndLoadFlow(network, "", parameters, ReportNode.NO_OP); - void assertDivergence(Network network) throws IOException { - OpenReacParameters parameters = new OpenReacParameters(); - parameters.setReactiveSlackBusesMode(ReactiveSlackBusesMode.CONFIGURED); + // verify non convergence due to insufficient bounds + network.getGenerator("g1").newReactiveCapabilityCurve() + .beginPoint() + .setP(0) + .setMinQ(0) + .setMaxQ(0) + .endPoint() + .beginPoint() + .setP(-10) + .setMinQ(-1.99) + .setMaxQ(1.99) + .endPoint() + .add(); OpenReacResult result = runOpenReac(network, "", parameters, false); assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); } /** - * g1 ld1 - * | | - * b1---------b2 - * l1 + * g1 ld1 + * | | + * b1---------b2 + * l1 */ - public static Network createWithTwoBuses(double targetP, double minP, double maxP, - double pValue1, double g1QMin1, double g1QMax1, - double pValue2, double g1QMin2, double g1QMax2, - double ld1TargetQ) { + public static Network create(double targetP, double minP, double maxP, double loadTargetQ) { Network network = Network.create("q-bounds", "test"); Substation s1 = network.newSubstation() .setId("S1") @@ -235,18 +430,6 @@ public static Network createWithTwoBuses(double targetP, double minP, double max .setMaxP(maxP) .setVoltageRegulatorOn(true) .add(); - network.getGenerator("g1").newReactiveCapabilityCurve() - .beginPoint() - .setP(pValue1) - .setMinQ(g1QMin1) - .setMaxQ(g1QMax1) - .endPoint() - .beginPoint() - .setP(pValue2) - .setMinQ(g1QMin2) - .setMaxQ(g1QMax2) - .endPoint() - .add(); VoltageLevel vl2 = s2.newVoltageLevel() .setId("vl2") .setNominalV(400) @@ -260,7 +443,7 @@ public static Network createWithTwoBuses(double targetP, double minP, double max .setConnectableBus("b2") .setBus("b2") .setP0(targetP) - .setQ0(ld1TargetQ) + .setQ0(loadTargetQ) .add(); network.newLine() .setId("l1") @@ -271,5 +454,4 @@ public static Network createWithTwoBuses(double targetP, double minP, double max .add(); return network; } - } From 5be40075266352d73d4176a26943c3badbaa2caa Mon Sep 17 00:00:00 2001 From: p-arvy Date: Thu, 2 Jan 2025 18:05:22 +0100 Subject: [PATCH 41/63] wip Signed-off-by: p-arvy --- .../openreac/acopf_preprocessing.run | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/open-reac/src/main/resources/openreac/acopf_preprocessing.run b/open-reac/src/main/resources/openreac/acopf_preprocessing.run index b4952790..dd9956b8 100644 --- a/open-reac/src/main/resources/openreac/acopf_preprocessing.run +++ b/open-reac/src/main/resources/openreac/acopf_preprocessing.run @@ -254,16 +254,17 @@ for {(g,n) in UNITON} { let corrected_unit_Qp[g,n] := tempo; } - if (abs(unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) < Pnull) then { - let corrected_unit_Qmin[g,n] := corrected_unit_qp[g,n]; - let corrected_unit_Qmax[g,n] := corrected_unit_Qp[g,n]; - } else if (abs(unit_Pc[1,g,n] - corrected_unit_Pmax[g,n]) < Pnull) then { - let corrected_unit_Qmin[g,n] := corrected_unit_qP[g,n]; - let corrected_unit_Qmax[g,n] := corrected_unit_QP[g,n]; + #if (abs(unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) < Pnull) then { + # let corrected_unit_Qmin[g,n] := corrected_unit_qp[g,n]; + ## let corrected_unit_Qmax[g,n] := corrected_unit_Qp[g,n]; + # } else if (abs(unit_Pc[1,g,n] - corrected_unit_Pmax[g,n]) < Pnull) then { + # let corrected_unit_Qmin[g,n] := corrected_unit_qP[g,n]; + # let corrected_unit_Qmax[g,n] := corrected_unit_QP[g,n]; # cases when Qmin/Qmax are interpolated between Pmin and Pmax - } else if (unit_Pc[1,g,n] >= corrected_unit_Pmin[g,n] and unit_Pc[1,g,n] <= corrected_unit_Pmax[g,n] and (corrected_unit_Pmin[g,n] >= 0 or corrected_unit_Pmax[g,n] <= 0)) then { + #} else + if (unit_Pc[1,g,n] >= corrected_unit_Pmin[g,n] and unit_Pc[1,g,n] <= corrected_unit_Pmax[g,n] and (corrected_unit_Pmin[g,n] >= 0 or corrected_unit_Pmax[g,n] <= 0)) then { # if Pmin/Pmax are too close, compute Qmin/Qmax as the mean of diagram values - if (abs((corrected_unit_Pmax[g,n] - corrected_unit_Pmin[g,n])) < 1e-4) then { + if (abs((corrected_unit_Pmax[g,n] - corrected_unit_Pmin[g,n])) < Pnull) then { let corrected_unit_Qmin[g,n] := (corrected_unit_qp[g,n] + corrected_unit_qP[g,n]) / 2; let corrected_unit_Qmax[g,n] := (corrected_unit_Qp[g,n] + corrected_unit_QP[g,n]) / 2; } else { @@ -275,7 +276,7 @@ for {(g,n) in UNITON} { } else if ((unit_Pc[1,g,n] >= corrected_unit_Pmin[g,n] and unit_Pc[1,g,n] <= corrected_unit_Pmax[g,n] and unit_Pc[1,g,n] > 0) or (unit_Pc[1,g,n] < 0 and unit_Pc[1,g,n] >= corrected_unit_Pmax[g,n])) then { # if 0/Pmax are too close, compute Qmin/Qmax as the mean of diagram values - if (abs(corrected_unit_Pmax[g,n]) < 1e-4) then { + if (abs(corrected_unit_Pmax[g,n]) < Pnull) then { let corrected_unit_Qmin[g,n] := (corrected_unit_qp0[g,n] + corrected_unit_qP[g,n]) / 2; let corrected_unit_Qmax[g,n] := (corrected_unit_Qp0[g,n] + corrected_unit_QP[g,n]) / 2; } else { @@ -287,7 +288,7 @@ for {(g,n) in UNITON} { } else if ((unit_Pc[1,g,n] >= corrected_unit_Pmin[g,n] and unit_Pc[1,g,n] <= corrected_unit_Pmax[g,n] and unit_Pc[1,g,n] < 0) or (unit_Pc[1,g,n] > 0 and unit_Pc[1,g,n] <= corrected_unit_Pmin[g,n])) then { # if Pmin/0 are too close, compute Qmin/Qmax as the mean of diagram values - if (abs(corrected_unit_Pmin[g,n]) < 1e-4) then { + if (abs(corrected_unit_Pmin[g,n]) < Pnull) then { let corrected_unit_Qmin[g,n] := (corrected_unit_qp0[g,n] + corrected_unit_qp[g,n]) / 2; let corrected_unit_Qmax[g,n] := (corrected_unit_Qp0[g,n] + corrected_unit_Qp[g,n]) / 2; } else { From 1c0daf148251ac6f93b86021317db073a8991866 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Thu, 2 Jan 2025 19:05:05 +0100 Subject: [PATCH 42/63] wip Signed-off-by: p-arvy --- docs/optimizer/preprocessing.md | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/docs/optimizer/preprocessing.md b/docs/optimizer/preprocessing.md index f51c711e..44ecf151 100644 --- a/docs/optimizer/preprocessing.md +++ b/docs/optimizer/preprocessing.md @@ -36,8 +36,8 @@ Let $P_{g}^{min,c}$ and $P_{g}^{max,c}$ be the corrected active bounds: - If $|P_g^{min}| \geq \text{PQmax}$, then $P_{g}^{min,c} = \min(\text{defaultPmin}, P_g^t)$ - If $|P_{g}^{max,c} - P_{g}^{min,c}| \leq \text{minimalQPrange}$, then $P_{g}^{max,c} = P_{g}^{min,c} = P_{g}^t$ (active power is fixed). -To determine the consistent domain of produced reactive power, the reactive power diagram (specified in `ampl_network_generators.txt`) of generator $g$ is used: $qp_g$ (resp. $qP_g$) and $Qp_g$ ($QP_g$) when $P_{g}^{min,c}$ (resp. $P_{g}^{max,c}$) is reached. -Let $qp_g^c$ (resp. $qP_g^c$) and $Qp_g^c$ (resp. $QP_g^c$) be the bounds of the corrected reactive diagram, and $Q_{g}^{min,c}$ and $Q_{g}^{max,c}$ be the corrected reactive bounds: +To determine the consistent domain of produced reactive power, the reactive power diagram (specified in `ampl_network_generators.txt`) of generator $g$ is used: $qp_g$ (resp. $qp0_g$, $qP_g$) and $Qp_g$ (resp. $Qp0_g$, $QP_g$) when $P_{g}^{min,c}$ (resp. $0$, $P_{g}^{max,c}$) is reached. +Let $qp_g^c$ (resp. $qp0_g^c$, $qP_g^c$) and $Qp_g^c$ (resp. $Qp0_g^c$, $QP_g^c$) be the bounds of the corrected reactive diagram, and $Q_{g}^{min,c}$ and $Q_{g}^{max,c}$ be the corrected reactive bounds: - By default, $qp_g^{c} = qP_{g}^{c} = - \text{defaultPmin} \times \text{defaultQmaxPmaxRatio}$ and $Qp_{g}^{c} = QP_{g}^{c} = \text{defaultPmax} \times \text{defaultQmaxPmaxRatio}$ (see [Configuration of the run](inputs.md#configuration-of-the-run)) - If $|qp_{g}| \geq \text{PQmax}$, then $qp_{g}^{c} = -\text{defaultQmaxPmaxRatio} \times P_{max}^{g,c}$. @@ -46,12 +46,29 @@ Let $qp_g^c$ (resp. $qP_g^c$) and $Qp_g^c$ (resp. $QP_g^c$) be the bounds of the Same with $QP_{g}^{c}$. - If $qp_{g}^{c} > Qp_{g}^{c}$, the values are swapped. Same with $qP_{g}^{c}$ and $QP_{g}^{c}$. -- If the corrected reactive diagram is too small (the distances between the vertices of the reactive diagram are lower than $\text{minimalQPrange}$), then $qp_{g}^{c} = Qp_{g}^{c} = qP_{g}^{c} = QP_{g}^{c} = \frac{qp_{g}^{c} + Qp_{g}^{c} + qP_{g}^{c} + QP_{g}^{c}}{4}$ (reactive power is fixed). -- $Q_{g}^{min,c} = \min(qp_{g}^{c}, qP_{g}^{c})$ and $Q_{g}^{max,c} = \min(Qp_{g}^{c}, QP_{g}^{c})$ - -Please note that in the end, **the corrected bounds are rectangular**, not trapezoidal, and they are used only in the reactive OPF (see [AC optimal powerflow](acOptimalPowerflow.md). The trapezoidal diagram should be added shortly. -In addition, bounds $qP_{g}^0$ and $Qp_{g}^0$ are not used, as generators with zero active power will be excluded from the optimisation (see [AC optimal powerflow](acOptimalPowerflow.md#generalities)). +- If the corrected reactive diagram is too small (the distances between the vertices of the reactive diagram are lower than $\text{minimalQPrange}$), then $qp_{g}^{c} = Qp_{g}^{c} = qP_{g}^{c} = QP_{g}^{c} = \frac{qp_{g}^{c} + Qp_{g}^{c} + qP_{g}^{c} + QP_{g}^{c}}{4}$ (reactive power is fixed). +Then, the corrected reactive bounds ($Q_{g}^{min,c}$ and $Q_{g}^{max,c}$) are interpolated between the points forming the hexagonal diagram. +The general case corresponds to the active target between the active bounds ($P_{g}^{min,c}$ and $P_{g}^{max,c}$). Then, the interpolating formula is: +# TODO The general correction of the generator's reactive power diagram $g$ is illustrated in the following figure: ![Reactive diagram correction](_static/img/reactive-diagram.png){width="50%" align=center} +On note les exceptions suivantes, qu'il est utile de clarifier. + +Si le générateur est en ramp up, c'est à dire que la target de puissance active est située entre 0 et Pmin, alors +l'interpolation est effectuée entre les points $0$ et Pmin, comme suit: +![Reactive diagram correction](_static/img/reactive-diagram.png){width="50%" align=center} + +Si le générateur a une target supérieure à sa borne supérieure de production de puissance active, et que cette borne est +supérieure à $0$, then the corrected reactive bounds are taken at Pmax, as follows: +![Reactive diagram correction](_static/img/reactive-diagram.png){width="50%" align=center} + +Si des points du diagramme héxagonal du générateur sont trop sérrés, et que la target P du générateur se situe entre ces points, +alors the corrected reactive bounds are taken as the half of the extreme points of the diagram. This is illustrated by the following: +![Reactive diagram correction](_static/img/reactive-diagram.png){width="50%" align=center} + +- $Q_{g}^{min,c} = \min(qp_{g}^{c}, qP_{g}^{c})$ and $Q_{g}^{max,c} = \min(Qp_{g}^{c}, QP_{g}^{c})$ + +Please note that in the end, **the corrected bounds are hexagonal**, and they are used only in the reactive OPF (see [AC optimal powerflow](acOptimalPowerflow.md). +In addition, note that bounds $qP_{g}^0$ and $Qp_{g}^0$ are only used to interpolate the corrected bounds $Q_{g}^{min,c}$ and $Q_{g}^{max,c}$, as generators with zero active power are excluded from the optimisation (see [AC optimal powerflow](acOptimalPowerflow.md#generalities)). From c6a999c2a2418479c8e3acb00edc00de7c3843a9 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Fri, 3 Jan 2025 12:00:22 +0100 Subject: [PATCH 43/63] wip Signed-off-by: p-arvy --- .../openreac/acopf_preprocessing.run | 60 ++++++++++++------- 1 file changed, 40 insertions(+), 20 deletions(-) diff --git a/open-reac/src/main/resources/openreac/acopf_preprocessing.run b/open-reac/src/main/resources/openreac/acopf_preprocessing.run index dd9956b8..eff0763b 100644 --- a/open-reac/src/main/resources/openreac/acopf_preprocessing.run +++ b/open-reac/src/main/resources/openreac/acopf_preprocessing.run @@ -240,37 +240,57 @@ for {(g,n) in UNITON} { let corrected_unit_Qp0[g,n] := tempo; } - # TODO : add corner cases here + # If reactive diagram between pmin and 0 is too small, fix it + if abs(corrected_unit_qp0[g,n]-corrected_unit_Qp0[g,n]) <= minimalQPrange + and abs(corrected_unit_qp[g,n]-corrected_unit_Qp[g,n]) <= minimalQPrange + and abs(corrected_unit_Qp0[g,n]-corrected_unit_qp[g,n]) <= minimalQPrange + then { + let tempo := 0.25*(corrected_unit_Qp0[g,n]+corrected_unit_qp0[g,n]+corrected_unit_qp[g,n]+corrected_unit_Qp[g,n]); + printf{LOG_DEBUG} "Unit %Q has reactive diagram too small between Pmin=%.1f and 0 -> we set qp=qp0=Qp=Qp0=%Q (Pc=%Q)\n", + unit_id[1,g,n],corrected_unit_Pmin[g,n],tempo,unit_Pc[1,g,n]; + let corrected_unit_Qp0[g,n] := tempo; + let corrected_unit_qp0[g,n] := tempo; + let corrected_unit_qp[g,n] := tempo; + let corrected_unit_Qp[g,n] := tempo; + } + + # If reactive diagram between 0 and pmax is too small, fix it + if abs(corrected_unit_qP[g,n]-corrected_unit_QP[g,n]) <= minimalQPrange + and abs(corrected_unit_qp0[g,n]-corrected_unit_Qp0[g,n]) <= minimalQPrange + and abs(corrected_unit_QP[g,n]-corrected_unit_qp0[g,n]) <= minimalQPrange + then { + let tempo := 0.25*(corrected_unit_qP[g,n]+corrected_unit_QP[g,n]+corrected_unit_qp0[g,n]+corrected_unit_Qp0[g,n]); + printf{LOG_DEBUG} "Unit %Q has reactive diagram too small between 0 and Pmax=%.1f -> we set qp0=qP=Qp0=QP=%Q (Pc=%Q)\n", + unit_id[1,g,n],corrected_unit_Pmax[g,n],tempo,unit_Pc[1,g,n]; + let corrected_unit_qP[g,n] := tempo; + let corrected_unit_QP[g,n] := tempo; + let corrected_unit_qp0[g,n] := tempo; + let corrected_unit_Qp0[g,n] := tempo; + } + + # If reactive diagram between pmin and pmax is too small, fix it if abs(corrected_unit_qP[g,n]-corrected_unit_QP[g,n]) <= minimalQPrange and abs(corrected_unit_qp[g,n]-corrected_unit_Qp[g,n]) <= minimalQPrange and abs(corrected_unit_QP[g,n]-corrected_unit_qp[g,n]) <= minimalQPrange then { let tempo := 0.25*(corrected_unit_qP[g,n]+corrected_unit_QP[g,n]+corrected_unit_qp[g,n]+corrected_unit_Qp[g,n]); - printf{LOG_DEBUG} "Unit %Q has reactive diagram too small -> we set qp=qP=Qp=QP=%Q (Pc=%Q)\n", - unit_id[1,g,n],tempo,unit_Pc[1,g,n]; + printf{LOG_DEBUG} "Unit %Q has reactive diagram too small between Pmin=%.1f and Pmax=%.1f -> we set qp=qP=Qp=QP=%Q (Pc=%Q)\n", + unit_id[1,g,n],corrected_unit_Pmin[g,n],corrected_unit_Pmax[g,n],tempo,unit_Pc[1,g,n]; let corrected_unit_qP[g,n] := tempo; let corrected_unit_QP[g,n] := tempo; let corrected_unit_qp[g,n] := tempo; let corrected_unit_Qp[g,n] := tempo; } - #if (abs(unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) < Pnull) then { - # let corrected_unit_Qmin[g,n] := corrected_unit_qp[g,n]; - ## let corrected_unit_Qmax[g,n] := corrected_unit_Qp[g,n]; - # } else if (abs(unit_Pc[1,g,n] - corrected_unit_Pmax[g,n]) < Pnull) then { - # let corrected_unit_Qmin[g,n] := corrected_unit_qP[g,n]; - # let corrected_unit_Qmax[g,n] := corrected_unit_QP[g,n]; - # cases when Qmin/Qmax are interpolated between Pmin and Pmax - #} else - if (unit_Pc[1,g,n] >= corrected_unit_Pmin[g,n] and unit_Pc[1,g,n] <= corrected_unit_Pmax[g,n] and (corrected_unit_Pmin[g,n] >= 0 or corrected_unit_Pmax[g,n] <= 0)) then { - # if Pmin/Pmax are too close, compute Qmin/Qmax as the mean of diagram values - if (abs((corrected_unit_Pmax[g,n] - corrected_unit_Pmin[g,n])) < Pnull) then { - let corrected_unit_Qmin[g,n] := (corrected_unit_qp[g,n] + corrected_unit_qP[g,n]) / 2; - let corrected_unit_Qmax[g,n] := (corrected_unit_Qp[g,n] + corrected_unit_QP[g,n]) / 2; - } else { - let corrected_unit_Qmin[g,n] := corrected_unit_qp[g,n] + (unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) / (corrected_unit_Pmax[g,n] - corrected_unit_Pmin[g,n]) * (corrected_unit_qP[g,n] - corrected_unit_qp[g,n]); - let corrected_unit_Qmax[g,n] := corrected_unit_Qp[g,n] + (unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) / (corrected_unit_Pmax[g,n] - corrected_unit_Pmin[g,n]) * (corrected_unit_QP[g,n] - corrected_unit_Qp[g,n]); - } + if (unit_Pc[1,g,n] >= corrected_unit_Pmin[g,n] and unit_Pc[1,g,n] <= corrected_unit_Pmax[g,n] and (corrected_unit_Pmin[g,n] >= 0 or corrected_unit_Pmax[g,n] <= 0)) then { + # if Pmin/Pmax are too close, compute Qmin/Qmax as the mean of diagram values + if (abs((corrected_unit_Pmax[g,n] - corrected_unit_Pmin[g,n])) < Pnull) then { + let corrected_unit_Qmin[g,n] := (corrected_unit_qp[g,n] + corrected_unit_qP[g,n]) / 2; + let corrected_unit_Qmax[g,n] := (corrected_unit_Qp[g,n] + corrected_unit_QP[g,n]) / 2; + } else { + let corrected_unit_Qmin[g,n] := corrected_unit_qp[g,n] + (unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) / (corrected_unit_Pmax[g,n] - corrected_unit_Pmin[g,n]) * (corrected_unit_qP[g,n] - corrected_unit_qp[g,n]); + let corrected_unit_Qmax[g,n] := corrected_unit_Qp[g,n] + (unit_Pc[1,g,n] - corrected_unit_Pmin[g,n]) / (corrected_unit_Pmax[g,n] - corrected_unit_Pmin[g,n]) * (corrected_unit_QP[g,n] - corrected_unit_Qp[g,n]); + } # cases when Qmin/Qmax are interpolated between 0 and Pmax } else if ((unit_Pc[1,g,n] >= corrected_unit_Pmin[g,n] and unit_Pc[1,g,n] <= corrected_unit_Pmax[g,n] and unit_Pc[1,g,n] > 0) From 49fa11a13829a0d3fcc41554ff354748079ef9ea Mon Sep 17 00:00:00 2001 From: p-arvy Date: Fri, 3 Jan 2025 14:41:10 +0100 Subject: [PATCH 44/63] Add doc Signed-off-by: p-arvy --- ...reactive-bounds-ptarget-between-0-pmax.PNG | Bin 0 -> 24067 bytes ...reactive-bounds-ptarget-between-0-pmin.PNG | Bin 0 -> 23410 bytes ...active-bounds-ptarget-higher-than-pmax.PNG | Bin 0 -> 22785 bytes ...nds-ptarget-in-active-bounds-too-close.PNG | Bin 0 -> 26418 bytes docs/optimizer/preprocessing.md | 61 ++++++++++-------- .../openreac/acopf_preprocessing.run | 4 +- 6 files changed, 36 insertions(+), 29 deletions(-) create mode 100644 docs/optimizer/_static/img/reactive-bounds-ptarget-between-0-pmax.PNG create mode 100644 docs/optimizer/_static/img/reactive-bounds-ptarget-between-0-pmin.PNG create mode 100644 docs/optimizer/_static/img/reactive-bounds-ptarget-higher-than-pmax.PNG create mode 100644 docs/optimizer/_static/img/reactive-bounds-ptarget-in-active-bounds-too-close.PNG diff --git a/docs/optimizer/_static/img/reactive-bounds-ptarget-between-0-pmax.PNG b/docs/optimizer/_static/img/reactive-bounds-ptarget-between-0-pmax.PNG new file mode 100644 index 0000000000000000000000000000000000000000..04bcd73a5998dd8bd7e5c0ff9a5e591a66bb1025 GIT binary patch literal 24067 zcmeFZcT`ht(=QxAL_mlNh=8s#ymasFVj2zy_9_FQw#%x~s5d1!8G z$ic?X1_FUNt{Ppj1c4Y4AP@uX$YJ1-Kq(XMI0lx}EnYTxg`WD4Dy9 zG6~X)PN;N|v>qh86ys?88a(ASU}mfVq%BFi)_}nrr7t>GZ!>t5ZFTw6nbao{ zM7CO?s#=sOi)rzA5gz5l)Xt^DcTA1p%6jxkUbf6B{DasmmNvHzo-YQS{oyk0gM6Ic zI}@bG$Z|Cso!aD%;B0OUp6E^gxltyNKA@&5UT`>@M&QfqC~K)>Z-2b}c=qy_vI?R5 zofzYV%VYJaFvlh{nabGG@j_Zb;`BzEcrKHU3ZP0tmtKZlfmd#lXszNi&N6k53(}zQ zW0WApPVT#LxUK}nsJ_6wkxpL~o0FUBgWk7a3FFBliv9b$&0^Y?c~V^J0Z3k!MSGh=mZpM%8T7Yb?qW0OSyhlE|1wB?Kn|;Oq8FM43-jWQEr$iH`=%sBx*D=_9eFPU_ZBH zoCBn<3rJ=-Z2rRSl$NAPzFxgglgmlKFsO1joKcpOclmhoQ|mxOO{m z#GMi_-cOLvl=TRQ%pt&;fQ6QLDaS7}7&(s^ab;-~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hljF>rRl5qJATB>+A^eJev^IC6q9yl7bUklC!M$|9ansTck{@kXOV=FgN}DUDfba%Odo3 z$i?L?=68y1<8?DPaaYA3?joNKU(Iq{_3!t_emJUL4c{bo^aon>4!5$kmBOx%b~uvV zHtL{0=;fN=PO!WANG5c{N}_Q!Gi$F~B;G;Sst172bRJxA>te$4%zlhutL#S6|Cx>l zh$!yJx5=Aa15>f1msWOZ+vkmkD_&AKGz%Ivlwi;p>d6{`++WTi7U!pj*s<>Zd@rj0 zxnu{W+nfrM*cK3hL+oECy*Ef!S3lXb$zld14zcYM!Sc6u$kvV;Uw^aO80hRE>YJ3j zIWM+gn^>+-T8~RGqd=f*p`mdUeJH^4s>?37LR?_@D!wUzs^;MVzV3aWFt9pFO-_t2 zCHhETKg6~{7acl}%*}3)$(vfX0oV~x2PJ2@1V^QS;^sB~B#F!*pw9L09~)}!Q1ZsC svG4=I_x}}G``=T_|KFBUZZ5{ePBb3bp!mcS(9a=ud!6@`TONx07rdf=9{>OV literal 0 HcmV?d00001 diff --git a/docs/optimizer/_static/img/reactive-bounds-ptarget-between-0-pmin.PNG b/docs/optimizer/_static/img/reactive-bounds-ptarget-between-0-pmin.PNG new file mode 100644 index 0000000000000000000000000000000000000000..10642d4c7afa517aaef3494b765aabf7929d43a3 GIT binary patch literal 23410 zcmeFZX*iVO|2{mF6qOcB2$f2Sl)aH9ifki$##YHP7)!=X(IBPWmXKv^!;B?c7+XU- zC5)XJLnRqAW>k!cF+BHB-|zqU9mn(HIgaP|yn0?#2lstn_viZD*Y#P>^SpX+0b;gI zL`DPz0&O!tf7T8J62yQ&0;`)h0l$$D@c9k=BM@e1W(=z6+B*&Wu+jI7^%)STI#G1_ zvJmj|mXPx-dFeB1FUJJagmRYXB z+eHqgueGC5%h8?6aT+&pWb;mU&o-i(%1WDO%TG-ar}}%_1OQu9O=%lJAft|*VBjax zwL1{tceQ)-ck?fq{l9r>b3X<(Hl1+#cRSs=f!_U%JHFbIr4#JI+zB$u*#W*4WV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FEI~>Jnh33mvr4`^}Q3wW&AGI2^VE7{^_h{gm;d~m)dG8Hv@m|5MaD*_5TbQ1UVyD za8QXT_$Byi*}DS0OIMFID~A9HLXT*WoJEWhsj+XL?oFVq7(y;*@v$$=udj9 zK@*}VjzikL$IC0iXDk>KN>kv|S=Yz|h!xY#IZ%ZtmL~WFv*3>Q|bO%7wOx>h3t?Q`~kg(gcbV z`B!Br6(&+_Xt%}sW1=SUKpN@3paP-SGc3%&SV~u!k+??&sL)HtA0dPSNXHZaw)>_jPLbete zb`{Z8L+WYM`}W3c1$#dsPTJmC08l|4^5_wqE{voD(35!}td^#>tvQtIG3H`(2MNe*q#TTpPj9n^NhgR<^M~1{_oMzABR^r YZECDZSJm}u1hYUkmN<)2^tsr70~b2LmjD0& literal 0 HcmV?d00001 diff --git a/docs/optimizer/_static/img/reactive-bounds-ptarget-higher-than-pmax.PNG b/docs/optimizer/_static/img/reactive-bounds-ptarget-higher-than-pmax.PNG new file mode 100644 index 0000000000000000000000000000000000000000..aaec23f262e88833cbc4fb93cf9ff2779c999b23 GIT binary patch literal 22785 zcmeFZdpOkH_cuN&DU!N#2%*DW6q-~h3`x>SPB}9|j$=s9BL+28in`sQFiwRS24kFu zB1vKhGfqQN3}a@5F&HzR_e|ZN&*%9*|2)rg{jTf#yRP5wkFGA>+uCcdz4qE`z1CX$ zq4{+aaZx!@5C|lG`O*bT5NHzu1QPnWZ7cAbHO<|Rfd7PoEKSaX%DVT>06%Q;GBh;= zfhv;4)?I~xpSRz>WFG_qNgw9_6S{2q=R62xmwNev;f-)8owB{r**c1iEUv~^FBGwS zN~~#ElZxfzLfRJ1&-fzFy)ip_CE~IUDzeNNH_Fh>;4$A?Xkx3xxD{HfP40f51(szKLr+>yN zfMi0)hT~lp_LsQ28$(whx!P-fN)dC62;eI1V+pCtB9>2{e*pKnN2- zZtztS%1PU`6tmNOW$l|xvz?fmh(fS==?qcSOVsCHAd|qZmuX&U!{5v|NLZ3veo6Y& z@^!%0g~D9#y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yW>|KD)raQ>HjjY(bd)DAA&tX?qLUiKUiyDX)A6 zwocA}yyJ}y7st52ebh0mnusZYiMjh-{n%aT)8VmNewXNuN~z%KK^p7Bvwr_v&+Nd$ zHWc;qJ=6Tbb_dv^IppcVe8;V)npnFl&6%E+R`%>PRg!EJpSL_D798}~im8gUq{z&y pii{|(nRD>MKA literal 0 HcmV?d00001 diff --git a/docs/optimizer/_static/img/reactive-bounds-ptarget-in-active-bounds-too-close.PNG b/docs/optimizer/_static/img/reactive-bounds-ptarget-in-active-bounds-too-close.PNG new file mode 100644 index 0000000000000000000000000000000000000000..d7eb12649c04513cc415c4f1cc14a85930b29bb7 GIT binary patch literal 26418 zcmeFZc|6qb_cuP26p5@ML`o@C*6i73-?Jy#_jQD^WG7pSkX@FsZ-Ws+p=24`SY`;t zFlH#rU<~(bdcVJ)`+NWK`{#b#zvYkLA3Z!~=Jh()xz2T6=RD6j&#MG|U3EGd4jK>$ zM5n2tVh93Jrh`BfN9WH0-`H-mjRJot{0!BVK(!-R*MSdbogV2t0)ZM*X^-uwfX^4a zHO&1$Al4h?e-xUA{M#Uq&$5$Zf>Uks;| z_tWOPLYAkO=(wc)7ws*u$U0lnbP&@`ZOr{syErb^&e%4G${4Y5sZ^Wr{9UU(*=En2 zP8-lI4nXLwPqzl2yleROE=EB-2DUKvhk1-yjkDo!{G7DH*^Nc{aC6PKdY%2(Q)PV@ zLy^{CYf|R13mWqf^Wu!6IRjs$uv4U#NpG8-Nr$!F-8)q@g4N#iztS_T~6Trm>4LOWmxjCbMinw^-j2jb08C z>T4H(xP=kC<|NECpgSP%_?Xlw^LZIoKKbq4`>HyCysLlC`I)McvR>{SDjBMMkG76L(eSb|w~!>jTEJl(C>RR$fMoA#3qujtPxN z*InLm-7!tePGgKw#nkbB5HIaJ8gmKeJmZFD26ncznvE=f+k*Vm*c|ch%<^uUMw*8G zP*v<$UCPnWw8zQsEKMu|+GQaOV&?iQ^-m5LJthv`%sbwzZ}|3J%4#e0gPe_2b=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JJ!H%~^TILyNdw>`9{j*dKPH~l0>V?{$TQiI$t6Z(iOj~>Cq5(vka#rnJ0BgnU z-%rIL(9cqWzek2cPnMz^UHnIK(}sOI`E+qq)_JB$?ZU5!KAr~3DG zoK2r0(Xf-Ic8kbBy;_iw;xcQ8(R$R&G48Ibb?nkb{{03kzcltm8{#?bX3z;=quPz) zDXXn_S9iLqevd|Za7`MLA??-_bf2#JPMFA*hWmbf=LZY|R*P;vrGh2s(T)Vk z|9-A)c++rp^qPf*fp7W)l+|aoStQq8r*u^#m@fKVa78X83_Y)jt6^rmV!^AKBn;1sX^(qU z)7V>GZwL*BJ}x2MEGUNh?seQqS)_`6LeMPI_E|o(zmP-kWPLpsje^fSQq9`_&(}U} zG@z~)PR}O*iM(dl?EcJD2x5jijPcK;zhrl7RI2-09746r!60uy)bJYF2FIW9v{pF1 zEnM?@O`->`C47vF(yXU@?EO#2*n~MwIw!c<>Z8RaU$#8Bgy;6D9_BwSg&EJjjEkx| z=hAHLLY0VCc9x?-+^7OJxZjVbN&|@1(R>1Iqdr_d=8sO+#67JV+az!3+(5@1+pP z2F-6idk(wz-zcTr&@-Np-JE|~beA^S`5x`TApUN0&`y#ZXVJH1mq9_wOfN|@kso0w>AUk*Q^RFV7Nn)>~4)n z6@5$*{XoM7-eCgCdLbyd$NPCM1-_We5@OCua$`eu)Wp*i-K@N9-l5%2nOu0Ap$C4*OpllSh|f0sezcAWKe|Y@Jl7$QM@LsJc{V> ziTtN|PGu^ Zp^~9t-|u-P?|@JsYPYqNOO@`2{~vQ=p Qp_{g}^{c}$, the values are swapped. - Same with $qP_{g}^{c}$ and $QP_{g}^{c}$. -- If the corrected reactive diagram is too small (the distances between the vertices of the reactive diagram are lower than $\text{minimalQPrange}$), then $qp_{g}^{c} = Qp_{g}^{c} = qP_{g}^{c} = QP_{g}^{c} = \frac{qp_{g}^{c} + Qp_{g}^{c} + qP_{g}^{c} + QP_{g}^{c}}{4}$ (reactive power is fixed). + Same with $qP_{g}^{c}$ and $QP_{g}^{c}$, $qp0_{g}^{c}$ and $Qp0_{g}^{c}$. +- If the corrected reactive diagram is too small between $P_{g}^{min,c}$ and $P_{g}^{max,c}$ (the distances between the vertices of the reactive diagram are lower than $\text{minimalQPrange}$), +then $qp_{g}^{c} = Qp_{g}^{c} = qP_{g}^{c} = QP_{g}^{c} = \frac{qp_{g}^{c} + Qp_{g}^{c} + qP_{g}^{c} + QP_{g}^{c}}{4}$ (reactive power is fixed). The same applies if the diagram +is too small between $P_{g}^{min,c}$ and 0, or 0 and $P_{g}^{max,c}$. Then, the corrected reactive bounds ($Q_{g}^{min,c}$ and $Q_{g}^{max,c}$) are interpolated between the points forming the hexagonal diagram. -The general case corresponds to the active target between the active bounds ($P_{g}^{min,c}$ and $P_{g}^{max,c}$). Then, the interpolating formula is: -# TODO -The general correction of the generator's reactive power diagram $g$ is illustrated in the following figure: -![Reactive diagram correction](_static/img/reactive-diagram.png){width="50%" align=center} - -On note les exceptions suivantes, qu'il est utile de clarifier. - -Si le générateur est en ramp up, c'est à dire que la target de puissance active est située entre 0 et Pmin, alors -l'interpolation est effectuée entre les points $0$ et Pmin, comme suit: -![Reactive diagram correction](_static/img/reactive-diagram.png){width="50%" align=center} - -Si le générateur a une target supérieure à sa borne supérieure de production de puissance active, et que cette borne est -supérieure à $0$, then the corrected reactive bounds are taken at Pmax, as follows: -![Reactive diagram correction](_static/img/reactive-diagram.png){width="50%" align=center} - -Si des points du diagramme héxagonal du générateur sont trop sérrés, et que la target P du générateur se situe entre ces points, -alors the corrected reactive bounds are taken as the half of the extreme points of the diagram. This is illustrated by the following: -![Reactive diagram correction](_static/img/reactive-diagram.png){width="50%" align=center} - -- $Q_{g}^{min,c} = \min(qp_{g}^{c}, qP_{g}^{c})$ and $Q_{g}^{max,c} = \min(Qp_{g}^{c}, QP_{g}^{c})$ - -Please note that in the end, **the corrected bounds are hexagonal**, and they are used only in the reactive OPF (see [AC optimal powerflow](acOptimalPowerflow.md). -In addition, note that bounds $qP_{g}^0$ and $Qp_{g}^0$ are only used to interpolate the corrected bounds $Q_{g}^{min,c}$ and $Q_{g}^{max,c}$, as generators with zero active power are excluded from the optimisation (see [AC optimal powerflow](acOptimalPowerflow.md#generalities)). +The general case corresponds to the active target being between the active bounds ($P_{g}^{min,c}$ and $P_{g}^{max,c}$). The interpolating formula is as follows: +- $Q_{g}^{min,c} = qp_{g}^{c} + \frac{P_{g}^{t}-P_{g}^{min,c}}{P_{g}^{max,c}-P_{g}^{min,c}}(qP_{g}^{c}-qp_{g}^{c})$ +- $Q_{g}^{max,c} = Qp_{g}^{c} + \frac{P_{g}^{t}-P_{g}^{min,c}}{P_{g}^{max,c}-P_{g}^{min,c}}(QP_{g}^{c}-Qp_{g}^{c})$ + +The formula also applies when the active target is between $0$ and $P_{g}^{min,c}$, or $0$ and $P_{g}^{max,c}$. For the last case, the interpolating formula becomes: +- $Q_{g}^{min,c} = qp0_{g}^{c} + \frac{P_{g}^{t}}{P_{g}^{max,c}}(qP_{g}^{c}-qp0_{g}^{c})$ +- $Q_{g}^{max,c} = Qp0_{g}^{c} + \frac{P_{g}^{t}}{P_{g}^{max,c}}(QP_{g}^{c}-Qp0_{g}^{c})$ +This is illustrated in the following figure: +![Reactive diagram correction](_static/img/reactive-bounds-ptarget-between-0-pmax.PNG){width="50%" align=center} + +The following corner cases are important to clarify: +- If the generator has an active power target located between $0$ and $P_{g}^{min,c}$ (e.g., during ramp up), the +interpolation is performed between the points $0$ and $P_{g}^{min,c}$, as follows: +![Reactive diagram correction](_static/img/reactive-bounds-ptarget-between-0-pmin.PNG){width="50%" align=center} + +- If the generator has a target greater (resp. smaller) than its upper (resp. lower) active power bound, and +this bound is greater (resp. smaller) than $0$, then the corrected reactive bounds are taken at $P_{g}^{max,c}$ (resp. $P_{g}^{min,c}$), as follows: +![Reactive diagram correction](_static/img/reactive-bounds-ptarget-higher-than-pmax.PNG){width="50%" align=center} + +- If corrected active bounds $P_{g}^{min,c}$ and $P_{g}^{max,c}$ are too close, and the target + of the generator is located between these points, then the corrected reactive bounds are taken as the midpoint of the extreme points of the diagram. The same applies + if $0$ and $P_{g}^{min,c}$ or $0$ and $P_{g}^{max,c}$ are too close, and that the target is located between. + This is illustrated below: +![Reactive diagram correction](_static/img/reactive-bounds-ptarget-in-active-bounds-too-close.PNG){width="50%" align=center} + +Please note that in the end, the corrected bounds are used in the reactive OPF (see [AC optimal powerflow](acOptimalPowerflow.md). +In addition, note that bounds $qP_{g}^0$ and $Qp_{g}^0$ are only used to interpolate the corrected bounds $Q_{g}^{min,c}$ and $Q_{g}^{max,c}$, +as generators with zero active power are excluded from the optimisation (see [AC optimal powerflow](acOptimalPowerflow.md#generalities)). diff --git a/open-reac/src/main/resources/openreac/acopf_preprocessing.run b/open-reac/src/main/resources/openreac/acopf_preprocessing.run index eff0763b..8717e8ab 100644 --- a/open-reac/src/main/resources/openreac/acopf_preprocessing.run +++ b/open-reac/src/main/resources/openreac/acopf_preprocessing.run @@ -317,12 +317,12 @@ for {(g,n) in UNITON} { } # cases when Qmin/Qmax are equals to qP/QP - } else if (unit_Pc[1,g,n] > corrected_unit_Pmax[g,n] and corrected_unit_Pmax[g,n] > 0) then { + } else if (unit_Pc[1,g,n] >= corrected_unit_Pmax[g,n] and corrected_unit_Pmax[g,n] > 0) then { let corrected_unit_Qmin[g,n] := corrected_unit_qP[g,n]; let corrected_unit_Qmax[g,n] := corrected_unit_QP[g,n]; # cases when Qmin/Qmax are equals to qp/Qp - } else if (unit_Pc[1,g,n] < corrected_unit_Pmin[g,n] and corrected_unit_Pmin[g,n] < 0) then { + } else if (unit_Pc[1,g,n] <= corrected_unit_Pmin[g,n] and corrected_unit_Pmin[g,n] < 0) then { let corrected_unit_Qmin[g,n] := corrected_unit_qp[g,n]; let corrected_unit_Qmax[g,n] := corrected_unit_Qp[g,n]; From ebaeb80c39a595839a86979e5041cac3eb5d829a Mon Sep 17 00:00:00 2001 From: p-arvy Date: Fri, 3 Jan 2025 14:52:29 +0100 Subject: [PATCH 45/63] Small clean Signed-off-by: p-arvy --- docs/optimizer/preprocessing.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/optimizer/preprocessing.md b/docs/optimizer/preprocessing.md index 24f8ecbe..47925116 100644 --- a/docs/optimizer/preprocessing.md +++ b/docs/optimizer/preprocessing.md @@ -29,7 +29,10 @@ The following corrections apply successively to determine consistent domains for To determine the consistent domain of produced active power, the bounds of the domains $P_g^{min}$ and $P_g^{max}$, as well as the target $P_g^{t}$ of generator $g$ (all specified in `ampl_network_generators.txt`) are used. -Let $P_{g}^{min,c}$ and $P_{g}^{max,c}$ be the corrected active bounds: +Let $P_{g}^{min,c}$ and $P_{g}^{max,c}$ be the corrected active bounds. Note that these bounds are used to determine the generator's reactive bounds, and they can be used in the optimization if the user specifies a value for +`coeff_alpha` different from 1 (see [Configuration of the run](inputs.md#configuration-of-the-run)). + +$P_{g}^{min,c}$ and $P_{g}^{max,c}$ are computed using the following: - By default, $P_{g}^{min,c} = \text{defaultPmin}$ and $P_{g}^{max,c} = \text{defaultPmax}$ (see [Configuration of the run](inputs.md#configuration-of-the-run)) - If $|P_g^{max}| \geq \text{PQmax}$, then $P_{g}^{max,c} = \max(\text{defaultPmax}, P_g^t)$ @@ -37,7 +40,8 @@ Let $P_{g}^{min,c}$ and $P_{g}^{max,c}$ be the corrected active bounds: - If $|P_{g}^{max,c} - P_{g}^{min,c}| \leq \text{minimalQPrange}$, then $P_{g}^{max,c} = P_{g}^{min,c} = P_{g}^t$ (active power is fixed). To determine the consistent domain of produced reactive power, the reactive power diagram (specified in `ampl_network_generators.txt`) of generator $g$ is used: $qp_g$ (resp. $qp0_g$, $qP_g$) and $Qp_g$ (resp. $Qp0_g$, $QP_g$) when $P_{g}^{min,c}$ (resp. $0$, $P_{g}^{max,c}$) is reached. -Let $qp_g^c$ (resp. $qp0_g^c$, $qP_g^c$) and $Qp_g^c$ (resp. $Qp0_g^c$, $QP_g^c$) be the bounds of the corrected reactive diagram, and $Q_{g}^{min,c}$ and $Q_{g}^{max,c}$ be the corrected reactive bounds: +Let $qp_g^c$ (resp. $qp0_g^c$, $qP_g^c$) and $Qp_g^c$ (resp. $Qp0_g^c$, $QP_g^c$) be the bounds of the corrected reactive diagram, +and $Q_{g}^{min,c}$ and $Q_{g}^{max,c}$ be the corrected reactive bounds, used in the optimization: - By default, $qp_g^{c} = qP_{g}^{c} = - \text{defaultPmin} \times \text{defaultQmaxPmaxRatio}$ and $Qp_{g}^{c} = QP_{g}^{c} = \text{defaultPmax} \times \text{defaultQmaxPmaxRatio}$ (see [Configuration of the run](inputs.md#configuration-of-the-run)) - If $|qp_{g}| \geq \text{PQmax}$, then $qp_{g}^{c} = -\text{defaultQmaxPmaxRatio} \times P_{max}^{g,c}$. @@ -58,6 +62,7 @@ The general case corresponds to the active target being between the active bound The formula also applies when the active target is between $0$ and $P_{g}^{min,c}$, or $0$ and $P_{g}^{max,c}$. For the last case, the interpolating formula becomes: - $Q_{g}^{min,c} = qp0_{g}^{c} + \frac{P_{g}^{t}}{P_{g}^{max,c}}(qP_{g}^{c}-qp0_{g}^{c})$ - $Q_{g}^{max,c} = Qp0_{g}^{c} + \frac{P_{g}^{t}}{P_{g}^{max,c}}(QP_{g}^{c}-Qp0_{g}^{c})$ + This is illustrated in the following figure: ![Reactive diagram correction](_static/img/reactive-bounds-ptarget-between-0-pmax.PNG){width="50%" align=center} From ad7f77e27c5fbf296f3e1709150aab22893c3e07 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Fri, 3 Jan 2025 15:22:41 +0100 Subject: [PATCH 46/63] Add resources Signed-off-by: p-arvy --- .../AbstractOpenReacRunnerTest.java | 13 ++- .../OpecReacOptimizationBoundsTest.java | 32 +++---- .../com/powsybl/config/test/config.yml | 2 +- .../invalid/reactiveopf_results_indic.txt | 83 +++++++++++++++++++ .../valid/reactiveopf_results_generators.csv | 2 + .../valid/reactiveopf_results_indic.txt | 82 ++++++++++++++++++ .../valid/reactiveopf_results_rtc.csv | 1 + .../valid/reactiveopf_results_shunts.csv | 1 + ...iveopf_results_static_var_compensators.csv | 1 + .../valid/reactiveopf_results_voltages.csv | 3 + ...tiveopf_results_vsc_converter_stations.csv | 1 + .../invalid/reactiveopf_results_indic.txt | 83 +++++++++++++++++++ .../valid/reactiveopf_results_generators.csv | 2 + .../valid/reactiveopf_results_indic.txt | 82 ++++++++++++++++++ .../valid/reactiveopf_results_rtc.csv | 1 + .../valid/reactiveopf_results_shunts.csv | 1 + ...iveopf_results_static_var_compensators.csv | 1 + .../valid/reactiveopf_results_voltages.csv | 3 + ...tiveopf_results_vsc_converter_stations.csv | 1 + .../invalid/reactiveopf_results_indic.txt | 83 +++++++++++++++++++ .../valid/reactiveopf_results_generators.csv | 2 + .../valid/reactiveopf_results_indic.txt | 82 ++++++++++++++++++ .../valid/reactiveopf_results_rtc.csv | 1 + .../valid/reactiveopf_results_shunts.csv | 1 + ...iveopf_results_static_var_compensators.csv | 1 + .../valid/reactiveopf_results_voltages.csv | 3 + ...tiveopf_results_vsc_converter_stations.csv | 1 + .../invalid/reactiveopf_results_indic.txt | 83 +++++++++++++++++++ .../valid/reactiveopf_results_generators.csv | 2 + .../valid/reactiveopf_results_indic.txt | 82 ++++++++++++++++++ .../valid/reactiveopf_results_rtc.csv | 1 + .../valid/reactiveopf_results_shunts.csv | 1 + ...iveopf_results_static_var_compensators.csv | 1 + .../valid/reactiveopf_results_voltages.csv | 3 + ...tiveopf_results_vsc_converter_stations.csv | 1 + .../invalid/reactiveopf_results_indic.txt | 83 +++++++++++++++++++ .../valid/reactiveopf_results_generators.csv | 2 + .../valid/reactiveopf_results_indic.txt | 82 ++++++++++++++++++ .../valid/reactiveopf_results_rtc.csv | 1 + .../valid/reactiveopf_results_shunts.csv | 1 + ...iveopf_results_static_var_compensators.csv | 1 + .../valid/reactiveopf_results_voltages.csv | 3 + ...tiveopf_results_vsc_converter_stations.csv | 1 + .../invalid/reactiveopf_results_indic.txt | 83 +++++++++++++++++++ .../valid/reactiveopf_results_generators.csv | 2 + .../valid/reactiveopf_results_indic.txt | 82 ++++++++++++++++++ .../valid/reactiveopf_results_rtc.csv | 1 + .../valid/reactiveopf_results_shunts.csv | 1 + ...iveopf_results_static_var_compensators.csv | 1 + .../valid/reactiveopf_results_voltages.csv | 3 + ...tiveopf_results_vsc_converter_stations.csv | 1 + .../invalid/reactiveopf_results_indic.txt | 83 +++++++++++++++++++ .../valid/reactiveopf_results_generators.csv | 3 + .../valid}/reactiveopf_results_indic.txt | 52 ++++++------ .../valid/reactiveopf_results_rtc.csv | 1 + .../valid/reactiveopf_results_shunts.csv | 1 + ...iveopf_results_static_var_compensators.csv | 1 + .../valid/reactiveopf_results_voltages.csv | 3 + ...tiveopf_results_vsc_converter_stations.csv | 1 + .../invalid/reactiveopf_results_indic.txt | 83 +++++++++++++++++++ .../valid/reactiveopf_results_generators.csv | 2 + .../valid/reactiveopf_results_indic.txt | 82 ++++++++++++++++++ .../valid/reactiveopf_results_rtc.csv | 1 + .../valid/reactiveopf_results_shunts.csv | 1 + ...iveopf_results_static_var_compensators.csv | 1 + .../valid/reactiveopf_results_voltages.csv | 3 + ...tiveopf_results_vsc_converter_stations.csv | 1 + 67 files changed, 1361 insertions(+), 49 deletions(-) create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/invalid/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_generators.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_rtc.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_shunts.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_static_var_compensators.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_voltages.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_vsc_converter_stations.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/invalid/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_generators.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_rtc.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_shunts.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_static_var_compensators.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_voltages.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_vsc_converter_stations.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/invalid/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_generators.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_rtc.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_shunts.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_static_var_compensators.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_voltages.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_vsc_converter_stations.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/invalid/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_generators.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_rtc.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_shunts.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_static_var_compensators.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_voltages.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_vsc_converter_stations.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/invalid/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_generators.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_rtc.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_shunts.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_static_var_compensators.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_voltages.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_vsc_converter_stations.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/invalid/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_generators.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_rtc.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_shunts.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_static_var_compensators.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_voltages.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_vsc_converter_stations.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/invalid/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_generators.csv rename open-reac/src/test/resources/optimization/bounds/{generator-rectangular-bounds => generator-q-bounds-taken-at-pmax/valid}/reactiveopf_results_indic.txt (68%) create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_rtc.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_shunts.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_static_var_compensators.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_voltages.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_vsc_converter_stations.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/invalid/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_generators.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_rtc.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_shunts.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_static_var_compensators.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_voltages.csv create mode 100644 open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_vsc_converter_stations.csv diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java index ce4d3c1b..2b9e328b 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/AbstractOpenReacRunnerTest.java @@ -12,6 +12,7 @@ import com.powsybl.commons.test.ComparisonUtils; import com.powsybl.computation.ComputationManager; import com.powsybl.computation.local.LocalCommandExecutor; +import com.powsybl.computation.local.LocalComputationConfig; import com.powsybl.computation.local.LocalComputationManager; import com.powsybl.iidm.network.*; import com.powsybl.loadflow.LoadFlow; @@ -31,6 +32,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.concurrent.ForkJoinPool; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -133,14 +135,11 @@ protected OpenReacResult runOpenReac(Network network, String subFolder, OpenReac } LocalCommandExecutor localCommandExecutor = new TestLocalCommandExecutor(outputFileNames); // To really run open reac, use the commentede line below. Be sure that open-reac/src/test/resources/com/powsybl/config/test/config.yml contains your ampl path - try (ComputationManager computationManager = new LocalComputationManager()) { -// try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), -// localCommandExecutor, ForkJoinPool.commonPool())) { -// parameters.setLogLevelAmpl(OpenReacAmplLogLevel.DEBUG); - OpenReacResult result = OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, +// try (ComputationManager computationManager = new LocalComputationManager()) { + try (ComputationManager computationManager = new LocalComputationManager(new LocalComputationConfig(tmpDir), + localCommandExecutor, ForkJoinPool.commonPool())) { + return OpenReacRunner.run(network, network.getVariantManager().getWorkingVariantId(), parameters, new OpenReacConfig(true), computationManager, reportNode, null); -// System.out.println(result.getIndicators().get("directory")); - return result; } } diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java index c8c9d652..0d0810e2 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java @@ -118,7 +118,7 @@ void testGeneratorQBoundsInterpolatedBetweenMinPMaxP() throws IOException { .setMaxQ(200) .endPoint() .add(); - testAllModifAndLoadFlow(network, "", parameters, ReportNode.NO_OP); + testAllModifAndLoadFlow(network, "optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid", parameters, ReportNode.NO_OP); // verify non convergence due to insufficient bounds network = create(101, 50, 150, 150); @@ -134,7 +134,7 @@ void testGeneratorQBoundsInterpolatedBetweenMinPMaxP() throws IOException { .setMaxQ(150) .endPoint() .add(); - OpenReacResult result = runOpenReac(network, "", parameters, false); + OpenReacResult result = runOpenReac(network, "optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/invalid", parameters, true); assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); } @@ -155,7 +155,7 @@ void testGeneratorQBoundsInterpolatedBetweenMinPMaxP2() throws IOException { .setMaxQ(5) .endPoint() .add(); - testAllModifAndLoadFlow(network, "", parameters, ReportNode.NO_OP); + testAllModifAndLoadFlow(network, "optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid", parameters, ReportNode.NO_OP); // verify non convergence due to insufficient bounds network.getGenerator("g1").newReactiveCapabilityCurve() @@ -170,7 +170,7 @@ void testGeneratorQBoundsInterpolatedBetweenMinPMaxP2() throws IOException { .setMaxQ(5) .endPoint() .add(); - OpenReacResult result = runOpenReac(network, "", parameters, false); + OpenReacResult result = runOpenReac(network, "optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/invalid", parameters, true); assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); } @@ -190,7 +190,7 @@ void testGeneratorQBoundsInterpolatedBetweenP0MaxP() throws IOException { .setMaxQ(300) .endPoint() .add(); - testAllModifAndLoadFlow(network, "", parameters, ReportNode.NO_OP); + testAllModifAndLoadFlow(network, "optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid", parameters, ReportNode.NO_OP); // verify non convergence due to insufficient bounds network.getGenerator("g1").newReactiveCapabilityCurve() @@ -205,7 +205,7 @@ void testGeneratorQBoundsInterpolatedBetweenP0MaxP() throws IOException { .setMaxQ(100) .endPoint() .add(); - OpenReacResult result = runOpenReac(network, "", parameters, false); + OpenReacResult result = runOpenReac(network, "optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/invalid", parameters, true); assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); } @@ -226,7 +226,7 @@ void testGeneratorQBoundsInterpolatedBetweenP0MaxP2() throws IOException { .setMaxQ(1) .endPoint() .add(); - testAllModifAndLoadFlow(network, "", parameters, ReportNode.NO_OP); + testAllModifAndLoadFlow(network, "optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid", parameters, ReportNode.NO_OP); // verify non convergence due to insufficient bounds network.getGenerator("g1").newReactiveCapabilityCurve() @@ -241,7 +241,7 @@ void testGeneratorQBoundsInterpolatedBetweenP0MaxP2() throws IOException { .setMaxQ(1) .endPoint() .add(); - OpenReacResult result = runOpenReac(network, "", parameters, false); + OpenReacResult result = runOpenReac(network, "optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/invalid", parameters, true); assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); } @@ -261,7 +261,7 @@ void testGeneratorQBoundsInterpolatedBetweenP0MinP() throws IOException { .setMaxQ(150) .endPoint() .add(); - testAllModifAndLoadFlow(network, "", parameters, ReportNode.NO_OP); + testAllModifAndLoadFlow(network, "optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid", parameters, ReportNode.NO_OP); // verify non convergence due to insufficient bounds network.getGenerator("g1").newReactiveCapabilityCurve() @@ -276,7 +276,7 @@ void testGeneratorQBoundsInterpolatedBetweenP0MinP() throws IOException { .setMaxQ(140) .endPoint() .add(); - OpenReacResult result = runOpenReac(network, "", parameters, false); + OpenReacResult result = runOpenReac(network, "optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/invalid", parameters, true); assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); } @@ -297,7 +297,7 @@ void testGeneratorQBoundsInterpolatedBetweenP0MinP2() throws IOException { .setMaxQ(4) .endPoint() .add(); - testAllModifAndLoadFlow(network, "", parameters, ReportNode.NO_OP); + testAllModifAndLoadFlow(network, "optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid", parameters, ReportNode.NO_OP); // verify non convergence due to insufficient bounds network.getGenerator("g1").newReactiveCapabilityCurve() @@ -312,7 +312,7 @@ void testGeneratorQBoundsInterpolatedBetweenP0MinP2() throws IOException { .setMaxQ(3) .endPoint() .add(); - OpenReacResult result = runOpenReac(network, "", parameters, false); + OpenReacResult result = runOpenReac(network, "optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/invalid", parameters, true); assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); } @@ -343,7 +343,7 @@ void testGeneratorQBoundsTakenAtMaxP() throws IOException { .setMaxP(2) .setVoltageRegulatorOn(true) .add(); - testAllModifAndLoadFlow(network, "", parameters, ReportNode.NO_OP); + testAllModifAndLoadFlow(network, "optimization/bounds/generator-q-bounds-taken-at-pmax/valid", parameters, ReportNode.NO_OP); // verify non convergence due to insufficient bounds network.getGenerator("g1").newReactiveCapabilityCurve() @@ -358,7 +358,7 @@ void testGeneratorQBoundsTakenAtMaxP() throws IOException { .setMaxQ(149) .endPoint() .add(); - OpenReacResult result = runOpenReac(network, "", parameters, false); + OpenReacResult result = runOpenReac(network, "optimization/bounds/generator-q-bounds-taken-at-pmax/invalid", parameters, true); assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); } @@ -379,7 +379,7 @@ void testGeneratorQBoundsTakenAtMinP() throws IOException { .setMaxQ(10) .endPoint() .add(); - testAllModifAndLoadFlow(network, "", parameters, ReportNode.NO_OP); + testAllModifAndLoadFlow(network, "optimization/bounds/generator-q-bounds-taken-at-pmin/valid", parameters, ReportNode.NO_OP); // verify non convergence due to insufficient bounds network.getGenerator("g1").newReactiveCapabilityCurve() @@ -394,7 +394,7 @@ void testGeneratorQBoundsTakenAtMinP() throws IOException { .setMaxQ(1.99) .endPoint() .add(); - OpenReacResult result = runOpenReac(network, "", parameters, false); + OpenReacResult result = runOpenReac(network, "optimization/bounds/generator-q-bounds-taken-at-pmin/invalid", parameters, true); assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); } diff --git a/open-reac/src/test/resources/com/powsybl/config/test/config.yml b/open-reac/src/test/resources/com/powsybl/config/test/config.yml index 9d797384..1acd4f0d 100644 --- a/open-reac/src/test/resources/com/powsybl/config/test/config.yml +++ b/open-reac/src/test/resources/com/powsybl/config/test/config.yml @@ -1,2 +1,2 @@ ampl: - homeDir: D:\AMPL-13.1.20220703-Win-64 + homeDir: ??? diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/invalid/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/invalid/reactiveopf_results_indic.txt new file mode 100644 index 00000000..aa3bd527 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/invalid/reactiveopf_results_indic.txt @@ -0,0 +1,83 @@ +final_status NOK +dcopf_status OK + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 CONFIGURED +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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 2 +nb_bus_with_reactive_slacks 0 +nb_bus_without_reactive_slacks 2 +nb_branch_in_data_file 1 +nb_branch_in_AC_CC 1 +nb_branch_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc -0.00 +min_teta_ac -0.00 +teta_min -3.00 +max_delta_teta_dc -0.000075 +max_delta_teta_ac -0.000100 +min_delta_teta_dc -0.000075 +min_delta_teta_ac -0.000100 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 +messageInfo1 'Acopf optimization was ***not*** successfull - Convergence to an infeasible solution' diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_generators.csv new file mode 100644 index 00000000..db545f16 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_generators.csv @@ -0,0 +1,2 @@ +#variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW); +1;1;1;'true';1.142;-4.0;-4.0;4.0;4.0; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_indic.txt new file mode 100644 index 00000000..123d4fed --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_indic.txt @@ -0,0 +1,82 @@ +final_status OK +dcopf_status OK + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 CONFIGURED +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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_branch_in_data_file 1 +nb_branch_in_AC_CC 1 +nb_branch_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc -0.00 +min_teta_ac -0.00 +teta_min -3.00 +max_delta_teta_dc -0.000075 +max_delta_teta_ac -0.000056 +min_delta_teta_dc -0.000075 +min_delta_teta_ac -0.000056 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_rtc.csv new file mode 100644 index 00000000..9a62a138 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_rtc.csv @@ -0,0 +1 @@ +#variant;num;tap; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_shunts.csv new file mode 100644 index 00000000..8d515fde --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_shunts.csv @@ -0,0 +1 @@ +#variant;num;bus;b(pu);Q(Mvar);section; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_static_var_compensators.csv new file mode 100644 index 00000000..6792ddb9 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_static_var_compensators.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;V(pu);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_voltages.csv new file mode 100644 index 00000000..e28a6229 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_voltages.csv @@ -0,0 +1,3 @@ +#variant;bus;V(pu);theta(rad);id; +1;1;1.142;-0.000;"vl1_0"; +1;2;1.142;0.000;"vl2_0"; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_vsc_converter_stations.csv new file mode 100644 index 00000000..aa24858c --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/negative-pmax/valid/reactiveopf_results_vsc_converter_stations.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;targetV(pu);targetQ(Mvar);P(MW);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/invalid/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/invalid/reactiveopf_results_indic.txt new file mode 100644 index 00000000..9427d181 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/invalid/reactiveopf_results_indic.txt @@ -0,0 +1,83 @@ +final_status NOK +dcopf_status OK + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 CONFIGURED +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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 2 +nb_bus_with_reactive_slacks 0 +nb_bus_without_reactive_slacks 2 +nb_branch_in_data_file 1 +nb_branch_in_AC_CC 1 +nb_branch_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.001894 +max_delta_teta_ac 0.000823 +min_delta_teta_dc 0.001894 +min_delta_teta_ac 0.000823 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 +messageInfo1 'Acopf optimization was ***not*** successfull - Convergence to an infeasible solution' diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_generators.csv new file mode 100644 index 00000000..22a6c14a --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_generators.csv @@ -0,0 +1,2 @@ +#variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW); +1;1;1;'true';0.909;101.0;150.7;-101.0;-150.7; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_indic.txt new file mode 100644 index 00000000..ac8db301 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_indic.txt @@ -0,0 +1,82 @@ +final_status OK +dcopf_status OK + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 CONFIGURED +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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_branch_in_data_file 1 +nb_branch_in_AC_CC 1 +nb_branch_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.001894 +max_delta_teta_ac 0.002186 +min_delta_teta_dc 0.001894 +min_delta_teta_ac 0.002186 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_rtc.csv new file mode 100644 index 00000000..9a62a138 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_rtc.csv @@ -0,0 +1 @@ +#variant;num;tap; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_shunts.csv new file mode 100644 index 00000000..8d515fde --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_shunts.csv @@ -0,0 +1 @@ +#variant;num;bus;b(pu);Q(Mvar);section; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_static_var_compensators.csv new file mode 100644 index 00000000..6792ddb9 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_static_var_compensators.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;V(pu);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_voltages.csv new file mode 100644 index 00000000..e88977d6 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_voltages.csv @@ -0,0 +1,3 @@ +#variant;bus;V(pu);theta(rad);id; +1;1;0.909;0.002;"vl1_0"; +1;2;0.906;0.000;"vl2_0"; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_vsc_converter_stations.csv new file mode 100644 index 00000000..aa24858c --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmax/positive-pmax/valid/reactiveopf_results_vsc_converter_stations.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;targetV(pu);targetQ(Mvar);P(MW);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/invalid/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/invalid/reactiveopf_results_indic.txt new file mode 100644 index 00000000..8769ee82 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/invalid/reactiveopf_results_indic.txt @@ -0,0 +1,83 @@ +final_status NOK +dcopf_status OK + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 CONFIGURED +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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 2 +nb_bus_with_reactive_slacks 0 +nb_bus_without_reactive_slacks 2 +nb_branch_in_data_file 1 +nb_branch_in_AC_CC 1 +nb_branch_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc -0.00 +min_teta_ac -0.00 +teta_min -3.00 +max_delta_teta_dc -0.000096 +max_delta_teta_ac -0.000131 +min_delta_teta_dc -0.000096 +min_delta_teta_ac -0.000131 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 +messageInfo1 'Acopf optimization was ***not*** successfull - Convergence to an infeasible solution' diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_generators.csv new file mode 100644 index 00000000..64a63c2c --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_generators.csv @@ -0,0 +1,2 @@ +#variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW); +1;1;1;'true';1.150;-5.1;-2.0;5.1;2.0; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_indic.txt new file mode 100644 index 00000000..cf65215a --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_indic.txt @@ -0,0 +1,82 @@ +final_status OK +dcopf_status OK + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 CONFIGURED +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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_branch_in_data_file 1 +nb_branch_in_AC_CC 1 +nb_branch_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc -0.00 +min_teta_ac -0.00 +teta_min -3.00 +max_delta_teta_dc -0.000096 +max_delta_teta_ac -0.000071 +min_delta_teta_dc -0.000096 +min_delta_teta_ac -0.000071 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_rtc.csv new file mode 100644 index 00000000..9a62a138 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_rtc.csv @@ -0,0 +1 @@ +#variant;num;tap; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_shunts.csv new file mode 100644 index 00000000..8d515fde --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_shunts.csv @@ -0,0 +1 @@ +#variant;num;bus;b(pu);Q(Mvar);section; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_static_var_compensators.csv new file mode 100644 index 00000000..6792ddb9 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_static_var_compensators.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;V(pu);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_voltages.csv new file mode 100644 index 00000000..433fbf47 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_voltages.csv @@ -0,0 +1,3 @@ +#variant;bus;V(pu);theta(rad);id; +1;1;1.150;-0.000;"vl1_0"; +1;2;1.150;0.000;"vl2_0"; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_vsc_converter_stations.csv new file mode 100644 index 00000000..aa24858c --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/negative-pmin/valid/reactiveopf_results_vsc_converter_stations.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;targetV(pu);targetQ(Mvar);P(MW);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/invalid/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/invalid/reactiveopf_results_indic.txt new file mode 100644 index 00000000..f2426d7a --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/invalid/reactiveopf_results_indic.txt @@ -0,0 +1,83 @@ +final_status NOK +dcopf_status OK + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 CONFIGURED +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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 2 +nb_bus_with_reactive_slacks 0 +nb_bus_without_reactive_slacks 2 +nb_branch_in_data_file 1 +nb_branch_in_AC_CC 1 +nb_branch_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.001894 +max_delta_teta_ac 0.000816 +min_delta_teta_dc 0.001894 +min_delta_teta_ac 0.000816 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 +messageInfo1 'Acopf optimization was ***not*** successfull - Convergence to an infeasible solution' diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_generators.csv new file mode 100644 index 00000000..2f26fd6f --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_generators.csv @@ -0,0 +1,2 @@ +#variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW); +1;1;1;'true';0.804;101.0;100.6;-101.0;-100.6; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_indic.txt new file mode 100644 index 00000000..058c28fc --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_indic.txt @@ -0,0 +1,82 @@ +final_status OK +dcopf_status OK + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 CONFIGURED +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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_branch_in_data_file 1 +nb_branch_in_AC_CC 1 +nb_branch_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.001894 +max_delta_teta_ac 0.002845 +min_delta_teta_dc 0.001894 +min_delta_teta_ac 0.002845 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_rtc.csv new file mode 100644 index 00000000..9a62a138 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_rtc.csv @@ -0,0 +1 @@ +#variant;num;tap; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_shunts.csv new file mode 100644 index 00000000..8d515fde --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_shunts.csv @@ -0,0 +1 @@ +#variant;num;bus;b(pu);Q(Mvar);section; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_static_var_compensators.csv new file mode 100644 index 00000000..6792ddb9 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_static_var_compensators.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;V(pu);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_voltages.csv new file mode 100644 index 00000000..f2adc304 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_voltages.csv @@ -0,0 +1,3 @@ +#variant;bus;V(pu);theta(rad);id; +1;1;0.804;0.003;"vl1_0"; +1;2;0.801;0.000;"vl2_0"; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_vsc_converter_stations.csv new file mode 100644 index 00000000..aa24858c --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-0-pmin/positive-pmin/valid/reactiveopf_results_vsc_converter_stations.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;targetV(pu);targetQ(Mvar);P(MW);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/invalid/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/invalid/reactiveopf_results_indic.txt new file mode 100644 index 00000000..4c81c6be --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/invalid/reactiveopf_results_indic.txt @@ -0,0 +1,83 @@ +final_status NOK +dcopf_status OK + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 CONFIGURED +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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 2 +nb_bus_with_reactive_slacks 0 +nb_bus_without_reactive_slacks 2 +nb_branch_in_data_file 1 +nb_branch_in_AC_CC 1 +nb_branch_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc -0.00 +min_teta_ac -0.00 +teta_min -3.00 +max_delta_teta_dc -0.000187 +max_delta_teta_ac -0.000251 +min_delta_teta_dc -0.000187 +min_delta_teta_ac -0.000251 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 +messageInfo1 'Acopf optimization was ***not*** successfull - Convergence to an infeasible solution' diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_generators.csv new file mode 100644 index 00000000..aebabdb1 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_generators.csv @@ -0,0 +1,2 @@ +#variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW); +1;1;1;'true';1.150;-10.0;-10.0;10.0;10.0; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_indic.txt new file mode 100644 index 00000000..b6fd686d --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_indic.txt @@ -0,0 +1,82 @@ +final_status OK +dcopf_status OK + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 CONFIGURED +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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_branch_in_data_file 1 +nb_branch_in_AC_CC 1 +nb_branch_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc -0.00 +min_teta_ac -0.00 +teta_min -3.00 +max_delta_teta_dc -0.000187 +max_delta_teta_ac -0.000137 +min_delta_teta_dc -0.000187 +min_delta_teta_ac -0.000137 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_rtc.csv new file mode 100644 index 00000000..9a62a138 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_rtc.csv @@ -0,0 +1 @@ +#variant;num;tap; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_shunts.csv new file mode 100644 index 00000000..8d515fde --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_shunts.csv @@ -0,0 +1 @@ +#variant;num;bus;b(pu);Q(Mvar);section; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_static_var_compensators.csv new file mode 100644 index 00000000..6792ddb9 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_static_var_compensators.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;V(pu);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_voltages.csv new file mode 100644 index 00000000..433fbf47 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_voltages.csv @@ -0,0 +1,3 @@ +#variant;bus;V(pu);theta(rad);id; +1;1;1.150;-0.000;"vl1_0"; +1;2;1.150;0.000;"vl2_0"; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_vsc_converter_stations.csv new file mode 100644 index 00000000..aa24858c --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/negative-pmax/valid/reactiveopf_results_vsc_converter_stations.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;targetV(pu);targetQ(Mvar);P(MW);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/invalid/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/invalid/reactiveopf_results_indic.txt new file mode 100644 index 00000000..917f5439 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/invalid/reactiveopf_results_indic.txt @@ -0,0 +1,83 @@ +final_status NOK +dcopf_status OK + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 CONFIGURED +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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_branch_in_data_file 1 +nb_branch_in_AC_CC 1 +nb_branch_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.001894 +max_delta_teta_ac 0.000806 +min_delta_teta_dc 0.001894 +min_delta_teta_ac 0.000806 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 +messageInfo1 'Acopf optimization was ***not*** successfull - Convergence to an infeasible solution' diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_generators.csv new file mode 100644 index 00000000..a813d90c --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_generators.csv @@ -0,0 +1,2 @@ +#variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW); +1;1;1;'true';0.912;101.0;150.7;-101.0;-150.7; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_indic.txt new file mode 100644 index 00000000..73448211 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_indic.txt @@ -0,0 +1,82 @@ +final_status OK +dcopf_status OK + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 CONFIGURED +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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_branch_in_data_file 1 +nb_branch_in_AC_CC 1 +nb_branch_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.001894 +max_delta_teta_ac 0.002174 +min_delta_teta_dc 0.001894 +min_delta_teta_ac 0.002174 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_rtc.csv new file mode 100644 index 00000000..9a62a138 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_rtc.csv @@ -0,0 +1 @@ +#variant;num;tap; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_shunts.csv new file mode 100644 index 00000000..8d515fde --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_shunts.csv @@ -0,0 +1 @@ +#variant;num;bus;b(pu);Q(Mvar);section; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_static_var_compensators.csv new file mode 100644 index 00000000..6792ddb9 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_static_var_compensators.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;V(pu);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_voltages.csv new file mode 100644 index 00000000..39d3d916 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_voltages.csv @@ -0,0 +1,3 @@ +#variant;bus;V(pu);theta(rad);id; +1;1;0.912;0.002;"vl1_0"; +1;2;0.908;0.000;"vl2_0"; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_vsc_converter_stations.csv new file mode 100644 index 00000000..aa24858c --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-interpolated-between-pmin-pmax/positive-pmin/valid/reactiveopf_results_vsc_converter_stations.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;targetV(pu);targetQ(Mvar);P(MW);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/invalid/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/invalid/reactiveopf_results_indic.txt new file mode 100644 index 00000000..a2324339 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/invalid/reactiveopf_results_indic.txt @@ -0,0 +1,83 @@ +final_status NOK +dcopf_status OK + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 CONFIGURED +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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 2 +nb_bus_with_reactive_slacks 0 +nb_bus_without_reactive_slacks 2 +nb_branch_in_data_file 1 +nb_branch_in_AC_CC 1 +nb_branch_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 2 +nb_unit_in_AC_CC 2 +nb_unit_up_and_running 2 +nb_unit_with_variable_reactive_power 2 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.001912 +max_delta_teta_ac 0.001479 +min_delta_teta_dc 0.001912 +min_delta_teta_ac 0.001479 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 +messageInfo1 'Acopf optimization was ***not*** successfull - no solution found' diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_generators.csv new file mode 100644 index 00000000..4c6bb46a --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_generators.csv @@ -0,0 +1,3 @@ +#variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW); +1;1;1;'true';0.915;102.0;150.7;-102.0;-150.7; +1;2;1;'true';0.915;1.0;0.0;-0.0;-0.0; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-rectangular-bounds/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_indic.txt similarity index 68% rename from open-reac/src/test/resources/optimization/bounds/generator-rectangular-bounds/reactiveopf_results_indic.txt rename to open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_indic.txt index 09e8c47b..604c8700 100644 --- a/open-reac/src/test/resources/optimization/bounds/generator-rectangular-bounds/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_indic.txt @@ -12,7 +12,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 ALL +buses_with_reactive_slacks CONFIGURED PQmax 9000.000000 defaultPmax 1000.000000 defaultPmin 0.000000 @@ -26,24 +26,26 @@ reactive_slack_variable_scaling_factor 0.100000 transformer_ratio_variable_scaling_factor 0.001000 shunt_variable_scaling_factor 0.100000 -nb_substations 5 -nb_bus_in_data_file 5 -nb_bus_in_ACDC_CC 4 -nb_bus_in_AC_CC 4 +nb_substations 2 +nb_bus_in_data_file 2 +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 4 -nb_bus_without_reactive_slacks 0 -nb_branch_in_data_file 4 -nb_branch_in_AC_CC 3 -nb_branch_with_nonsmall_impedance 3 +nb_bus_with_reactive_slacks 0 +nb_bus_without_reactive_slacks 2 +nb_branch_in_data_file 1 +nb_branch_in_AC_CC 1 +nb_branch_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 nb_branch_with_zero_or_small_impedance 0 -nb_unit_in_data_file 3 +nb_unit_in_data_file 2 nb_unit_in_AC_CC 2 nb_unit_up_and_running 2 nb_unit_with_variable_reactive_power 2 nb_unit_with_fixed_reactive_power 0 -nb_load_in_data_file 2 +nb_load_in_data_file 1 nb_load_in_AC_CC 1 nb_shunt_in_data_file 0 nb_shunt_connectable_or_in_AC_CC 0 @@ -62,19 +64,19 @@ nb_batteries 0 sum_batteries_pmax 0.0 sum_batteries_pmin 0.0 -max_teta_dc 0.02 -max_teta_ac 0.01 -teta_max 3.02 -min_teta_dc -0.04 -min_teta_ac -0.02 -teta_min -3.04 -max_delta_teta_dc 0.040000 -max_delta_teta_ac 0.017957 -min_delta_teta_dc -0.020000 -min_delta_teta_ac -0.008898 +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.001912 +max_delta_teta_ac 0.002181 +min_delta_teta_dc 0.001912 +min_delta_teta_ac 0.002181 -nb_reactive_slacks 2 -nb_slacks_condensator 2 -sum_slacks_condensator 1.6 +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 nb_slacks_self 0 sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_rtc.csv new file mode 100644 index 00000000..9a62a138 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_rtc.csv @@ -0,0 +1 @@ +#variant;num;tap; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_shunts.csv new file mode 100644 index 00000000..8d515fde --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_shunts.csv @@ -0,0 +1 @@ +#variant;num;bus;b(pu);Q(Mvar);section; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_static_var_compensators.csv new file mode 100644 index 00000000..6792ddb9 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_static_var_compensators.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;V(pu);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_voltages.csv new file mode 100644 index 00000000..f159572d --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_voltages.csv @@ -0,0 +1,3 @@ +#variant;bus;V(pu);theta(rad);id; +1;1;0.915;0.002;"vl1_0"; +1;2;0.912;0.000;"vl2_0"; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_vsc_converter_stations.csv new file mode 100644 index 00000000..aa24858c --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmax/valid/reactiveopf_results_vsc_converter_stations.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;targetV(pu);targetQ(Mvar);P(MW);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/invalid/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/invalid/reactiveopf_results_indic.txt new file mode 100644 index 00000000..649353e4 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/invalid/reactiveopf_results_indic.txt @@ -0,0 +1,83 @@ +final_status NOK +dcopf_status OK + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 CONFIGURED +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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 2 +nb_bus_with_reactive_slacks 0 +nb_bus_without_reactive_slacks 2 +nb_branch_in_data_file 1 +nb_branch_in_AC_CC 1 +nb_branch_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc -0.00 +min_teta_ac -0.00 +teta_min -3.00 +max_delta_teta_dc -0.000009 +max_delta_teta_ac -0.000013 +min_delta_teta_dc -0.000009 +min_delta_teta_ac -0.000013 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 +messageInfo1 'Acopf optimization was ***not*** successfull - no solution found' diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_generators.csv new file mode 100644 index 00000000..d3dc8723 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_generators.csv @@ -0,0 +1,2 @@ +#variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW); +1;1;1;'true';1.150;-0.5;-0.2;0.5;0.2; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_indic.txt new file mode 100644 index 00000000..b518b2c9 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_indic.txt @@ -0,0 +1,82 @@ +final_status OK +dcopf_status OK + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 CONFIGURED +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +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_branch_in_data_file 1 +nb_branch_in_AC_CC 1 +nb_branch_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 1 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc -0.00 +min_teta_ac -0.00 +teta_min -3.00 +max_delta_teta_dc -0.000009 +max_delta_teta_ac -0.000007 +min_delta_teta_dc -0.000009 +min_delta_teta_ac -0.000007 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_rtc.csv new file mode 100644 index 00000000..9a62a138 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_rtc.csv @@ -0,0 +1 @@ +#variant;num;tap; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_shunts.csv new file mode 100644 index 00000000..8d515fde --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_shunts.csv @@ -0,0 +1 @@ +#variant;num;bus;b(pu);Q(Mvar);section; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_static_var_compensators.csv new file mode 100644 index 00000000..6792ddb9 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_static_var_compensators.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;V(pu);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_voltages.csv new file mode 100644 index 00000000..433fbf47 --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_voltages.csv @@ -0,0 +1,3 @@ +#variant;bus;V(pu);theta(rad);id; +1;1;1.150;-0.000;"vl1_0"; +1;2;1.150;0.000;"vl2_0"; diff --git a/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_vsc_converter_stations.csv new file mode 100644 index 00000000..aa24858c --- /dev/null +++ b/open-reac/src/test/resources/optimization/bounds/generator-q-bounds-taken-at-pmin/valid/reactiveopf_results_vsc_converter_stations.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;targetV(pu);targetQ(Mvar);P(MW);Q(Mvar); From f995fc513bae8cdc08d034988572d52bae1c6a99 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Fri, 3 Jan 2025 15:28:24 +0100 Subject: [PATCH 47/63] Small clean Signed-off-by: p-arvy --- open-reac/src/main/resources/openreac/iidm_importer.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/open-reac/src/main/resources/openreac/iidm_importer.mod b/open-reac/src/main/resources/openreac/iidm_importer.mod index c1a4bb59..c935e204 100644 --- a/open-reac/src/main/resources/openreac/iidm_importer.mod +++ b/open-reac/src/main/resources/openreac/iidm_importer.mod @@ -124,7 +124,7 @@ check {(t,g,n) in UNIT}: t in TIME; check {(t,g,n) in UNIT}: (t,n) in BUS or n==-1; check {(t,g,n) in UNIT}: (t,unit_substation[t,g,n]) in SUBSTATIONS; check {(t,g,n) in UNIT}: (t,unit_vregul_bus[t,g,n]) in BUS or unit_vregul_bus[t,g,n] == -1; -#check {(t,g,n) in UNIT}: unit_Pmax[t,g,n] >= -Pnull; +check {(t,g,n) in UNIT}: abs(unit_Pmax[t,g,n]) >= Pnull; check {(t,g,n) in UNIT}: unit_Pmax[t,g,n] >= unit_Pmin[t,g,n]; # Checks below are useless since values will be corrected for units in UNITON #check {(t,g,n) in UNIT}: unit_Qp[t,g,n] >= unit_qp[t,g,n]; From f2b0a182317cf8b3c8cd329431a9fdf647d1ce24 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Fri, 3 Jan 2025 15:32:35 +0100 Subject: [PATCH 48/63] Clean comments Signed-off-by: p-arvy --- .../optimization/OpecReacOptimizationBoundsTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java index 0d0810e2..c2d076fe 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpecReacOptimizationBoundsTest.java @@ -104,7 +104,7 @@ void testGeneratorQmaxPmaxRatioBounds() throws IOException { @Test void testGeneratorQBoundsInterpolatedBetweenMinPMaxP() throws IOException { - // verify feasibility when minQ/maxQ are interpolated between bounds at MinP and MaxP (0 < minP < targetP < maxP) + // verify feasibility when minQ/maxQ are interpolated between minP and maxP (0 < minP < targetP < maxP) Network network = create(101, 50, 150, 150); network.getGenerator("g1").newReactiveCapabilityCurve() .beginPoint() @@ -140,7 +140,7 @@ void testGeneratorQBoundsInterpolatedBetweenMinPMaxP() throws IOException { @Test void testGeneratorQBoundsInterpolatedBetweenMinPMaxP2() throws IOException { - // verify feasibility when minQ/maxQ are interpolated between bounds at MinP and MaxP (minP < targetP < maxP < 0) + // verify feasibility when minQ/maxQ are interpolated between minP and maxP (minP < targetP < maxP < 0) Network network = create(-10, -20, -5, -10); setDefaultVoltageLimits(network, 0.85, 1.15); network.getGenerator("g1").newReactiveCapabilityCurve() @@ -176,7 +176,7 @@ void testGeneratorQBoundsInterpolatedBetweenMinPMaxP2() throws IOException { @Test void testGeneratorQBoundsInterpolatedBetweenP0MaxP() throws IOException { - // verify feasibility when minQ/maxQ are interpolated between bounds at MinP and P0 (minP < 0 < targetP < maxP) + // verify feasibility when minQ/maxQ are interpolated between P0 and maxP (minP < 0 < targetP < maxP) Network network = create(101, -50, 150, 150); network.getGenerator("g1").newReactiveCapabilityCurve() .beginPoint() @@ -211,7 +211,7 @@ void testGeneratorQBoundsInterpolatedBetweenP0MaxP() throws IOException { @Test void testGeneratorQBoundsInterpolatedBetweenP0MaxP2() throws IOException { - // verify feasibility when minQ/maxQ are interpolated between bounds at MinP and P0 (maxP < targetP < 0) + // verify feasibility when minQ/maxQ are interpolated between P0 and maxP (maxP < targetP < 0) Network network = create(-4, -20, -5, -4); setDefaultVoltageLimits(network, 0.85, 1.15); network.getGenerator("g1").newReactiveCapabilityCurve() @@ -247,7 +247,7 @@ void testGeneratorQBoundsInterpolatedBetweenP0MaxP2() throws IOException { @Test void testGeneratorQBoundsInterpolatedBetweenP0MinP() throws IOException { - // verify feasibility when minQ/maxQ are interpolated between bounds at MinP and P0 (0 < targetP < minP) + // verify feasibility when minQ/maxQ are interpolated between minP and P0 (0 < targetP < minP) Network network = create(101, 150, 200, 100); network.getGenerator("g1").newReactiveCapabilityCurve() .beginPoint() @@ -282,7 +282,7 @@ void testGeneratorQBoundsInterpolatedBetweenP0MinP() throws IOException { @Test void testGeneratorQBoundsInterpolatedBetweenP0MinP2() throws IOException { - // verify feasibility when minQ/maxQ are interpolated between bounds at MinP and P0 (minP < targetP < 0 < maxP) + // verify feasibility when minQ/maxQ are interpolated between minP and P0 (minP < targetP < 0 < maxP) Network network = create(-5.1, -10, 10, -2); setDefaultVoltageLimits(network, 0.85, 1.15); network.getGenerator("g1").newReactiveCapabilityCurve() From 43ff4041334b81114a4d9169bca4ad70e60963a2 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Fri, 3 Jan 2025 15:41:59 +0100 Subject: [PATCH 49/63] remove useless check Signed-off-by: p-arvy --- open-reac/src/main/resources/openreac/iidm_importer.mod | 1 - 1 file changed, 1 deletion(-) diff --git a/open-reac/src/main/resources/openreac/iidm_importer.mod b/open-reac/src/main/resources/openreac/iidm_importer.mod index c935e204..5b891322 100644 --- a/open-reac/src/main/resources/openreac/iidm_importer.mod +++ b/open-reac/src/main/resources/openreac/iidm_importer.mod @@ -124,7 +124,6 @@ check {(t,g,n) in UNIT}: t in TIME; check {(t,g,n) in UNIT}: (t,n) in BUS or n==-1; check {(t,g,n) in UNIT}: (t,unit_substation[t,g,n]) in SUBSTATIONS; check {(t,g,n) in UNIT}: (t,unit_vregul_bus[t,g,n]) in BUS or unit_vregul_bus[t,g,n] == -1; -check {(t,g,n) in UNIT}: abs(unit_Pmax[t,g,n]) >= Pnull; check {(t,g,n) in UNIT}: unit_Pmax[t,g,n] >= unit_Pmin[t,g,n]; # Checks below are useless since values will be corrected for units in UNITON #check {(t,g,n) in UNIT}: unit_Qp[t,g,n] >= unit_qp[t,g,n]; From 73363fd4e90f05885391b25a019f6ce6829ff3d3 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Fri, 3 Jan 2025 19:42:22 +0100 Subject: [PATCH 50/63] Update comments Signed-off-by: p-arvy --- docs/optimizer/preprocessing.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/optimizer/preprocessing.md b/docs/optimizer/preprocessing.md index 47925116..b0f7588b 100644 --- a/docs/optimizer/preprocessing.md +++ b/docs/optimizer/preprocessing.md @@ -64,22 +64,22 @@ The formula also applies when the active target is between $0$ and $P_{g}^{min,c - $Q_{g}^{max,c} = Qp0_{g}^{c} + \frac{P_{g}^{t}}{P_{g}^{max,c}}(QP_{g}^{c}-Qp0_{g}^{c})$ This is illustrated in the following figure: -![Reactive diagram correction](_static/img/reactive-bounds-ptarget-between-0-pmax.PNG){width="50%" align=center} +![Reactive diagram between 0 and Pmax](_static/img/reactive-bounds-ptarget-between-0-pmax.PNG){width="50%" align=center} The following corner cases are important to clarify: - If the generator has an active power target located between $0$ and $P_{g}^{min,c}$ (e.g., during ramp up), the interpolation is performed between the points $0$ and $P_{g}^{min,c}$, as follows: -![Reactive diagram correction](_static/img/reactive-bounds-ptarget-between-0-pmin.PNG){width="50%" align=center} +![Reactive diagram between 0 and Pmin](_static/img/reactive-bounds-ptarget-between-0-pmin.PNG){width="50%" align=center} - If the generator has a target greater (resp. smaller) than its upper (resp. lower) active power bound, and this bound is greater (resp. smaller) than $0$, then the corrected reactive bounds are taken at $P_{g}^{max,c}$ (resp. $P_{g}^{min,c}$), as follows: -![Reactive diagram correction](_static/img/reactive-bounds-ptarget-higher-than-pmax.PNG){width="50%" align=center} +![Reactive diagram taken at Pmax](_static/img/reactive-bounds-ptarget-higher-than-pmax.PNG){width="50%" align=center} - If corrected active bounds $P_{g}^{min,c}$ and $P_{g}^{max,c}$ are too close, and the target of the generator is located between these points, then the corrected reactive bounds are taken as the midpoint of the extreme points of the diagram. The same applies if $0$ and $P_{g}^{min,c}$ or $0$ and $P_{g}^{max,c}$ are too close, and that the target is located between. This is illustrated below: -![Reactive diagram correction](_static/img/reactive-bounds-ptarget-in-active-bounds-too-close.PNG){width="50%" align=center} +![Reactive diagram when active bounds are too close](_static/img/reactive-bounds-ptarget-in-active-bounds-too-close.PNG){width="50%" align=center} Please note that in the end, the corrected bounds are used in the reactive OPF (see [AC optimal powerflow](acOptimalPowerflow.md). In addition, note that bounds $qP_{g}^0$ and $Qp_{g}^0$ are only used to interpolate the corrected bounds $Q_{g}^{min,c}$ and $Q_{g}^{max,c}$, From 425c8dd2f9cfd97352fe530a2e30083053e9236e Mon Sep 17 00:00:00 2001 From: Florian Dupuy Date: Fri, 20 Dec 2024 13:44:05 +0100 Subject: [PATCH 51/63] Bump powsybl-core to 6.6.0 Signed-off-by: Florian Dupuy --- open-reac/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/open-reac/pom.xml b/open-reac/pom.xml index 40627eaf..028416d0 100644 --- a/open-reac/pom.xml +++ b/open-reac/pom.xml @@ -22,7 +22,7 @@ OpenReac optimizer - 6.5.1 + 6.6.0 1.13.2 From 5e6030238a5e72aeeee6c4c17cb7c91932f681f3 Mon Sep 17 00:00:00 2001 From: Florian Dupuy Date: Fri, 20 Dec 2024 13:46:04 +0100 Subject: [PATCH 52/63] Bump powsybl-open-loadflow to 1.14.1 Signed-off-by: Florian Dupuy --- open-reac/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/open-reac/pom.xml b/open-reac/pom.xml index 028416d0..2d2991a9 100644 --- a/open-reac/pom.xml +++ b/open-reac/pom.xml @@ -23,7 +23,7 @@ 6.6.0 - 1.13.2 + 1.14.1 From 03dbaf6f2210e9fe30563d934aaf24152e6de259 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Wed, 4 Dec 2024 19:26:56 +0100 Subject: [PATCH 53/63] Adapt iidm importer to V2 of extended AMPL exporter Signed-off-by: p-arvy --- .../src/main/resources/openreac/iidm_importer.mod | 5 +++++ .../src/main/resources/openreac/reactiveopf.dat | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/open-reac/src/main/resources/openreac/iidm_importer.mod b/open-reac/src/main/resources/openreac/iidm_importer.mod index 5b891322..73306f4a 100644 --- a/open-reac/src/main/resources/openreac/iidm_importer.mod +++ b/open-reac/src/main/resources/openreac/iidm_importer.mod @@ -108,6 +108,7 @@ param unit_Qp {UNIT}; param unit_vregul {UNIT} symbolic; # Does unit do voltage regulation, or PQ bus? param unit_vregul_bus {UNIT} integer; # Bus regulated by unit, if it does voltage regulation param unit_Vc {UNIT}; # Voltage set point (in case of voltage regulation) +param unit_condenser {UNIT} symbolic; # Is unit a condenser param unit_Pc {UNIT}; # Active power set point param unit_Qc {UNIT}; # Rective power set point (in case no voltage regulation) param unit_fault {UNIT}; @@ -417,6 +418,7 @@ check {(t,cs,n) in VSCCONV}: vscconv_qP[t,cs,n] <= vscconv_QP[t,cs,n]; set LCCCONV dimen 3; # [variant, num, bus] param lccconv_possiblebus {LCCCONV} integer; param lccconv_substation {LCCCONV} integer; +param lccconv_q0 {LCCCONV}; # Load target q of lcc converter station param lccconv_loss_factor {LCCCONV}; param lccconv_power_factor{LCCCONV}; param lccconv_fault {LCCCONV}; @@ -440,7 +442,10 @@ param hvdc_conv2 {HVDC} integer; param hvdc_r {HVDC}; param hvdc_Vnom {HVDC}; param hvdc_convertersMode {HVDC} symbolic; +param hvdc_ac_emul {HVDC} symbolic; # Is the line emulating in AC param hvdc_targetP {HVDC}; +param hvdc_p0 {HVDC}; # Active power offset of ac emulation +param hvdc_k {HVDC}; param hvdc_Pmax {HVDC}; param hvdc_fault {HVDC}; param hvdc_curative {HVDC}; diff --git a/open-reac/src/main/resources/openreac/reactiveopf.dat b/open-reac/src/main/resources/openreac/reactiveopf.dat index 95248550..ed1564f6 100644 --- a/open-reac/src/main/resources/openreac/reactiveopf.dat +++ b/open-reac/src/main/resources/openreac/reactiveopf.dat @@ -25,8 +25,8 @@ param: SUBSTATIONS: substation_horizon substation_fodist substation_Vnomi substa param: BUS: bus_substation bus_CC bus_SC bus_V0 bus_angl0 bus_injA bus_injR bus_slack bus_fault bus_curative bus_id := include ampl_network_buses.txt; # ampl_network_generators.txt -#"variant" "num" "bus" "con. bus" "substation" "minP (MW)" "maxP (MW)" "minQmaxP (MVar)" "minQ0 (MVar)" "minQminP (MVar)" "maxQmaxP (MVar)" "maxQ0 (MVar)" "maxQminP (MVar)" "v regul." "v regul. bus" "targetV (pu)" "targetP (MW)" "targetQ (MVar)" "fault" "curative" "id" "description" "P (MW)" "Q (MVar)" -param: UNIT: unit_potentialbus unit_substation unit_Pmin unit_Pmax unit_qP unit_qp0 unit_qp unit_QP unit_Qp0 unit_Qp unit_vregul unit_vregul_bus unit_Vc unit_Pc unit_Qc unit_fault unit_curative unit_id unit_name unit_P0 unit_Q0 := include ampl_network_generators.txt; +#"variant" "num" "bus" "con. bus" "substation" "minP (MW)" "maxP (MW)" "minQmaxP (MVar)" "minQ0 (MVar)" "minQminP (MVar)" "maxQmaxP (MVar)" "maxQ0 (MVar)" "maxQminP (MVar)" "v regul." "v regul. bus" "targetV (pu)" "condenser" "targetP (MW)" "targetQ (MVar)" "fault" "curative" "id" "description" "P (MW)" "Q (MVar)" +param: UNIT: unit_potentialbus unit_substation unit_Pmin unit_Pmax unit_qP unit_qp0 unit_qp unit_QP unit_Qp0 unit_Qp unit_vregul unit_vregul_bus unit_Vc unit_condenser unit_Pc unit_Qc unit_fault unit_curative unit_id unit_name unit_P0 unit_Q0 := include ampl_network_generators.txt; # ampl_network_loads.txt #"variant" "num" "bus" "substation" "p (MW)" "q (MVar)" "fault" "curative" "id" "description" "p (MW)" "q (MVar)" @@ -41,7 +41,7 @@ param: SHUNT: shunt_possiblebus shunt_substation shunt_valmin shunt_valmax shunt param: SVC: svc_possiblebus svc_substation svc_bmin svc_bmax svc_vregul svc_vregul_bus svc_targetV svc_targetQ svc_fault svc_curative svc_id svc_description svc_P0 svc_Q0 := include ampl_network_static_var_compensators.txt; # ampl_network_batteries.txt -#"variant" "num" "bus" "con. bus" "substation" "p0 (MW)" "q0 (MW)" "minP (MW)" "maxP (MW)" "minQmaxP (MVar)" "minQ0 (MVar)" "minQminP (MVar)" "maxQmaxP (MVar)" "maxQ0 (MVar)" "maxQminP (MVar)" "fault" "curative" "id" "description" "P (MW)" "Q (MVar)" +#"variant" "num" "bus" "con. bus" "substation" "p0 (MW)" "q0 (MVar)" "minP (MW)" "maxP (MW)" "minQmaxP (MVar)" "minQ0 (MVar)" "minQminP (MVar)" "maxQmaxP (MVar)" "maxQ0 (MVar)" "maxQminP (MVar)" "fault" "curative" "id" "description" "P (MW)" "Q (MVar)" param: BATTERY: battery_possiblebus battery_substation battery_p0 battery_q0 battery_Pmin battery_Pmax battery_qP battery_qp0 battery_qp battery_QP battery_Qp0 battery_Qp battery_fault battery_curative battery_id battery_name battery_P0 battery_Q0 := include ampl_network_batteries.txt; # ampl_network_tct.txt @@ -62,13 +62,13 @@ param: DEPH: deph_tap0 deph_table deph_fault deph_curative deph_id := include am param: VSCCONV: vscconv_possiblebus vscconv_substation vscconv_Pmin vscconv_Pmax vscconv_qP vscconv_qp0 vscconv_qp vscconv_QP vscconv_Qp0 vscconv_Qp vscconv_vregul vscconv_targetV vscconv_targetQ vscconv_lossFactor vscconv_fault vscconv_curative vscconv_id vscconv_description vscconv_P0 vscconv_Q0 := include ampl_network_vsc_converter_stations.txt; # ampl_network_lcc_converter_stations.txt -#"variant" "num" "bus" "con. bus" "substation" "lossFactor (%PDC)" "powerFactor" "fault" "curative" "id" "description" "P (MW)" "Q (MVar)" -param: LCCCONV: lccconv_possiblebus lccconv_substation lccconv_loss_factor lccconv_power_factor lccconv_fault lccconv_curative lccconv_id lccconv_description lccconv_P0 lccconv_Q0 := include ampl_network_lcc_converter_stations.txt; +#"variant" "num" "bus" "con. bus" "substation" "q0 (MVar)" "lossFactor (%PDC)" "powerFactor" "fault" "curative" "id" "description" "P (MW)" "Q (MVar)" +param: LCCCONV: lccconv_possiblebus lccconv_substation lccconv_q0 lccconv_loss_factor lccconv_power_factor lccconv_fault lccconv_curative lccconv_id lccconv_description lccconv_P0 lccconv_Q0 := include ampl_network_lcc_converter_stations.txt; #ampl_network_hvdc.txt -#"variant" "num" "type" "converterStation1" "converterStation2" "r (ohm)" "nomV (KV)" "convertersMode" "targetP (MW)" "maxP (MW)" "fault" "curative" "id" "description" +#"variant" "num" "type" "converterStation1" "converterStation2" "r (ohm)" "nomV (KV)" "convertersMode" "ac emul." "targetP (MW)" "P offset (MW)" "k (MW/rad)" "maxP (MW)" "fault" "curative" "id" "description" #ampl_network_hvdc.txt -param: HVDC: hvdc_type hvdc_conv1 hvdc_conv2 hvdc_r hvdc_Vnom hvdc_convertersMode hvdc_targetP hvdc_Pmax hvdc_fault hvdc_curative hvdc_id hvdc_description := include ampl_network_hvdc.txt; +param: HVDC: hvdc_type hvdc_conv1 hvdc_conv2 hvdc_r hvdc_Vnom hvdc_convertersMode hvdc_ac_emul hvdc_targetP hvdc_p0 hvdc_k hvdc_Pmax hvdc_fault hvdc_curative hvdc_id hvdc_description := include ampl_network_hvdc.txt; # ampl_network_branches.txt #"variant" "num" "bus1" "bus2" "3wt num" "sub.1" "sub.2" "r (pu)" "x (pu)" "g1 (pu)" "g2 (pu)" "b1 (pu)" "b2 (pu)" "cst ratio (pu)" "ratio tc" "phase tc" "p1 (MW)" "p2 (MW)" "q1 (MVar)" "q2 (MVar)" "patl1 (A)" "patl2 (A)" "merged" "fault" "curative" "id" "description" From 92fdf34085b3da21ddeab2d8484f993645acc629 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Thu, 2 Jan 2025 10:59:06 +0100 Subject: [PATCH 54/63] Update README Signed-off-by: p-arvy --- docs/optimizer/inputs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/optimizer/inputs.md b/docs/optimizer/inputs.md index 56e289a3..57cd2628 100644 --- a/docs/optimizer/inputs.md +++ b/docs/optimizer/inputs.md @@ -3,7 +3,7 @@ ## Network data Files with the prefix `ampl_` contain the data and the parameters of the network on which the reactive OPF is executed. -These files are obtained by using the [PowSyBl AMPL export](inv:powsyblcore:*:*:#grid_exchange_formats/ampl/export), which is the default version. +[V2 of the extended version of PowSyBl AMPL export](https://github.com/powsybl/powsybl-core/blob/main/ampl-converter/src/main/java/com/powsybl/ampl/converter/version/ExtendedAmplExporterV2.java), which is the default version. ## Configuration of the run From 11992aca2b5eebe3ba05551f2442e9ad25b7d577 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Thu, 2 Jan 2025 14:25:06 +0100 Subject: [PATCH 55/63] Fix targetP/Q used by VSC/LCC converter stations Signed-off-by: p-arvy --- .../src/main/resources/openreac/acopf.mod | 8 ++-- .../src/main/resources/openreac/commons.mod | 39 ++++++++++++++++--- .../openreac/connected_component.run | 6 +-- .../src/main/resources/openreac/dcopf.mod | 4 +- .../src/main/resources/openreac/dcopf.run | 2 +- .../resources/openreac/reactiveopfoutput.run | 2 +- .../com/powsybl/config/test/config.yml | 2 +- 7 files changed, 46 insertions(+), 17 deletions(-) diff --git a/open-reac/src/main/resources/openreac/acopf.mod b/open-reac/src/main/resources/openreac/acopf.mod index a2c717a6..35b42846 100644 --- a/open-reac/src/main/resources/openreac/acopf.mod +++ b/open-reac/src/main/resources/openreac/acopf.mod @@ -134,7 +134,7 @@ var Red_Tran_Rea_Inv{(qq,m,n) in BRANCHCC } = var Red_Tran_Act_Dir_Side_2_Opened{(qq,m,n) in BRANCHCC_WITH_SIDE_2_OPENED} = (branch_Ror[qq,m,n])**2 * V[m] * (branch_Gor_mod[qq,m,n] + (branch_admi[qq,m,n])**2 * branch_Gex_mod[qq,m,n] / ( (branch_Gex_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 - + (- branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) + + (- branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) + ((branch_Bex_mod[qq,m,n])**2 + (branch_Gex_mod[qq,m,n])**2) * branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]) / ( (branch_Gex_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 + (- branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 )) ; @@ -180,9 +180,9 @@ sum{(qq,k,n) in BRANCHCC} base100MVA * V[k] * Red_Tran_Act_Dir[qq,k,n] # Loads + sum{(c,k) in LOADCC} load_PFix[1,c,k] # Fixed value # VSC converters -+ sum{(v,k) in VSCCONVON} vscconv_P0[1,v,k] # Fixed value ++ sum{(v,k) in VSCCONVON} vscconv_targetP[v] # Fixed value # LCC converters -+ sum{(l,k) in LCCCONVON} lccconv_P0[1,l,k] # Fixed value ++ sum{(l,k) in LCCCONVON} lccconv_targetP[l] # Fixed value = 0; # No slack variables for active power. If data are really too bad, may not converge. @@ -220,7 +220,7 @@ sum{(qq,k,n) in BRANCHCC} base100MVA * V[k] * Red_Tran_Rea_Dir[qq,k,n] # VSC converters - sum{(v,k) in VSCCONVON} vscconv_qvar[v,k] # LCC converters -+ sum{(l,k) in LCCCONVON} lccconv_Q0[1,l,k] # Fixed value ++ sum{(l,k) in LCCCONVON} lccconv_q0[1,l,k] # Fixed value # Slack variables + if k in BUSCC_SLACK then (- base100MVA * V[k]^2 * slack1_shunt_B[k] # Homogeneous to a generation of reactive power (condensator) diff --git a/open-reac/src/main/resources/openreac/commons.mod b/open-reac/src/main/resources/openreac/commons.mod index 85b3500a..a80e200e 100644 --- a/open-reac/src/main/resources/openreac/commons.mod +++ b/open-reac/src/main/resources/openreac/commons.mod @@ -72,16 +72,45 @@ set BATTERYCC := setof {(1,b,n) in BATTERY : n in BUSCC} (b,n); # Warning: units with Ptarget=0 are considered as out of order set UNITON := {(g,n) in UNITCC : abs(unit_Pc[1,g,n]) >= Pnull}; +set LCCCONV_NUM := setof{(t,lcc,bus) in LCCCONV}lcc; +set VSCCONV_NUM := setof{(t,vsc,bus) in VSCCONV}vsc; +param lccconv_targetP {LCCCONV_NUM}; +param vscconv_targetP {VSCCONV_NUM}; +for {(1,h) in HVDC} { + # case of VSC converter stations + if (hvdc_type[1,h] == 1) then { + if (hvdc_convertersMode[1,h] == "SIDE_1_RECTIFIER_SIDE_2_INVERTER") then { + let vscconv_targetP[hvdc_conv1[1,h]] := hvdc_targetP[1,h]; + let vscconv_targetP[hvdc_conv2[1,h]] := -hvdc_targetP[1,h]; + } else { + let vscconv_targetP[hvdc_conv1[1,h]] := -hvdc_targetP[1,h]; + let vscconv_targetP[hvdc_conv2[1,h]] := hvdc_targetP[1,h]; + } + } + # case of LCC converter stations + if (hvdc_type[1,h] == 2) then { + if (hvdc_convertersMode[1,h] == "SIDE_1_RECTIFIER_SIDE_2_INVERTER") then { + let lccconv_targetP[hvdc_conv1[1,h]] := hvdc_targetP[1,h]; + let lccconv_targetP[hvdc_conv2[1,h]] := -hvdc_targetP[1,h]; + } else { + let lccconv_targetP[hvdc_conv1[1,h]] := -hvdc_targetP[1,h]; + let lccconv_targetP[hvdc_conv2[1,h]] := hvdc_targetP[1,h]; + } + } +} +check {lcc in LCCCONV_NUM}: lccconv_targetP[lcc] != NaN; +check {vsc in VSCCONV_NUM}: vscconv_targetP[vsc] != NaN; + # # VSC converter stations # set VSCCONVON := setof{(t,v,n) in VSCCONV: n in BUSCC - and abs(vscconv_P0[t,v,n] ) <= PQmax + and abs(vscconv_targetP[v] ) <= PQmax and abs(vscconv_Pmin[t,v,n]) <= PQmax and abs(vscconv_Pmax[t,v,n]) <= PQmax - and vscconv_P0[t,v,n] >= vscconv_Pmin[t,v,n] - and vscconv_P0[t,v,n] <= vscconv_Pmax[t,v,n] + and vscconv_targetP[v] >= vscconv_Pmin[t,v,n] + and vscconv_targetP[v] <= vscconv_Pmax[t,v,n] } (v,n); # @@ -89,8 +118,8 @@ set VSCCONVON := setof{(t,v,n) in VSCCONV: # set LCCCONVON := setof{(t,l,n) in LCCCONV: n in BUSCC - and abs(lccconv_P0[1,l,n]) <= PQmax - and abs(lccconv_Q0[1,l,n]) <= PQmax + and abs(lccconv_targetP[l]) <= PQmax + and abs(lccconv_q0[1,l,n]) <= PQmax } (l,n); diff --git a/open-reac/src/main/resources/openreac/connected_component.run b/open-reac/src/main/resources/openreac/connected_component.run index 8dfe864c..b6007445 100644 --- a/open-reac/src/main/resources/openreac/connected_component.run +++ b/open-reac/src/main/resources/openreac/connected_component.run @@ -122,16 +122,16 @@ if 1 in LOG_INFO then { let temp1 := sum{(c,n) in LOADCC} load_PFix[1,c,n]; let temp2 := sum{(g,n) in UNITON} unit_Pc[1,g,n]; let temp2 := temp2 + sum{(b,n) in BATTERYCC} battery_p0[1,b,n]; -let temp3 := (sum{(vscconv,n) in VSCCONVON} vscconv_P0[1,vscconv,n])+(sum{(l,k) in LCCCONVON} lccconv_P0[1,l,k]); +let temp3 := (sum{(vscconv,n) in VSCCONVON} vscconv_targetP[vscconv])+(sum{(l,k) in LCCCONVON} lccconv_targetP[l]); let global_initial_losses_ratio := (temp2-temp1-temp3)/(temp1+temp3); printf{LOG_INFO} "HVDC injections (homogeneous to loads):\n"; for {(v,n) in VSCCONVON} printf{LOG_INFO} "VSC converter %Q in %Q: P0=%.1fMW is fixed, Q is variable\n", - vscconv_id[1,v,n],substation_id[1,bus_substation[1,n]],vscconv_P0[1,v,n]; + vscconv_id[1,v,n],substation_id[1,bus_substation[1,n]],vscconv_targetP[v]; for {(l,n) in LCCCONVON} printf{LOG_INFO} "LCC converter %Q in %Q: P0=%.1fMW is fixed, Q0=%.1fMvar is fixed\n", - lccconv_id[1,l,n],substation_id[1,bus_substation[1,n]],lccconv_P0[1,l,n],lccconv_Q0[1,l,n]; + lccconv_id[1,l,n],substation_id[1,bus_substation[1,n]],lccconv_targetP[l],lccconv_q0[1,l,n]; printf{LOG_INFO} "Sum of HVDC conv. H: %.0f MW\n", temp3; printf{LOG_INFO} "Sum of loads C: %.0f MW\n", temp1; printf{LOG_INFO} "Sum of generations P: %.0f MW\n", temp2; diff --git a/open-reac/src/main/resources/openreac/dcopf.mod b/open-reac/src/main/resources/openreac/dcopf.mod index 320c5ac4..f09a41e2 100644 --- a/open-reac/src/main/resources/openreac/dcopf.mod +++ b/open-reac/src/main/resources/openreac/dcopf.mod @@ -53,8 +53,8 @@ subject to ctr_balance{PROBLEM_DCOPF, n in BUSCC}: + sum{(c,n) in LOADCC} load_PFix[1,c,n] + sum{(qq,n,m) in BRANCHCC} activeflow[qq,n,m] # active power flow outgoing on branch qq at bus n - sum{(qq,m,n) in BRANCHCC} activeflow[qq,m,n] # active power flow entering in bus n on branch qq - + sum{(vscconv,n) in VSCCONVON} vscconv_P0[1,vscconv,n] - + sum{(l,n) in LCCCONVON} lccconv_P0[1,l,n] + - sum{(vscconv,n) in VSCCONVON} vscconv_targetP[vscconv] + + sum{(l,n) in LCCCONVON} lccconv_targetP[l] = balance_pos[n] - balance_neg[n]; diff --git a/open-reac/src/main/resources/openreac/dcopf.run b/open-reac/src/main/resources/openreac/dcopf.run index 77c8f471..32a03968 100644 --- a/open-reac/src/main/resources/openreac/dcopf.run +++ b/open-reac/src/main/resources/openreac/dcopf.run @@ -107,7 +107,7 @@ for {(g,n) in UNITON : abs(P_dcopf[g,n]-unit_Pc[1,g,n]) >= temp2*0.99} let temp1 := sum{(c,n) in LOADCC} load_PFix[1,c,n]; let temp2 := sum{(g,n) in UNITON} P_dcopf[g,n]; let temp2 := temp2 + sum{(b,n) in BATTERYCC} battery_p0[1,b,n]; -let temp3 := (sum{(vscconv,n) in VSCCONVON} vscconv_P0[1,vscconv,n])+(sum{(l,k) in LCCCONVON} lccconv_P0[1,l,k]); +let temp3 := (sum{(vscconv,n) in VSCCONVON} vscconv_targetP[vscconv])+(sum{(l,k) in LCCCONVON} lccconv_targetP[l]); printf{LOG_INFO} "Sum of HVDC conv. H: %.0f MW\n", temp3; printf{LOG_INFO} "Sum of loads C: %.0f MW\n", temp1; printf{LOG_INFO} "Sum of generations P: %.0f MW\n", temp2; diff --git a/open-reac/src/main/resources/openreac/reactiveopfoutput.run b/open-reac/src/main/resources/openreac/reactiveopfoutput.run index 09cabee5..3f580a48 100644 --- a/open-reac/src/main/resources/openreac/reactiveopfoutput.run +++ b/open-reac/src/main/resources/openreac/reactiveopfoutput.run @@ -115,7 +115,7 @@ printf{(v,n) in VSCCONVON} "%i;%i;%i;%Q;%.3f;%.1f;%.1f;%.1f;\n", vscconv_vregul[1,v,n], V[n], vscconv_qvar[v,n], - vscconv_P0[1,v,n], + vscconv_targetP[v], vscconv_qvar[v,n] > (fileOut); close (fileOut); diff --git a/open-reac/src/test/resources/com/powsybl/config/test/config.yml b/open-reac/src/test/resources/com/powsybl/config/test/config.yml index 1acd4f0d..9d797384 100644 --- a/open-reac/src/test/resources/com/powsybl/config/test/config.yml +++ b/open-reac/src/test/resources/com/powsybl/config/test/config.yml @@ -1,2 +1,2 @@ ampl: - homeDir: ??? + homeDir: D:\AMPL-13.1.20220703-Win-64 From 4c34378ef4c3df9ae67fa58e4e115bccab3215f9 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Fri, 3 Jan 2025 18:26:12 +0100 Subject: [PATCH 56/63] Fix sign in dcopf and add comments Signed-off-by: p-arvy --- open-reac/src/main/resources/openreac/commons.mod | 2 ++ open-reac/src/main/resources/openreac/dcopf.mod | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/open-reac/src/main/resources/openreac/commons.mod b/open-reac/src/main/resources/openreac/commons.mod index a80e200e..65f33080 100644 --- a/open-reac/src/main/resources/openreac/commons.mod +++ b/open-reac/src/main/resources/openreac/commons.mod @@ -72,6 +72,8 @@ set BATTERYCC := setof {(1,b,n) in BATTERY : n in BUSCC} (b,n); # Warning: units with Ptarget=0 are considered as out of order set UNITON := {(g,n) in UNITCC : abs(unit_Pc[1,g,n]) >= Pnull}; +# Active and reactive targets of converter stations +# Warning: the losses are ignored set LCCCONV_NUM := setof{(t,lcc,bus) in LCCCONV}lcc; set VSCCONV_NUM := setof{(t,vsc,bus) in VSCCONV}vsc; param lccconv_targetP {LCCCONV_NUM}; diff --git a/open-reac/src/main/resources/openreac/dcopf.mod b/open-reac/src/main/resources/openreac/dcopf.mod index f09a41e2..eb6dbd91 100644 --- a/open-reac/src/main/resources/openreac/dcopf.mod +++ b/open-reac/src/main/resources/openreac/dcopf.mod @@ -53,7 +53,7 @@ subject to ctr_balance{PROBLEM_DCOPF, n in BUSCC}: + sum{(c,n) in LOADCC} load_PFix[1,c,n] + sum{(qq,n,m) in BRANCHCC} activeflow[qq,n,m] # active power flow outgoing on branch qq at bus n - sum{(qq,m,n) in BRANCHCC} activeflow[qq,m,n] # active power flow entering in bus n on branch qq - - sum{(vscconv,n) in VSCCONVON} vscconv_targetP[vscconv] + + sum{(vscconv,n) in VSCCONVON} vscconv_targetP[vscconv] + sum{(l,n) in LCCCONVON} lccconv_targetP[l] = balance_pos[n] - balance_neg[n]; From 2a51cb705edecd8bcc92848d771f4449875591b7 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Thu, 2 Jan 2025 16:56:01 +0100 Subject: [PATCH 57/63] Update TUs Signed-off-by: p-arvy --- .../optimization/OpenReacOptimizationAndLoadFlowTest.java | 2 -- .../openreac/optimization/OpenReacOptimizationHvdcTest.java | 2 ++ .../optimization/OpenReacOptimizationIndicatorsTest.java | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) create mode 100644 open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationHvdcTest.java diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java index b7e5de6b..9cb2b55d 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationAndLoadFlowTest.java @@ -74,8 +74,6 @@ void testOnlyGenerator() throws IOException { @Test void testHvdc() throws IOException { Network network = HvdcNetworkFactory.createNetworkWithGenerators2(); - network.getVscConverterStation("cs3").getTerminal().setP(0.0); - network.getVscConverterStation("cs4").getTerminal().setP(0.0); OpenReacParameters parameters = new OpenReacParameters(); parameters.addConstantQGenerators(List.of("g1", "g2", "g5", "g6")); testAllModifAndLoadFlow(network, "optimization/loadflow/openreac-output-vsc", parameters, ReportNode.NO_OP); diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationHvdcTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationHvdcTest.java new file mode 100644 index 00000000..2a3efd77 --- /dev/null +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationHvdcTest.java @@ -0,0 +1,2 @@ +package com.powsybl.openreac.optimization;public class OpenReacOptimizationHvdcTest { +} diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java index 0b3ae806..22132381 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationIndicatorsTest.java @@ -162,8 +162,6 @@ void testTransformersIndicators() throws IOException { @Test void testVscIndicators() throws IOException { Network network = HvdcNetworkFactory.createVsc(); - // FIXME : should not depend on P/Q values on terminal - network.getVscConverterStation("cs2").getTerminal().setP(2).setQ(1); OpenReacResult result = runOpenReac(network, "optimization/indicators/vsc-test", true); assertEquals(OpenReacStatus.OK, result.getStatus()); @@ -175,8 +173,6 @@ void testVscIndicators() throws IOException { @Test void testLccIndicators() throws IOException { Network network = HvdcNetworkFactory.createLcc(); - // FIXME : should not depend on P/Q values on terminal - network.getLccConverterStation("cs2").getTerminal().setP(2).setQ(1); OpenReacResult result = runOpenReac(network, "optimization/indicators/lcc-test", true); assertEquals(OpenReacStatus.OK, result.getStatus()); From 0664d26db39221b1e43acac096e0715a680295ef Mon Sep 17 00:00:00 2001 From: p-arvy Date: Thu, 2 Jan 2025 16:58:22 +0100 Subject: [PATCH 58/63] Add TUs Signed-off-by: p-arvy --- .../OpenReacOptimizationHvdcTest.java | 115 +++++++++++++++++- 1 file changed, 114 insertions(+), 1 deletion(-) diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationHvdcTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationHvdcTest.java index 2a3efd77..e2d6fc5a 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationHvdcTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationHvdcTest.java @@ -1,2 +1,115 @@ -package com.powsybl.openreac.optimization;public class OpenReacOptimizationHvdcTest { +/** + * Copyright (c) 2024, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 + */ +package com.powsybl.openreac.optimization; + +import com.powsybl.iidm.network.HvdcLine; +import com.powsybl.iidm.network.Network; +import com.powsybl.openreac.network.HvdcNetworkFactory; +import com.powsybl.openreac.parameters.input.OpenReacParameters; +import com.powsybl.openreac.parameters.output.OpenReacResult; +import com.powsybl.openreac.parameters.output.OpenReacStatus; +import org.junit.jupiter.api.Test; + +import java.io.IOException; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * Test OpenReac optimization with HVDC lines. + * + * @author Pierre ARVY {@literal } + */ +public class OpenReacOptimizationHvdcTest extends AbstractOpenReacRunnerTest { + + @Test + void testActivePowerSetpointLowerThanPmax() throws IOException { + Network network = HvdcNetworkFactory.createVsc(); + // put max P < active set point to fail checks before optimization + network.getVscConverterStation("cs2").getHvdcLine().setMaxP(1); + OpenReacResult result = runOpenReac(network, "optimization/indicators/lcc-test", true); + assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); + } + + @Test + void testLccExcludedFromOptimization() throws IOException { + Network network = HvdcNetworkFactory.createLcc(); + OpenReacParameters parameters = new OpenReacParameters(); + network.getLccConverterStation("cs2") + .getHvdcLine() + // put active set point > PQmax to remove LCC converter station from optimization + .setActivePowerSetpoint(parameters.getPQMax() + 1) + // modify max P to avoid check failure before optimization + .setMaxP(Double.MAX_VALUE); + OpenReacResult result = runOpenReac(network, "optimization/indicators/lcc-test", true); + + assertEquals(OpenReacStatus.OK, result.getStatus()); + assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_lcc_converter_in_data_file"))); + // verify no lcc is considered in optimization + assertEquals(0, Integer.parseInt(result.getIndicators().get("nb_lcc_converter_up_and_running"))); + } + + @Test + void testVscExcludedFromOptimization() throws IOException { + Network network = HvdcNetworkFactory.createVsc(); + OpenReacParameters parameters = new OpenReacParameters(); + network.getVscConverterStation("cs2") + .getHvdcLine() + // put active set point > PQmax to remove VSC converter station from optimization + .setActivePowerSetpoint(parameters.getPQMax() + 1) + // modify max P to avoid check failure before optimization + .setMaxP(parameters.getPQMax() + 2); + OpenReacResult result = runOpenReac(network, "optimization/indicators/lcc-test", true); + + assertEquals(OpenReacStatus.OK, result.getStatus()); + assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_vsc_converter_in_data_file"))); + // verify no vsc is considered in optimization + assertEquals(0, Integer.parseInt(result.getIndicators().get("nb_vsc_converter_up_and_running"))); + } + + @Test + void testVscExcludedFromOptimization2() throws IOException { + Network network = HvdcNetworkFactory.createVsc(); + OpenReacParameters parameters = new OpenReacParameters(); + network.getVscConverterStation("cs2") + .getHvdcLine() + // put max P > PQmax to remove vsc from optimization + .setMaxP(parameters.getPQMax() + 1); + OpenReacResult result = runOpenReac(network, "optimization/indicators/lcc-test", true); + + assertEquals(OpenReacStatus.OK, result.getStatus()); + assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_vsc_converter_in_data_file"))); + // verify no vsc is considered in optimization + assertEquals(0, Integer.parseInt(result.getIndicators().get("nb_vsc_converter_up_and_running"))); + } + + @Test + void testVscActiveSetPointSignInOptimization() throws IOException { + Network network = HvdcNetworkFactory.createVsc(); + // verify active power equilibrium if cs2 is rectifier + OpenReacResult result = runOpenReac(network, "optimization/indicators/lcc-test", true); + assertEquals(OpenReacStatus.OK, result.getStatus()); + + // verify there is no equilibrium if cs2 is inverter + network.getHvdcLine("hvdc23").setConvertersMode(HvdcLine.ConvertersMode.SIDE_1_INVERTER_SIDE_2_RECTIFIER); + result = runOpenReac(network, "optimization/indicators/lcc-test", true); + assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); + } + + @Test + void testLccActiveSetPointSignInOptimization() throws IOException { + Network network = HvdcNetworkFactory.createLcc(); + // verify active power equilibrium if cs2 is rectifier + OpenReacResult result = runOpenReac(network, "optimization/indicators/lcc-test", true); + assertEquals(OpenReacStatus.OK, result.getStatus()); + + // verify there is no equilibrium if cs2 is inverter + network.getHvdcLine("hvdc23").setConvertersMode(HvdcLine.ConvertersMode.SIDE_1_INVERTER_SIDE_2_RECTIFIER); + result = runOpenReac(network, "optimization/indicators/lcc-test", true); + assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); + } } From 2979dd65e7bffe945050427faf1735bdc443f5f3 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Fri, 3 Jan 2025 19:17:13 +0100 Subject: [PATCH 59/63] Add resources for TUs Signed-off-by: p-arvy --- .../OpenReacOptimizationHvdcTest.java | 47 +++++------ .../com/powsybl/config/test/config.yml | 2 +- .../reactiveopf_results_indic.txt | 82 +++++++++++++++++++ .../reactiveopf_results_generators.csv | 2 + .../inverter/reactiveopf_results_indic.txt | 82 +++++++++++++++++++ .../inverter/reactiveopf_results_rtc.csv | 1 + .../inverter/reactiveopf_results_shunts.csv | 1 + ...iveopf_results_static_var_compensators.csv | 1 + .../inverter/reactiveopf_results_voltages.csv | 3 + ...tiveopf_results_vsc_converter_stations.csv | 1 + .../reactiveopf_results_generators.csv | 2 + .../rectifier/reactiveopf_results_indic.txt | 82 +++++++++++++++++++ .../rectifier/reactiveopf_results_rtc.csv | 1 + .../rectifier/reactiveopf_results_shunts.csv | 1 + ...iveopf_results_static_var_compensators.csv | 1 + .../reactiveopf_results_voltages.csv | 3 + ...tiveopf_results_vsc_converter_stations.csv | 1 + .../reactiveopf_results_indic.txt | 82 +++++++++++++++++++ .../reactiveopf_results_indic.txt | 82 +++++++++++++++++++ .../reactiveopf_results_generators.csv | 2 + .../inverter/reactiveopf_results_indic.txt | 82 +++++++++++++++++++ .../inverter/reactiveopf_results_rtc.csv | 1 + .../inverter/reactiveopf_results_shunts.csv | 1 + ...iveopf_results_static_var_compensators.csv | 1 + .../inverter/reactiveopf_results_voltages.csv | 3 + ...tiveopf_results_vsc_converter_stations.csv | 2 + .../reactiveopf_results_generators.csv | 2 + .../rectifier/reactiveopf_results_indic.txt | 82 +++++++++++++++++++ .../rectifier/reactiveopf_results_rtc.csv | 1 + .../rectifier/reactiveopf_results_shunts.csv | 1 + ...iveopf_results_static_var_compensators.csv | 1 + .../reactiveopf_results_voltages.csv | 3 + ...tiveopf_results_vsc_converter_stations.csv | 2 + .../lcc-test/reactiveopf_results_indic.txt | 10 ++- .../vsc-test/reactiveopf_results_indic.txt | 10 ++- .../reactiveopf_results_generators.csv | 4 +- .../reactiveopf_results_indic.txt | 22 ++--- .../reactiveopf_results_voltages.csv | 10 +-- ...tiveopf_results_vsc_converter_stations.csv | 4 +- 39 files changed, 667 insertions(+), 54 deletions(-) create mode 100644 open-reac/src/test/resources/optimization/hvdc/lcc-excluded/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_generators.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_rtc.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_shunts.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_static_var_compensators.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_voltages.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_vsc_converter_stations.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_generators.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_rtc.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_shunts.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_static_var_compensators.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_voltages.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_vsc_converter_stations.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/vsc-excluded/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/hvdc/vsc-excluded2/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_generators.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_rtc.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_shunts.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_static_var_compensators.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_voltages.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_vsc_converter_stations.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_generators.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_indic.txt create mode 100644 open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_rtc.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_shunts.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_static_var_compensators.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_voltages.csv create mode 100644 open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_vsc_converter_stations.csv diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationHvdcTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationHvdcTest.java index e2d6fc5a..379b95cd 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationHvdcTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationHvdcTest.java @@ -7,6 +7,7 @@ */ package com.powsybl.openreac.optimization; +import com.powsybl.commons.report.ReportNode; import com.powsybl.iidm.network.HvdcLine; import com.powsybl.iidm.network.Network; import com.powsybl.openreac.network.HvdcNetworkFactory; @@ -26,15 +27,6 @@ */ public class OpenReacOptimizationHvdcTest extends AbstractOpenReacRunnerTest { - @Test - void testActivePowerSetpointLowerThanPmax() throws IOException { - Network network = HvdcNetworkFactory.createVsc(); - // put max P < active set point to fail checks before optimization - network.getVscConverterStation("cs2").getHvdcLine().setMaxP(1); - OpenReacResult result = runOpenReac(network, "optimization/indicators/lcc-test", true); - assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); - } - @Test void testLccExcludedFromOptimization() throws IOException { Network network = HvdcNetworkFactory.createLcc(); @@ -45,7 +37,7 @@ void testLccExcludedFromOptimization() throws IOException { .setActivePowerSetpoint(parameters.getPQMax() + 1) // modify max P to avoid check failure before optimization .setMaxP(Double.MAX_VALUE); - OpenReacResult result = runOpenReac(network, "optimization/indicators/lcc-test", true); + OpenReacResult result = runOpenReac(network, "optimization/hvdc/lcc-excluded", true); assertEquals(OpenReacStatus.OK, result.getStatus()); assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_lcc_converter_in_data_file"))); @@ -63,7 +55,7 @@ void testVscExcludedFromOptimization() throws IOException { .setActivePowerSetpoint(parameters.getPQMax() + 1) // modify max P to avoid check failure before optimization .setMaxP(parameters.getPQMax() + 2); - OpenReacResult result = runOpenReac(network, "optimization/indicators/lcc-test", true); + OpenReacResult result = runOpenReac(network, "optimization/hvdc/vsc-excluded", true); assertEquals(OpenReacStatus.OK, result.getStatus()); assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_vsc_converter_in_data_file"))); @@ -79,7 +71,7 @@ void testVscExcludedFromOptimization2() throws IOException { .getHvdcLine() // put max P > PQmax to remove vsc from optimization .setMaxP(parameters.getPQMax() + 1); - OpenReacResult result = runOpenReac(network, "optimization/indicators/lcc-test", true); + OpenReacResult result = runOpenReac(network, "optimization/hvdc/vsc-excluded2", true); assertEquals(OpenReacStatus.OK, result.getStatus()); assertEquals(2, Integer.parseInt(result.getIndicators().get("nb_vsc_converter_in_data_file"))); @@ -90,26 +82,29 @@ void testVscExcludedFromOptimization2() throws IOException { @Test void testVscActiveSetPointSignInOptimization() throws IOException { Network network = HvdcNetworkFactory.createVsc(); - // verify active power equilibrium if cs2 is rectifier - OpenReacResult result = runOpenReac(network, "optimization/indicators/lcc-test", true); - assertEquals(OpenReacStatus.OK, result.getStatus()); + network.getHvdcLine("hvdc23") + .setActivePowerSetpoint(20) + .setConvertersMode(HvdcLine.ConvertersMode.SIDE_1_RECTIFIER_SIDE_2_INVERTER); + testAllModifAndLoadFlow(network, "optimization/hvdc/vsc-in-optimization/rectifier", new OpenReacParameters(), ReportNode.NO_OP); + + network.getHvdcLine("hvdc23") + .setActivePowerSetpoint(2) + .setConvertersMode(HvdcLine.ConvertersMode.SIDE_1_INVERTER_SIDE_2_RECTIFIER); + testAllModifAndLoadFlow(network, "optimization/hvdc/vsc-in-optimization/inverter", new OpenReacParameters(), ReportNode.NO_OP); - // verify there is no equilibrium if cs2 is inverter - network.getHvdcLine("hvdc23").setConvertersMode(HvdcLine.ConvertersMode.SIDE_1_INVERTER_SIDE_2_RECTIFIER); - result = runOpenReac(network, "optimization/indicators/lcc-test", true); - assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); } @Test void testLccActiveSetPointSignInOptimization() throws IOException { Network network = HvdcNetworkFactory.createLcc(); - // verify active power equilibrium if cs2 is rectifier - OpenReacResult result = runOpenReac(network, "optimization/indicators/lcc-test", true); - assertEquals(OpenReacStatus.OK, result.getStatus()); + network.getHvdcLine("hvdc23") + .setActivePowerSetpoint(20) + .setConvertersMode(HvdcLine.ConvertersMode.SIDE_1_RECTIFIER_SIDE_2_INVERTER); + testAllModifAndLoadFlow(network, "optimization/hvdc/lcc-in-optimization/rectifier", new OpenReacParameters(), ReportNode.NO_OP); - // verify there is no equilibrium if cs2 is inverter - network.getHvdcLine("hvdc23").setConvertersMode(HvdcLine.ConvertersMode.SIDE_1_INVERTER_SIDE_2_RECTIFIER); - result = runOpenReac(network, "optimization/indicators/lcc-test", true); - assertEquals(OpenReacStatus.NOT_OK, result.getStatus()); + network.getHvdcLine("hvdc23") + .setActivePowerSetpoint(51) + .setConvertersMode(HvdcLine.ConvertersMode.SIDE_1_INVERTER_SIDE_2_RECTIFIER); + testAllModifAndLoadFlow(network, "optimization/hvdc/lcc-in-optimization/inverter", new OpenReacParameters(), ReportNode.NO_OP); } } diff --git a/open-reac/src/test/resources/com/powsybl/config/test/config.yml b/open-reac/src/test/resources/com/powsybl/config/test/config.yml index 9d797384..1acd4f0d 100644 --- a/open-reac/src/test/resources/com/powsybl/config/test/config.yml +++ b/open-reac/src/test/resources/com/powsybl/config/test/config.yml @@ -1,2 +1,2 @@ ampl: - homeDir: D:\AMPL-13.1.20220703-Win-64 + homeDir: ??? diff --git a/open-reac/src/test/resources/optimization/hvdc/lcc-excluded/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/hvdc/lcc-excluded/reactiveopf_results_indic.txt new file mode 100644 index 00000000..299b7b26 --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/lcc-excluded/reactiveopf_results_indic.txt @@ -0,0 +1,82 @@ +final_status OK +dcopf_status OK + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +nb_bus_in_ACDC_CC 3 +nb_bus_in_AC_CC 2 +nb_bus_in_ACDC_but_out_AC_CC 1 +nb_bus_with_voltage_value 0 +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_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 2 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 2 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.000937 +max_delta_teta_ac 0.001223 +min_delta_teta_dc 0.000937 +min_delta_teta_ac 0.001223 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_generators.csv new file mode 100644 index 00000000..b343fbb7 --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_generators.csv @@ -0,0 +1,2 @@ +#variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW); +1;1;1;'true';0.817;102.6;47.9;1.0;-47.9; diff --git a/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_indic.txt new file mode 100644 index 00000000..32390c06 --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_indic.txt @@ -0,0 +1,82 @@ +final_status OK +dcopf_status OK + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +nb_bus_in_ACDC_CC 3 +nb_bus_in_AC_CC 2 +nb_bus_in_ACDC_but_out_AC_CC 1 +nb_bus_with_voltage_value 0 +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_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 2 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 2 +nb_lcc_converter_up_and_running 1 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc -0.00 +min_teta_ac -0.00 +teta_min -3.00 +max_delta_teta_dc -0.000019 +max_delta_teta_ac -0.000476 +min_delta_teta_dc -0.000019 +min_delta_teta_ac -0.000476 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_rtc.csv new file mode 100644 index 00000000..9a62a138 --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_rtc.csv @@ -0,0 +1 @@ +#variant;num;tap; diff --git a/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_shunts.csv new file mode 100644 index 00000000..8d515fde --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_shunts.csv @@ -0,0 +1 @@ +#variant;num;bus;b(pu);Q(Mvar);section; diff --git a/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_static_var_compensators.csv new file mode 100644 index 00000000..6792ddb9 --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_static_var_compensators.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;V(pu);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_voltages.csv new file mode 100644 index 00000000..407928a4 --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_voltages.csv @@ -0,0 +1,3 @@ +#variant;bus;V(pu);theta(rad);id; +1;1;0.817;-0.000;"vl1_0"; +1;2;0.816;0.000;"vl2_0"; diff --git a/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_vsc_converter_stations.csv new file mode 100644 index 00000000..aa24858c --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/inverter/reactiveopf_results_vsc_converter_stations.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;targetV(pu);targetQ(Mvar);P(MW);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_generators.csv new file mode 100644 index 00000000..28ea49cc --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_generators.csv @@ -0,0 +1,2 @@ +#variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW); +1;1;1;'true';1.040;102.6;25.1;-70.0;-25.1; diff --git a/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_indic.txt new file mode 100644 index 00000000..8001b767 --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_indic.txt @@ -0,0 +1,82 @@ +final_status OK +dcopf_status OK + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +nb_bus_in_ACDC_CC 3 +nb_bus_in_AC_CC 2 +nb_bus_in_ACDC_but_out_AC_CC 1 +nb_bus_with_voltage_value 0 +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_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 2 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 0 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 2 +nb_lcc_converter_up_and_running 1 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.001312 +max_delta_teta_ac 0.001070 +min_delta_teta_dc 0.001312 +min_delta_teta_ac 0.001070 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_rtc.csv new file mode 100644 index 00000000..9a62a138 --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_rtc.csv @@ -0,0 +1 @@ +#variant;num;tap; diff --git a/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_shunts.csv new file mode 100644 index 00000000..8d515fde --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_shunts.csv @@ -0,0 +1 @@ +#variant;num;bus;b(pu);Q(Mvar);section; diff --git a/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_static_var_compensators.csv new file mode 100644 index 00000000..6792ddb9 --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_static_var_compensators.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;V(pu);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_voltages.csv new file mode 100644 index 00000000..145800f4 --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_voltages.csv @@ -0,0 +1,3 @@ +#variant;bus;V(pu);theta(rad);id; +1;1;1.040;0.001;"vl1_0"; +1;2;1.039;0.000;"vl2_0"; diff --git a/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_vsc_converter_stations.csv new file mode 100644 index 00000000..aa24858c --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/lcc-in-optimization/rectifier/reactiveopf_results_vsc_converter_stations.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;targetV(pu);targetQ(Mvar);P(MW);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/hvdc/vsc-excluded/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/hvdc/vsc-excluded/reactiveopf_results_indic.txt new file mode 100644 index 00000000..508604ab --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/vsc-excluded/reactiveopf_results_indic.txt @@ -0,0 +1,82 @@ +final_status OK +dcopf_status OK + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +nb_bus_in_ACDC_CC 3 +nb_bus_in_AC_CC 2 +nb_bus_in_ACDC_but_out_AC_CC 1 +nb_bus_with_voltage_value 0 +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_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 2 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.000937 +max_delta_teta_ac 0.001223 +min_delta_teta_dc 0.000937 +min_delta_teta_ac 0.001223 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/hvdc/vsc-excluded2/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/hvdc/vsc-excluded2/reactiveopf_results_indic.txt new file mode 100644 index 00000000..508604ab --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/vsc-excluded2/reactiveopf_results_indic.txt @@ -0,0 +1,82 @@ +final_status OK +dcopf_status OK + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +nb_bus_in_ACDC_CC 3 +nb_bus_in_AC_CC 2 +nb_bus_in_ACDC_but_out_AC_CC 1 +nb_bus_with_voltage_value 0 +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_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 2 +nb_vsc_converter_up_and_running 0 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.000937 +max_delta_teta_ac 0.001223 +min_delta_teta_dc 0.000937 +min_delta_teta_ac 0.001223 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_generators.csv new file mode 100644 index 00000000..40715a08 --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_generators.csv @@ -0,0 +1,2 @@ +#variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW); +1;1;1;'true';0.847;102.6;0.0;-48.0;-0.0; diff --git a/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_indic.txt new file mode 100644 index 00000000..ac7cc7f6 --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_indic.txt @@ -0,0 +1,82 @@ +final_status OK +dcopf_status OK + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +nb_bus_in_ACDC_CC 3 +nb_bus_in_AC_CC 2 +nb_bus_in_ACDC_but_out_AC_CC 1 +nb_bus_with_voltage_value 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_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 2 +nb_vsc_converter_up_and_running 1 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.000900 +max_delta_teta_ac 0.001256 +min_delta_teta_dc 0.000900 +min_delta_teta_ac 0.001256 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_rtc.csv new file mode 100644 index 00000000..9a62a138 --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_rtc.csv @@ -0,0 +1 @@ +#variant;num;tap; diff --git a/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_shunts.csv new file mode 100644 index 00000000..8d515fde --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_shunts.csv @@ -0,0 +1 @@ +#variant;num;bus;b(pu);Q(Mvar);section; diff --git a/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_static_var_compensators.csv new file mode 100644 index 00000000..6792ddb9 --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_static_var_compensators.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;V(pu);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_voltages.csv new file mode 100644 index 00000000..64e18718 --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_voltages.csv @@ -0,0 +1,3 @@ +#variant;bus;V(pu);theta(rad);id; +1;1;0.847;0.001;"vl1_0"; +1;2;0.846;0.000;"vl2_0"; diff --git a/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_vsc_converter_stations.csv new file mode 100644 index 00000000..f2c164a4 --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/inverter/reactiveopf_results_vsc_converter_stations.csv @@ -0,0 +1,2 @@ +#variant;num;bus;vRegul;targetV(pu);targetQ(Mvar);P(MW);Q(Mvar); +1;1;2;'true';0.846;10.0;-2.0;10.0; diff --git a/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_generators.csv new file mode 100644 index 00000000..6b0e45a7 --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_generators.csv @@ -0,0 +1,2 @@ +#variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW); +1;1;1;'true';1.006;102.6;0.0;-70.0;-0.0; diff --git a/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_indic.txt new file mode 100644 index 00000000..b7fb3971 --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_indic.txt @@ -0,0 +1,82 @@ +final_status OK +dcopf_status OK + +log_level_ampl INFO +log_level_knitro 2 +objective_choice 0 +ratio_voltage_target 0.500000 +coeff_alpha 1.000000 +Pnull 0.010000 +Znull 0.000100 +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 ALL +PQmax 9000.000000 +defaultPmax 1000.000000 +defaultPmin 0.000000 +defaultQmaxPmaxRatio 0.300000 +defaultQmin -300.000000 +defaultQmax 300.000000 +minimalQPrange 1.000000 +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 +nb_bus_in_ACDC_CC 3 +nb_bus_in_AC_CC 2 +nb_bus_in_ACDC_but_out_AC_CC 1 +nb_bus_with_voltage_value 0 +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_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 +nb_branch_with_nonsmall_impedance 1 +nb_branch_with_zero_or_small_impedance 0 +nb_unit_in_data_file 1 +nb_unit_in_AC_CC 1 +nb_unit_up_and_running 1 +nb_unit_with_variable_reactive_power 1 +nb_unit_with_fixed_reactive_power 0 +nb_load_in_data_file 2 +nb_load_in_AC_CC 1 +nb_shunt_in_data_file 0 +nb_shunt_connectable_or_in_AC_CC 0 +nb_shunt_with_fixed_value 0 +nb_shunt_with_variable_value 0 +nb_transformers_with_variable_ratio 0 +nb_transformers_with_fixed_ratio 0 +nb_svc_in_data_file 0 +nb_svc_in_AC_CC 0 +nb_svc_up_and_operating 0 +nb_vsc_converter_in_data_file 2 +nb_vsc_converter_up_and_running 1 +nb_lcc_converter_in_data_file 0 +nb_lcc_converter_up_and_running 0 +nb_batteries 0 +sum_batteries_pmax 0.0 +sum_batteries_pmin 0.0 + +max_teta_dc 0.00 +max_teta_ac 0.00 +teta_max 3.00 +min_teta_dc 0.00 +min_teta_ac 0.00 +teta_min -3.00 +max_delta_teta_dc 0.001312 +max_delta_teta_ac 0.001298 +min_delta_teta_dc 0.001312 +min_delta_teta_ac 0.001298 + +nb_reactive_slacks 0 +nb_slacks_condensator 0 +sum_slacks_condensator 0.0 +nb_slacks_self 0 +sum_slacks_self 0.0 diff --git a/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_rtc.csv b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_rtc.csv new file mode 100644 index 00000000..9a62a138 --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_rtc.csv @@ -0,0 +1 @@ +#variant;num;tap; diff --git a/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_shunts.csv b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_shunts.csv new file mode 100644 index 00000000..8d515fde --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_shunts.csv @@ -0,0 +1 @@ +#variant;num;bus;b(pu);Q(Mvar);section; diff --git a/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_static_var_compensators.csv b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_static_var_compensators.csv new file mode 100644 index 00000000..6792ddb9 --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_static_var_compensators.csv @@ -0,0 +1 @@ +#variant;num;bus;vRegul;V(pu);Q(Mvar); diff --git a/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_voltages.csv new file mode 100644 index 00000000..7f165729 --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_voltages.csv @@ -0,0 +1,3 @@ +#variant;bus;V(pu);theta(rad);id; +1;1;1.006;0.001;"vl1_0"; +1;2;1.006;0.000;"vl2_0"; diff --git a/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_vsc_converter_stations.csv new file mode 100644 index 00000000..5dffc584 --- /dev/null +++ b/open-reac/src/test/resources/optimization/hvdc/vsc-in-optimization/rectifier/reactiveopf_results_vsc_converter_stations.csv @@ -0,0 +1,2 @@ +#variant;num;bus;vRegul;targetV(pu);targetQ(Mvar);P(MW);Q(Mvar); +1;1;2;'true';1.006;10.1;20.0;10.1; diff --git a/open-reac/src/test/resources/optimization/indicators/lcc-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/lcc-test/reactiveopf_results_indic.txt index 3add2771..6cd4efaa 100644 --- a/open-reac/src/test/resources/optimization/indicators/lcc-test/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/indicators/lcc-test/reactiveopf_results_indic.txt @@ -36,6 +36,8 @@ 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_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 nb_branch_with_nonsmall_impedance 1 nb_branch_with_zero_or_small_impedance 0 nb_unit_in_data_file 2 @@ -68,10 +70,10 @@ teta_max 3.00 min_teta_dc 0.00 min_teta_ac 0.00 teta_min -3.00 -max_delta_teta_dc 0.000975 -max_delta_teta_ac 0.001211 -min_delta_teta_dc 0.000975 -min_delta_teta_ac 0.001211 +max_delta_teta_dc 0.001875 +max_delta_teta_ac 0.000948 +min_delta_teta_dc 0.001875 +min_delta_teta_ac 0.000948 nb_reactive_slacks 0 nb_slacks_condensator 0 diff --git a/open-reac/src/test/resources/optimization/indicators/vsc-test/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/indicators/vsc-test/reactiveopf_results_indic.txt index 42a8e2fa..83afeb52 100644 --- a/open-reac/src/test/resources/optimization/indicators/vsc-test/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/indicators/vsc-test/reactiveopf_results_indic.txt @@ -36,6 +36,8 @@ 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_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 nb_branch_with_nonsmall_impedance 1 nb_branch_with_zero_or_small_impedance 0 nb_unit_in_data_file 1 @@ -68,10 +70,10 @@ teta_max 3.00 min_teta_dc 0.00 min_teta_ac 0.00 teta_min -3.00 -max_delta_teta_dc 0.000975 -max_delta_teta_ac 0.001335 -min_delta_teta_dc 0.000975 -min_delta_teta_ac 0.001335 +max_delta_teta_dc 0.001875 +max_delta_teta_ac 0.001259 +min_delta_teta_dc 0.001875 +min_delta_teta_ac 0.001259 nb_reactive_slacks 0 nb_slacks_condensator 0 diff --git a/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_generators.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_generators.csv index db3443d2..b03f0ee3 100644 --- a/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_generators.csv +++ b/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_generators.csv @@ -1,5 +1,5 @@ #variant;num;bus;vRegul;V(pu);targetP(MW);targetQ(Mvar);P(MW);Q(MW); -1;1;1;'true';0.568;1.0;0.0;-1.0;0.0; +1;1;1;'true';0.535;1.0;0.0;-1.0;0.0; 1;2;2;'true';0.500;1.0;0.0;-1.0;0.0; -1;3;6;'true';0.568;1.0;0.0;-1.0;0.0; +1;3;6;'true';0.500;1.0;0.0;-1.0;0.0; 1;4;5;'true';0.500;1.0;0.0;-1.0;0.0; diff --git a/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_indic.txt b/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_indic.txt index 00b3ea7b..6f8036de 100644 --- a/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_indic.txt +++ b/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_indic.txt @@ -36,6 +36,8 @@ 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_in_AC_CC_side_1_opened 0 +nb_branch_in_AC_CC_side_2_opened 0 nb_branch_with_nonsmall_impedance 7 nb_branch_with_zero_or_small_impedance 0 nb_unit_in_data_file 4 @@ -62,16 +64,16 @@ nb_batteries 0 sum_batteries_pmax 0.0 sum_batteries_pmin 0.0 -max_teta_dc 0.07 -max_teta_ac 0.22 -teta_max 3.07 -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.220224 -min_delta_teta_dc -0.200000 -min_delta_teta_ac -0.927179 +max_teta_dc 0.17 +max_teta_ac 0.58 +teta_max 3.17 +min_teta_dc -0.10 +min_teta_ac -0.38 +teta_min -3.10 +max_delta_teta_dc 0.133333 +max_delta_teta_ac 0.496485 +min_delta_teta_dc -0.166667 +min_delta_teta_ac -0.577584 nb_reactive_slacks 0 nb_slacks_condensator 0 diff --git a/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_voltages.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_voltages.csv index 7859766f..ad340422 100644 --- a/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_voltages.csv +++ b/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_voltages.csv @@ -1,7 +1,7 @@ #variant;bus;V(pu);theta(rad);id; -1;1;0.568;-0.707;"b1_vl_0"; -1;2;0.500;-0.927;"b2_vl_0"; -1;3;0.651;-0.810;"b3_vl_0"; -1;4;0.651;0.117;"b4_vl_0"; +1;1;0.535;0.496;"b1_vl_0"; +1;2;0.500;0.000;"b2_vl_0"; +1;3;0.632;0.578;"b3_vl_0"; +1;4;0.539;-0.381;"b4_vl_0"; 1;5;0.500;0.000;"b5_vl_0"; -1;6;0.568;0.220;"b6_vl_0"; +1;6;0.500;-0.000;"b6_vl_0"; diff --git a/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_vsc_converter_stations.csv b/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_vsc_converter_stations.csv index d8171906..904f7536 100644 --- a/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_vsc_converter_stations.csv +++ b/open-reac/src/test/resources/optimization/loadflow/openreac-output-vsc/reactiveopf_results_vsc_converter_stations.csv @@ -1,3 +1,3 @@ #variant;num;bus;vRegul;targetV(pu);targetQ(Mvar);P(MW);Q(Mvar); -1;1;3;'true';0.651;1.6;0.0;1.6; -1;2;4;'true';0.651;1.6;0.0;1.6; +1;1;3;'true';0.632;2.0;-2.0;2.0; +1;2;4;'true';0.539;0.8;2.0;0.8; From 3d139fa640cd98dc55787d783745634ca7b008f6 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Fri, 3 Jan 2025 19:27:41 +0100 Subject: [PATCH 60/63] Add doc Signed-off-by: p-arvy --- docs/optimizer/inputs.md | 3 +++ .../openreac/optimization/OpenReacOptimizationHvdcTest.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/optimizer/inputs.md b/docs/optimizer/inputs.md index 57cd2628..c9810655 100644 --- a/docs/optimizer/inputs.md +++ b/docs/optimizer/inputs.md @@ -5,6 +5,9 @@ Files with the prefix `ampl_` contain the data and the parameters of the network on which the reactive OPF is executed. [V2 of the extended version of PowSyBl AMPL export](https://github.com/powsybl/powsybl-core/blob/main/ampl-converter/src/main/java/com/powsybl/ampl/converter/version/ExtendedAmplExporterV2.java), which is the default version. +Note that from release `0.10.0` of OpenReac, the active target of VSC and LCC converter stations is calculated using HVDC line active set point +and the converter mode, both specified in `ampl_network_hvdc.txt`. The losses related to rectifier/inverter conversion, and HVDC line **are ignored**. + ## Configuration of the run The user can configure the run with the dedicated Java interface diff --git a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationHvdcTest.java b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationHvdcTest.java index 379b95cd..fb24e883 100644 --- a/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationHvdcTest.java +++ b/open-reac/src/test/java/com/powsybl/openreac/optimization/OpenReacOptimizationHvdcTest.java @@ -25,7 +25,7 @@ * * @author Pierre ARVY {@literal } */ -public class OpenReacOptimizationHvdcTest extends AbstractOpenReacRunnerTest { +class OpenReacOptimizationHvdcTest extends AbstractOpenReacRunnerTest { @Test void testLccExcludedFromOptimization() throws IOException { From c040deecc931db27bede9b725a2f1c3cb99774ad Mon Sep 17 00:00:00 2001 From: p-arvy Date: Fri, 3 Jan 2025 19:29:03 +0100 Subject: [PATCH 61/63] revert Signed-off-by: p-arvy --- open-reac/src/main/resources/openreac/acopf.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/open-reac/src/main/resources/openreac/acopf.mod b/open-reac/src/main/resources/openreac/acopf.mod index 35b42846..5ed1d276 100644 --- a/open-reac/src/main/resources/openreac/acopf.mod +++ b/open-reac/src/main/resources/openreac/acopf.mod @@ -134,7 +134,7 @@ var Red_Tran_Rea_Inv{(qq,m,n) in BRANCHCC } = var Red_Tran_Act_Dir_Side_2_Opened{(qq,m,n) in BRANCHCC_WITH_SIDE_2_OPENED} = (branch_Ror[qq,m,n])**2 * V[m] * (branch_Gor_mod[qq,m,n] + (branch_admi[qq,m,n])**2 * branch_Gex_mod[qq,m,n] / ( (branch_Gex_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 - + (- branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) + + (- branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) + ((branch_Bex_mod[qq,m,n])**2 + (branch_Gex_mod[qq,m,n])**2) * branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]) / ( (branch_Gex_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 + (- branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 )) ; From 6aa3b1ef60af564f439d1ea942e057d50c180deb Mon Sep 17 00:00:00 2001 From: p-arvy Date: Fri, 3 Jan 2025 19:30:41 +0100 Subject: [PATCH 62/63] small clean Signed-off-by: p-arvy --- open-reac/src/main/resources/openreac/acopf.mod | 2 +- open-reac/src/main/resources/openreac/commons.mod | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/open-reac/src/main/resources/openreac/acopf.mod b/open-reac/src/main/resources/openreac/acopf.mod index 5ed1d276..35b42846 100644 --- a/open-reac/src/main/resources/openreac/acopf.mod +++ b/open-reac/src/main/resources/openreac/acopf.mod @@ -134,7 +134,7 @@ var Red_Tran_Rea_Inv{(qq,m,n) in BRANCHCC } = var Red_Tran_Act_Dir_Side_2_Opened{(qq,m,n) in BRANCHCC_WITH_SIDE_2_OPENED} = (branch_Ror[qq,m,n])**2 * V[m] * (branch_Gor_mod[qq,m,n] + (branch_admi[qq,m,n])**2 * branch_Gex_mod[qq,m,n] / ( (branch_Gex_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 - + (- branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) + + (- branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) + ((branch_Bex_mod[qq,m,n])**2 + (branch_Gex_mod[qq,m,n])**2) * branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]) / ( (branch_Gex_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 + (- branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 )) ; diff --git a/open-reac/src/main/resources/openreac/commons.mod b/open-reac/src/main/resources/openreac/commons.mod index 65f33080..5d9fd540 100644 --- a/open-reac/src/main/resources/openreac/commons.mod +++ b/open-reac/src/main/resources/openreac/commons.mod @@ -108,7 +108,7 @@ check {vsc in VSCCONV_NUM}: vscconv_targetP[vsc] != NaN; # set VSCCONVON := setof{(t,v,n) in VSCCONV: n in BUSCC - and abs(vscconv_targetP[v] ) <= PQmax + and abs(vscconv_targetP[v]) <= PQmax and abs(vscconv_Pmin[t,v,n]) <= PQmax and abs(vscconv_Pmax[t,v,n]) <= PQmax and vscconv_targetP[v] >= vscconv_Pmin[t,v,n] @@ -121,7 +121,7 @@ set VSCCONVON := setof{(t,v,n) in VSCCONV: set LCCCONVON := setof{(t,l,n) in LCCCONV: n in BUSCC and abs(lccconv_targetP[l]) <= PQmax - and abs(lccconv_q0[1,l,n]) <= PQmax + and abs(lccconv_q0[1,l,n]) <= PQmax } (l,n); From e39fa12ed9f27cc5b8f482a2e33fb4df8e22e543 Mon Sep 17 00:00:00 2001 From: p-arvy Date: Fri, 3 Jan 2025 19:31:08 +0100 Subject: [PATCH 63/63] small revert Signed-off-by: p-arvy --- open-reac/src/main/resources/openreac/acopf.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/open-reac/src/main/resources/openreac/acopf.mod b/open-reac/src/main/resources/openreac/acopf.mod index 35b42846..5ed1d276 100644 --- a/open-reac/src/main/resources/openreac/acopf.mod +++ b/open-reac/src/main/resources/openreac/acopf.mod @@ -134,7 +134,7 @@ var Red_Tran_Rea_Inv{(qq,m,n) in BRANCHCC } = var Red_Tran_Act_Dir_Side_2_Opened{(qq,m,n) in BRANCHCC_WITH_SIDE_2_OPENED} = (branch_Ror[qq,m,n])**2 * V[m] * (branch_Gor_mod[qq,m,n] + (branch_admi[qq,m,n])**2 * branch_Gex_mod[qq,m,n] / ( (branch_Gex_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 - + (- branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) + + (- branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 ) + ((branch_Bex_mod[qq,m,n])**2 + (branch_Gex_mod[qq,m,n])**2) * branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]) / ( (branch_Gex_mod[qq,m,n] + branch_admi[qq,m,n] * sin(branch_angper[qq,m,n]))**2 + (- branch_Bex_mod[qq,m,n] + branch_admi[qq,m,n] * cos(branch_angper[qq,m,n]))**2 )) ;