From 676681e808263654c772b8aea5fe8f26373bd343 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 001/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../extensions/iidm/BusAsymmetrical.java | 20 + .../network/impl/LfBranchImpl.java | 6 + .../network/util/AsymIeeeFeederParser.java | 643 +++++++++++++ .../network/util/AsymLvFeederParser.java | 352 +++++++ .../openloadflow/ac/Asym13BusFeederTest.java | 2 +- .../openloadflow/ac/Asym34BusFeederTest.java | 6 +- .../util/AsymIeeeFeederParserTest.java | 98 ++ src/test/resources/ieeeFeeder123/Bus.csv | 120 +++ .../ieeeFeeder123/DistributedLoad.csv | 1 + src/test/resources/ieeeFeeder123/Gen.csv | 2 + src/test/resources/ieeeFeeder123/Line.csv | 119 +++ .../resources/ieeeFeeder123/LineConfig.csv | 14 + .../resources/ieeeFeeder123/Regulator.csv | 5 + src/test/resources/ieeeFeeder123/SpotLoad.csv | 86 ++ src/test/resources/ieeeFeeder123/Tfo.csv | 1 + .../resources/ieeeFeeder123/TfoConfig.csv | 1 + src/test/resources/ieeeFeeder13/Bus.csv | 13 + .../ieeeFeeder13/DistributedLoad.csv | 2 + src/test/resources/ieeeFeeder13/Gen.csv | 2 + src/test/resources/ieeeFeeder13/Line.csv | 11 + .../resources/ieeeFeeder13/LineConfig.csv | 8 + src/test/resources/ieeeFeeder13/Regulator.csv | 2 + src/test/resources/ieeeFeeder13/SpotLoad.csv | 10 + src/test/resources/ieeeFeeder13/Tfo.csv | 2 + src/test/resources/ieeeFeeder13/TfoConfig.csv | 3 + src/test/resources/ieeeFeeder34/Bus.csv | 35 + .../ieeeFeeder34/DistributedLoad.csv | 19 + src/test/resources/ieeeFeeder34/Gen.csv | 2 + src/test/resources/ieeeFeeder34/Line.csv | 33 + .../resources/ieeeFeeder34/LineConfig.csv | 6 + src/test/resources/ieeeFeeder34/Regulator.csv | 3 + src/test/resources/ieeeFeeder34/SpotLoad.csv | 7 + src/test/resources/ieeeFeeder34/Tfo.csv | 2 + src/test/resources/ieeeFeeder34/TfoConfig.csv | 3 + src/test/resources/lvFeeder/Buscoords.csv | 908 ++++++++++++++++++ src/test/resources/lvFeeder/LineCodes.csv | 12 + src/test/resources/lvFeeder/Lines.csv | 907 +++++++++++++++++ src/test/resources/lvFeeder/LoadShapes.csv | 57 ++ src/test/resources/lvFeeder/Loads.csv | 58 ++ src/test/resources/lvFeeder/Source.csv | 6 + src/test/resources/lvFeeder/Transformer.csv | 3 + 41 files changed, 3586 insertions(+), 4 deletions(-) create mode 100644 src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java create mode 100644 src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java create mode 100644 src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java create mode 100644 src/test/resources/ieeeFeeder123/Bus.csv create mode 100644 src/test/resources/ieeeFeeder123/DistributedLoad.csv create mode 100644 src/test/resources/ieeeFeeder123/Gen.csv create mode 100644 src/test/resources/ieeeFeeder123/Line.csv create mode 100644 src/test/resources/ieeeFeeder123/LineConfig.csv create mode 100644 src/test/resources/ieeeFeeder123/Regulator.csv create mode 100644 src/test/resources/ieeeFeeder123/SpotLoad.csv create mode 100644 src/test/resources/ieeeFeeder123/Tfo.csv create mode 100644 src/test/resources/ieeeFeeder123/TfoConfig.csv create mode 100644 src/test/resources/ieeeFeeder13/Bus.csv create mode 100644 src/test/resources/ieeeFeeder13/DistributedLoad.csv create mode 100644 src/test/resources/ieeeFeeder13/Gen.csv create mode 100644 src/test/resources/ieeeFeeder13/Line.csv create mode 100644 src/test/resources/ieeeFeeder13/LineConfig.csv create mode 100644 src/test/resources/ieeeFeeder13/Regulator.csv create mode 100644 src/test/resources/ieeeFeeder13/SpotLoad.csv create mode 100644 src/test/resources/ieeeFeeder13/Tfo.csv create mode 100644 src/test/resources/ieeeFeeder13/TfoConfig.csv create mode 100644 src/test/resources/ieeeFeeder34/Bus.csv create mode 100644 src/test/resources/ieeeFeeder34/DistributedLoad.csv create mode 100644 src/test/resources/ieeeFeeder34/Gen.csv create mode 100644 src/test/resources/ieeeFeeder34/Line.csv create mode 100644 src/test/resources/ieeeFeeder34/LineConfig.csv create mode 100644 src/test/resources/ieeeFeeder34/Regulator.csv create mode 100644 src/test/resources/ieeeFeeder34/SpotLoad.csv create mode 100644 src/test/resources/ieeeFeeder34/Tfo.csv create mode 100644 src/test/resources/ieeeFeeder34/TfoConfig.csv create mode 100644 src/test/resources/lvFeeder/Buscoords.csv create mode 100644 src/test/resources/lvFeeder/LineCodes.csv create mode 100644 src/test/resources/lvFeeder/Lines.csv create mode 100644 src/test/resources/lvFeeder/LoadShapes.csv create mode 100644 src/test/resources/lvFeeder/Loads.csv create mode 100644 src/test/resources/lvFeeder/Source.csv create mode 100644 src/test/resources/lvFeeder/Transformer.csv diff --git a/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/BusAsymmetrical.java b/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/BusAsymmetrical.java index e300b1aaf5..8b15cc2f55 100644 --- a/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/BusAsymmetrical.java +++ b/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/BusAsymmetrical.java @@ -65,4 +65,24 @@ public boolean isFortescueRepresentation() { public boolean isPositiveSequenceAsCurrent() { return isPositiveSequenceAsCurrent; } + + public void setPositiveSequenceAsCurrent(boolean positiveSequenceAsCurrent) { + isPositiveSequenceAsCurrent = positiveSequenceAsCurrent; + } + + public void setFortescueRepresentation(boolean fortescueRepresentation) { + isFortescueRepresentation = fortescueRepresentation; + } + + public void setHasPhaseA(boolean hasPhaseA) { + this.hasPhaseA = hasPhaseA; + } + + public void setHasPhaseB(boolean hasPhaseB) { + this.hasPhaseB = hasPhaseB; + } + + public void setHasPhaseC(boolean hasPhaseC) { + this.hasPhaseC = hasPhaseC; + } } diff --git a/src/main/java/com/powsybl/openloadflow/network/impl/LfBranchImpl.java b/src/main/java/com/powsybl/openloadflow/network/impl/LfBranchImpl.java index d4a6087bb5..3f829d261e 100644 --- a/src/main/java/com/powsybl/openloadflow/network/impl/LfBranchImpl.java +++ b/src/main/java/com/powsybl/openloadflow/network/impl/LfBranchImpl.java @@ -172,9 +172,15 @@ private static void createTransfoToAsym(TwoWindingsTransformer t2w, double zb, L if (asymBus1 != null) { side1VariableType = asymBus1.getAsymBusVariableType(); + if (!asymBus1.isFortescueRepresentation()) { + throw new PowsyblException("A three phase transformer must have its busses in Fortescue representation but bus 1 of '" + t2w.getId() + "' is in ABC representation"); + } } if (asymBus2 != null) { side2VariableType = asymBus2.getAsymBusVariableType(); + if (!asymBus2.isFortescueRepresentation()) { + throw new PowsyblException("A three phase transformer must have its busses in Fortescue representation but bus 2 of '" + t2w.getId() + "' is in ABC representation"); + } } AsymThreePhaseTransfo asym3phaseTfo = new AsymThreePhaseTransfo(leg1Type, leg2Type, stepLegConnectionType, diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java new file mode 100644 index 0000000000..4ca3d3aea2 --- /dev/null +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -0,0 +1,643 @@ +package com.powsybl.openloadflow.network.util; + +import com.powsybl.iidm.network.*; +import com.powsybl.iidm.network.extensions.*; +import com.powsybl.math.matrix.DenseMatrix; +import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; +import com.powsybl.openloadflow.util.ComplexMatrix; +import com.univocity.parsers.annotations.Parsed; +import com.univocity.parsers.common.processor.BeanListProcessor; +import com.univocity.parsers.csv.CsvParser; +import com.univocity.parsers.csv.CsvParserSettings; +import org.apache.commons.math3.complex.Complex; +import org.joda.time.DateTime; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.util.*; + +public final class AsymIeeeFeederParser { + + private AsymIeeeFeederParser() { + } + + private static List parseCsv(String resourceName, Class clazz) { + try (Reader inputReader = new InputStreamReader(Objects.requireNonNull(AsymIeeeFeederParser.class.getResourceAsStream(resourceName)), StandardCharsets.UTF_8)) { + BeanListProcessor rowProcessor = new BeanListProcessor<>(clazz); + CsvParserSettings settings = new CsvParserSettings(); + settings.setHeaderExtractionEnabled(true); + settings.setProcessor(rowProcessor); + CsvParser parser = new CsvParser(settings); + parser.parse(inputReader); + return rowProcessor.getBeans(); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + public static class LineData { + @Parsed(field = "NodeA") + String nodeA; + + @Parsed(field = "NodeB") + String nodeB; + + @Parsed(field = "Length") + double length; + + @Parsed(field = "Config") + String config; + } + + public static class TfoData { + @Parsed(field = "NodeA") + String nodeA; + + @Parsed(field = "NodeB") + String nodeB; + + @Parsed(field = "Config") + String config; + } + + public static class GenData { + @Parsed(field = "GenName") + String genName; + + @Parsed(field = "BusName") + String busName; + + @Parsed(field = "SetPoint") + double setPoint; + + } + + public static class BusData { + @Parsed(field = "BusName") + String busName; + + @Parsed(field = "UNom") + double uNom; + + } + + public static class LoadData { + @Parsed(field = "Node") + String busName; + + @Parsed(field = "Load") + String loadType; + + @Parsed(field = "Ph-1") + double ph1P; + + @Parsed(field = "Ph-1Q") + double ph1Q; + + @Parsed(field = "Ph-2") + double ph2P; + + @Parsed(field = "Ph-2Q") + double ph2Q; + + @Parsed(field = "Ph-3") + double ph3P; + + @Parsed(field = "Ph-3Q") + double ph3Q; + + } + + public static class DistriLoadData { + @Parsed(field = "NodeA") + String busNameA; + + @Parsed(field = "NodeB") + String busNameB; + + @Parsed(field = "Load") + String loadType; + + @Parsed(field = "Ph-1") + double ph1P; + + @Parsed(field = "Ph-1Q") + double ph1Q; + + @Parsed(field = "Ph-2") + double ph2P; + + @Parsed(field = "Ph-2Q") + double ph2Q; + + @Parsed(field = "Ph-3") + double ph3P; + + @Parsed(field = "Ph-3Q") + double ph3Q; + } + + public static class LineConfigData { + @Parsed(field = "Config") + String config; + + @Parsed(field = "PhaseA") + int phaseA; + + @Parsed(field = "PhaseB") + int phaseB; + + @Parsed(field = "PhaseC") + int phaseC; + + @Parsed + double r11; + + @Parsed + double x11; + + @Parsed + double r12; + + @Parsed + double x12; + + @Parsed + double r13; + + @Parsed + double x13; + + @Parsed + double r22; + + @Parsed + double x22; + + @Parsed + double r23; + + @Parsed + double x23; + + @Parsed + double r33; + + @Parsed + double x33; + + @Parsed + double b11; + + @Parsed + double b12; + + @Parsed + double b13; + + @Parsed + double b22; + + @Parsed + double b23; + + @Parsed + double b33; + } + + public static class TfoConfigData { + @Parsed(field = "Config") + String config; + + @Parsed(field = "SkVA") + double skva; + + @Parsed(field = "kV-high") + double kvHigh; + + @Parsed(field = "Winding-high") + String windingHigh; + + @Parsed(field = "kV-low") + double kvLow; + + @Parsed(field = "Winding-low") + String windingLow; + + @Parsed(field = "R") + double r; + + @Parsed(field = "X") + double x; + + } + + public static class RegulatorData { + @Parsed(field = "Line") + String line; + + @Parsed(field = "RhoA") + double rhoA; + + @Parsed(field = "RhoB") + double rhoB; + + @Parsed(field = "RhoC") + double rhoC; + + } + + private static String getBusId(String busName) { + return "Bus-" + busName; + } + + private static String getVoltageLevelId(String busName) { + return "VoltageLevel-" + busName; + } + + private static String getSubstationId(String busName) { + return "Substation-" + busName; + } + + private static void createBuses(Network network, Map firstBusTfo, String path) { + for (BusData busData : parseCsv(path + "Bus.csv", BusData.class)) { + + String substationId = getSubstationId(busData.busName); + if (firstBusTfo.containsKey(busData.busName)) { + substationId = getSubstationId(firstBusTfo.get(busData.busName)); + } + Substation s = network.getSubstation(substationId); + if (s == null) { + s = network.newSubstation() + .setId(substationId) + .add(); + } + VoltageLevel vl = s.newVoltageLevel() + .setId(getVoltageLevelId(busData.busName)) + .setTopologyKind(TopologyKind.BUS_BREAKER) + .setNominalV(busData.uNom) + .add(); + Bus bus = vl.getBusBreakerView().newBus() + .setId(getBusId(busData.busName)) + .add(); + + bus.setV(busData.uNom).setAngle(0.); + + // default settings for bus extensions, will be modified depending on the type of connected equipment : + bus.newExtension(BusAsymmetricalAdder.class) + .withBusVariableType(BusVariableType.WYE) + .withHasPhaseA(false) + .withHasPhaseB(false) + .withHasPhaseC(false) + .withPositiveSequenceAsCurrent(true) + .withFortescueRepresentation(true) + .add(); + } + } + + private static void createGenerators(Network network, String path) { + for (GenData gen : parseCsv(path + "Gen.csv", GenData.class)) { + VoltageLevel vl = network.getVoltageLevel(getVoltageLevelId(gen.busName)); + Generator generator = vl.newGenerator() + .setId(gen.genName) + .setBus(getBusId(gen.busName)) + .setMinP(-100.0) + .setMaxP(200) + .setTargetP(0.0) + .setTargetV(vl.getNominalV() * gen.setPoint) // TODO : TEST + .setVoltageRegulatorOn(true) + .add(); + + Complex zz = new Complex(0.0001, 0.0001); + Complex zn = new Complex(0.0001, 0.0001); + + generator.newExtension(GeneratorFortescueAdder.class) + .withRz(zz.getReal()) + .withXz(zz.getImaginary()) + .withRn(zn.getReal()) + .withXn(zn.getImaginary()) + .add(); + + // modification of bus extension due to generating unit + network.getBusBreakerView().getBus(getBusId(gen.busName)).getExtension(BusAsymmetrical.class).setPositiveSequenceAsCurrent(false); + + } + } + + private static List parseTfos(String path) { + + List listTfos = new ArrayList<>(); + for (TfoData tfo : parseCsv(path + "Tfo.csv", TfoData.class)) { + listTfos.add(tfo); + } + + return listTfos; + } + + private static Map getFirstBusTfo(List listTfos) { + // used to create a substation with the name of the first bus for a tfo + Map firstBusTfo = new HashMap<>(); + for (TfoData tfo : listTfos) { + firstBusTfo.put(tfo.nodeB, tfo.nodeA); + } + + return firstBusTfo; + } + + private static void createLoad(Network network, String loadName, String busName, String loadType, + double pa, double qa, double pb, double qb, double pc, double qc) { + VoltageLevel vl = network.getVoltageLevel(getVoltageLevelId(busName)); + Load load = vl.newLoad() + .setId(loadName) + .setBus(getBusId(busName)) + .setP0(0.) + .setQ0(0.) + .add(); + + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); + LoadConnectionType loadConnectionType; + LoadType loadTypeOut; + if (loadType.equals("Y-PQ")) { + loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; + } else if (loadType.equals("D-PQ")) { + loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; + } else if (loadType.equals("Y-Z")) { + loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + extensionBus.setFortescueRepresentation(false); + } else if (loadType.equals("D-Z")) { + loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + extensionBus.setFortescueRepresentation(false); + } else if (loadType.equals("Y-I")) { + loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_CURRENT; + extensionBus.setFortescueRepresentation(false); + } else if (loadType.equals("D-I")) { + loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_CURRENT; + extensionBus.setFortescueRepresentation(false); + } else { + throw new IllegalStateException("Unknown load type in csv at bus : " + busName); + } + + load.newExtension(LoadAsymmetricalAdder.class) + .withDeltaPa(pa / 1000.) + .withDeltaQa(qa / 1000.) + .withDeltaPb(pb / 1000.) + .withDeltaQb(qb / 1000.) + .withDeltaPc(pc / 1000.) + .withDeltaQc(qc / 1000.) + .withConnectionType(loadConnectionType) + .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + + } + + private static void createLoads(Network network, String path) { + + for (LoadData loadData : parseCsv(path + "SpotLoad.csv", LoadData.class)) { + + String loadName = "LOAD_" + loadData.busName + "-" + loadData.loadType; + + createLoad(network, loadName, loadData.busName, loadData.loadType, + loadData.ph1P, loadData.ph1Q, loadData.ph2P, loadData.ph2Q, loadData.ph3P, loadData.ph3Q); + } + } + + private static void createDistriLoads(Network network, String path) { + + for (DistriLoadData loadData : parseCsv(path + "DistributedLoad.csv", DistriLoadData.class)) { + String loadName = "LOAD_" + loadData.busNameA + "-" + loadData.busNameB + "-" + loadData.loadType; + + createLoad(network, loadName, loadData.busNameA, loadData.loadType, + loadData.ph1P, loadData.ph1Q, loadData.ph2P, loadData.ph2Q, loadData.ph3P, loadData.ph3Q); + } + } + + private static void createLines(Network network, String path) { + Map lineConfig = new HashMap<>(); + for (LineConfigData lineCode : parseCsv(path + "LineConfig.csv", LineConfigData.class)) { + lineConfig.put(lineCode.config, lineCode); + } + Map regulatorDataMap = new HashMap<>(); + for (RegulatorData regulatorData : parseCsv(path + "Regulator.csv", RegulatorData.class)) { + String lineName = "Line-" + regulatorData.line; + regulatorDataMap.put(lineName, regulatorData); + } + + for (LineData line : parseCsv(path + "Line.csv", LineData.class)) { + LineConfigData lineConfigData = lineConfig.get(line.config); + var l = network.newLine() + .setId("Line-" + line.nodeA + "-" + line.nodeB) + .setVoltageLevel1(getVoltageLevelId(line.nodeA)) + .setBus1(getBusId(line.nodeA)) + .setVoltageLevel2(getVoltageLevelId(line.nodeB)) + .setBus2(getBusId(line.nodeB)) + .setR(1.0 * line.length / 1000) + .setX(1.0 * line.length / 1000) + .add(); + + l.newExtension(LineFortescueAdder.class) + .withOpenPhaseA(false) + .withOpenPhaseB(false) + .withOpenPhaseC(false) + .withRz(1.0 * line.length / 1000) + .withXz(1.0 * line.length / 1000) + .add(); + + double micro = 0.000001; + double feetInMile = 5280; + double yCoef = 1. / 3.; + + // building of Yabc from given Y impedance matrix Zy + ComplexMatrix zy = new ComplexMatrix(3, 3); + zy.set(1, 1, new Complex(lineConfigData.r11, lineConfigData.x11)); + zy.set(1, 2, new Complex(lineConfigData.r12, lineConfigData.x12)); + zy.set(1, 3, new Complex(lineConfigData.r13, lineConfigData.x13)); + zy.set(2, 1, new Complex(lineConfigData.r12, lineConfigData.x12)); + zy.set(2, 2, new Complex(lineConfigData.r22, lineConfigData.x22)); + zy.set(2, 3, new Complex(lineConfigData.r23, lineConfigData.x23)); + zy.set(3, 1, new Complex(lineConfigData.r13, lineConfigData.x13)); + zy.set(3, 2, new Complex(lineConfigData.r23, lineConfigData.x23)); + zy.set(3, 3, new Complex(lineConfigData.r33, lineConfigData.x33)); + + ComplexMatrix b = new ComplexMatrix(3, 3); + + b.set(1, 1, new Complex(0, micro * lineConfigData.b11)); + b.set(1, 2, new Complex(0, micro * lineConfigData.b12)); + b.set(1, 3, new Complex(0, micro * lineConfigData.b13)); + b.set(2, 1, new Complex(0, micro * lineConfigData.b12)); + b.set(2, 2, new Complex(0, micro * lineConfigData.b22)); + b.set(2, 3, new Complex(0, micro * lineConfigData.b23)); + b.set(3, 1, new Complex(0, micro * lineConfigData.b13)); + b.set(3, 2, new Complex(0, micro * lineConfigData.b23)); + b.set(3, 3, new Complex(0, micro * lineConfigData.b33)); + + boolean hasPhaseA = lineConfigData.phaseA == 1; + boolean hasPhaseB = lineConfigData.phaseB == 1; + boolean hasPhaseC = lineConfigData.phaseC == 1; + + ComplexMatrix yabc = LineAsymmetrical.getAdmittanceMatrixFromImpedanceAndBmatrix(zy, b, + hasPhaseA, hasPhaseB, hasPhaseC, line.length / feetInMile); + if (regulatorDataMap.containsKey(l.getId())) { + // take into account effect of regulator + RegulatorData regulatorData = regulatorDataMap.get(l.getId()); + ComplexMatrix rho = new ComplexMatrix(6, 6); + rho.set(1, 1, new Complex(regulatorData.rhoA, 0.)); + rho.set(2, 2, new Complex(regulatorData.rhoB, 0.)); + rho.set(3, 3, new Complex(regulatorData.rhoC, 0.)); + rho.set(4, 4, new Complex(1., 0.)); + rho.set(5, 5, new Complex(1., 0.)); + rho.set(6, 6, new Complex(1., 0.)); + DenseMatrix yabcRho = rho.getRealCartesianMatrix().times(yabc.getRealCartesianMatrix().times(rho.getRealCartesianMatrix())); + yabc = ComplexMatrix.getComplexMatrixFromRealCartesian(yabcRho); + } + + l.newExtension(LineAsymmetricalAdder.class) + .withYabc(ComplexMatrix.getMatrixScaled(yabc, yCoef)) + .add(); + + // modification of bus extension depending on line connections: + var extensionBus1 = network.getBusBreakerView().getBus(getBusId(line.nodeA)).getExtension(BusAsymmetrical.class); + var extensionBus2 = network.getBusBreakerView().getBus(getBusId(line.nodeB)).getExtension(BusAsymmetrical.class); + + extensionBus1.setHasPhaseA(extensionBus1.isHasPhaseA() || hasPhaseA); + extensionBus1.setHasPhaseB(extensionBus1.isHasPhaseB() || hasPhaseB); + extensionBus1.setHasPhaseC(extensionBus1.isHasPhaseC() || hasPhaseC); + + extensionBus2.setHasPhaseA(extensionBus2.isHasPhaseA() || hasPhaseA); + extensionBus2.setHasPhaseB(extensionBus2.isHasPhaseB() || hasPhaseB); + extensionBus2.setHasPhaseC(extensionBus2.isHasPhaseC() || hasPhaseC); + + } + } + + private static void createTfos(Network network, String path) { + Map tfoConfigDataMap = new HashMap<>(); + for (TfoConfigData tfoConfig : parseCsv(path + "TfoConfig.csv", TfoConfigData.class)) { + tfoConfigDataMap.put(tfoConfig.config, tfoConfig); + } + for (TfoData tfoData : parseCsv(path + "Tfo.csv", TfoData.class)) { + TfoConfigData tfoConfigData = tfoConfigDataMap.get(tfoData.config); + double ratedUhigh = tfoConfigData.kvHigh; + double ratedUlow = tfoConfigData.kvLow; + double sBase = tfoConfigData.skva / 1000.; + double rTpc = tfoConfigData.r; + double xTpc = tfoConfigData.x; + double zBase = ratedUhigh * ratedUlow / sBase; + double rT = rTpc * zBase / 100.; + double xT = xTpc * zBase / 100.; + + var tfo = network.getSubstation(getSubstationId(tfoData.nodeA)).newTwoWindingsTransformer() + .setId("Tfo-" + tfoData.nodeA + "-" + tfoData.nodeB) + .setVoltageLevel1(network.getVoltageLevel(getVoltageLevelId(tfoData.nodeA)).getId()) + .setBus1(getBusId(tfoData.nodeA)) + .setConnectableBus1(getBusId(tfoData.nodeA)) + .setRatedU1(ratedUhigh) + .setVoltageLevel2(network.getVoltageLevel(getVoltageLevelId(tfoData.nodeB)).getId()) + .setBus2(getBusId(tfoData.nodeB)) + .setConnectableBus2(getBusId(tfoData.nodeB)) + .setRatedU2(ratedUlow) + .setR(rT) + .setX(xT) + .setG(0.0D) + .setB(0.0D) + .setRatedS(sBase) + .add(); + + WindingConnectionType windingConnectionType1; + if (tfoConfigData.windingHigh.equals("Gr.Y") || tfoConfigData.windingHigh.equals("Gr.W")) { + windingConnectionType1 = WindingConnectionType.Y_GROUNDED; + } else { + windingConnectionType1 = WindingConnectionType.DELTA; + } + + WindingConnectionType windingConnectionType2; + if (tfoConfigData.windingLow.equals("Gr.Y") || tfoConfigData.windingLow.equals("Gr.W")) { + windingConnectionType2 = WindingConnectionType.Y_GROUNDED; + } else { + windingConnectionType2 = WindingConnectionType.DELTA; + } + + tfo.newExtension(TwoWindingsTransformerFortescueAdder.class) + .withRz(rT) + .withXz(xT) + .withConnectionType1(windingConnectionType1) + .withConnectionType2(windingConnectionType2) + .withGroundingX1(0.0000) + .withGroundingX2(0.0000) + .withFreeFluxes(true) + .add(); + + Complex zPhase = new Complex(rTpc, xTpc).multiply(zBase / 3. / 100.); + Complex yPhase = new Complex(0., 0.); + + tfo.newExtension(Tfo3PhasesAdder.class) + .withIsOpenPhaseA1(false) + .withIsOpenPhaseB1(false) + .withIsOpenPhaseC1(false) + .withYa(buildSinglePhaseAdmittanceMatrix(zPhase, yPhase, yPhase)) + .withYb(buildSinglePhaseAdmittanceMatrix(zPhase, yPhase, yPhase)) + .withYc(buildSinglePhaseAdmittanceMatrix(zPhase, yPhase, yPhase)) + .add(); + + // modification of bus extension depending on line connections: + var extensionBus1 = network.getBusBreakerView().getBus(getBusId(tfoData.nodeA)).getExtension(BusAsymmetrical.class); + var extensionBus2 = network.getBusBreakerView().getBus(getBusId(tfoData.nodeB)).getExtension(BusAsymmetrical.class); + + extensionBus1.setHasPhaseA(true); + extensionBus1.setHasPhaseB(true); + extensionBus1.setHasPhaseC(true); + + extensionBus2.setHasPhaseA(true); + extensionBus2.setHasPhaseB(true); + extensionBus2.setHasPhaseC(true); + + extensionBus1.setFortescueRepresentation(true); + extensionBus2.setFortescueRepresentation(true); + } + } + + public static ComplexMatrix buildSinglePhaseAdmittanceMatrix(Complex z, Complex y1, Complex y2) { + ComplexMatrix cm = new ComplexMatrix(2, 2); + cm.set(1, 1, y1.add(z.reciprocal())); + cm.set(1, 2, z.reciprocal().multiply(-1.)); + cm.set(2, 1, z.reciprocal().multiply(-1.)); + cm.set(2, 2, y2.add(z.reciprocal())); + + return cm; + } + + public static Network create(String path) { + return create(NetworkFactory.findDefault(), path); + } + + public static Network create(NetworkFactory networkFactory, String path) { + Network network = networkFactory.createNetwork("EuropeanLvTestFeeder", "csv"); + network.setCaseDate(DateTime.parse("2023-04-11T23:59:00.000+01:00")); + + // for substation naming when there are tfos: + List listTfos = parseTfos(path); + Map firstBusTfo = getFirstBusTfo(listTfos); + + createBuses(network, firstBusTfo, path); + createLines(network, path); + createGenerators(network, path); + createLoads(network, path); + createDistriLoads(network, path); + createTfos(network, path); + + return network; + } + +} diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java new file mode 100644 index 0000000000..5b70c85e15 --- /dev/null +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -0,0 +1,352 @@ +package com.powsybl.openloadflow.network.util; + +import com.powsybl.commons.PowsyblException; +import com.powsybl.iidm.network.*; +import com.powsybl.iidm.network.extensions.*; +import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; +import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; +import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; +import com.univocity.parsers.annotations.Parsed; +import com.univocity.parsers.common.processor.BeanListProcessor; +import com.univocity.parsers.csv.CsvParser; +import com.univocity.parsers.csv.CsvParserSettings; +import org.apache.commons.math3.complex.Complex; +import org.joda.time.DateTime; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +public final class AsymLvFeederParser { + private AsymLvFeederParser() { + } + + private static List parseCsv(String resourceName, Class clazz) { + try (Reader inputReader = new InputStreamReader(Objects.requireNonNull(AsymLvFeederParser.class.getResourceAsStream(resourceName)), StandardCharsets.UTF_8)) { + BeanListProcessor rowProcessor = new BeanListProcessor<>(clazz); + CsvParserSettings settings = new CsvParserSettings(); + settings.setHeaderExtractionEnabled(true); + settings.setProcessor(rowProcessor); + CsvParser parser = new CsvParser(settings); + parser.parse(inputReader); + return rowProcessor.getBeans(); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + private static String getBusId(int busName) { + return "Bus-" + busName; + } + + private static String getVoltageLevelId(int busName) { + return "VoltageLevel-" + busName; + } + + private static String getSubstationId(int busName) { + return "Substation-" + busName; + } + + public static class BusCoord { + @Parsed(field = "Busname") + int busName; + + @Parsed + double x; + + @Parsed + double y; + } + + public static class Line { + @Parsed(field = "Name") + String name; + + @Parsed(field = "Bus1") + int bus1; + + @Parsed(field = "Bus2") + int bus2; + + @Parsed(field = "Phases") + String phases; + + @Parsed(field = "Length") + double length; + + @Parsed(field = "Units") + String units; + + @Parsed(field = "LineCode") + String code; + } + + public static class LineCode { + @Parsed(field = "Name") + String name; + + @Parsed + int nphases; + + @Parsed(field = "R1") + double r1; + + @Parsed(field = "X1") + double x1; + + @Parsed(field = "R0") + double r0; + + @Parsed(field = "X0") + double x0; + + @Parsed(field = "C1") + double c1; + + @Parsed(field = "C0") + double c0; + + @Parsed(field = "Units") + String units; + } + + public static class Load { + @Parsed(field = "Name") + String name; + + @Parsed + int numPhases; + + @Parsed(field = "Bus") + int bus; + + @Parsed + char phases; + + @Parsed + double kV; + + @Parsed(field = "Model") + int model; + + @Parsed(field = "Connection") + String connection; + + @Parsed + double kW; + + @Parsed(field = "PF") + double pf; + + @Parsed(field = "Yearly") + String yearly; + } + + public static class Transformer { + @Parsed(field = "Name") + String name; + + @Parsed + int phases; + + @Parsed + String bus1; + + @Parsed + int bus2; + + @Parsed(field = "kV_pri") + double kvPri; + + @Parsed(field = "kV_sec") + double kvSec; + + @Parsed(field = "MVA") + double mva; + + @Parsed(field = "Conn_pri") + String connPri; + + @Parsed(field = "Conn_sec") + String connSec; + + @Parsed(field = "%XHL") + double xhl; + + @Parsed(field = "% resistance") + double resistance; + } + + private static void createBuses(Network network, String path) { + for (BusCoord busCoord : parseCsv(path + "Buscoords.csv", BusCoord.class)) { + String substationId = getSubstationId(busCoord.busName); + Substation s = network.getSubstation(substationId); + if (s == null) { + s = network.newSubstation() + .setId(substationId) + .add(); + } + VoltageLevel vl = s.newVoltageLevel() + .setId(getVoltageLevelId(busCoord.busName)) + .setTopologyKind(TopologyKind.BUS_BREAKER) + .setNominalV(1) + .add(); + Bus bus = vl.getBusBreakerView().newBus() + .setId(getBusId(busCoord.busName)) + .add(); + + // default settings for bus extensions, will be modified depending on the type of connected equipment : + bus.newExtension(BusAsymmetricalAdder.class) + .withBusVariableType(BusVariableType.WYE) + .withHasPhaseA(true) + .withHasPhaseB(true) + .withHasPhaseC(true) + .withPositiveSequenceAsCurrent(true) + .withFortescueRepresentation(true) + .add(); + } + } + + private static void createLines(Network network, String path) { + Map lineCodes = new HashMap<>(); + for (LineCode lineCode : parseCsv(path + "LineCodes.csv", LineCode.class)) { + lineCodes.put(lineCode.name, lineCode); + } + double coeff = 1 / 1000.; + for (Line line : parseCsv(path + "Lines.csv", Line.class)) { + LineCode lineCode = lineCodes.get(line.code); + var l = network.newLine() + .setId("Line-" + line.bus1 + "-" + line.bus2) + .setVoltageLevel1(getVoltageLevelId(line.bus1)) + .setBus1(getBusId(line.bus1)) + .setVoltageLevel2(getVoltageLevelId(line.bus2)) + .setBus2(getBusId(line.bus2)) + .setR(lineCode.r1 * line.length * coeff) + .setX(lineCode.x1 * line.length * coeff) + .add(); + l.newExtension(LineFortescueAdder.class) + .withRz(lineCode.r0 * line.length * coeff) + .withXz(lineCode.x0 * line.length * coeff) + .add(); + } + } + + private static LoadConnectionType getConnectionType(Load load) { + if (load.connection.equals("wye")) { + return LoadConnectionType.Y; + } + throw new PowsyblException("Unknown load connection: " + load.connection); + } + + private static void createLoads(Network network, String path) { + for (Load load : parseCsv(path + "Loads.csv", Load.class)) { + var vl = network.getVoltageLevel(getVoltageLevelId(load.bus)); + double p0 = load.kW / 1000; + double q0 = p0 * load.pf; + var l = vl.newLoad() + .setId("Load-" + load.bus) + .setBus(getBusId(load.bus)) + .setP0(0.) + .setQ0(0.) + .add(); + double defaultLoad = 0.000; + double deltaPa = defaultLoad; + double deltaQa = defaultLoad; + double deltaPb = defaultLoad; + double deltaQb = defaultLoad; + double deltaPc = defaultLoad; + double deltaQc = defaultLoad; + switch (load.phases) { + case 'A': + deltaPa += p0; + deltaQa += q0; + break; + case 'B': + deltaPb += p0; + deltaQb += q0; + break; + case 'C': + deltaPc += p0; + deltaQc += q0; + break; + default: + throw new PowsyblException("Unknown phase: " + load.phases); + } + l.newExtension(LoadAsymmetricalAdder.class) + .withConnectionType(getConnectionType(load)) + .withDeltaPa(deltaPa) + .withDeltaQa(deltaQa) + .withDeltaPb(deltaPb) + .withDeltaQb(deltaQb) + .withDeltaPc(deltaPc) + .withDeltaQc(deltaQc) + .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + } + } + + private static void createSource(Network network) { + int busName = 1; + VoltageLevel vl = network.getVoltageLevel(getVoltageLevelId(busName)); + Generator generator = vl.newGenerator() + .setId("G150") + .setBus(getBusId(busName)) + .setMinP(-100.0) + .setMaxP(200) + .setTargetP(0) + .setTargetV(vl.getNominalV() * 1.05) + .setVoltageRegulatorOn(true) + .add(); + + Complex zz = new Complex(0.0001, 0.0001); // 0.0001 , 0.001 + Complex zn = new Complex(0.0001, 0.0001); // 0.001 , 0.01 + + generator.newExtension(GeneratorFortescueAdder.class) + .withRz(zz.getReal()) + .withXz(zz.getImaginary()) + .withRn(zn.getReal()) + .withXn(zn.getImaginary()) + .add(); + + // modification of bus extension due to generating unit + network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class).setPositiveSequenceAsCurrent(false); + } + + private static WindingConnectionType getConnectionType(String conn) { + switch (conn) { + case "Delta": + return WindingConnectionType.DELTA; + case "Wye": + return WindingConnectionType.Y; + default: + throw new PowsyblException("Connection type not supported: " + conn); + } + } + + public static Network create(String path) { + return create(NetworkFactory.findDefault(), path); + } + + public static Network create(NetworkFactory networkFactory, String path) { + Network network = networkFactory.createNetwork("EuropeanLvTestFeeder", "csv"); + network.setCaseDate(DateTime.parse("2023-04-11T23:59:00.000+01:00")); + + createBuses(network, path); + createSource(network); + createLines(network, path); + createLoads(network, path); + return network; + } + +} diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym13BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym13BusFeederTest.java index f0e62dfb15..4582cc369c 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym13BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym13BusFeederTest.java @@ -295,7 +295,7 @@ void ieee13LoadWithConstantImpedanceDeltaTest() { assertVoltageEquals(4.290533459921324, bus632); assertVoltageEquals(4.2520625000874075, bus645); assertVoltageEquals(4.243258426216129, bus646); - assertVoltageEquals(4.154403168622116, bus652); + assertVoltageEquals(4.165204333227582, bus652); } @Test diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index 28d8d4b15c..b960dba8a4 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -884,7 +884,7 @@ public static Network ieee34LoadFeeder() { bus832.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(BusVariableType.WYE) .withPositiveSequenceAsCurrent(true) - .withFortescueRepresentation(false) + .withFortescueRepresentation(true) .add(); double p832 = 0.; @@ -907,7 +907,7 @@ public static Network ieee34LoadFeeder() { .add(); load832.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible .add(); // Bus 888 @@ -926,7 +926,7 @@ public static Network ieee34LoadFeeder() { bus888.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(BusVariableType.WYE) .withPositiveSequenceAsCurrent(true) - .withFortescueRepresentation(false) + .withFortescueRepresentation(true) .add(); // Bus 890 diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java new file mode 100644 index 0000000000..d489c65980 --- /dev/null +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -0,0 +1,98 @@ +package com.powsybl.openloadflow.util; + +import com.powsybl.iidm.network.Network; +import com.powsybl.loadflow.LoadFlow; +import com.powsybl.loadflow.LoadFlowParameters; +import com.powsybl.loadflow.LoadFlowResult; +import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.openloadflow.OpenLoadFlowParameters; +import com.powsybl.openloadflow.OpenLoadFlowProvider; +import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; +import com.powsybl.openloadflow.network.util.AsymLvFeederParser; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class AsymIeeeFeederParserTest { + + private LoadFlow.Runner loadFlowRunner; + private LoadFlowParameters parameters; + + @BeforeEach + void setUp() { + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) + .setDistributedSlack(false); + + OpenLoadFlowParameters.create(parameters) + .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) + .setMaxNewtonRaphsonIterations(100) + .setMaxActivePowerMismatch(0.0001) + .setMaxReactivePowerMismatch(0.0001) + .setNewtonRaphsonConvEpsPerEq(0.0001) + .setMaxVoltageMismatch(0.0001) + .setMaxSusceptanceMismatch(0.0001) + .setMaxAngleMismatch(0.0001) + .setMaxRatioMismatch(0.0001) + .setAsymmetrical(true); + } + + @Test + void test13BussesTest() { + + Network network = AsymIeeeFeederParser.create("/ieeeFeeder13/"); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + assertVoltageEquals(4.276427533655057, network.getBusBreakerView().getBus("Bus-632")); + } + + @Test + void test34BussesTest() { + + Network network = AsymIeeeFeederParser.create("/ieeeFeeder34/"); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + assertVoltageEquals(26.145, network.getBusBreakerView().getBus("Bus-800")); + assertVoltageEquals(25.86703194305272, network.getBusBreakerView().getBus("Bus-832")); + } + + @Test + void test123BussesTest() { + + Network network = AsymIeeeFeederParser.create("/ieeeFeeder123/"); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + assertVoltageEquals(4.16, network.getBusBreakerView().getBus("Bus-150")); + assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); + } + + @Disabled + @Test + void testLvFeedersTest() { + + OpenLoadFlowParameters.create(parameters) + .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) + .setMaxNewtonRaphsonIterations(100) + .setMaxActivePowerMismatch(0.0000001) + .setMaxReactivePowerMismatch(0.0000001) + .setNewtonRaphsonConvEpsPerEq(0.0000001) + .setMaxVoltageMismatch(0.00001) + .setMaxSusceptanceMismatch(0.0001) + .setMaxAngleMismatch(0.0001) + .setMaxRatioMismatch(0.0001) + .setAsymmetrical(true); + + Network network = AsymLvFeederParser.create("/lvFeeder/"); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + } + +} diff --git a/src/test/resources/ieeeFeeder123/Bus.csv b/src/test/resources/ieeeFeeder123/Bus.csv new file mode 100644 index 0000000000..033b1a0ab3 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Bus.csv @@ -0,0 +1,120 @@ +BusName,UNom +150,4.16 +1,4.16 +2,4.16 +3,4.16 +4,4.16 +5,4.16 +6,4.16 +7,4.16 +8,4.16 +12,4.16 +9,4.16 +13,4.16 +14,4.16 +18,4.16 +11,4.16 +10,4.16 +15,4.16 +16,4.16 +17,4.16 +19,4.16 +21,4.16 +20,4.16 +22,4.16 +23,4.16 +24,4.16 +25,4.16 +26,4.16 +28,4.16 +27,4.16 +31,4.16 +33,4.16 +29,4.16 +30,4.16 +250,4.16 +32,4.16 +34,4.16 +35,4.16 +36,4.16 +40,4.16 +37,4.16 +38,4.16 +39,4.16 +41,4.16 +42,4.16 +43,4.16 +44,4.16 +45,4.16 +47,4.16 +46,4.16 +48,4.16 +49,4.16 +50,4.16 +51,4.16 +151,4.16 +52,4.16 +53,4.16 +54,4.16 +57,4.16 +55,4.16 +56,4.16 +58,4.16 +60,4.16 +59,4.16 +61,4.16 +62,4.16 +63,4.16 +64,4.16 +65,4.16 +66,4.16 +67,4.16 +68,4.16 +72,4.16 +69,4.16 +70,4.16 +71,4.16 +73,4.16 +76,4.16 +74,4.16 +75,4.16 +77,4.16 +78,4.16 +79,4.16 +80,4.16 +81,4.16 +82,4.16 +84,4.16 +83,4.16 +85,4.16 +86,4.16 +87,4.16 +88,4.16 +89,4.16 +90,4.16 +91,4.16 +92,4.16 +93,4.16 +94,4.16 +95,4.16 +96,4.16 +97,4.16 +98,4.16 +99,4.16 +100,4.16 +450,4.16 +101,4.16 +102,4.16 +105,4.16 +103,4.16 +104,4.16 +106,4.16 +108,4.16 +107,4.16 +109,4.16 +300,4.16 +110,4.16 +111,4.16 +112,4.16 +113,4.16 +114,4.16 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder123/DistributedLoad.csv b/src/test/resources/ieeeFeeder123/DistributedLoad.csv new file mode 100644 index 0000000000..65cf9c2d6e --- /dev/null +++ b/src/test/resources/ieeeFeeder123/DistributedLoad.csv @@ -0,0 +1 @@ +NodeA,NodeB,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q diff --git a/src/test/resources/ieeeFeeder123/Gen.csv b/src/test/resources/ieeeFeeder123/Gen.csv new file mode 100644 index 0000000000..5b4542d8fa --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Gen.csv @@ -0,0 +1,2 @@ +GenName,busName,SetPoint +G150,150,1.0 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder123/Line.csv b/src/test/resources/ieeeFeeder123/Line.csv new file mode 100644 index 0000000000..b2a8bf6652 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Line.csv @@ -0,0 +1,119 @@ +NodeA,NodeB,Length,Config +1,2,175,10 +1,3,250,11 +1,7,300,1 +3,4,200,11 +3,5,325,11 +5,6,250,11 +7,8,200,1 +8,12,225,10 +8,9,225,9 +8,13,300,1 +9,14,425,9 +13,34,150,11 +13,18,825,2 +14,11,250,9 +14,10,250,9 +15,16,375,11 +15,17,350,11 +18,19,250,9 +18,21,300,2 +19,20,325,9 +21,22,525,10 +21,23,250,2 +23,24,550,11 +23,25,275,2 +25,26,350,7 +25,28,200,2 +26,27,275,7 +26,31,225,11 +27,33,500,9 +28,29,300,2 +29,30,350,2 +30,250,200,2 +31,32,300,11 +34,15,100,11 +35,36,650,8 +35,40,250,1 +36,37,300,9 +36,38,250,10 +38,39,325,10 +40,41,325,11 +40,42,250,1 +42,43,500,10 +42,44,200,1 +44,45,200,9 +44,47,250,1 +45,46,300,9 +47,48,150,4 +47,49,250,4 +49,50,250,4 +50,51,250,4 +51,151,500,4 +52,53,200,1 +53,54,125,1 +54,55,275,1 +54,57,350,3 +55,56,275,1 +57,58,250,10 +57,60,750,3 +58,59,250,10 +60,61,550,5 +60,62,250,12 +62,63,175,12 +63,64,350,12 +64,65,425,12 +65,66,325,12 +67,68,200,9 +67,72,275,3 +67,97,250,3 +68,69,275,9 +69,70,325,9 +70,71,275,9 +72,73,275,11 +72,76,200,3 +73,74,350,11 +74,75,400,11 +76,77,400,6 +76,86,700,3 +77,78,100,6 +78,79,225,6 +78,80,475,6 +80,81,475,6 +81,82,250,6 +81,84,675,11 +82,83,250,6 +84,85,475,11 +86,87,450,6 +87,88,175,9 +87,89,275,6 +89,90,225,10 +89,91,225,6 +91,92,300,11 +91,93,225,6 +93,94,275,9 +93,95,300,6 +95,96,200,10 +97,98,275,3 +98,99,550,3 +99,100,300,3 +100,450,800,3 +101,102,225,11 +101,105,275,3 +102,103,325,11 +103,104,700,11 +105,106,225,10 +105,108,325,3 +106,107,575,10 +108,109,450,9 +108,300,1000,3 +109,110,300,9 +110,111,575,9 +110,112,125,9 +112,113,525,9 +113,114,325,9 +18,35,375,4 +150,1,400,1 +13,52,400,1 +60,67,350,6 +97,101,250,3 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder123/LineConfig.csv b/src/test/resources/ieeeFeeder123/LineConfig.csv new file mode 100644 index 0000000000..6345fc3ead --- /dev/null +++ b/src/test/resources/ieeeFeeder123/LineConfig.csv @@ -0,0 +1,14 @@ +Config,PhaseA,PhaseB,PhaseC,r11,x11,r12,x12,r13,x13,r22,x22,r23,x23,r33,x33,b11,b12,b13,b22,b23,b33 +1,1,1,1,0.4576,1.0780,0.1560,0.5017,0.1535,0.3849,0.4666,1.0482,0.1580,0.4236,0.4615,1.0651,5.6765,-1.8319,-0.6982,5.9809,-1.1645,5.3971 +2,1,1,1,0.4666,1.0482,0.1580,0.4236,0.1560,0.5017,0.4615,1.0651,0.1535,0.3849,0.4576,1.0780,5.9809,-1.1645,-1.8319,5.3971,-0.6982,5.6765 +3,1,1,1,0.4615,1.0651,0.1535,0.3849,0.1580,0.4236,0.4576,1.0780,0.1560,0.5017,0.4666,1.0482,5.3971,-0.6982,-1.1645,5.6765,-1.8319,5.9809 +4,1,1,1,0.4615,1.0651,0.1580,0.4236,0.1535,0.3849,0.4666,1.0482,0.1560,0.5017,0.4576,1.0780,5.3971,-1.1645,-0.6982,5.9809,-1.8319,5.6765 +5,1,1,1,0.4666,1.0482,0.1560,0.5017,0.1580,0.4236,0.4576,1.0780,0.1535,0.3849,0.4615,1.0651,5.9809,-1.8319,-1.1645,5.6765,-0.6982,5.3971 +6,1,1,1,0.4576,1.0780,0.1535,0.3849,0.1560,0.5017,0.4615,1.0651,0.1580,0.4236,0.4666,1.0482,5.6765,-0.6982,-1.8319,5.3971,-1.1645,5.9809 +7,1,0,1,0.4576,1.0780,0.0000,0.0000,0.1535,0.3849,0.0000,0.0000,0.0000,0.0000,0.4615,1.0651,5.1154,0.0000,-1.0549,0.0000,0.0000,5.1704 +8,1,1,0,0.4576,1.0780,0.1535,0.3849,0.0000,0.0000,0.4615,1.0651,0.0000,0.0000,0.0000,0.0000,5.1154,-1.0549,0.0000,5.1704,0.0000,0.0000 +9,1,0,0,1.3292,1.3475,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.5193,0.0000,0.0000,0.0000,0.0000,0.0000 +10,0,1,0,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.3292,1.3475,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.5193,0.0000,0.0000 +11,0,0,1,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.3292,1.3475,0.0000,0.0000,0.0000,0.0000,0.0000,4.5193 +12,1,1,1,1.5209,0.7521,0.5198,0.2775,0.4924,0.2157,1.5329,0.7162,0.5198,0.2775,1.5209,0.7521,67.2242,0.0000,0.0000,67.2242,0.0000,67.2242 + diff --git a/src/test/resources/ieeeFeeder123/Regulator.csv b/src/test/resources/ieeeFeeder123/Regulator.csv new file mode 100644 index 0000000000..b680c8f64f --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Regulator.csv @@ -0,0 +1,5 @@ +Line,RhoA,RhoB,RhoC +150-1,1.0437,1.0438,1.0438 +60-67,1.05,1.00624,1.03123 +25-26,1.0,1.0,0.9937 +9-14,0.9937,1.0,1.0 diff --git a/src/test/resources/ieeeFeeder123/SpotLoad.csv b/src/test/resources/ieeeFeeder123/SpotLoad.csv new file mode 100644 index 0000000000..d3327baa38 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/SpotLoad.csv @@ -0,0 +1,86 @@ +Node,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +1,Y-PQ,40,20,0,0,0,0 +2,Y-PQ,0,0,20,10,0,0 +4,Y-PQ,0,0,0,0,40,20 +5,Y-I,0,0,0,0,20,10 +6,Y-Z,0,0,0,0,40,20 +7,Y-PQ,20,10,0,0,0,0 +9,Y-PQ,40,20,0,0,0,0 +10,Y-I,20,10,0,0,0,0 +11,Y-Z,40,20,0,0,0,0 +12,Y-PQ,0,0,20,10,0,0 +16,Y-PQ,0,0,0,0,40,20 +17,Y-PQ,0,0,0,0,20,10 +19,Y-PQ,40,20,0,0,0,0 +20,Y-I,40,20,0,0,0,0 +22,Y-Z,0,0,40,20,0,0 +24,Y-PQ,0,0,0,0,40,20 +28,Y-I,40,20,0,0,0,0 +29,Y-Z,40,20,0,0,0,0 +30,Y-PQ,0,0,0,0,40,20 +31,Y-PQ,0,0,0,0,20,10 +32,Y-PQ,0,0,0,0,20,10 +33,Y-I,40,20,0,0,0,0 +34,Y-Z,0,0,0,0,40,20 +35,D-PQ,40,20,0,0,0,0 +37,Y-Z,40,20,0,0,0,0 +38,Y-I,0,0,20,10,0,0 +39,Y-PQ,0,0,20,10,0,0 +41,Y-PQ,0,0,0,0,20,10 +42,Y-PQ,20,10,0,0,0,0 +43,Y-Z,0,0,40,20,0,0 +45,Y-I,20,10,0,0,0,0 +46,Y-PQ,20,10,0,0,0,0 +47,Y-I,35,25,35,25,35,25 +48,Y-Z,70,50,70,50,70,50 +49,Y-PQ,35,25,70,50,35,20 +50,Y-PQ,0,0,0,0,40,20 +51,Y-PQ,20,10,0,0,0,0 +52,Y-PQ,40,20,0,0,0,0 +53,Y-PQ,40,20,0,0,0,0 +55,Y-Z,20,10,0,0,0,0 +56,Y-PQ,0,0,20,10,0,0 +58,Y-I,0,0,20,10,0,0 +59,Y-PQ,0,0,20,10,0,0 +60,Y-PQ,20,10,0,0,0,0 +62,Y-Z,0,0,0,0,40,20 +63,Y-PQ,40,20,0,0,0,0 +64,Y-I,0,0,75,35,0,0 +65,D-Z,35,25,35,25,70,50 +66,Y-PQ,0,0,0,0,75,35 +68,Y-PQ,20,10,0,0,0,0 +69,Y-PQ,40,20,0,0,0,0 +70,Y-PQ,20,10,0,0,0,0 +71,Y-PQ,40,20,0,0,0,0 +73,Y-PQ,0,0,0,0,40,20 +74,Y-Z,0,0,0,0,40,20 +75,Y-PQ,0,0,0,0,40,20 +76,D-I,105,80,70,50,70,50 +77,Y-PQ,0,0,40,20,0,0 +79,Y-Z,40,20,0,0,0,0 +80,Y-PQ,0,0,40,20,0,0 +82,Y-PQ,40,20,0,0,0,0 +83,Y-PQ,0,-200,0,-200,20,-190 +84,Y-PQ,0,0,0,0,20,10 +85,Y-PQ,0,0,0,0,40,20 +86,Y-PQ,0,0,20,10,0,0 +87,Y-PQ,0,0,40,20,0,0 +88,Y-PQ,40,-30,0,0,0,0 +90,Y-I,0,0,40,-30,0,0 +92,Y-PQ,0,0,0,0,40,-30 +94,Y-PQ,40,20,0,0,0,0 +95,Y-PQ,0,0,20,10,0,0 +96,Y-PQ,0,0,20,10,0,0 +98,Y-PQ,40,20,0,0,0,0 +99,Y-PQ,0,0,40,20,0,0 +100,Y-Z,0,0,0,0,40,20 +102,Y-PQ,0,0,0,0,20,10 +103,Y-PQ,0,0,0,0,40,20 +104,Y-PQ,0,0,0,0,40,20 +106,Y-PQ,0,0,40,20,0,0 +107,Y-PQ,0,0,40,20,0,0 +109,Y-PQ,40,20,0,0,0,0 +111,Y-PQ,20,10,0,0,0,0 +112,Y-I,20,10,0,0,0,0 +113,Y-Z,40,20,0,0,0,0 +114,Y-PQ,20,10,0,0,0,0 diff --git a/src/test/resources/ieeeFeeder123/Tfo.csv b/src/test/resources/ieeeFeeder123/Tfo.csv new file mode 100644 index 0000000000..7cc8d7f924 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Tfo.csv @@ -0,0 +1 @@ +NodeA,NodeB,Config \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder123/TfoConfig.csv b/src/test/resources/ieeeFeeder123/TfoConfig.csv new file mode 100644 index 0000000000..af208d5f88 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/TfoConfig.csv @@ -0,0 +1 @@ +Config,SkVA,kV-high,Winding-high,kV-low,Winding-low,R,X diff --git a/src/test/resources/ieeeFeeder13/Bus.csv b/src/test/resources/ieeeFeeder13/Bus.csv new file mode 100644 index 0000000000..048c44ba55 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Bus.csv @@ -0,0 +1,13 @@ +BusName,UNom +650,4.16 +632,4.16 +633,4.16 +634,0.48 +645,4.16 +646,4.16 +684,4.16 +611,4.16 +652,4.16 +680,4.16 +675,4.16 +671,4.16 diff --git a/src/test/resources/ieeeFeeder13/DistributedLoad.csv b/src/test/resources/ieeeFeeder13/DistributedLoad.csv new file mode 100644 index 0000000000..1462655e5d --- /dev/null +++ b/src/test/resources/ieeeFeeder13/DistributedLoad.csv @@ -0,0 +1,2 @@ +NodeA,NodeB,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +632,671,Y-PQ,17,10,66,38,117,68 diff --git a/src/test/resources/ieeeFeeder13/Gen.csv b/src/test/resources/ieeeFeeder13/Gen.csv new file mode 100644 index 0000000000..19dfc82448 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Gen.csv @@ -0,0 +1,2 @@ +GenName,busName,SetPoint +G650,650,1.0 diff --git a/src/test/resources/ieeeFeeder13/Line.csv b/src/test/resources/ieeeFeeder13/Line.csv new file mode 100644 index 0000000000..9e1ad5d5e3 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Line.csv @@ -0,0 +1,11 @@ +NodeA,NodeB,Length,Config +632,645,500,603 +632,633,500,602 +645,646,300,603 +650,632,2000,601 +684,652,800,607 +632,671,2000,601 +671,684,300,604 +671,680,1000,601 +684,611,300,605 +671,675,500,606 diff --git a/src/test/resources/ieeeFeeder13/LineConfig.csv b/src/test/resources/ieeeFeeder13/LineConfig.csv new file mode 100644 index 0000000000..e3cee9907f --- /dev/null +++ b/src/test/resources/ieeeFeeder13/LineConfig.csv @@ -0,0 +1,8 @@ +Config,PhaseA,PhaseB,PhaseC,r11,x11,r12,x12,r13,x13,r22,x22,r23,x23,r33,x33,b11,b12,b13,b22,b23,b33 +601,1,1,1,0.3465,1.0179,0.1560,0.5017,0.1580,0.4236,0.3375,1.0478,0.1535,0.3849,0.3414,1.0348,6.2998,-1.9958,-1.2595,5.9597,-0.7417,5.6386 +602,1,1,1,0.7526,1.1814,0.1580,0.4236,0.1560,0.5017,0.7475,1.1983,0.1535,0.3849,0.7436,1.2112,5.6990,-1.0817,-1.6905,5.1795,-0.6588,5.4246 +603,0,1,1,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.3294,1.3471,0.2066,0.4591,1.3238,1.3569,0.0000,0.0000,0.0000,4.7097,-0.8999,4.6658 +604,1,0,1,1.3238,1.3569,0.0000,0.0000,0.2066,0.4591,0.0000,0.0000,0.0000,0.0000,1.3294,1.3471,4.6658,0.0000,-0.8999,0.0000,0.0000,4.7097 +605,0,0,1,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.3292,1.3475,0.0000,0.0000,0.0000,0.0000,0.0000,4.5193 +606,1,1,1,0.7982,0.4463,0.3192,0.0328,0.2849,-0.0143,0.7891,0.4041,0.3192,0.0328,0.7982,0.4463,96.8897,0.0000,0.0000,96.8897,0.0000,96.8897 +607,1,0,0,1.3425,0.5124,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,88.9912,0.0000,0.0000,0.0000,0.0000,0.0000 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder13/Regulator.csv b/src/test/resources/ieeeFeeder13/Regulator.csv new file mode 100644 index 0000000000..8fa3bf4830 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Regulator.csv @@ -0,0 +1,2 @@ +Line,RhoA,RhoB,RhoC +650-632,1.0625,1.05,1.0687 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder13/SpotLoad.csv b/src/test/resources/ieeeFeeder13/SpotLoad.csv new file mode 100644 index 0000000000..7c49850bcd --- /dev/null +++ b/src/test/resources/ieeeFeeder13/SpotLoad.csv @@ -0,0 +1,10 @@ +Node,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +634,Y-PQ,160,110,120,90,120,90 +645,Y-PQ,0,0,170,125,0,0 +646,D-Z,0,0,230,132,0,0 +652,Y-Z,128,86,0,0,0,0 +671,D-PQ,385,220,385,220,555,371 +675,Y-PQ,485,190,68,60,290,212 +675,Y-Z,0,-200,0,-200,0,-200 +611,Y-I,0,0,0,0,170,80 +611,Y-Z,0,0,0,0,0,-100 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder13/Tfo.csv b/src/test/resources/ieeeFeeder13/Tfo.csv new file mode 100644 index 0000000000..50122c84ac --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Tfo.csv @@ -0,0 +1,2 @@ +NodeA,NodeB,Config +633,634,XFM-1 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder13/TfoConfig.csv b/src/test/resources/ieeeFeeder13/TfoConfig.csv new file mode 100644 index 0000000000..b9f8c2ff30 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/TfoConfig.csv @@ -0,0 +1,3 @@ +Config,SkVA,kV-high,Winding-high,kV-low,Winding-low,R,X +Substation,5000,115,D,4.16,Gr.Y,1,8 +XFM-1,500,4.16,Gr.W,0.48,Gr.W,1.1,2 diff --git a/src/test/resources/ieeeFeeder34/Bus.csv b/src/test/resources/ieeeFeeder34/Bus.csv new file mode 100644 index 0000000000..c41c848a80 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Bus.csv @@ -0,0 +1,35 @@ +BusName,UNom +800,24.9 +802,24.9 +806,24.9 +808,24.9 +810,24.9 +812,24.9 +814,24.9 +850,24.9 +816,24.9 +818,24.9 +820,24.9 +822,24.9 +824,24.9 +826,24.9 +828,24.9 +830,24.9 +832,24.9 +834,24.9 +836,24.9 +840,24.9 +842,24.9 +844,24.9 +846,24.9 +848,24.9 +852,24.9 +854,24.9 +856,24.9 +858,24.9 +864,24.9 +860,24.9 +862,24.9 +838,24.9 +888,4.16 +890,4.16 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/DistributedLoad.csv b/src/test/resources/ieeeFeeder34/DistributedLoad.csv new file mode 100644 index 0000000000..81aa998ff6 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/DistributedLoad.csv @@ -0,0 +1,19 @@ +NodeA,NodeB,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +802,806,Y-PQ,0,0,30,15,25,14 +808,810,Y-I,0,0,16,8,0,0 +818,820,Y-Z,34,17,0,0,0,0 +820,822,Y-PQ,135,70,0,0,0,0 +816,824,D-I,0,0,5,2,0,0 +824,826,Y-I,0,0,40,20,4,2 +828,830,Y-PQ,7,3,0,0,0,0 +854,856,Y-PQ,0,0,4,2,0,0 +832,858,D-PQ,7,3,2,1,6,3 +858,864,Y-PQ,2,1,0,0,0,0 +858,834,D-PQ,4,2,15,8,13,7 +834,860,D-Z,16,8,20,10,110,55 +860,836,D-PQ,30,15,10,6,42,22 +836,840,D-I,18,9,22,11,0,0 +862,838,Y-PQ,0,0,28,14,0,0 +842,844,Y-PQ,9,5,0,0,0,0 +844,846,Y-PQ,0,0,25,12,20,11 +846,848,Y-PQ,0,0,23,11,0,0 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/Gen.csv b/src/test/resources/ieeeFeeder34/Gen.csv new file mode 100644 index 0000000000..5e5fce36a7 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Gen.csv @@ -0,0 +1,2 @@ +GenName,busName,SetPoint +G800,800,1.05 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/Line.csv b/src/test/resources/ieeeFeeder34/Line.csv new file mode 100644 index 0000000000..46d005d707 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Line.csv @@ -0,0 +1,33 @@ +NodeA,NodeB,Length,Config +800,802,2580,300 +802,806,1730,300 +806,808,32230,300 +808,810,5804,303 +808,812,37500,300 +812,814,29730,300 +814,850,10,301 +816,818,1710,302 +816,824,10210,301 +818,820,48150,302 +820,822,13740,302 +824,826,3030,303 +824,828,840,301 +828,830,20440,301 +830,854,520,301 +832,858,4900,301 +834,860,2020,301 +834,842,280,301 +836,840,860,301 +836,862,280,301 +842,844,1350,301 +844,846,3640,301 +846,848,530,301 +850,816,310,301 +852,832,10,301 +854,856,23330,303 +854,852,36830,301 +858,864,1620,302 +858,834,5830,301 +860,836,2680,301 +862,838,4860,304 +888,890,10560,300 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/LineConfig.csv b/src/test/resources/ieeeFeeder34/LineConfig.csv new file mode 100644 index 0000000000..50858fe88d --- /dev/null +++ b/src/test/resources/ieeeFeeder34/LineConfig.csv @@ -0,0 +1,6 @@ +Config,PhaseA,PhaseB,PhaseC,r11,x11,r12,x12,r13,x13,r22,x22,r23,x23,r33,x33,b11,b12,b13,b22,b23,b33 +300,1,1,1,1.3368,1.3343,0.2101,0.5779,0.2130,0.5015,1.3238,1.3569,0.2066,0.4591,1.3294,1.3471,5.3350,-1.5313,-0.9943,5.0979,-0.6212,4.8880 +301,1,1,1,1.9300,1.4115,0.2327,0.6442,0.2359,0.5691,1.9157,1.4281,0.2288,0.5238,1.9219,1.4209,5.1207,-1.4364,-0.9402,4.9055,-0.5951,4.7154 +302,1,0,0,2.7995,1.4855,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.2251,0.0000,0.0000,0.0000,0.0000,0.0000 +303,0,1,0,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,2.7995,1.4855,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.2251,0.0000,0.0000 +304,0,1,0,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.9217,1.4212,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.3637,0.0000,0.0000 diff --git a/src/test/resources/ieeeFeeder34/Regulator.csv b/src/test/resources/ieeeFeeder34/Regulator.csv new file mode 100644 index 0000000000..f1b24d136b --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Regulator.csv @@ -0,0 +1,3 @@ +Line,RhoA,RhoB,RhoC +814-850,1.075,1.03117,1.03133 +852-832,1.0812,1.0687,1.075 diff --git a/src/test/resources/ieeeFeeder34/SpotLoad.csv b/src/test/resources/ieeeFeeder34/SpotLoad.csv new file mode 100644 index 0000000000..84f9f6f194 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/SpotLoad.csv @@ -0,0 +1,7 @@ +Node,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +860,Y-PQ,20,16,20,16,20,16 +840,Y-I,9,7,9,7,9,7 +844,Y-Z,135,5,135,5,135,5 +848,D-PQ,20,-134,20,-134,20,-134 +890,D-I,150,75,150,75,150,75 +830,D-Z,10,5,10,5,25,10 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/Tfo.csv b/src/test/resources/ieeeFeeder34/Tfo.csv new file mode 100644 index 0000000000..b531a06915 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Tfo.csv @@ -0,0 +1,2 @@ +NodeA,NodeB,Config +832,888,XFM-1 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/TfoConfig.csv b/src/test/resources/ieeeFeeder34/TfoConfig.csv new file mode 100644 index 0000000000..63035a3040 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/TfoConfig.csv @@ -0,0 +1,3 @@ +Config,SkVA,kV-high,Winding-high,kV-low,Winding-low,R,X +Substation,2500,69,D,24.9,Gr.W,1,8 +XFM-1,500,24.9,Gr.W,4.16,Gr.W,1.9,4.08 \ No newline at end of file diff --git a/src/test/resources/lvFeeder/Buscoords.csv b/src/test/resources/lvFeeder/Buscoords.csv new file mode 100644 index 0000000000..623890f156 --- /dev/null +++ b/src/test/resources/lvFeeder/Buscoords.csv @@ -0,0 +1,908 @@ +#Bus Coordinates,, +Busname, x, y +1,390872.663,392887.379 +2,390871.596,392887.638 +3,390871.481,392887.643 +4,390871.379,392887.608 +5,390871.305,392887.55 +6,390871.234,392887.42 +7,390868.779,392877.637 +8,390868.753,392877.186 +9,390868.753,392876.81 +10,390868.804,392876.484 +11,390868.904,392876.259 +12,390869.079,392876.108 +13,390869.18,392876.008 +14,390869.5,392875.857 +15,390872.292,392875.208 +16,390872.314,392875.302 +17,390875.678,392874.422 +18,390872.316,392875.346 +19,390875.907,392874.353 +20,390872.312,392875.392 +21,390876.142,392874.223 +22,390872.303,392875.433 +23,390876.44,392873.903 +24,390872.288,392875.482 +25,390877.003,392873.341 +26,390872.263,392875.532 +27,390880.364,392878.196 +28,390884.19,392866.433 +29,390872.239,392875.581 +30,390881.306,392879.522 +31,390879.232,392879.305 +32,390886.111,392864.602 +33,390872.17,392875.71 +34,390885,392880 +35,390879.208,392879.353 +36,390890.1695,392868.642 +37,390891.919,392859.065 +38,390872.092,392875.822 +39,390879.183,392879.426 +40,390890.444,392868.351 +41,390891.41,392869.955 +42,390895.963,392855.237 +43,390891.775,392858.903 +44,390872.073,392875.85 +45,390879.159,392879.522 +46,390890.571,392868.223 +47,390893,392874 +48,390899.026,392852.352 +49,390891.742,392858.804 +50,390872.038,392875.883 +51,390879.159,392879.763 +52,390890.754,392868.168 +53,390899.475,392851.944 +54,390899.491,392852.791 +55,390891.759,392858.689 +56,390871.964,392875.93 +57,390879.232,392879.956 +58,390890.936,392868.168 +59,390901.469,392850.053 +60,390899.548,392852.823 +61,390891.775,392858.59 +62,390871.892,392875.96 +63,390879.907,392880.679 +64,390891.045,392868.168 +65,390901.87,392849.664 +66,390907.23,392855.97 +67,390899.618,392852.847 +68,390891.825,392858.508 +69,390871.812,392875.983 +70,390881,392884 +71,390891.246,392868.241 +72,390906.932,392845.428 +73,390907,392860 +74,390907,392860 +75,390899.793,392852.887 +76,390891.972,392858.324 +77,390871.436,392876.083 +78,390892.048,392868.97 +79,390908.613,392843.857 +80,390899.889,392852.926 +81,390892.512,392857.808 +82,390870.935,392876.183 +83,390896,392870 +84,390909.025,392843.57 +85,390899.982,392852.987 +86,390893.558,392856.82 +87,390870.634,392876.259 +88,390909.878,392843.014 +89,390900.06,392853.057 +90,390893.775,392856.555 +91,390870.525,392876.285 +92,390910.741,392842.593 +93,390893.803,392856.496 +94,390870.492,392876.296 +95,390911.23,392842.324 +96,390893.8,392856.41 +97,390870.458,392876.31 +98,390911.556,392842.152 +99,390893.781,392856.378 +100,390870.383,392876.359 +101,390911.997,392841.898 +102,390890.706,392852.332 +103,390870.157,392876.534 +104,390912.282,392841.942 +105,390912.282,392841.72 +106,390890.64,392852.121 +107,390912.63,392841.967 +108,390912.43,392841.6 +109,390890.511,392851.689 +110,390913.032,392842.011 +111,390917.463,392836.015 +112,390883.277,392842.144 +113,390913.637,392842.13 +114,390918.004,392835.491 +115,390876.523,392833.895 +116,390914.4,392842.345 +117,390918.765,392836.293 +118,390915.488,392832.839 +119,390875.778,392833.236 +120,390914.924,392842.567 +121,390918.949,392836.229 +122,390919.135,392836.684 +123,390910.895,392828.11 +124,390875.199,392832.8 +125,390915.64,392842.933 +126,390919.115,392836.199 +127,390920.876,392838.518 +128,390908.834,392825.979 +129,390874.662,392832.48 +130,390916.403,392843.351 +131,390919.234,392836.205 +132,390923.576,392835.814 +133,390925.817,392843.725 +134,390908.271,392825.3 +135,390872.865,392831.803 +136,390917.072,392843.826 +137,390919.412,392836.253 +138,390923.799,392835.572 +139,390929.524,392847.569 +140,390907.615,392824.551 +141,390871.466,392831.607 +142,390918.076,392844.727 +143,390919.608,392836.348 +144,390923.973,392835.3 +145,390932.015,392850.135 +146,390907.053,392823.802 +147,390871.226,392831.623 +148,390922.542,392849.331 +149,390919.762,392836.466 +150,390924.07,392835.058 +151,390934.503,392852.697 +152,390935.584,392846.448 +153,390906.491,392822.865 +154,390871.173,392831.687 +155,390923.521,392850.328 +156,390919.905,392836.632 +157,390924.128,392834.671 +158,390941.046,392859.545 +159,390935.817,392846.24 +160,390906.35,392822.584 +161,390871.128,392831.801 +162,390915.061,392858.471 +163,390927.222,392854.1 +164,390920.012,392836.805 +165,390924.169,392834.201 +166,390943.336,392861.907 +167,390935.995,392846.017 +168,390905.502,392821.012 +169,390871.1,392832.049 +170,390913.478,392860.025 +171,390931.986,392859.25 +172,390920.077,392836.965 +173,390924.246,392833.853 +174,390946.01,392864.771 +175,390946.317,392858.942 +176,390936.05,392845.912 +177,390905.189,392820.053 +178,390910,392863 +179,390932.788,392860.118 +180,390930.205,392860.892 +181,390920.101,392837.143 +182,390924.411,392833.475 +183,390946.422,392865.19 +184,390946.618,392858.602 +185,390936.119,392845.666 +186,390905.022,392819.323 +187,390935.932,392863.545 +188,390923.046,392867.911 +189,390920.095,392837.297 +190,390924.644,392833.165 +191,390948.046,392866.84 +192,390946.652,392865.034 +193,390946.84,392858.223 +194,390936.242,392845.027 +195,390904.938,392818.655 +196,390941.568,392869.643 +197,390921.647,392869.283 +198,390923.824,392868.734 +199,390920.042,392837.481 +200,390924.934,392832.865 +201,390948.693,392867.51 +202,390946.807,392864.979 +203,390946.971,392857.897 +204,390936.288,392844.648 +205,390905.001,392817.821 +206,390939.128,392871.786 +207,390943.019,392871.212 +208,390917,392871 +209,390923.916,392868.865 +210,390919.804,392837.861 +211,390925.39,392832.419 +212,390946.962,392864.97 +213,390947.023,392857.622 +214,390936.388,392844.4 +215,390905.251,392816.298 +216,390931.512,392879.201 +217,390945.597,392874.081 +218,390923.961,392868.986 +219,390919.412,392838.407 +220,390926.643,392831.209 +221,390947.126,392865.015 +222,390947.089,392857.034 +223,390936.61,392843.936 +224,390905.69,392815.026 +225,390927,392880 +226,390946.519,392875.104 +227,390923.967,392869.089 +228,390926.75,392831.106 +229,390947.326,392865.134 +230,390947.18,392856.577 +231,390936.749,392843.721 +232,390906.065,392814.191 +233,390937.556,392882.924 +234,390947.273,392875.942 +235,390923.916,392869.238 +236,390926.805,392831.065 +237,390947.49,392865.261 +238,390947.287,392856.272 +239,390936.874,392843.589 +240,390906.399,392813.691 +241,390936.301,392884.111 +242,390923.807,392869.387 +243,390926.875,392831.043 +244,390947.59,392865.397 +245,390947.457,392855.998 +246,390938.352,392842.126 +247,390907.213,392812.685 +248,390931,392884 +249,390931,392884 +250,390923.606,392869.587 +251,390926.945,392831.047 +252,390947.626,392865.525 +253,390947.784,392855.658 +254,390938.796,392841.703 +255,390910.805,392815.497 +256,390907.752,392812.019 +257,390922.855,392870.303 +258,390927.019,392831.072 +259,390947.635,392865.698 +260,390949.052,392854.417 +261,390938.914,392841.633 +262,390911.309,392815.876 +263,390909.871,392809.604 +264,390921,392875 +265,390927.156,392831.157 +266,390947.599,392865.889 +267,390949.358,392854.138 +268,390936.706,392838.972 +269,390939.032,392841.62 +270,390911.514,392816.081 +271,390913.165,392812.297 +272,390910.583,392808.793 +273,390927.282,392831.268 +274,390947.508,392866.043 +275,390949.516,392854.033 +276,390935,392836 +277,390939.171,392841.613 +278,390911.683,392816.381 +279,390913.42,392812.472 +280,390913.173,392805.861 +281,390927.695,392831.755 +282,390947.071,392866.462 +283,390949.636,392853.999 +284,390939.296,392841.627 +285,390911.851,392816.885 +286,390913.648,392812.586 +287,390914.334,392804.546 +288,390912.467,392805.282 +289,390931,392831 +290,390946.507,392867.044 +291,390949.096,392853.309 +292,390949.744,392853.995 +293,390939.414,392841.675 +294,390912.001,392817.334 +295,390913.996,392812.686 +296,390914.839,392803.916 +297,390909.292,392803.146 +298,390948.848,392852.992 +299,390949.819,392854.01 +300,390939.539,392841.731 +301,390912.188,392817.651 +302,390915.584,392813.037 +303,390918.269,392799.909 +304,390908.726,392802.519 +305,390948.3925,392852.4855 +306,390949.898,392854.051 +307,390940.115,392842.278 +308,390912.454,392818.024 +309,390915.882,392813.133 +310,390918.529,392799.613 +311,390908.548,392802.302 +312,390947.472,392851.557 +313,390950.032,392854.156 +314,390943,392844 +315,390912.783,392818.365 +316,390916.093,392813.229 +317,390919.05,392800 +318,390923.291,392794.191 +319,390908.47,392802.178 +320,390946,392848 +321,390950.481,392854.63 +322,390913.191,392818.747 +323,390916.33,392813.352 +324,390921.636,392802.118 +325,390925.511,392791.533 +326,390908.408,392802.069 +327,390952,392853 +328,390913.426,392818.962 +329,390916.549,392813.501 +330,390922.556,392802.836 +331,390932.594,392797.299 +332,390929.7419,392786.3729 +333,390908.354,392801.937 +334,390914.512,392819.906 +335,390918.357,392814.966 +336,390924.531,392804.433 +337,390935,392800 +338,390934.963,392790.74 +339,390930.511,392785.435 +340,390908.323,392801.829 +341,390914.975,392820.221 +342,390923,392816 +343,390926.15,392805.742 +344,390923.88,392805.165 +345,390937.605,392792.915 +346,390931.168,392784.63 +347,390908.308,392801.736 +348,390915.149,392820.308 +349,390929,392807 +350,390923.819,392805.287 +351,390937.856,392793.111 +352,390931.703,392784.132 +353,390908.308,392801.651 +354,390915.29,392820.348 +355,390923.758,392805.422 +356,390937.949,392793.204 +357,390932.46,392783.603 +358,390908.315,392801.581 +359,390915.397,392820.355 +360,390923.744,392805.551 +361,390938.005,392793.278 +362,390932.953,392783.3 +363,390908.339,392801.503 +364,390915.451,392820.348 +365,390923.772,392805.686 +366,390938.024,392793.371 +367,390933.748,392782.903 +368,390908.385,392801.426 +369,390915.511,392820.295 +370,390923.86,392805.862 +371,390938.024,392793.483 +372,390934.599,392782.657 +373,390908.689,392801.043 +374,390915.592,392820.188 +375,390924.022,392806.038 +376,390938.005,392793.623 +377,390935.584,392782.524 +378,390910.98,392798.157 +379,390907.282,392801.155 +380,390915.907,392819.679 +381,390925.152,392806.998 +382,390937.968,392793.744 +383,390936.303,392782.505 +384,390913.208,392795.42 +385,390898.776,392802.817 +386,390906.36,392802.282 +387,390918,392819 +388,390926,392812 +389,390937.912,392793.827 +390,390937.155,392782.6 +391,390913.3067,392795.2978 +392,390895.655,392803.358 +393,390901.454,392808.389 +394,390937.791,392793.949 +395,390938.366,392782.884 +396,390910.051,392792.872 +397,390915.116,392793.058 +398,390895.344,392803.443 +399,390901.096,392808.831 +400,390937.344,392794.349 +401,390939.237,392783.187 +402,390909.746,392792.659 +403,390916.015,392791.999 +404,390895.119,392803.443 +405,390900.933,392809.018 +406,390937,392798 +407,390940.013,392783.622 +408,390909.563,392792.553 +409,390918.607,392788.706 +410,390915.753,392791.725 +411,390894.893,392803.386 +412,390900.791,392809.106 +413,390940.732,392784.113 +414,390909.433,392792.492 +415,390922.398,392784.096 +416,390915.69,392791.654 +417,390894.074,392802.85 +418,390900.539,392809.227 +419,390941.549,392784.768 +420,390909.212,392792.415 +421,390923.197,392783.136 +422,390915.654,392791.598 +423,390893.905,392802.681 +424,390897.659,392810.609 +425,390942.91,392785.874 +426,390942.91,392785.874 +427,390908.473,392792.172 +428,390923.398,392782.888 +429,390915.626,392791.52 +430,390893.792,392802.483 +431,390896.587,392810.976 +432,390947.433,392789.686 +433,390947.433,392789.686 +434,390907.642,392791.928 +435,390923.491,392782.749 +436,390915.619,392791.449 +437,390893.764,392802.258 +438,390896.22,392811.089 +439,390953.846,392795.059 +440,390953.846,392795.059 +441,390907.177,392791.783 +442,390923.553,392782.625 +443,390915.619,392791.371 +444,390893.82,392802.004 +445,390895.542,392811.117 +446,390958.463,392798.896 +447,390958.463,392798.896 +448,390906.751,392791.616 +449,390923.584,392782.517 +450,390915.633,392791.293 +451,390894.441,392801.355 +452,390894.949,392811.145 +453,390959.827,392800.103 +454,390959.827,392800.103 +455,390906.364,392791.414 +456,390923.6,392782.346 +457,390915.654,392791.243 +458,390894,392797 +459,390894.3,392810.976 +460,390963.865,392803.674 +461,390963.865,392803.674 +462,390957.305,392802.791 +463,390905.762,392791.025 +464,390923.584,392782.192 +465,390915.683,392791.215 +466,390893.764,392810.637 +467,390968.351,392807.642 +468,390968.351,392807.642 +469,390964.469,392803.03 +470,390956.915,392803.162 +471,390905.366,392790.721 +472,390923.538,392782.052 +473,390915.718,392791.18 +474,390891.2225,392808.691 +475,390970.015,392809.073 +476,390970.015,392809.073 +477,390956.693,392803.354 +478,390905.122,392790.469 +479,390923.476,392781.898 +480,390915.775,392791.151 +481,390891.138,392808.521 +482,390973.535,392812.101 +483,390973.535,392812.101 +484,390963.033,392816.614 +485,390956.52,392803.452 +486,390905.015,392790.34 +487,390923.352,392781.774 +488,390915.881,392791.116 +489,390891.11,392808.352 +490,390978.625,392816.388 +491,390978.625,392816.388 +492,390962.663,392817.058 +493,390965.49,392819.862 +494,390956.242,392803.57 +495,390904.962,392790.248 +496,390923.073,392781.511 +497,390916.016,392791.08 +498,390891.166,392808.126 +499,390981.879,392818.818 +500,390981.879,392818.818 +501,390962.507,392817.246 +502,390964,392822 +503,390955.804,392803.705 +504,390904.939,392790.18 +505,390916.237,392776.136 +506,390916.108,392791.052 +507,390891.336,392807.872 +508,390982.421,392819.26 +509,390982.421,392819.26 +510,390962.384,392817.32 +511,390955.501,392803.823 +512,390904.924,392790.081 +513,390912.695,392780.428 +514,390915.185,392775.311 +515,390916.186,392791.017 +516,390983.883,392820.451 +517,390983.883,392820.451 +518,390979.167,392822.695 +519,390962.253,392817.337 +520,390955.316,392803.946 +521,390904.932,392790.005 +522,390908,392779 +523,390914.619,392774.864 +524,390916.242,392790.981 +525,390985.003,392821.271 +526,390985.003,392821.271 +527,390977.209,392824.691 +528,390962.138,392817.312 +529,390955.18,392804.057 +530,390905.076,392789.479 +531,390914.548,392774.783 +532,390916.278,392790.932 +533,390986.567,392822.332 +534,390986.567,392822.332 +535,390975.743,392826.352 +536,390962.023,392817.271 +537,390954.784,392804.457 +538,390903.887,392790.99 +539,390904,392784 +540,390914.494,392774.721 +541,390916.292,392790.868 +542,390987.709,392823.028 +543,390987.709,392823.028 +544,390975.138,392827.039 +545,390961.735,392817.041 +546,390951.688,392807.795 +547,390902.523,392792.617 +548,390914.467,392774.649 +549,390916.278,392790.783 +550,390991,392824.805 +551,390991,392824.805 +552,390974.926,392827.234 +553,390977.781,392829.754 +554,390961.464,392816.787 +555,390951.538,392807.965 +556,390897,392791 +557,390914.449,392774.569 +558,390916.242,392790.733 +559,390993.403,392826.054 +560,390993.403,392826.054 +561,390974.831,392827.281 +562,390976,392832 +563,390958,392817 +564,390951.458,392808.125 +565,390914.458,392774.497 +566,390916.157,392790.648 +567,390993.936,392826.331 +568,390993.936,392826.331 +569,390991.104,392829.14 +570,390974.676,392827.311 +571,390951.428,392808.325 +572,390914.476,392774.425 +573,390994.064,392826.393 +574,390994.064,392826.393 +575,390990.836,392829.546 +576,390974.581,392827.311 +577,390951.428,392808.505 +578,390914.701,392774.115 +579,390997.536,392828.07 +580,390997.536,392828.07 +581,390993.888,392826.66 +582,390990.662,392829.86 +583,390974.467,392827.299 +584,390951.458,392808.71 +585,390910.991,392771.178 +586,390915.202,392773.458 +587,390999.985,392829.212 +588,390999.985,392829.212 +589,390993.812,392826.748 +590,390990.534,392830.185 +591,390974.378,392827.252 +592,390951.553,392808.9 +593,390910.777,392771.009 +594,390917.646,392770.357 +595,391004.98,392831.301 +596,391000.5776,392829.4599 +597,390993.745,392826.807 +598,390989.572,392833.322 +599,390973.854,392826.853 +600,390951.713,392809.099 +601,390910.657,392770.943 +602,390910.518,392764.593 +603,390920.545,392766.731 +604,391009.465,392833.089 +605,391009.465,392833.089 +606,391000.5776,392829.4599 +607,390996.172,392840.26 +608,390996.172,392840.26 +609,390993.64,392826.841 +610,390989.096,392834.773 +611,390969,392827 +612,390951.838,392809.199 +613,390910.547,392770.91 +614,390909,392760 +615,390923.419,392763.338 +616,391008.023,392836.745 +617,391012.375,392834.183 +618,391012.375,392834.183 +619,390996,392843 +620,390993.577,392826.832 +621,390988.794,392835.423 +622,390952.418,392809.569 +623,390910.454,392770.899 +624,390922.171,392762.286 +625,390924.232,392762.387 +626,391006.125,392841.751 +627,390993.509,392826.794 +628,390988.562,392835.841 +629,390954,392812 +630,390910.307,392770.899 +631,390921.888,392762.003 +632,390924.414,392762.164 +633,391005.565,392843.218 +634,390993.467,392826.744 +635,390988.132,392836.432 +636,390909.959,392770.941 +637,390921.726,392761.781 +638,390924.515,392762.063 +639,391002,392847 +640,390993.45,392826.677 +641,390987.226,392837.535 +642,390909.718,392770.968 +643,390921.524,392761.458 +644,390924.636,392761.963 +645,390993.459,392826.609 +646,390986.947,392837.814 +647,390909.412,392771.006 +648,390921.12,392760.65 +649,390924.798,392761.882 +650,390993.492,392826.521 +651,390986.866,392837.895 +652,390909.225,392771.017 +653,390920.797,392760.044 +654,390924.98,392761.862 +655,390993.551,392826.412 +656,390986.773,392837.93 +657,390987.307,392838.185 +658,390909.056,392771.023 +659,390920.534,392759.64 +660,390925.182,392761.882 +661,390993.787,392826.134 +662,390986.68,392837.93 +663,390987.923,392838.51 +664,390908.771,392771.012 +665,390920.231,392759.236 +666,390925.444,392762.018 +667,390993.989,392825.97 +668,390986.587,392837.907 +669,390990.478,392839.868 +670,390908.492,392770.984 +671,390919.948,392758.933 +672,390925.74,392761.64 +673,390926.091,392762.508 +674,390994.166,392825.873 +675,390986.018,392837.512 +676,390990,392841 +677,390908.361,392770.963 +678,390919.443,392758.468 +679,390925.919,392761.414 +680,390929.951,392765.901 +681,390994.528,392825.697 +682,390981,392837 +683,390908.218,392770.935 +684,390917.785,392756.994 +685,390926.062,392761.188 +686,390932.739,392768.301 +687,390908.087,392770.886 +688,390913,392755 +689,390926.169,392760.95 +690,390938.131,392762.197 +691,390940.702,392775.184 +692,390907.934,392770.815 +693,390926.216,392760.76 +694,390937.548,392761.707 +695,390939.539,392760.604 +696,390947.039,392768.131 +697,390942.352,392776.625 +698,390907.699,392770.684 +699,390926.24,392760.45 +700,390937.379,392761.539 +701,390943,392758 +702,390949,392763 +703,390944.148,392778.217 +704,390907.124,392770.224 +705,390926.204,392759.927 +706,390937.285,392761.418 +707,390948.941,392782.353 +708,390944.182,392778.111 +709,390906.396,392769.568 +710,390925.585,392756.048 +711,390937.231,392761.343 +712,390954.592,392787.288 +713,390951.513,392779.362 +714,390944.201,392778.008 +715,390906.33,392769.502 +716,390925.095,392752.863 +717,390937.197,392761.256 +718,390960.503,392792.29 +719,390951.779,392779.034 +720,390944.201,392777.911 +721,390906.287,392769.442 +722,390924.96,392751.851 +723,390937.177,392761.175 +724,390962.999,392794.377 +725,390966.597,392785.202 +726,390951.873,392778.903 +727,390944.188,392777.802 +728,390906.259,392769.376 +729,390924.892,392750.924 +730,390937.177,392761.081 +731,390966.383,392797.222 +732,390967.383,392784.225 +733,390951.956,392778.754 +734,390944.156,392777.718 +735,390906.248,392769.3 +736,390924.876,392750.418 +737,390937.191,392761.007 +738,390970.344,392800.554 +739,390967.79,392783.707 +740,390952.012,392778.624 +741,390944.072,392777.609 +742,390906.248,392769.229 +743,390924.892,392750.014 +744,390937.231,392760.926 +745,390973.519,392803.236 +746,390965.176,392781.034 +747,390967.869,392783.614 +748,390952.068,392778.466 +749,390943.95,392777.499 +750,390906.259,392769.163 +751,390924.96,392749.676 +752,390937.285,392760.845 +753,390974.708,392804.22 +754,390977.441,392798.798 +755,390965,392778 +756,390967.938,392783.559 +757,390952.106,392778.307 +758,390943.847,392777.429 +759,390906.303,392769.081 +760,390925.078,392749.289 +761,390937.393,392760.704 +762,390976.271,392805.664 +763,390980.72,392795.089 +764,390968.007,392783.531 +765,390952.134,392778.084 +766,390943.737,392777.377 +767,390906.369,392768.988 +768,390925.23,392748.952 +769,390938.215,392759.66 +770,390980.319,392808.983 +771,390978.194,392792.523 +772,390980.83,392795.019 +773,390968.132,392783.517 +774,390952.161,392777.776 +775,390943.66,392777.358 +776,390906.708,392768.567 +777,390925.5,392748.446 +778,390940,392756 +779,390983.29,392812.012 +780,390978,392789 +781,390980.951,392794.989 +782,390968.299,392783.573 +783,390952.189,392777.45 +784,390943.563,392777.358 +785,390906,392764 +786,390926.112,392747.463 +787,390985.762,392814.221 +788,390981.082,392794.959 +789,390968.41,392783.642 +790,390952.227,392777.236 +791,390943.473,392777.377 +792,390926.444,392747.366 +793,390924.179,392748.181 +794,390988.243,392815.901 +795,390981.202,392794.959 +796,390968.576,392783.781 +797,390952.283,392777.022 +798,390943.39,392777.416 +799,390926.734,392747.283 +800,390921.1,392749.367 +801,390988.444,392815.944 +802,390990.626,392817.377 +803,390981.333,392794.979 +804,390969.687,392784.793 +805,390952.311,392776.92 +806,390943.306,392777.506 +807,390926.982,392747.256 +808,390918.462,392750.361 +809,390988.65,392815.95 +810,390993.25,392818.98 +811,390993.25,392818.98 +812,390981.413,392795.009 +813,390973,392785 +814,390952.366,392776.761 +815,390943.035,392777.828 +816,390927.176,392747.256 +817,390917,392751 +818,390988.854,392815.918 +819,390995.557,392820.131 +820,390995.557,392820.131 +821,390981.524,392795.079 +822,390952.441,392776.622 +823,390942.694,392778.175 +824,390927.369,392747.297 +825,390989.048,392815.851 +826,390997.983,392821.471 +827,390997.983,392821.471 +828,390982.359,392795.763 +829,390952.581,392776.445 +830,390942.333,392778.516 +831,390927.535,392747.339 +832,390989.227,392815.749 +833,390999.996,392822.532 +834,390999.996,392822.532 +835,390986,392795 +836,390954.1,392774.61 +837,390927.645,392747.394 +838,390989.385,392815.617 +839,391002.28,392823.399 +840,391002.28,392823.399 +841,390954.732,392773.897 +842,390927.77,392747.463 +843,390989.516,392815.458 +844,391004.255,392819.014 +845,391005.615,392824.81 +846,391005.615,392824.81 +847,390955.053,392773.535 +848,390927.935,392747.601 +849,390989.5735,392815.3755 +850,391004.582,392818.391 +851,391009.67,392826.423 +852,391009.67,392826.423 +853,390955.134,392773.465 +854,390928.184,392747.849 +855,390990.602,392813.363 +856,391005.27,392816.532 +857,391016.001,392829.07 +858,391016.001,392829.07 +859,390955.204,392773.418 +860,390931,392748 +861,390935,392751 +862,390991.411,392812.136 +863,391006.257,392814.424 +864,391018.607,392830.063 +865,391018.607,392830.063 +866,390955.285,392773.378 +867,390991.997,392810.992 +868,391006.471,392814.211 +869,391020.304,392830.435 +870,391020.304,392830.435 +871,390955.355,392773.36 +872,390992.556,392809.765 +873,391006.765,392813.971 +874,391005.777,392813.73 +875,391021.504,392830.435 +876,391021.504,392830.435 +877,390955.425,392773.355 +878,390993.762,392807.804 +879,391007.112,392813.917 +880,391004.149,392812.61 +881,391022.496,392830.239 +882,391022.496,392830.239 +883,390955.495,392773.355 +884,390994.075,392807.334 +885,391007.646,392813.917 +886,391005,392808 +887,390955.564,392773.36 +888,390994.421,392806.816 +889,390992.316,392804.712 +890,391008.286,392814.131 +891,390956.756,392773.691 +892,390994.97,392805.953 +893,390990.811,392802.497 +894,391010.609,392815.358 +895,390952.377,392769.85 +896,390960,392774 +897,390995.113,392805.81 +898,390991,392798 +899,391014,392812 +900,390952,392766 +901,390995.257,392805.718 +902,390995.401,392805.718 +903,390995.584,392805.758 +904,390995.885,392805.914 +905,390996.355,392806.267 +906,391001,392805 diff --git a/src/test/resources/lvFeeder/LineCodes.csv b/src/test/resources/lvFeeder/LineCodes.csv new file mode 100644 index 0000000000..f603a0cd0f --- /dev/null +++ b/src/test/resources/lvFeeder/LineCodes.csv @@ -0,0 +1,12 @@ +# Line Codes defined by matrix values,,,,,,,, +Name,nphases,R1,X1,R0,X0,C1,C0,Units +2c_.007,3,3.97,0.099,3.97,0.099,0,0,km +2c_.0225,3,1.257,0.085,1.257,0.085,0,0,km +2c_16,3,1.15,0.088,1.2,0.088,0,0,km +35_SAC_XSC,3,0.868,0.092,0.76,0.092,0,0,km +4c_.06,3,0.469,0.075,1.581,0.091,0,0,km +4c_.1,3,0.274,0.073,0.959,0.079,0,0,km +4c_.35,3,0.089,0.0675,0.319,0.076,0,0,km +4c_185,3,0.166,0.068,0.58,0.078,0,0,km +4c_70,3,0.446,0.071,1.505,0.083,0,0,km +4c_95_SAC_XC,3,0.322,0.074,0.804,0.093,0,0,km diff --git a/src/test/resources/lvFeeder/Lines.csv b/src/test/resources/lvFeeder/Lines.csv new file mode 100644 index 0000000000..fa35170156 --- /dev/null +++ b/src/test/resources/lvFeeder/Lines.csv @@ -0,0 +1,907 @@ +# Line definitions ,,,,,, +Name,Bus1,Bus2,Phases,Length,Units,LineCode +LINE1,1,2,ABC,1.098,m,4c_70 +LINE2,2,3,ABC,0.11511,m,4c_70 +LINE3,3,4,ABC,0.10784,m,4c_70 +LINE4,4,5,ABC,0.094021,m,4c_70 +LINE5,5,6,ABC,0.14812,m,4c_70 +LINE6,6,7,ABC,10.0863,m,4c_70 +LINE7,7,8,ABC,0.45175,m,4c_70 +LINE8,8,9,ABC,0.376,m,4c_70 +LINE9,9,10,ABC,0.32997,m,4c_70 +LINE10,10,11,ABC,0.24622,m,4c_70 +LINE11,11,12,ABC,0.23114,m,4c_70 +LINE12,12,13,ABC,0.14213,m,4c_70 +LINE13,13,14,ABC,0.35384,m,4c_70 +LINE14,14,15,ABC,2.8664,m,4c_70 +LINE15,15,16,ABC,0.09654,m,2c_.007 +LINE16,15,17,ABC,3.476,m,4c_70 +LINE17,16,18,ABC,0.044045,m,2c_.007 +LINE18,17,19,ABC,0.23917,m,4c_70 +LINE19,18,20,ABC,0.046174,m,2c_.007 +LINE20,19,21,ABC,0.26856,m,4c_70 +LINE21,20,22,ABC,0.041976,m,2c_.007 +LINE22,21,23,ABC,0.43727,m,4c_70 +LINE23,22,24,ABC,0.051245,m,2c_.007 +LINE24,23,25,ABC,0.7955,m,4c_70 +LINE25,24,26,ABC,0.055902,m,2c_.007 +LINE26,25,27,ABC,5.9049,m,2c_16 +LINE27,25,28,ABC,9.9686,m,4c_70 +LINE28,26,29,ABC,0.054562,m,2c_.007 +LINE29,27,30,ABC,1.6265,m,2c_16 +LINE30,27,31,ABC,1.5847,m,2c_16 +LINE31,28,32,ABC,2.6538,m,4c_70 +LINE32,29,33,ABC,0.14629,m,2c_.007 +LINE33,30,34,ABC,3.7248,m,2c_16 +LINE34,31,35,ABC,0.053666,m,2c_16 +LINE35,32,36,ABC,5.7265,m,2c_16 +LINE36,32,37,ABC,8.0244,m,4c_70 +LINE37,33,38,ABC,0.13648,m,2c_.007 +LINE38,35,39,ABC,0.077162,m,2c_16 +LINE39,36,40,ABC,0.40004,m,2c_16 +LINE40,36,41,ABC,1.8063,m,2c_16 +LINE41,37,42,ABC,5.5684,m,4c_70 +LINE42,37,43,ABC,0.21675,m,4c_185 +LINE43,38,44,ABC,0.033838,m,2c_.007 +LINE44,39,45,ABC,0.098955,m,2c_16 +LINE45,40,46,ABC,0.18031,m,2c_16 +LINE46,41,47,ABC,4.3463,m,2c_16 +LINE47,42,48,ABC,4.2078,m,4c_70 +LINE48,43,49,ABC,0.10436,m,4c_185 +LINE49,44,50,ABC,0.048104,m,2c_.007 +LINE50,45,51,ABC,0.241,m,2c_16 +LINE51,46,52,ABC,0.19109,m,2c_16 +LINE52,48,53,ABC,0.60668,m,4c_70 +LINE53,48,54,ABC,0.63949,m,4c_70 +LINE54,49,55,ABC,0.11625,m,4c_185 +LINE55,50,56,ABC,0.087664,m,2c_.007 +LINE56,51,57,ABC,0.20634,m,2c_16 +LINE57,52,58,ABC,0.182,m,2c_16 +LINE58,53,59,ABC,2.7481,m,4c_70 +LINE59,54,60,ABC,0.065368,m,4c_70 +LINE60,55,61,ABC,0.10028,m,4c_185 +LINE61,56,62,ABC,0.078,m,2c_.007 +LINE62,57,63,ABC,0.98912,m,2c_16 +LINE63,58,64,ABC,0.109,m,2c_16 +LINE64,59,65,ABC,0.55868,m,4c_70 +LINE65,59,66,ABC,8.2583,m,2c_16 +LINE66,60,67,ABC,0.074,m,4c_70 +LINE67,61,68,ABC,0.096042,m,4c_185 +LINE68,62,69,ABC,0.083241,m,2c_.007 +LINE69,63,70,ABC,3.4962,m,2c_16 +LINE70,64,71,ABC,0.21385,m,2c_16 +LINE71,65,72,ABC,6.6006,m,4c_70 +LINE72,66,73,ABC,4.0366,m,2c_16 +LINE73,66,74,ABC,4.0366,m,2c_16 +LINE74,67,75,ABC,0.17951,m,4c_70 +LINE75,68,76,ABC,0.23551,m,4c_185 +LINE76,69,77,ABC,0.38907,m,2c_.007 +LINE77,71,78,ABC,1.0838,m,2c_16 +LINE78,72,79,ABC,2.3008,m,4c_70 +LINE79,75,80,ABC,0.10362,m,4c_70 +LINE80,76,81,ABC,0.7469,m,4c_185 +LINE81,77,82,ABC,0.51088,m,2c_.007 +LINE82,78,83,ABC,4.084,m,2c_16 +LINE83,79,84,ABC,0.50211,m,4c_70 +LINE84,80,85,ABC,0.11122,m,4c_70 +LINE85,81,86,ABC,1.4388,m,4c_185 +LINE86,82,87,ABC,0.31045,m,2c_.007 +LINE87,84,88,ABC,1.0182,m,4c_70 +LINE88,85,89,ABC,0.1048,m,4c_70 +LINE89,86,90,ABC,0.34251,m,4c_185 +LINE90,87,91,ABC,0.11206,m,2c_.007 +LINE91,88,92,ABC,0.96021,m,4c_70 +LINE92,90,93,ABC,0.065307,m,4c_185 +LINE93,91,94,ABC,0.034785,m,2c_.007 +LINE94,92,95,ABC,0.55811,m,4c_70 +LINE95,93,96,ABC,0.086052,m,4c_185 +LINE96,94,97,ABC,0.03677,m,2c_.007 +LINE97,95,98,ABC,0.36859,m,4c_70 +LINE98,96,99,ABC,0.037216,m,4c_185 +LINE99,97,100,ABC,0.089588,m,2c_.007 +LINE100,98,101,ABC,0.50892,m,4c_70 +LINE101,99,102,ABC,5.0819,m,4c_185 +LINE102,100,103,ABC,0.28583,m,2c_.007 +LINE103,101,104,ABC,0.28838,m,4c_.35 +LINE104,101,105,ABC,0.33602,m,4c_70 +LINE105,102,106,ABC,0.22108,m,4c_185 +LINE106,104,107,ABC,0.3489,m,4c_.35 +LINE107,105,108,ABC,0.19054,m,4c_70 +LINE108,106,109,ABC,0.45085,m,4c_185 +LINE109,107,110,ABC,0.4044,m,4c_.35 +LINE110,108,111,ABC,7.5182,m,4c_70 +LINE111,109,112,ABC,11.9766,m,4c_185 +LINE112,110,113,ABC,0.61659,m,4c_.35 +LINE113,111,114,ABC,0.75316,m,4c_70 +LINE114,112,115,ABC,10.6613,m,4c_185 +LINE115,113,116,ABC,0.79271,m,4c_.35 +LINE116,114,117,ABC,1.1056,m,4c_.35 +LINE117,114,118,ABC,3.6556,m,4c_.1 +LINE118,115,119,ABC,0.99464,m,4c_185 +LINE119,116,120,ABC,0.56909,m,4c_.35 +LINE120,117,121,ABC,0.19481,m,2c_.007 +LINE121,117,122,ABC,0.53831,m,4c_.35 +LINE122,118,123,ABC,6.5924,m,4c_.1 +LINE123,119,124,ABC,0.7248,m,4c_185 +LINE124,120,125,ABC,0.80412,m,4c_.35 +LINE125,121,126,ABC,0.16869,m,2c_.007 +LINE126,122,127,ABC,2.5288,m,4c_.35 +LINE127,123,128,ABC,2.9646,m,4c_.1 +LINE128,124,129,ABC,0.62512,m,4c_185 +LINE129,125,130,ABC,0.87,m,4c_.35 +LINE130,126,131,ABC,0.11915,m,2c_.007 +LINE131,127,132,ABC,3.8212,m,2c_16 +LINE132,127,133,ABC,7.1782,m,4c_.35 +LINE133,128,134,ABC,0.88205,m,4c_.1 +LINE134,129,135,ABC,1.9203,m,4c_185 +LINE135,130,136,ABC,0.82048,m,4c_.35 +LINE136,131,137,ABC,0.18436,m,2c_.007 +LINE137,132,138,ABC,0.32908,m,2c_16 +LINE138,133,139,ABC,5.3402,m,4c_.35 +LINE139,134,140,ABC,0.99566,m,4c_.1 +LINE140,135,141,ABC,1.4127,m,4c_185 +LINE141,136,142,ABC,1.349,m,4c_.35 +LINE142,137,143,ABC,0.21781,m,2c_.007 +LINE143,138,144,ABC,0.32289,m,2c_16 +LINE144,139,145,ABC,3.5762,m,4c_.35 +LINE145,140,146,ABC,0.9364,m,4c_.1 +LINE146,141,147,ABC,0.24053,m,4c_185 +LINE147,142,148,ABC,6.4142,m,4c_.35 +LINE148,143,149,ABC,0.19401,m,2c_.007 +LINE149,144,150,ABC,0.26072,m,2c_16 +LINE150,145,151,ABC,3.5713,m,4c_.35 +LINE151,145,152,ABC,5.1314,m,2c_16 +LINE152,146,153,ABC,1.0926,m,4c_.1 +LINE153,147,154,ABC,0.083096,m,4c_185 +LINE154,148,155,ABC,1.3973,m,4c_.35 +LINE155,149,156,ABC,0.2191,m,2c_.007 +LINE156,150,157,ABC,0.39132,m,2c_16 +LINE157,151,158,ABC,9.4713,m,4c_.35 +LINE158,152,159,ABC,0.31233,m,2c_16 +LINE159,153,160,ABC,0.31439,m,4c_.1 +LINE160,154,161,ABC,0.12256,m,4c_185 +LINE161,155,162,ABC,11.7422,m,2c_16 +LINE162,155,163,ABC,5.2844,m,4c_.35 +LINE163,156,164,ABC,0.20342,m,2c_.007 +LINE164,157,165,ABC,0.47178,m,2c_16 +LINE165,158,166,ABC,3.2899,m,4c_.35 +LINE166,159,167,ABC,0.28533,m,2c_16 +LINE167,160,168,ABC,1.7861,m,4c_.1 +LINE168,161,169,ABC,0.24958,m,4c_185 +LINE169,162,170,ABC,2.2183,m,2c_16 +LINE170,163,171,ABC,7.0156,m,4c_.35 +LINE171,164,172,ABC,0.1727,m,2c_.007 +LINE172,165,173,ABC,0.35642,m,2c_16 +LINE173,166,174,ABC,3.9183,m,4c_.35 +LINE174,166,175,ABC,4.2045,m,2c_16 +LINE175,167,176,ABC,0.11853,m,2c_16 +LINE176,168,177,ABC,1.0088,m,4c_.1 +LINE177,170,178,ABC,4.5768,m,2c_16 +LINE178,171,179,ABC,1.1818,m,4c_.35 +LINE179,171,180,ABC,2.4224,m,2c_16 +LINE180,172,181,ABC,0.17961,m,2c_.007 +LINE181,173,182,ABC,0.41244,m,2c_16 +LINE182,174,183,ABC,0.58763,m,4c_.35 +LINE183,175,184,ABC,0.45409,m,2c_16 +LINE184,176,185,ABC,0.25549,m,2c_16 +LINE185,177,186,ABC,0.74886,m,4c_.1 +LINE186,179,187,ABC,4.6507,m,4c_.35 +LINE187,180,188,ABC,10.0258,m,2c_16 +LINE188,181,189,ABC,0.15412,m,2c_.007 +LINE189,182,190,ABC,0.3878,m,2c_16 +LINE190,183,191,ABC,2.3151,m,4c_.35 +LINE191,183,192,ABC,0.27791,m,4c_.35 +LINE192,184,193,ABC,0.43923,m,2c_16 +LINE193,185,194,ABC,0.65073,m,2c_16 +LINE194,186,195,ABC,0.67326,m,4c_.1 +LINE195,187,196,ABC,8.3036,m,4c_.35 +LINE196,188,197,ABC,1.9595,m,2c_16 +LINE197,188,198,ABC,1.1325,m,2c_16 +LINE198,189,199,ABC,0.19148,m,2c_.007 +LINE199,190,200,ABC,0.41725,m,2c_16 +LINE200,191,201,ABC,0.9314,m,4c_.35 +LINE201,192,202,ABC,0.16447,m,4c_.35 +LINE202,193,203,ABC,0.35134,m,2c_16 +LINE203,194,204,ABC,0.38178,m,2c_16 +LINE204,195,205,ABC,0.83638,m,4c_.1 +LINE205,196,206,ABC,3.2475,m,2c_16 +LINE206,196,207,ABC,2.1371,m,4c_.35 +LINE207,197,208,ABC,4.9541,m,2c_16 +LINE208,198,209,ABC,0.16008,m,2c_16 +LINE209,199,210,ABC,0.44838,m,2c_.007 +LINE210,200,211,ABC,0.63785,m,2c_16 +LINE211,202,212,ABC,0.15526,m,4c_.35 +LINE212,203,213,ABC,0.27987,m,2c_16 +LINE213,204,214,ABC,0.2674,m,2c_16 +LINE214,205,215,ABC,1.5434,m,4c_.1 +LINE215,206,216,ABC,10.6295,m,2c_16 +LINE216,207,217,ABC,3.8571,m,4c_.35 +LINE217,209,218,ABC,0.1291,m,2c_16 +LINE218,210,219,ABC,0.67215,m,2c_.007 +LINE219,211,220,ABC,1.7419,m,2c_16 +LINE220,212,221,ABC,0.17006,m,4c_.35 +LINE221,213,222,ABC,0.59169,m,2c_16 +LINE222,214,223,ABC,0.51437,m,2c_16 +LINE223,215,224,ABC,1.3456,m,4c_.1 +LINE224,216,225,ABC,4.5822,m,2c_16 +LINE225,217,226,ABC,1.3772,m,4c_.35 +LINE226,218,227,ABC,0.10317,m,2c_16 +LINE227,220,228,ABC,0.14852,m,2c_16 +LINE228,221,229,ABC,0.23273,m,4c_.35 +LINE229,222,230,ABC,0.46597,m,2c_16 +LINE230,223,231,ABC,0.25602,m,2c_16 +LINE231,224,232,ABC,0.91534,m,4c_.1 +LINE232,226,233,ABC,11.8949,m,2c_16 +LINE233,226,234,ABC,1.1273,m,4c_.35 +LINE234,227,235,ABC,0.15749,m,2c_16 +LINE235,228,236,ABC,0.0686,m,2c_16 +LINE236,229,237,ABC,0.20742,m,4c_.35 +LINE237,230,238,ABC,0.32322,m,2c_16 +LINE238,231,239,ABC,0.18179,m,2c_16 +LINE239,232,240,ABC,0.6013,m,4c_.1 +LINE240,233,241,ABC,1.7274,m,2c_16 +LINE241,235,242,ABC,0.18461,m,2c_16 +LINE242,236,243,ABC,0.073376,m,2c_16 +LINE243,237,244,ABC,0.16881,m,4c_.35 +LINE244,238,245,ABC,0.32245,m,2c_16 +LINE245,239,246,ABC,2.0796,m,2c_16 +LINE246,240,247,ABC,1.2941,m,4c_.1 +LINE247,241,248,ABC,5.3022,m,2c_16 +LINE248,241,249,ABC,5.3022,m,2c_16 +LINE249,242,250,ABC,0.28355,m,2c_16 +LINE250,243,251,ABC,0.070114,m,2c_16 +LINE251,244,252,ABC,0.13297,m,4c_.35 +LINE252,245,253,ABC,0.47173,m,2c_16 +LINE253,246,254,ABC,0.61324,m,2c_16 +LINE254,247,255,ABC,4.5618,m,2c_16 +LINE255,247,256,ABC,0.85678,m,4c_.1 +LINE256,250,257,ABC,1.0376,m,2c_16 +LINE257,251,258,ABC,0.07811,m,2c_16 +LINE258,252,259,ABC,0.17323,m,4c_.35 +LINE259,253,260,ABC,1.7742,m,2c_16 +LINE260,254,261,ABC,0.1372,m,2c_16 +LINE261,255,262,ABC,0.6306,m,2c_16 +LINE262,256,263,ABC,3.2128,m,4c_.1 +LINE263,257,264,ABC,5.05,m,2c_16 +LINE264,258,265,ABC,0.16123,m,2c_16 +LINE265,259,266,ABC,0.19436,m,4c_.35 +LINE266,260,267,ABC,0.4141,m,2c_16 +LINE267,261,268,ABC,3.4578,m,2c_16 +LINE268,261,269,ABC,0.11871,m,2c_16 +LINE269,262,270,ABC,0.28991,m,2c_16 +LINE270,263,271,ABC,4.2547,m,2c_16 +LINE271,263,272,ABC,1.0792,m,4c_.1 +LINE272,265,273,ABC,0.16792,m,2c_16 +LINE273,266,274,ABC,0.17888,m,4c_.35 +LINE274,267,275,ABC,0.18971,m,2c_16 +LINE275,268,276,ABC,3.4268,m,2c_16 +LINE276,269,277,ABC,0.13918,m,2c_16 +LINE277,270,278,ABC,0.34433,m,2c_16 +LINE278,271,279,ABC,0.30927,m,2c_16 +LINE279,272,280,ABC,3.9121,m,4c_.1 +LINE280,273,281,ABC,0.63854,m,2c_16 +LINE281,274,282,ABC,0.60542,m,4c_.35 +LINE282,275,283,ABC,0.12472,m,2c_16 +LINE283,277,284,ABC,0.12578,m,2c_16 +LINE284,278,285,ABC,0.53126,m,2c_16 +LINE285,279,286,ABC,0.25491,m,2c_16 +LINE286,280,287,ABC,1.7542,m,4c_.06 +LINE287,280,288,ABC,0.91306,m,4c_.1 +LINE288,281,289,ABC,3.3901,m,2c_16 +LINE289,282,290,ABC,0.81044,m,4c_.35 +LINE290,283,291,ABC,0.87618,m,2c_16 +LINE291,283,292,ABC,0.10807,m,2c_16 +LINE292,284,293,ABC,0.12739,m,2c_16 +LINE293,285,294,ABC,0.47339,m,2c_16 +LINE294,286,295,ABC,0.36208,m,2c_16 +LINE295,287,296,ABC,0.80742,m,4c_.06 +LINE296,288,297,ABC,3.8266,m,4c_.1 +LINE297,291,298,ABC,0.40248,m,2c_16 +LINE298,292,299,ABC,0.076485,m,2c_16 +LINE299,293,300,ABC,0.13697,m,2c_16 +LINE300,294,301,ABC,0.36805,m,2c_16 +LINE301,295,302,ABC,1.6263,m,2c_16 +LINE302,296,303,ABC,5.2746,m,4c_.06 +LINE303,297,304,ABC,0.84468,m,4c_.1 +LINE304,298,305,ABC,0.68119,m,2c_16 +LINE305,299,306,ABC,0.089006,m,2c_16 +LINE306,300,307,ABC,0.79435,m,2c_16 +LINE307,301,308,ABC,0.45813,m,2c_16 +LINE308,302,309,ABC,0.31308,m,2c_16 +LINE309,303,310,ABC,0.39397,m,4c_.06 +LINE310,304,311,ABC,0.28067,m,4c_.1 +LINE311,305,312,ABC,1.3075,m,2c_16 +LINE312,306,313,ABC,0.17024,m,2c_16 +LINE313,307,314,ABC,3.3598,m,2c_16 +LINE314,308,315,ABC,0.47384,m,2c_16 +LINE315,309,316,ABC,0.23181,m,2c_16 +LINE316,310,317,ABC,0.64903,m,2c_16 +LINE317,310,318,ABC,7.2163,m,4c_.06 +LINE318,311,319,ABC,0.14649,m,4c_.1 +LINE319,312,320,ABC,3.8495,m,2c_16 +LINE320,313,321,ABC,0.6529,m,2c_16 +LINE321,315,322,ABC,0.55892,m,2c_16 +LINE322,316,323,ABC,0.26702,m,2c_16 +LINE323,317,324,ABC,3.3427,m,2c_16 +LINE324,318,325,ABC,3.4631,m,4c_.06 +LINE325,319,326,ABC,0.1254,m,4c_.1 +LINE326,321,327,ABC,2.2281,m,2c_16 +LINE327,322,328,ABC,0.31851,m,2c_16 +LINE328,323,329,ABC,0.26488,m,2c_16 +LINE329,324,330,ABC,1.167,m,2c_16 +LINE330,325,331,ABC,9.1332,m,2c_16 +LINE331,325,332,ABC,6.6729,m,4c_.06 +LINE332,326,333,ABC,0.14262,m,4c_.1 +LINE333,328,334,ABC,1.4389,m,2c_16 +LINE334,329,335,ABC,2.327,m,2c_16 +LINE335,330,336,ABC,2.5399,m,2c_16 +LINE336,331,337,ABC,3.6172,m,2c_16 +LINE337,332,338,ABC,6.8067,m,2c_16 +LINE338,332,339,ABC,1.2129,m,4c_.06 +LINE339,333,340,ABC,0.11236,m,4c_.1 +LINE340,334,341,ABC,0.55999,m,2c_16 +LINE341,335,342,ABC,4.7567,m,2c_16 +LINE342,336,343,ABC,2.082,m,2c_16 +LINE343,336,344,ABC,0.9796,m,2c_16 +LINE344,338,345,ABC,3.4221,m,2c_16 +LINE345,339,346,ABC,1.0391,m,4c_.06 +LINE346,340,347,ABC,0.094202,m,4c_.1 +LINE347,341,348,ABC,0.19454,m,2c_16 +LINE348,343,349,ABC,3.1153,m,2c_16 +LINE349,344,350,ABC,0.1364,m,2c_16 +LINE350,345,351,ABC,0.31846,m,2c_16 +LINE351,346,352,ABC,0.73091,m,4c_.06 +LINE352,347,353,ABC,0.085,m,4c_.1 +LINE353,348,354,ABC,0.14656,m,2c_16 +LINE354,350,355,ABC,0.14814,m,2c_16 +LINE355,351,356,ABC,0.13152,m,2c_16 +LINE356,352,357,ABC,0.92352,m,4c_.06 +LINE357,353,358,ABC,0.070349,m,4c_.1 +LINE358,354,359,ABC,0.10723,m,2c_16 +LINE359,355,360,ABC,0.12976,m,2c_16 +LINE360,356,361,ABC,0.092801,m,2c_16 +LINE361,357,362,ABC,0.57867,m,4c_.06 +LINE362,358,363,ABC,0.081609,m,4c_.1 +LINE363,359,364,ABC,0.054452,m,2c_16 +LINE364,360,365,ABC,0.13787,m,2c_16 +LINE365,361,366,ABC,0.094921,m,2c_16 +LINE366,362,367,ABC,0.88861,m,4c_.06 +LINE367,363,368,ABC,0.089694,m,4c_.1 +LINE368,364,369,ABC,0.080056,m,2c_16 +LINE369,365,370,ABC,0.19677,m,2c_16 +LINE370,366,371,ABC,0.112,m,2c_16 +LINE371,367,372,ABC,0.88584,m,4c_.06 +LINE372,368,373,ABC,0.48898,m,4c_.1 +LINE373,369,374,ABC,0.1342,m,2c_16 +LINE374,370,375,ABC,0.23921,m,2c_16 +LINE375,371,376,ABC,0.14128,m,2c_16 +LINE376,372,377,ABC,0.99394,m,4c_.06 +LINE377,373,378,ABC,3.6848,m,4c_.1 +LINE378,373,379,ABC,1.4115,m,2c_16 +LINE379,374,380,ABC,0.59859,m,2c_16 +LINE380,375,381,ABC,1.4827,m,2c_16 +LINE381,376,382,ABC,0.12653,m,2c_16 +LINE382,377,383,ABC,0.71925,m,4c_.06 +LINE383,378,384,ABC,3.5292,m,4c_.1 +LINE384,379,385,ABC,8.6668,m,2c_16 +LINE385,379,386,ABC,1.4561,m,2c_16 +LINE386,380,387,ABC,2.2004,m,2c_16 +LINE387,381,388,ABC,5.0734,m,2c_16 +LINE388,382,389,ABC,0.10012,m,2c_16 +LINE389,383,390,ABC,0.85728,m,4c_.06 +LINE390,384,391,ABC,0.15711,m,4c_.1 +LINE391,385,392,ABC,3.1675,m,2c_16 +LINE392,386,393,ABC,7.8335,m,2c_16 +LINE393,389,394,ABC,0.17183,m,2c_16 +LINE394,390,395,ABC,1.2439,m,4c_.06 +LINE395,391,396,ABC,4.0601,m,2c_16 +LINE396,391,397,ABC,2.8793,m,4c_.1 +LINE397,392,398,ABC,0.32241,m,2c_16 +LINE398,393,399,ABC,0.5688,m,2c_16 +LINE399,394,400,ABC,0.59984,m,2c_16 +LINE400,395,401,ABC,0.9222,m,4c_.06 +LINE401,396,402,ABC,0.37201,m,2c_16 +LINE402,397,403,ABC,1.3891,m,4c_.1 +LINE403,398,404,ABC,0.225,m,2c_16 +LINE404,399,405,ABC,0.24807,m,2c_16 +LINE405,400,406,ABC,3.6672,m,2c_16 +LINE406,401,407,ABC,0.88961,m,4c_.06 +LINE407,402,408,ABC,0.21148,m,2c_16 +LINE408,403,409,ABC,4.1907,m,4c_.1 +LINE409,403,410,ABC,0.3791,m,4c_.1 +LINE410,404,411,ABC,0.23308,m,2c_16 +LINE411,405,412,ABC,0.16706,m,2c_16 +LINE412,407,413,ABC,0.87066,m,4c_.06 +LINE413,408,414,ABC,0.1436,m,2c_16 +LINE414,409,415,ABC,5.9686,m,4c_.1 +LINE415,410,416,ABC,0.094921,m,4c_.1 +LINE416,411,417,ABC,0.9788,m,2c_16 +LINE417,412,418,ABC,0.27954,m,2c_16 +LINE418,413,419,ABC,1.0471,m,4c_.06 +LINE419,414,420,ABC,0.23403,m,2c_16 +LINE420,415,421,ABC,1.249,m,4c_.1 +LINE421,416,422,ABC,0.066573,m,4c_.1 +LINE422,417,423,ABC,0.239,m,2c_16 +LINE423,418,424,ABC,3.1944,m,2c_16 +LINE424,419,425,ABC,1.7537,m,4c_.06 +LINE425,419,426,ABC,1.7537,m,4c_.06 +LINE426,420,427,ABC,0.77793,m,2c_16 +LINE427,421,428,ABC,0.31923,m,4c_.1 +LINE428,422,429,ABC,0.082873,m,4c_.1 +LINE429,423,430,ABC,0.22798,m,2c_16 +LINE430,424,431,ABC,1.1331,m,2c_16 +LINE431,425,432,ABC,5.9151,m,4c_.06 +LINE432,425,433,ABC,5.9151,m,4c_.06 +LINE433,427,434,ABC,0.86608,m,2c_16 +LINE434,428,435,ABC,0.16724,m,4c_.1 +LINE435,429,436,ABC,0.071344,m,4c_.1 +LINE436,430,437,ABC,0.22674,m,2c_16 +LINE437,431,438,ABC,0.384,m,2c_16 +LINE438,432,439,ABC,8.3663,m,4c_.06 +LINE439,432,440,ABC,8.3663,m,4c_.06 +LINE440,434,441,ABC,0.48708,m,2c_16 +LINE441,435,442,ABC,0.13864,m,4c_.1 +LINE442,436,443,ABC,0.078,m,4c_.1 +LINE443,437,444,ABC,0.2601,m,2c_16 +LINE444,438,445,ABC,0.67858,m,2c_16 +LINE445,439,446,ABC,6.0033,m,4c_.06 +LINE446,439,447,ABC,6.0033,m,4c_.06 +LINE447,441,448,ABC,0.45756,m,2c_16 +LINE448,442,449,ABC,0.11236,m,4c_.1 +LINE449,443,450,ABC,0.079246,m,4c_.1 +LINE450,444,451,ABC,0.89824,m,2c_16 +LINE451,445,452,ABC,0.59366,m,2c_16 +LINE452,446,453,ABC,1.8214,m,4c_.06 +LINE453,446,454,ABC,1.8214,m,4c_.06 +LINE454,448,455,ABC,0.43655,m,2c_16 +LINE455,449,456,ABC,0.17175,m,4c_.1 +LINE456,450,457,ABC,0.054231,m,4c_.1 +LINE457,451,458,ABC,4.3773,m,2c_16 +LINE458,452,459,ABC,0.67064,m,2c_16 +LINE459,453,460,ABC,5.3905,m,4c_.06 +LINE460,453,461,ABC,5.3905,m,4c_.06 +LINE461,453,462,ABC,3.6859,m,2c_16 +LINE462,455,463,ABC,0.71675,m,2c_16 +LINE463,456,464,ABC,0.15483,m,4c_.1 +LINE464,457,465,ABC,0.040311,m,4c_.1 +LINE465,459,466,ABC,0.63421,m,2c_16 +LINE466,460,467,ABC,5.9891,m,4c_.06 +LINE467,460,468,ABC,5.9891,m,4c_.06 +LINE468,460,469,ABC,0.88292,m,4c_.06 +LINE469,462,470,ABC,0.53828,m,2c_16 +LINE470,463,471,ABC,0.49923,m,2c_16 +LINE471,464,472,ABC,0.14736,m,4c_.1 +LINE472,465,473,ABC,0.049497,m,4c_.1 +LINE473,466,474,ABC,3.201,m,2c_16 +LINE474,467,475,ABC,2.1947,m,4c_.06 +LINE475,467,476,ABC,2.1947,m,4c_.06 +LINE476,470,477,ABC,0.29351,m,2c_16 +LINE477,471,478,ABC,0.35077,m,2c_16 +LINE478,472,479,ABC,0.16601,m,4c_.1 +LINE479,473,480,ABC,0.063953,m,4c_.1 +LINE480,474,481,ABC,0.18984,m,2c_16 +LINE481,475,482,ABC,4.6432,m,4c_.06 +LINE482,475,483,ABC,4.6432,m,4c_.06 +LINE483,475,484,ABC,10.2769,m,2c_16 +LINE484,477,485,ABC,0.19883,m,2c_16 +LINE485,478,486,ABC,0.1676,m,2c_16 +LINE486,479,487,ABC,0.17536,m,4c_.1 +LINE487,480,488,ABC,0.11163,m,4c_.1 +LINE488,481,489,ABC,0.1713,m,2c_16 +LINE489,482,490,ABC,6.6548,m,4c_.06 +LINE490,482,491,ABC,6.6548,m,4c_.06 +LINE491,484,492,ABC,0.57796,m,2c_16 +LINE492,484,493,ABC,4.0726,m,2c_16 +LINE493,485,494,ABC,0.30201,m,2c_16 +LINE494,486,495,ABC,0.10617,m,2c_16 +LINE495,487,496,ABC,0.38342,m,4c_.1 +LINE496,488,497,ABC,0.13972,m,4c_.1 +LINE497,489,498,ABC,0.23283,m,2c_16 +LINE498,490,499,ABC,4.0612,m,4c_.06 +LINE499,490,500,ABC,4.0612,m,4c_.06 +LINE500,492,501,ABC,0.24429,m,2c_16 +LINE501,493,502,ABC,2.606,m,2c_16 +LINE502,494,503,ABC,0.45833,m,2c_16 +LINE503,495,504,ABC,0.071784,m,2c_16 +LINE504,496,505,ABC,8.6961,m,4c_.1 +LINE505,497,506,ABC,0.096167,m,4c_.1 +LINE506,498,507,ABC,0.30564,m,2c_16 +LINE507,499,508,ABC,0.69938,m,4c_.06 +LINE508,499,509,ABC,0.69938,m,4c_.06 +LINE509,501,510,ABC,0.14354,m,2c_16 +LINE510,503,511,ABC,0.32517,m,2c_16 +LINE511,504,512,ABC,0.10013,m,2c_16 +LINE512,505,513,ABC,5.5648,m,2c_16 +LINE513,505,514,ABC,1.3369,m,4c_.1 +LINE514,506,515,ABC,0.085492,m,4c_.1 +LINE515,508,516,ABC,1.8857,m,4c_.06 +LINE516,508,517,ABC,1.8857,m,4c_.06 +LINE517,508,518,ABC,4.7316,m,2c_16 +LINE518,510,519,ABC,0.1321,m,2c_16 +LINE519,511,520,ABC,0.22216,m,2c_16 +LINE520,512,521,ABC,0.07642,m,2c_16 +LINE521,513,522,ABC,4.9074,m,2c_16 +LINE522,514,523,ABC,0.72122,m,4c_.1 +LINE523,515,524,ABC,0.066573,m,4c_.1 +LINE524,516,525,ABC,1.3881,m,4c_.06 +LINE525,516,526,ABC,1.3881,m,4c_.06 +LINE526,518,527,ABC,2.796,m,2c_16 +LINE527,519,528,ABC,0.11769,m,2c_16 +LINE528,520,529,ABC,0.17555,m,2c_16 +LINE529,521,530,ABC,0.54535,m,2c_16 +LINE530,523,531,ABC,0.10771,m,4c_.1 +LINE531,524,532,ABC,0.060803,m,4c_.1 +LINE532,525,533,ABC,1.8899,m,4c_.06 +LINE533,525,534,ABC,1.8899,m,4c_.06 +LINE534,527,535,ABC,2.2154,m,2c_16 +LINE535,528,536,ABC,0.12209,m,2c_16 +LINE536,529,537,ABC,0.56286,m,2c_16 +LINE537,530,538,ABC,1.9227,m,2c_16 +LINE538,530,539,ABC,5.5837,m,2c_16 +LINE539,531,540,ABC,0.082219,m,4c_.1 +LINE540,532,541,ABC,0.065513,m,4c_.1 +LINE541,533,542,ABC,1.3374,m,4c_.06 +LINE542,533,543,ABC,1.3374,m,4c_.06 +LINE543,535,544,ABC,0.91542,m,2c_16 +LINE544,536,545,ABC,0.36857,m,2c_16 +LINE545,537,546,ABC,4.5527,m,2c_16 +LINE546,538,547,ABC,2.1231,m,2c_16 +LINE547,540,548,ABC,0.076896,m,4c_.1 +LINE548,541,549,ABC,0.086145,m,4c_.1 +LINE549,542,550,ABC,3.7401,m,4c_.06 +LINE550,542,551,ABC,3.7401,m,4c_.06 +LINE551,544,552,ABC,0.28804,m,2c_16 +LINE552,544,553,ABC,3.789,m,2c_16 +LINE553,545,554,ABC,0.37143,m,2c_16 +LINE554,546,555,ABC,0.22672,m,2c_16 +LINE555,547,556,ABC,5.7548,m,2c_16 +LINE556,548,557,ABC,0.082,m,4c_.1 +LINE557,549,558,ABC,0.061612,m,4c_.1 +LINE558,550,559,ABC,2.7082,m,4c_.06 +LINE559,550,560,ABC,2.7082,m,4c_.06 +LINE560,552,561,ABC,0.10599,m,2c_16 +LINE561,553,562,ABC,2.8664,m,2c_16 +LINE562,554,563,ABC,3.4705,m,2c_16 +LINE563,555,564,ABC,0.17889,m,2c_16 +LINE564,557,565,ABC,0.07256,m,4c_.1 +LINE565,558,566,ABC,0.12021,m,4c_.1 +LINE566,559,567,ABC,0.60068,m,4c_.06 +LINE567,559,568,ABC,0.60068,m,4c_.06 +LINE568,559,569,ABC,3.8482,m,2c_16 +LINE569,561,570,ABC,0.15788,m,2c_16 +LINE570,564,571,ABC,0.20224,m,2c_16 +LINE571,565,572,ABC,0.074216,m,4c_.1 +LINE572,567,573,ABC,0.14223,m,4c_.06 +LINE573,567,574,ABC,0.14223,m,4c_.06 +LINE574,569,575,ABC,0.48648,m,2c_16 +LINE575,570,576,ABC,0.095,m,2c_16 +LINE576,571,577,ABC,0.18,m,2c_16 +LINE577,572,578,ABC,0.38305,m,4c_.1 +LINE578,573,579,ABC,3.8558,m,4c_.06 +LINE579,573,580,ABC,3.8558,m,4c_.06 +LINE580,573,581,ABC,0.31979,m,4c_.06 +LINE581,575,582,ABC,0.35899,m,2c_16 +LINE582,576,583,ABC,0.11463,m,2c_16 +LINE583,577,584,ABC,0.20718,m,2c_16 +LINE584,578,585,ABC,4.7318,m,2c_16 +LINE585,578,586,ABC,0.82623,m,4c_.1 +LINE586,579,587,ABC,2.7022,m,4c_.06 +LINE587,579,588,ABC,2.7022,m,4c_.06 +LINE588,581,589,ABC,0.11628,m,4c_.06 +LINE589,582,590,ABC,0.3493,m,2c_16 +LINE590,583,591,ABC,0.10065,m,2c_16 +LINE591,584,592,ABC,0.21243,m,2c_16 +LINE592,585,593,ABC,0.27268,m,2c_16 +LINE593,586,594,ABC,3.9483,m,4c_.1 +LINE594,587,595,ABC,5.4142,m,4c_.06 +LINE595,587,596,ABC,0.64238,m,4c_.06 +LINE596,589,597,ABC,0.089275,m,4c_.06 +LINE597,590,598,ABC,3.2812,m,2c_16 +LINE598,591,599,ABC,0.65862,m,2c_16 +LINE599,592,600,ABC,0.25534,m,2c_16 +LINE600,593,601,ABC,0.13695,m,2c_16 +LINE601,594,602,ABC,9.1669,m,2c_16 +LINE602,594,603,ABC,4.6424,m,4c_.1 +LINE603,595,604,ABC,4.8283,m,4c_.06 +LINE604,595,605,ABC,4.8283,m,4c_.06 +LINE605,595,606,ABC,4.7719,m,4c_.06 +LINE606,596,607,ABC,11.6642,m,2c_16 +LINE607,596,608,ABC,11.6642,m,2c_16 +LINE608,597,609,ABC,0.11037,m,4c_.06 +LINE609,598,610,ABC,1.5271,m,2c_16 +LINE610,599,611,ABC,4.8562,m,2c_16 +LINE611,600,612,ABC,0.16008,m,2c_16 +LINE612,601,613,ABC,0.11484,m,2c_16 +LINE613,602,614,ABC,4.8374,m,2c_16 +LINE614,603,615,ABC,4.4466,m,4c_.1 +LINE615,604,616,ABC,3.9301,m,2c_.0225 +LINE616,604,617,ABC,3.1088,m,4c_.06 +LINE617,604,618,ABC,3.1088,m,4c_.06 +LINE618,607,619,ABC,2.7454,m,2c_16 +LINE619,609,620,ABC,0.06364,m,4c_.06 +LINE620,610,621,ABC,0.71673,m,2c_16 +LINE621,612,622,ABC,0.68797,m,2c_16 +LINE622,613,623,ABC,0.093648,m,2c_16 +LINE623,615,624,ABC,1.6322,m,2c_16 +LINE624,615,625,ABC,1.2511,m,4c_.1 +LINE625,616,626,ABC,5.3537,m,2c_.0225 +LINE626,620,627,ABC,0.077897,m,4c_.06 +LINE627,621,628,ABC,0.47807,m,2c_16 +LINE628,622,629,ABC,2.9004,m,2c_16 +LINE629,623,630,ABC,0.147,m,2c_16 +LINE630,624,631,ABC,0.40022,m,2c_16 +LINE631,625,632,ABC,0.28784,m,4c_.1 +LINE632,626,633,ABC,1.5703,m,2c_.0225 +LINE633,627,634,ABC,0.065299,m,4c_.06 +LINE634,628,635,ABC,0.73088,m,2c_16 +LINE635,630,636,ABC,0.35053,m,2c_16 +LINE636,631,637,ABC,0.27482,m,2c_16 +LINE637,632,638,ABC,0.14284,m,4c_.1 +LINE638,633,639,ABC,5.1974,m,2c_.0225 +LINE639,634,640,ABC,0.069123,m,4c_.06 +LINE640,635,641,ABC,1.4274,m,2c_16 +LINE641,636,642,ABC,0.24251,m,2c_16 +LINE642,637,643,ABC,0.38096,m,2c_16 +LINE643,638,644,ABC,0.15697,m,4c_.1 +LINE644,640,645,ABC,0.068593,m,4c_.06 +LINE645,641,646,ABC,0.39457,m,2c_16 +LINE646,642,647,ABC,0.30835,m,2c_16 +LINE647,643,648,ABC,0.90337,m,2c_16 +LINE648,644,649,ABC,0.18112,m,4c_.1 +LINE649,645,650,ABC,0.093984,m,4c_.06 +LINE650,646,651,ABC,0.11455,m,2c_16 +LINE651,647,652,ABC,0.18732,m,2c_16 +LINE652,648,653,ABC,0.68671,m,2c_16 +LINE653,649,654,ABC,0.1831,m,4c_.1 +LINE654,650,655,ABC,0.12394,m,4c_.06 +LINE655,651,656,ABC,0.099368,m,2c_16 +LINE656,651,657,ABC,0.52781,m,2c_16 +LINE657,652,658,ABC,0.16911,m,2c_16 +LINE658,653,659,ABC,0.48206,m,2c_16 +LINE659,654,660,ABC,0.20299,m,4c_.1 +LINE660,655,661,ABC,0.36466,m,4c_.06 +LINE661,656,662,ABC,0.093,m,2c_16 +LINE662,657,663,ABC,0.69648,m,2c_16 +LINE663,658,664,ABC,0.28521,m,2c_16 +LINE664,659,665,ABC,0.505,m,2c_16 +LINE665,660,666,ABC,0.29519,m,4c_.1 +LINE666,661,667,ABC,0.26019,m,4c_.06 +LINE667,662,668,ABC,0.095802,m,2c_16 +LINE668,663,669,ABC,2.8935,m,2c_16 +LINE669,664,670,ABC,0.2804,m,2c_16 +LINE670,665,671,ABC,0.41461,m,2c_16 +LINE671,666,672,ABC,0.4801,m,2c_16 +LINE672,666,673,ABC,0.81161,m,4c_.1 +LINE673,667,674,ABC,0.20184,m,4c_.06 +LINE674,668,675,ABC,0.69267,m,2c_16 +LINE675,669,676,ABC,1.2288,m,2c_16 +LINE676,670,677,ABC,0.13267,m,2c_16 +LINE677,671,678,ABC,0.68648,m,2c_16 +LINE678,672,679,ABC,0.2883,m,2c_16 +LINE679,673,680,ABC,5.1393,m,4c_.1 +LINE680,674,681,ABC,0.40252,m,4c_.06 +LINE681,675,682,ABC,5.0441,m,2c_16 +LINE682,677,683,ABC,0.14572,m,2c_16 +LINE683,678,684,ABC,2.2185,m,2c_16 +LINE684,679,685,ABC,0.26744,m,2c_16 +LINE685,680,686,ABC,3.6787,m,4c_.1 +LINE686,683,687,ABC,0.13986,m,2c_16 +LINE687,684,688,ABC,5.1838,m,2c_16 +LINE688,685,689,ABC,0.26095,m,2c_16 +LINE689,686,690,ABC,8.1445,m,2c_16 +LINE690,686,691,ABC,10.5254,m,4c_.1 +LINE691,687,692,ABC,0.16867,m,2c_16 +LINE692,689,693,ABC,0.19573,m,2c_16 +LINE693,690,694,ABC,0.76157,m,2c_16 +LINE694,690,695,ABC,2.1261,m,2c_16 +LINE695,691,696,ABC,9.4817,m,2c_16 +LINE696,691,697,ABC,2.1907,m,4c_.1 +LINE697,692,698,ABC,0.26905,m,2c_16 +LINE698,693,699,ABC,0.31093,m,2c_16 +LINE699,694,700,ABC,0.2383,m,2c_16 +LINE700,695,701,ABC,4.3312,m,2c_16 +LINE701,696,702,ABC,5.493,m,2c_16 +LINE702,697,703,ABC,2.4,m,4c_.06 +LINE703,698,704,ABC,0.73636,m,2c_16 +LINE704,699,705,ABC,0.52424,m,2c_16 +LINE705,700,706,ABC,0.15322,m,2c_16 +LINE706,703,707,ABC,6.3308,m,4c_.06 +LINE707,703,708,ABC,0.11132,m,4c_.06 +LINE708,704,709,ABC,0.97996,m,2c_16 +LINE709,705,710,ABC,3.9281,m,2c_16 +LINE710,706,711,ABC,0.092418,m,2c_16 +LINE711,707,712,ABC,7.5025,m,4c_.06 +LINE712,707,713,ABC,3.9448,m,2c_16 +LINE713,708,714,ABC,0.10474,m,4c_.06 +LINE714,709,715,ABC,0.093338,m,2c_16 +LINE715,710,716,ABC,3.2225,m,2c_16 +LINE716,711,717,ABC,0.093408,m,2c_16 +LINE717,712,718,ABC,7.7434,m,4c_.06 +LINE718,713,719,ABC,0.4223,m,2c_16 +LINE719,714,720,ABC,0.097,m,4c_.06 +LINE720,715,721,ABC,0.073817,m,2c_16 +LINE721,716,722,ABC,1.021,m,2c_16 +LINE722,717,723,ABC,0.083433,m,2c_16 +LINE723,718,724,ABC,3.2535,m,4c_.06 +LINE724,718,725,ABC,9.3475,m,2c_16 +LINE725,719,726,ABC,0.16124,m,2c_16 +LINE726,720,727,ABC,0.10977,m,4c_.06 +LINE727,721,728,ABC,0.071694,m,2c_16 +LINE728,722,729,ABC,0.92949,m,2c_16 +LINE729,723,730,ABC,0.094,m,2c_16 +LINE730,724,731,ABC,4.421,m,4c_.06 +LINE731,725,732,ABC,1.2539,m,2c_16 +LINE732,726,733,ABC,0.17056,m,2c_16 +LINE733,727,734,ABC,0.089889,m,4c_.06 +LINE734,728,735,ABC,0.076792,m,2c_16 +LINE735,729,736,ABC,0.50625,m,2c_16 +LINE736,730,737,ABC,0.075313,m,2c_16 +LINE737,731,738,ABC,5.1761,m,4c_.06 +LINE738,732,739,ABC,0.65877,m,2c_16 +LINE739,733,740,ABC,0.14155,m,2c_16 +LINE740,734,741,ABC,0.13761,m,4c_.06 +LINE741,735,742,ABC,0.071,m,2c_16 +LINE742,736,743,ABC,0.40432,m,2c_16 +LINE743,737,744,ABC,0.090338,m,2c_16 +LINE744,738,745,ABC,4.1562,m,4c_.06 +LINE745,739,746,ABC,3.7387,m,2c_16 +LINE746,739,747,ABC,0.12202,m,2c_16 +LINE747,740,748,ABC,0.16763,m,2c_16 +LINE748,741,749,ABC,0.16427,m,4c_.06 +LINE749,742,750,ABC,0.06691,m,2c_16 +LINE750,743,751,ABC,0.34477,m,2c_16 +LINE751,744,752,ABC,0.09735,m,2c_16 +LINE752,745,753,ABC,1.5434,m,4c_.06 +LINE753,745,754,ABC,5.9227,m,2c_16 +LINE754,746,755,ABC,3.0391,m,2c_16 +LINE755,747,756,ABC,0.088238,m,2c_16 +LINE756,748,757,ABC,0.16348,m,2c_16 +LINE757,749,758,ABC,0.12454,m,4c_.06 +LINE758,750,759,ABC,0.093059,m,2c_16 +LINE759,751,760,ABC,0.40459,m,2c_16 +LINE760,752,761,ABC,0.17761,m,2c_16 +LINE761,753,762,ABC,2.1279,m,4c_.06 +LINE762,754,763,ABC,4.9506,m,2c_16 +LINE763,756,764,ABC,0.074465,m,2c_16 +LINE764,757,765,ABC,0.22475,m,2c_16 +LINE765,758,766,ABC,0.12167,m,4c_.06 +LINE766,759,767,ABC,0.11404,m,2c_16 +LINE767,760,768,ABC,0.36969,m,2c_16 +LINE768,761,769,ABC,1.3288,m,2c_16 +LINE769,762,770,ABC,5.2347,m,4c_.06 +LINE770,763,771,ABC,3.6007,m,2c_16 +LINE771,763,772,ABC,0.13038,m,2c_16 +LINE772,764,773,ABC,0.12578,m,2c_16 +LINE773,765,774,ABC,0.30918,m,2c_16 +LINE774,766,775,ABC,0.07931,m,4c_.06 +LINE775,767,776,ABC,0.54052,m,2c_16 +LINE776,768,777,ABC,0.57353,m,2c_16 +LINE777,769,778,ABC,4.0721,m,2c_16 +LINE778,770,779,ABC,4.2428,m,4c_.06 +LINE779,771,780,ABC,3.5283,m,2c_16 +LINE780,772,781,ABC,0.12466,m,2c_16 +LINE781,773,782,ABC,0.17614,m,2c_16 +LINE782,774,783,ABC,0.3272,m,2c_16 +LINE783,775,784,ABC,0.097,m,4c_.06 +LINE784,776,785,ABC,4.6216,m,2c_16 +LINE785,777,786,ABC,1.1579,m,2c_16 +LINE786,779,787,ABC,3.3152,m,4c_.06 +LINE787,781,788,ABC,0.13439,m,2c_16 +LINE788,782,789,ABC,0.1307,m,2c_16 +LINE789,783,790,ABC,0.21735,m,2c_16 +LINE790,784,791,ABC,0.091984,m,4c_.06 +LINE791,786,792,ABC,0.34588,m,2c_16 +LINE792,786,793,ABC,2.062,m,2c_16 +LINE793,787,794,ABC,2.9963,m,4c_.06 +LINE794,788,795,ABC,0.12,m,2c_16 +LINE795,789,796,ABC,0.21651,m,2c_16 +LINE796,790,797,ABC,0.22121,m,2c_16 +LINE797,791,798,ABC,0.091706,m,4c_.06 +LINE798,792,799,ABC,0.30164,m,2c_16 +LINE799,793,800,ABC,3.2995,m,2c_16 +LINE800,794,801,ABC,0.20555,m,2c_16 +LINE801,794,802,ABC,2.8031,m,4c_95_SAC_XC +LINE802,795,803,ABC,0.13252,m,2c_16 +LINE803,796,804,ABC,1.5028,m,2c_16 +LINE804,797,805,ABC,0.10577,m,2c_16 +LINE805,798,806,ABC,0.12311,m,4c_.06 +LINE806,799,807,ABC,0.24947,m,2c_16 +LINE807,800,808,ABC,2.8191,m,2c_16 +LINE808,801,809,ABC,0.20609,m,2c_16 +LINE809,802,810,ABC,3.0749,m,4c_.06 +LINE810,802,811,ABC,3.0749,m,4c_.06 +LINE811,803,812,ABC,0.08544,m,2c_16 +LINE812,804,813,ABC,3.3195,m,2c_16 +LINE813,805,814,ABC,0.16824,m,2c_16 +LINE814,806,815,ABC,0.42086,m,4c_.06 +LINE815,807,816,ABC,0.194,m,2c_16 +LINE816,808,817,ABC,1.5955,m,2c_16 +LINE817,809,818,ABC,0.20649,m,2c_16 +LINE818,810,819,ABC,2.5782,m,4c_.06 +LINE819,810,820,ABC,2.5782,m,4c_.06 +LINE820,812,821,ABC,0.13123,m,2c_16 +LINE821,814,822,ABC,0.15794,m,2c_16 +LINE822,815,823,ABC,0.48651,m,4c_.06 +LINE823,816,824,ABC,0.19731,m,2c_16 +LINE824,818,825,ABC,0.20524,m,2c_16 +LINE825,819,826,ABC,2.7715,m,4c_.06 +LINE826,819,827,ABC,2.7715,m,4c_.06 +LINE827,821,828,ABC,1.0794,m,2c_16 +LINE828,822,829,ABC,0.22567,m,2c_16 +LINE829,823,830,ABC,0.49659,m,4c_.06 +LINE830,824,831,ABC,0.17123,m,2c_16 +LINE831,825,832,ABC,0.20602,m,2c_16 +LINE832,826,833,ABC,2.2755,m,4c_.06 +LINE833,826,834,ABC,2.2755,m,4c_.06 +LINE834,828,835,ABC,3.7201,m,2c_16 +LINE835,829,836,ABC,2.3821,m,2c_16 +LINE836,831,837,ABC,0.12298,m,2c_16 +LINE837,832,838,ABC,0.20588,m,2c_16 +LINE838,833,839,ABC,2.443,m,4c_.06 +LINE839,833,840,ABC,2.443,m,4c_.06 +LINE840,836,841,ABC,0.95278,m,2c_16 +LINE841,837,842,ABC,0.14278,m,2c_16 +LINE842,838,843,ABC,0.20601,m,2c_16 +LINE843,839,844,ABC,4.8092,m,2c_.0225 +LINE844,839,845,ABC,3.6212,m,4c_.06 +LINE845,839,846,ABC,3.6212,m,4c_.06 +LINE846,841,847,ABC,0.48382,m,2c_16 +LINE847,842,848,ABC,0.2151,m,2c_16 +LINE848,843,849,ABC,0.10056,m,2c_16 +LINE849,844,850,ABC,0.7036,m,2c_.0225 +LINE850,845,851,ABC,4.364,m,4c_.06 +LINE851,845,852,ABC,4.364,m,4c_.06 +LINE852,847,853,ABC,0.10706,m,2c_16 +LINE853,848,854,ABC,0.35143,m,2c_16 +LINE854,849,855,ABC,2.2601,m,2c_16 +LINE855,850,856,ABC,1.9822,m,2c_.0225 +LINE856,851,857,ABC,6.8621,m,4c_.06 +LINE857,851,858,ABC,6.8621,m,4c_.06 +LINE858,853,859,ABC,0.084315,m,2c_16 +LINE859,854,860,ABC,2.82,m,2c_16 +LINE860,854,861,ABC,7.5091,m,2c_16 +LINE861,855,862,ABC,1.4697,m,2c_16 +LINE862,856,863,ABC,2.3276,m,2c_.0225 +LINE863,857,864,ABC,2.7888,m,4c_.06 +LINE864,857,865,ABC,2.7888,m,4c_.06 +LINE865,859,866,ABC,0.090338,m,2c_16 +LINE866,862,867,ABC,1.2854,m,2c_16 +LINE867,863,868,ABC,0.30194,m,2c_.0225 +LINE868,864,869,ABC,1.7373,m,4c_.06 +LINE869,864,870,ABC,1.7373,m,4c_.06 +LINE870,866,871,ABC,0.072277,m,2c_16 +LINE871,867,872,ABC,1.3483,m,2c_16 +LINE872,868,873,ABC,0.37952,m,2c_.0225 +LINE873,868,874,ABC,0.84439,m,2c_.0225 +LINE874,869,875,ABC,1.2,m,4c_.06 +LINE875,869,876,ABC,1.2,m,4c_.06 +LINE876,871,877,ABC,0.070178,m,2c_16 +LINE877,872,878,ABC,2.3022,m,2c_16 +LINE878,873,879,ABC,0.35118,m,2c_.0225 +LINE879,874,880,ABC,1.9761,m,2c_.0225 +LINE880,875,881,ABC,1.0112,m,4c_.06 +LINE881,875,882,ABC,1.0112,m,4c_.06 +LINE882,877,883,ABC,0.07,m,2c_16 +LINE883,878,884,ABC,0.56468,m,2c_16 +LINE884,879,885,ABC,0.534,m,2c_.0225 +LINE885,880,886,ABC,4.6879,m,2c_.0225 +LINE886,883,887,ABC,0.069181,m,2c_16 +LINE887,884,888,ABC,0.62293,m,2c_16 +LINE888,884,889,ABC,3.1574,m,35_SAC_XSC +LINE889,885,890,ABC,0.67483,m,2c_.0225 +LINE890,887,891,ABC,1.2371,m,2c_16 +LINE891,888,892,ABC,1.0228,m,2c_16 +LINE892,889,893,ABC,2.6779,m,35_SAC_XSC +LINE893,890,894,ABC,2.6271,m,2c_.0225 +LINE894,891,895,ABC,5.8249,m,2c_16 +LINE895,891,896,ABC,3.2587,m,2c_16 +LINE896,892,897,ABC,0.20223,m,2c_16 +LINE897,893,898,ABC,4.501,m,35_SAC_XSC +LINE898,894,899,ABC,4.7723,m,2c_.0225 +LINE899,895,900,ABC,3.8684,m,2c_16 +LINE900,897,901,ABC,0.17088,m,2c_16 +LINE901,901,902,ABC,0.144,m,2c_16 +LINE902,902,903,ABC,0.18732,m,2c_16 +LINE903,903,904,ABC,0.33902,m,2c_16 +LINE904,904,905,ABC,0.5878,m,2c_16 +LINE905,905,906,ABC,4.8147,m,2c_16 diff --git a/src/test/resources/lvFeeder/LoadShapes.csv b/src/test/resources/lvFeeder/LoadShapes.csv new file mode 100644 index 0000000000..a0841dec34 --- /dev/null +++ b/src/test/resources/lvFeeder/LoadShapes.csv @@ -0,0 +1,57 @@ +# Load Shapes,,,, +Name,npts,minterval,File,useactual +Shape_1,1440,1,Load_profile_1.csv,TRUE +Shape_2,1440,1,Load_profile_2.csv,TRUE +Shape_3,1440,1,Load_profile_3.csv,TRUE +Shape_4,1440,1,Load_profile_4.csv,TRUE +Shape_5,1440,1,Load_profile_5.csv,TRUE +Shape_6,1440,1,Load_profile_6.csv,TRUE +Shape_7,1440,1,Load_profile_7.csv,TRUE +Shape_8,1440,1,Load_profile_8.csv,TRUE +Shape_9,1440,1,Load_profile_9.csv,TRUE +Shape_10,1440,1,Load_profile_10.csv,TRUE +Shape_11,1440,1,Load_profile_11.csv,TRUE +Shape_12,1440,1,Load_profile_12.csv,TRUE +Shape_13,1440,1,Load_profile_13.csv,TRUE +Shape_14,1440,1,Load_profile_14.csv,TRUE +Shape_15,1440,1,Load_profile_15.csv,TRUE +Shape_16,1440,1,Load_profile_16.csv,TRUE +Shape_17,1440,1,Load_profile_17.csv,TRUE +Shape_18,1440,1,Load_profile_18.csv,TRUE +Shape_19,1440,1,Load_profile_19.csv,TRUE +Shape_20,1440,1,Load_profile_20.csv,TRUE +Shape_21,1440,1,Load_profile_21.csv,TRUE +Shape_22,1440,1,Load_profile_22.csv,TRUE +Shape_23,1440,1,Load_profile_23.csv,TRUE +Shape_24,1440,1,Load_profile_24.csv,TRUE +Shape_25,1440,1,Load_profile_25.csv,TRUE +Shape_26,1440,1,Load_profile_26.csv,TRUE +Shape_27,1440,1,Load_profile_27.csv,TRUE +Shape_28,1440,1,Load_profile_28.csv,TRUE +Shape_29,1440,1,Load_profile_29.csv,TRUE +Shape_30,1440,1,Load_profile_30.csv,TRUE +Shape_31,1440,1,Load_profile_31.csv,TRUE +Shape_32,1440,1,Load_profile_32.csv,TRUE +Shape_33,1440,1,Load_profile_33.csv,TRUE +Shape_34,1440,1,Load_profile_34.csv,TRUE +Shape_35,1440,1,Load_profile_35.csv,TRUE +Shape_36,1440,1,Load_profile_36.csv,TRUE +Shape_37,1440,1,Load_profile_37.csv,TRUE +Shape_38,1440,1,Load_profile_38.csv,TRUE +Shape_39,1440,1,Load_profile_39.csv,TRUE +Shape_40,1440,1,Load_profile_40.csv,TRUE +Shape_41,1440,1,Load_profile_41.csv,TRUE +Shape_42,1440,1,Load_profile_42.csv,TRUE +Shape_43,1440,1,Load_profile_43.csv,TRUE +Shape_44,1440,1,Load_profile_44.csv,TRUE +Shape_45,1440,1,Load_profile_45.csv,TRUE +Shape_46,1440,1,Load_profile_46.csv,TRUE +Shape_47,1440,1,Load_profile_47.csv,TRUE +Shape_48,1440,1,Load_profile_48.csv,TRUE +Shape_49,1440,1,Load_profile_49.csv,TRUE +Shape_50,1440,1,Load_profile_50.csv,TRUE +Shape_51,1440,1,Load_profile_51.csv,TRUE +Shape_52,1440,1,Load_profile_52.csv,TRUE +Shape_53,1440,1,Load_profile_53.csv,TRUE +Shape_54,1440,1,Load_profile_54.csv,TRUE +Shape_55,1440,1,Load_profile_55.csv,TRUE diff --git a/src/test/resources/lvFeeder/Loads.csv b/src/test/resources/lvFeeder/Loads.csv new file mode 100644 index 0000000000..256565141f --- /dev/null +++ b/src/test/resources/lvFeeder/Loads.csv @@ -0,0 +1,58 @@ +# Loads ,,,,,,,,, +# Model 1 is constant PQ,,,,,,,,, +Name,numPhases,Bus,phases,kV,Model,Connection,kW,PF,Yearly +LOAD1,1,34,A,0.23,1,wye,1,0.95,Shape_1 +LOAD2,1,47,B,0.23,1,wye,1,0.95,Shape_2 +LOAD3,1,70,A,0.23,1,wye,1,0.95,Shape_3 +LOAD4,1,73,A,0.23,1,wye,1,0.95,Shape_4 +LOAD5,1,74,A,0.23,1,wye,1,0.95,Shape_5 +LOAD6,1,83,B,0.23,1,wye,1,0.95,Shape_6 +LOAD7,1,178,B,0.23,1,wye,1,0.95,Shape_7 +LOAD8,1,208,C,0.23,1,wye,1,0.95,Shape_8 +LOAD9,1,225,A,0.23,1,wye,1,0.95,Shape_9 +LOAD10,1,248,B,0.23,1,wye,1,0.95,Shape_10 +LOAD11,1,249,B,0.23,1,wye,1,0.95,Shape_11 +LOAD12,1,264,C,0.23,1,wye,1,0.95,Shape_12 +LOAD13,1,276,B,0.23,1,wye,1,0.95,Shape_13 +LOAD14,1,289,A,0.23,1,wye,1,0.95,Shape_14 +LOAD15,1,314,B,0.23,1,wye,1,0.95,Shape_15 +LOAD16,1,320,C,0.23,1,wye,1,0.95,Shape_16 +LOAD17,1,327,C,0.23,1,wye,1,0.95,Shape_17 +LOAD18,1,337,C,0.23,1,wye,1,0.95,Shape_18 +LOAD19,1,342,C,0.23,1,wye,1,0.95,Shape_19 +LOAD20,1,349,A,0.23,1,wye,1,0.95,Shape_20 +LOAD21,1,387,A,0.23,1,wye,1,0.95,Shape_21 +LOAD22,1,388,A,0.23,1,wye,1,0.95,Shape_22 +LOAD23,1,406,B,0.23,1,wye,1,0.95,Shape_23 +LOAD24,1,458,C,0.23,1,wye,1,0.95,Shape_24 +LOAD25,1,502,A,0.23,1,wye,1,0.95,Shape_25 +LOAD26,1,522,B,0.23,1,wye,1,0.95,Shape_26 +LOAD27,1,539,C,0.23,1,wye,1,0.95,Shape_27 +LOAD28,1,556,C,0.23,1,wye,1,0.95,Shape_28 +LOAD29,1,562,A,0.23,1,wye,1,0.95,Shape_29 +LOAD30,1,563,A,0.23,1,wye,1,0.95,Shape_30 +LOAD31,1,611,A,0.23,1,wye,1,0.95,Shape_31 +LOAD32,1,614,C,0.23,1,wye,1,0.95,Shape_32 +LOAD33,1,619,C,0.23,1,wye,1,0.95,Shape_33 +LOAD34,1,629,A,0.23,1,wye,1,0.95,Shape_34 +LOAD35,1,639,B,0.23,1,wye,1,0.95,Shape_35 +LOAD36,1,676,B,0.23,1,wye,1,0.95,Shape_36 +LOAD37,1,682,B,0.23,1,wye,1,0.95,Shape_37 +LOAD38,1,688,B,0.23,1,wye,1,0.95,Shape_38 +LOAD39,1,701,C,0.23,1,wye,1,0.95,Shape_39 +LOAD40,1,702,B,0.23,1,wye,1,0.95,Shape_40 +LOAD41,1,755,B,0.23,1,wye,1,0.95,Shape_41 +LOAD42,1,778,C,0.23,1,wye,1,0.95,Shape_42 +LOAD43,1,780,C,0.23,1,wye,1,0.95,Shape_43 +LOAD44,1,785,B,0.23,1,wye,1,0.95,Shape_44 +LOAD45,1,813,B,0.23,1,wye,1,0.95,Shape_45 +LOAD46,1,817,A,0.23,1,wye,1,0.95,Shape_46 +LOAD47,1,835,C,0.23,1,wye,1,0.95,Shape_47 +LOAD48,1,860,A,0.23,1,wye,1,0.95,Shape_48 +LOAD49,1,861,A,0.23,1,wye,1,0.95,Shape_49 +LOAD50,1,886,B,0.23,1,wye,1,0.95,Shape_50 +LOAD51,1,896,A,0.23,1,wye,1,0.95,Shape_51 +LOAD52,1,898,A,0.23,1,wye,1,0.95,Shape_52 +LOAD53,1,899,B,0.23,1,wye,1,0.95,Shape_53 +LOAD54,1,900,A,0.23,1,wye,1,0.95,Shape_54 +LOAD55,1,906,A,0.23,1,wye,1,0.95,Shape_55 diff --git a/src/test/resources/lvFeeder/Source.csv b/src/test/resources/lvFeeder/Source.csv new file mode 100644 index 0000000000..ca83982600 --- /dev/null +++ b/src/test/resources/lvFeeder/Source.csv @@ -0,0 +1,6 @@ +# Source impedance +[Source] +Voltage=11 kV +pu=1.05 +ISC3=3000 A +ISC1=5 A diff --git a/src/test/resources/lvFeeder/Transformer.csv b/src/test/resources/lvFeeder/Transformer.csv new file mode 100644 index 0000000000..2e34814d1a --- /dev/null +++ b/src/test/resources/lvFeeder/Transformer.csv @@ -0,0 +1,3 @@ +# Substation transformer connected Delta/grounded-wye,,,,,,,,,, +Name, phases, bus1, bus2, kV_pri, kV_sec, MVA, Conn_pri, Conn_sec, %XHL,% resistance +TR1,3,SourceBus,1,11,0.416,0.8, Delta, Wye,4,0.4 From 34dd427b1f7771022ca6c6a860b3142acfc29a07 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 21:17:12 +0200 Subject: [PATCH 002/153] corrections on delta transformers Signed-off-by: JB-H --- ...bstractClosedBranchAcFlowEquationTerm.java | 47 +++++++++-- .../ClosedBranchTfoZeroIflowEquationTerm.java | 17 +++- .../AsymmetricalAcEquationSystemCreator.java | 62 ++++++++------- .../openloadflow/network/LfAsymLine.java | 2 +- .../openloadflow/ac/Asym4DeltaTest.java | 79 +++++++++++++++++++ .../openloadflow/ac/Asym4nodesFeederTest.java | 68 +++++++++------- 6 files changed, 202 insertions(+), 73 deletions(-) create mode 100644 src/test/java/com/powsybl/openloadflow/ac/Asym4DeltaTest.java diff --git a/src/main/java/com/powsybl/openloadflow/ac/equations/AbstractClosedBranchAcFlowEquationTerm.java b/src/main/java/com/powsybl/openloadflow/ac/equations/AbstractClosedBranchAcFlowEquationTerm.java index f908941789..26f872a5c3 100644 --- a/src/main/java/com/powsybl/openloadflow/ac/equations/AbstractClosedBranchAcFlowEquationTerm.java +++ b/src/main/java/com/powsybl/openloadflow/ac/equations/AbstractClosedBranchAcFlowEquationTerm.java @@ -11,6 +11,7 @@ import com.powsybl.openloadflow.equations.VariableSet; import com.powsybl.openloadflow.network.LfBranch; import com.powsybl.openloadflow.network.LfBus; +import com.powsybl.openloadflow.network.extensions.AsymBusVariableType; import com.powsybl.openloadflow.util.Fortescue; import net.jafama.FastMath; @@ -80,16 +81,34 @@ protected AbstractClosedBranchAcFlowEquationTerm(LfBranch branch, LfBus bus1, Lf Objects.requireNonNull(variableSet); AcVariableType vType = getVoltageMagnitudeType(sequenceType); AcVariableType angleType = getVoltageAngleType(sequenceType); - v1Var = variableSet.getVariable(bus1.getNum(), vType); - v2Var = variableSet.getVariable(bus2.getNum(), vType); - ph1Var = variableSet.getVariable(bus1.getNum(), angleType); - ph2Var = variableSet.getVariable(bus2.getNum(), angleType); + + // if one side is DELTA, asym zero variables shouldn't be called here + if (sequenceType == Fortescue.SequenceType.POSITIVE) { + v1Var = variableSet.getVariable(bus1.getNum(), vType); + ph1Var = variableSet.getVariable(bus1.getNum(), angleType); + v2Var = variableSet.getVariable(bus2.getNum(), vType); + ph2Var = variableSet.getVariable(bus2.getNum(), angleType); + } else { + v1Var = (bus1.getAsym().getAsymBusVariableType() == AsymBusVariableType.WYE || sequenceType != Fortescue.SequenceType.ZERO) ? variableSet.getVariable(bus1.getNum(), vType) : null; + ph1Var = (bus1.getAsym().getAsymBusVariableType() == AsymBusVariableType.WYE || sequenceType != Fortescue.SequenceType.ZERO) ? variableSet.getVariable(bus1.getNum(), angleType) : null; + v2Var = (bus2.getAsym().getAsymBusVariableType() == AsymBusVariableType.WYE || sequenceType != Fortescue.SequenceType.ZERO) ? variableSet.getVariable(bus2.getNum(), vType) : null; + ph2Var = (bus2.getAsym().getAsymBusVariableType() == AsymBusVariableType.WYE || sequenceType != Fortescue.SequenceType.ZERO) ? variableSet.getVariable(bus2.getNum(), angleType) : null; + } + a1Var = deriveA1 ? variableSet.getVariable(branch.getNum(), AcVariableType.BRANCH_ALPHA1) : null; r1Var = deriveR1 ? variableSet.getVariable(branch.getNum(), AcVariableType.BRANCH_RHO1) : null; - variables.add(v1Var); - variables.add(v2Var); - variables.add(ph1Var); - variables.add(ph2Var); + if (v1Var != null) { + variables.add(v1Var); + } + if (v2Var != null) { + variables.add(v2Var); + } + if (ph1Var != null) { + variables.add(ph1Var); + } + if (ph2Var != null) { + variables.add(ph2Var); + } if (a1Var != null) { variables.add(a1Var); } @@ -103,18 +122,30 @@ public Variable getA1Var() { } protected double v1() { + if (v1Var == null) { + return 0.; + } return sv.get(v1Var.getRow()); } protected double v2() { + if (v2Var == null) { + return 0.; + } return sv.get(v2Var.getRow()); } protected double ph1() { + if (ph1Var == null) { + return 0.; + } return sv.get(ph1Var.getRow()); } protected double ph2() { + if (ph2Var == null) { + return 0.; + } return sv.get(ph2Var.getRow()); } diff --git a/src/main/java/com/powsybl/openloadflow/ac/equations/ClosedBranchTfoZeroIflowEquationTerm.java b/src/main/java/com/powsybl/openloadflow/ac/equations/ClosedBranchTfoZeroIflowEquationTerm.java index d3f7fa2df4..738da549f1 100644 --- a/src/main/java/com/powsybl/openloadflow/ac/equations/ClosedBranchTfoZeroIflowEquationTerm.java +++ b/src/main/java/com/powsybl/openloadflow/ac/equations/ClosedBranchTfoZeroIflowEquationTerm.java @@ -29,7 +29,7 @@ public class ClosedBranchTfoZeroIflowEquationTerm extends AbstractClosedBranchAc public ClosedBranchTfoZeroIflowEquationTerm(LfBranch branch, LfBus bus1, LfBus bus2, VariableSet variableSet, boolean deriveA1, boolean deriveR1, ClosedBranchTfoNegativeIflowEquationTerm.FlowType flowType) { - super(branch, bus1, bus2, variableSet, deriveA1, deriveR1, Fortescue.SequenceType.NEGATIVE); + super(branch, bus1, bus2, variableSet, deriveA1, deriveR1, Fortescue.SequenceType.ZERO); this.flowType = flowType; @@ -113,14 +113,23 @@ public static DenseMatrix getAdmittanceMatrix(Complex z0T1, Complex z0T2, Comple return getYgYgForcedFluxesAdmittanceMatrix(z0T1, z0T2, y0m, zG1, zG2, r1); } } else { - Complex y11; + Complex y11 = new Complex(0., 0.); Complex y22 = new Complex(0., 0.); Complex y12 = y22; - if (leg1Type == LegConnectionType.Y_GROUNDED && leg2Type == LegConnectionType.DELTA) { + if (leg1Type == LegConnectionType.DELTA && leg2Type == LegConnectionType.Y_GROUNDED) { + Complex tmp1 = z0T2.add(y0m.add(z0T1.reciprocal()).reciprocal()); + y22 = (zG2.multiply(3).add(tmp1)).reciprocal(); + } else if (leg1Type == LegConnectionType.Y_GROUNDED && leg2Type == LegConnectionType.DELTA) { Complex tmp2 = z0T1.add(y0m.add(z0T2.reciprocal()).reciprocal()).multiply(1 / (r1 * r1)); y11 = (zG1.multiply(3).add(tmp2)).reciprocal(); + } else if (leg1Type == LegConnectionType.Y && leg2Type == LegConnectionType.Y_GROUNDED && !isFreeFluxes) { + Complex tmp3 = z0T2.add(y0m.reciprocal()); + y22 = (zG2.multiply(3).add(tmp3)).reciprocal(); + } else if (leg1Type == LegConnectionType.Y_GROUNDED && leg2Type == LegConnectionType.Y && !isFreeFluxes) { + Complex tmp4 = z0T1.add(y0m.reciprocal()).multiply(1 / (r1 * r1)); + y11 = (zG1.multiply(3).add(tmp4)).reciprocal(); } else { - throw new IllegalArgumentException("Transfomer with winding config Yg or Y or DELTA not supported in current version of the asymmetric load flow"); + throw new IllegalArgumentException("Transfomer configuration not supported"); } // if windings are in another configuration we consider it is a zero admittance matrix return getMatrixFromBloc44(y11, y22, y12); diff --git a/src/main/java/com/powsybl/openloadflow/ac/equations/asym/AsymmetricalAcEquationSystemCreator.java b/src/main/java/com/powsybl/openloadflow/ac/equations/asym/AsymmetricalAcEquationSystemCreator.java index a9d7b2494f..9256ec961d 100644 --- a/src/main/java/com/powsybl/openloadflow/ac/equations/asym/AsymmetricalAcEquationSystemCreator.java +++ b/src/main/java/com/powsybl/openloadflow/ac/equations/asym/AsymmetricalAcEquationSystemCreator.java @@ -152,10 +152,22 @@ protected void createImpedantBranch(LfBranch branch, LfBus bus1, LfBus bus2, Equ } // no assymmetry is detected with this line, we handle the equations as Fortescue and decoupled - p1 = new ClosedBranchSide1ActiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); - q1 = new ClosedBranchSide1ReactiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); - p2 = new ClosedBranchSide2ActiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); - q2 = new ClosedBranchSide2ReactiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + if (asymBus1.isPositiveSequenceAsCurrent()) { + p1 = new ClosedBranchI1xFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + q1 = new ClosedBranchI1yFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + } else { + p1 = new ClosedBranchSide1ActiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + q1 = new ClosedBranchSide1ReactiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + } + + if (asymBus2.isPositiveSequenceAsCurrent()) { + p2 = new ClosedBranchI2xFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + q2 = new ClosedBranchI2yFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + } else { + p2 = new ClosedBranchSide2ActiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + q2 = new ClosedBranchSide2ReactiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + } + i1 = new ClosedBranchSide1CurrentMagnitudeEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1); i2 = new ClosedBranchSide2CurrentMagnitudeEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1); @@ -199,20 +211,16 @@ protected void createImpedantBranch(LfBranch branch, LfBus bus1, LfBus bus2, Equ } else { // assymmetry is detected with this line, we handle the equations as coupled between the different sequences // positive + if (asymBus1.isPositiveSequenceAsCurrent()) { + // in this case we try to model the positive sequence as current balances + p1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.ONE, SequenceType.POSITIVE); + q1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.ONE, SequenceType.POSITIVE); + } else { + p1 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.ONE, SequenceType.POSITIVE); + q1 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.ONE, SequenceType.POSITIVE); + } - // test: if we are WYE variables and there is a phase missing, the positive sequence is modeled with currents if (isBus1Wye) { - - if (asymBus1.isPositiveSequenceAsCurrent()) { - // in this case we try to model the positive sequence as current balances - p1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.ONE, SequenceType.POSITIVE); - q1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.ONE, SequenceType.POSITIVE); - } else { - p1 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.ONE, SequenceType.POSITIVE); - q1 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.ONE, SequenceType.POSITIVE); - } - - // test if (nbPhases1 == 3) { ixn1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.ONE, SequenceType.NEGATIVE); iyn1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.ONE, SequenceType.NEGATIVE); @@ -223,22 +231,19 @@ protected void createImpedantBranch(LfBranch branch, LfBus bus1, LfBus bus2, Equ } } else { - p1 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.ONE, SequenceType.POSITIVE); - q1 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.ONE, SequenceType.POSITIVE); - ixn1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.ONE, SequenceType.NEGATIVE); iyn1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.ONE, SequenceType.NEGATIVE); } - if (isBus2Wye) { + if (asymBus2.isPositiveSequenceAsCurrent()) { + p2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.TWO, SequenceType.POSITIVE); + q2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.TWO, SequenceType.POSITIVE); + } else { + p2 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.TWO, SequenceType.POSITIVE); + q2 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.TWO, SequenceType.POSITIVE); + } - if (asymBus2.isPositiveSequenceAsCurrent()) { - p2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.TWO, SequenceType.POSITIVE); - q2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.TWO, SequenceType.POSITIVE); - } else { - p2 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.TWO, SequenceType.POSITIVE); - q2 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.TWO, SequenceType.POSITIVE); - } + if (isBus2Wye) { if (nbPhases2 == 3) { ixn2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.TWO, SequenceType.NEGATIVE); @@ -249,9 +254,6 @@ protected void createImpedantBranch(LfBranch branch, LfBus bus1, LfBus bus2, Equ iyz2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.TWO, SequenceType.ZERO); } } else { - p2 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.TWO, SequenceType.POSITIVE); - q2 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.TWO, SequenceType.POSITIVE); - ixn2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.TWO, SequenceType.NEGATIVE); iyn2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.TWO, SequenceType.NEGATIVE); } diff --git a/src/main/java/com/powsybl/openloadflow/network/LfAsymLine.java b/src/main/java/com/powsybl/openloadflow/network/LfAsymLine.java index 210b431834..9c3abd6328 100644 --- a/src/main/java/com/powsybl/openloadflow/network/LfAsymLine.java +++ b/src/main/java/com/powsybl/openloadflow/network/LfAsymLine.java @@ -85,9 +85,9 @@ public LfAsymLine(ComplexMatrix yabc, boolean phaseOpenA, boolean phaseOpenB, bo this.hasPhaseC2 = hasPhaseC2; this.isSide1FortescueRepresentation = isSide1FortescueRepresentation; this.isSide2FortescueRepresentation = isSide2FortescueRepresentation; - admittanceMatrix = new LfAsymLineAdmittanceMatrix(this); this.side1VariableType = side1VariableType; this.side2VariableType = side2VariableType; + admittanceMatrix = new LfAsymLineAdmittanceMatrix(this); } public LfAsymLineAdmittanceMatrix getAdmittanceMatrix() { diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym4DeltaTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym4DeltaTest.java new file mode 100644 index 0000000000..a1e860d3a4 --- /dev/null +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym4DeltaTest.java @@ -0,0 +1,79 @@ +package com.powsybl.openloadflow.ac; + +import com.powsybl.iidm.network.Bus; +import com.powsybl.iidm.network.Network; +import com.powsybl.iidm.network.extensions.WindingConnectionType; +import com.powsybl.loadflow.LoadFlow; +import com.powsybl.loadflow.LoadFlowParameters; +import com.powsybl.loadflow.LoadFlowResult; +import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.openloadflow.OpenLoadFlowParameters; +import com.powsybl.openloadflow.OpenLoadFlowProvider; +import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.extensions.iidm.StepWindingConnectionType; +import org.apache.commons.math3.complex.Complex; +import org.junit.jupiter.api.Test; + +import static com.powsybl.openloadflow.util.LoadFlowAssert.assertAngleEquals; +import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class Asym4DeltaTest { + + private Network network; + private Bus bus1; + private Bus bus2; + private Bus bus3; + private Bus bus4; + + private LoadFlow.Runner loadFlowRunner; + private LoadFlowParameters parameters; + + @Test + void deltaY() { + + Complex zz = new Complex(0.1, 0.01); // 0.0001 , 0.001 + Complex zn = new Complex(0.1, 0.01); // 0.001 , 0.01 + Boolean isLoadBalanced = true; + WindingConnectionType w1 = WindingConnectionType.DELTA; + WindingConnectionType w2 = WindingConnectionType.Y_GROUNDED; + int numDisconnectedPhase = 0; + StepWindingConnectionType stepWindingConnectionType = StepWindingConnectionType.STEP_DOWN; + + network = Asym4nodesFeederTest.ieee4Feeder(zz, zn, isLoadBalanced, WindingConnectionType.Y_GROUNDED, w1, w2); + + bus1 = network.getBusBreakerView().getBus("B1"); + bus2 = network.getBusBreakerView().getBus("B2"); + bus3 = network.getBusBreakerView().getBus("B3"); + bus4 = network.getBusBreakerView().getBus("B4"); + + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) + .setDistributedSlack(false); + OpenLoadFlowParameters.create(parameters) + .setMaxNewtonRaphsonIterations(100) + .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) + .setAsymmetrical(true); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + + assertVoltageEquals(12.47, bus1); + assertAngleEquals(0., bus1); + assertVoltageEquals(12.433526294098483, bus2); + assertVoltageEquals(2.2804714045919776, bus3); + assertVoltageEquals(2.0355904463879693, bus4); + + // addition of an extension to have a 3 phase transformer and new load flow: + Asym4nodesFeederTest.addTfo3PhaseExtension(network, w2, stepWindingConnectionType, numDisconnectedPhase); + result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + + assertVoltageEquals(12.47, bus1); + assertAngleEquals(0., bus1); + assertVoltageEquals(12.401647497875299, bus2); + assertVoltageEquals(2.274193122764982, bus3); + assertVoltageEquals(2.0302309634844096, bus4); + } + +} diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym4nodesFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym4nodesFeederTest.java index cb4bff438d..e51f2ce87a 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym4nodesFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym4nodesFeederTest.java @@ -47,8 +47,8 @@ public class Asym4nodesFeederTest { @Test void ygYgUnbalancedTest() { - Complex zz = new Complex(0.1, 0.01); // 0.0001 , 0.001 - Complex zn = new Complex(0.1, 0.01); // 0.001 , 0.01 + Complex zz = new Complex(0.0001, 0.0001); // 0.0001 , 0.001 + Complex zn = new Complex(0.0001, 0.0001); // 0.001 , 0.01 Boolean isLoadBalanced = false; WindingConnectionType w1 = WindingConnectionType.Y_GROUNDED; WindingConnectionType w2 = WindingConnectionType.Y_GROUNDED; @@ -66,6 +66,7 @@ void ygYgUnbalancedTest() { parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); OpenLoadFlowParameters.create(parameters) + .setMaxNewtonRaphsonIterations(100) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setAsymmetrical(true); @@ -74,12 +75,12 @@ void ygYgUnbalancedTest() { assertVoltageEquals(7.199557856794634, bus1); assertAngleEquals(0., bus1); - assertVoltageEquals(7.133584938970962, bus2); - assertVoltageEquals(2.3420558121701402, bus3); - assertVoltageEquals(2.0966856983831206, bus4); + assertVoltageEquals(7.121540042954291, bus2); + assertVoltageEquals(2.2440043558129816, bus3); + assertVoltageEquals(1.9562695924418882, bus4); // addition of an extension to have a 3 phase transformer and new load flow: - addTfo3PhaseExtension(w2, stepWindingConnectionType, numDisconnectedPhase); + addTfo3PhaseExtension(network, w2, stepWindingConnectionType, numDisconnectedPhase); result = loadFlowRunner.run(network, parameters); assertTrue(result.isOk()); @@ -93,8 +94,8 @@ void ygYgUnbalancedTest() { @Test void ygYgTest() { - Complex zz = new Complex(0.1, 0.01); // 0.0001 , 0.001 - Complex zn = new Complex(0.1, 0.01); // 0.001 , 0.01 + Complex zz = new Complex(0.00001, 0.00001); // 0.0001 , 0.001 + Complex zn = new Complex(0.00001, 0.00001); // 0.001 , 0.01 Boolean isLoadBalanced = true; WindingConnectionType w1 = WindingConnectionType.Y_GROUNDED; WindingConnectionType w2 = WindingConnectionType.Y_GROUNDED; @@ -112,6 +113,7 @@ void ygYgTest() { parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); OpenLoadFlowParameters.create(parameters) + .setMaxNewtonRaphsonIterations(100) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setAsymmetrical(true); @@ -121,11 +123,11 @@ void ygYgTest() { assertVoltageEquals(7.199557856794634, bus1); assertAngleEquals(0., bus1); assertVoltageEquals(7.132278619390253, bus2); - assertVoltageEquals(2.344230653528591, bus3); - assertVoltageEquals(2.107863958213946, bus4); + assertVoltageEquals(2.2643149471277386, bus3); + assertVoltageEquals(2.017173369480019, bus4); // addition of an extension to have a 3 phase transformer and new load flow: - addTfo3PhaseExtension(w2, stepWindingConnectionType, numDisconnectedPhase); + addTfo3PhaseExtension(network, w2, stepWindingConnectionType, numDisconnectedPhase); result = loadFlowRunner.run(network, parameters); assertTrue(result.isOk()); @@ -175,12 +177,12 @@ void ygDeltaTest() { assertVoltageEquals(7.199557856794634, bus1); assertAngleEquals(0., bus1); - assertVoltageEquals(7.015678041873337, bus2); - assertVoltageEquals(3.842798277594563, bus3); - assertVoltageEquals(3.4440931482904062, bus4); + assertVoltageEquals(6.966398471893453, bus2); + assertVoltageEquals(3.222022038533233, bus3); + assertVoltageEquals(2.716189992104315, bus4); // addition of an extension to have a 3 phase transformer and new load flow: - addTfo3PhaseExtension(w2, stepWindingConnectionType, numDisconnectedPhase); + addTfo3PhaseExtension(network, w2, stepWindingConnectionType, numDisconnectedPhase); result = loadFlowRunner.run(network, parameters); assertTrue(result.isOk()); @@ -229,12 +231,12 @@ void deltaDeltaTest() { assertVoltageEquals(12.47, bus1); assertAngleEquals(0., bus1); - assertVoltageEquals(12.363327843118185, bus2); - assertVoltageEquals(3.919374745381408, bus3); - assertVoltageEquals(3.5306643903086035, bus4); + assertVoltageEquals(12.343319573062105, bus2); + assertVoltageEquals(3.3615589948468156, bus3); + assertVoltageEquals(2.885485615952693, bus4); // addition of an extension to have a 3 phase transformer and new load flow: - addTfo3PhaseExtension(w2, stepWindingConnectionType, numDisconnectedPhase); + addTfo3PhaseExtension(network, w2, stepWindingConnectionType, numDisconnectedPhase); result = loadFlowRunner.run(network, parameters); assertTrue(result.isOk()); @@ -283,12 +285,12 @@ void ygDeltaUnbalancedTest() { assertVoltageEquals(7.199557856794634, bus1); assertAngleEquals(0., bus1); - assertVoltageEquals(7.0078109349944375, bus2); - assertVoltageEquals(3.8315940839604075, bus3); - assertVoltageEquals(3.413967683262305, bus4); + assertVoltageEquals(6.937021164658664, bus2); + assertVoltageEquals(3.1166742441520894, bus3); + assertVoltageEquals(2.547669019028284, bus4); // addition of an extension to have a 3 phase transformer and new load flow: - addTfo3PhaseExtension(w2, stepWindingConnectionType, numDisconnectedPhase); + addTfo3PhaseExtension(network, w2, stepWindingConnectionType, numDisconnectedPhase); result = loadFlowRunner.run(network, parameters); assertTrue(result.isOk()); @@ -355,17 +357,15 @@ public static Network ieee4Feeder(Complex zz, Complex zn, boolean isLoadBalanced .setBus(bus1.getId()) .setMinP(-100.0) .setMaxP(200) - .setTargetP(0) + .setTargetP(2) .setTargetV(v1nom) .setVoltageRegulatorOn(true) .add(); gen1.newExtension(GeneratorFortescueAdder.class) .withRz(zz.getReal()) - //.withXz(0.001) .withXz(zz.getImaginary()) .withRn(zn.getReal()) - //.withXn(0.01) .withXn(zn.getImaginary()) .add(); @@ -389,6 +389,7 @@ public static Network ieee4Feeder(Complex zz, Complex zn, boolean isLoadBalanced bus2.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(side1VariableType) + .withPositiveSequenceAsCurrent(true) .add(); // Bus3 @@ -406,6 +407,7 @@ public static Network ieee4Feeder(Complex zz, Complex zn, boolean isLoadBalanced bus3.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(side2VariableType) + .withPositiveSequenceAsCurrent(true) .add(); // Bus4 @@ -427,6 +429,7 @@ public static Network ieee4Feeder(Complex zz, Complex zn, boolean isLoadBalanced bus4.setV(v3nom).setAngle(0.); bus4.newExtension(BusAsymmetricalAdder.class) + .withPositiveSequenceAsCurrent(true) .withBusVariableType(side2VariableType) .add(); @@ -572,9 +575,14 @@ public static Network ieee4Feeder(Complex zz, Complex zn, boolean isLoadBalanced .setB2(0.0) .add(); + // addition of asymmetrical extensions + ComplexMatrix yabc12 = ComplexMatrix.getMatrixScaled(ywyeabc, feetInMile / length1InFeet); + if (side1VariableType == BusVariableType.DELTA) { + yabc12 = ComplexMatrix.getMatrixScaled(yDeltaabc, feetInMile / length1InFeet); + } // addition of asymmetrical extensions line12.newExtension(LineAsymmetricalAdder.class) - .withYabc(ComplexMatrix.getMatrixScaled(ywyeabc, feetInMile / length1InFeet)) + .withYabc(yabc12) .add(); line12.newExtension(LineFortescueAdder.class) @@ -630,8 +638,8 @@ public static Network ieee4Feeder(Complex zz, Complex zn, boolean isLoadBalanced } double zBase = ratedU3 * ratedU3 / sBase; - double rT23 = zBase / 3. / 100; - double xT23 = 6. * zBase / 3. / 100; + double rT23 = zBase / 100; + double xT23 = 6. * zBase / 100; var t23 = substation23.newTwoWindingsTransformer() .setId("T2W_B2_B3") .setVoltageLevel1(vl2.getId()) @@ -662,7 +670,7 @@ public static Network ieee4Feeder(Complex zz, Complex zn, boolean isLoadBalanced return network; } - public void addTfo3PhaseExtension(WindingConnectionType w2, StepWindingConnectionType stepWindingConnectionType, int numDisconnectedPhase) { + public static void addTfo3PhaseExtension(Network network, WindingConnectionType w2, StepWindingConnectionType stepWindingConnectionType, int numDisconnectedPhase) { TwoWindingsTransformer t2w = network.getTwoWindingsTransformer("T2W_B2_B3"); // step up case, we use Vbase of transformer = Vnom From 4d64847512f938d35f32adc189431d8ef5111531 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 003/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From ecabe221fc15a6eccab90d8b8665d6ef28b82f5a Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 004/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../extensions/iidm/BusAsymmetrical.java | 20 + .../network/impl/LfBranchImpl.java | 6 + .../network/util/AsymIeeeFeederParser.java | 643 +++++++++++++ .../network/util/AsymLvFeederParser.java | 352 +++++++ .../openloadflow/ac/Asym13BusFeederTest.java | 2 +- .../openloadflow/ac/Asym34BusFeederTest.java | 12 +- .../util/AsymIeeeFeederParserTest.java | 98 ++ src/test/resources/ieeeFeeder123/Bus.csv | 120 +++ .../ieeeFeeder123/DistributedLoad.csv | 1 + src/test/resources/ieeeFeeder123/Gen.csv | 2 + src/test/resources/ieeeFeeder123/Line.csv | 119 +++ .../resources/ieeeFeeder123/LineConfig.csv | 14 + .../resources/ieeeFeeder123/Regulator.csv | 5 + src/test/resources/ieeeFeeder123/SpotLoad.csv | 86 ++ src/test/resources/ieeeFeeder123/Tfo.csv | 1 + .../resources/ieeeFeeder123/TfoConfig.csv | 1 + src/test/resources/ieeeFeeder13/Bus.csv | 13 + .../ieeeFeeder13/DistributedLoad.csv | 2 + src/test/resources/ieeeFeeder13/Gen.csv | 2 + src/test/resources/ieeeFeeder13/Line.csv | 11 + .../resources/ieeeFeeder13/LineConfig.csv | 8 + src/test/resources/ieeeFeeder13/Regulator.csv | 2 + src/test/resources/ieeeFeeder13/SpotLoad.csv | 10 + src/test/resources/ieeeFeeder13/Tfo.csv | 2 + src/test/resources/ieeeFeeder13/TfoConfig.csv | 3 + src/test/resources/ieeeFeeder34/Bus.csv | 35 + .../ieeeFeeder34/DistributedLoad.csv | 19 + src/test/resources/ieeeFeeder34/Gen.csv | 2 + src/test/resources/ieeeFeeder34/Line.csv | 33 + .../resources/ieeeFeeder34/LineConfig.csv | 6 + src/test/resources/ieeeFeeder34/Regulator.csv | 3 + src/test/resources/ieeeFeeder34/SpotLoad.csv | 7 + src/test/resources/ieeeFeeder34/Tfo.csv | 2 + src/test/resources/ieeeFeeder34/TfoConfig.csv | 3 + src/test/resources/lvFeeder/Buscoords.csv | 908 ++++++++++++++++++ src/test/resources/lvFeeder/LineCodes.csv | 12 + src/test/resources/lvFeeder/Lines.csv | 907 +++++++++++++++++ src/test/resources/lvFeeder/LoadShapes.csv | 57 ++ src/test/resources/lvFeeder/Loads.csv | 58 ++ src/test/resources/lvFeeder/Source.csv | 6 + src/test/resources/lvFeeder/Transformer.csv | 3 + 41 files changed, 3589 insertions(+), 7 deletions(-) create mode 100644 src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java create mode 100644 src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java create mode 100644 src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java create mode 100644 src/test/resources/ieeeFeeder123/Bus.csv create mode 100644 src/test/resources/ieeeFeeder123/DistributedLoad.csv create mode 100644 src/test/resources/ieeeFeeder123/Gen.csv create mode 100644 src/test/resources/ieeeFeeder123/Line.csv create mode 100644 src/test/resources/ieeeFeeder123/LineConfig.csv create mode 100644 src/test/resources/ieeeFeeder123/Regulator.csv create mode 100644 src/test/resources/ieeeFeeder123/SpotLoad.csv create mode 100644 src/test/resources/ieeeFeeder123/Tfo.csv create mode 100644 src/test/resources/ieeeFeeder123/TfoConfig.csv create mode 100644 src/test/resources/ieeeFeeder13/Bus.csv create mode 100644 src/test/resources/ieeeFeeder13/DistributedLoad.csv create mode 100644 src/test/resources/ieeeFeeder13/Gen.csv create mode 100644 src/test/resources/ieeeFeeder13/Line.csv create mode 100644 src/test/resources/ieeeFeeder13/LineConfig.csv create mode 100644 src/test/resources/ieeeFeeder13/Regulator.csv create mode 100644 src/test/resources/ieeeFeeder13/SpotLoad.csv create mode 100644 src/test/resources/ieeeFeeder13/Tfo.csv create mode 100644 src/test/resources/ieeeFeeder13/TfoConfig.csv create mode 100644 src/test/resources/ieeeFeeder34/Bus.csv create mode 100644 src/test/resources/ieeeFeeder34/DistributedLoad.csv create mode 100644 src/test/resources/ieeeFeeder34/Gen.csv create mode 100644 src/test/resources/ieeeFeeder34/Line.csv create mode 100644 src/test/resources/ieeeFeeder34/LineConfig.csv create mode 100644 src/test/resources/ieeeFeeder34/Regulator.csv create mode 100644 src/test/resources/ieeeFeeder34/SpotLoad.csv create mode 100644 src/test/resources/ieeeFeeder34/Tfo.csv create mode 100644 src/test/resources/ieeeFeeder34/TfoConfig.csv create mode 100644 src/test/resources/lvFeeder/Buscoords.csv create mode 100644 src/test/resources/lvFeeder/LineCodes.csv create mode 100644 src/test/resources/lvFeeder/Lines.csv create mode 100644 src/test/resources/lvFeeder/LoadShapes.csv create mode 100644 src/test/resources/lvFeeder/Loads.csv create mode 100644 src/test/resources/lvFeeder/Source.csv create mode 100644 src/test/resources/lvFeeder/Transformer.csv diff --git a/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/BusAsymmetrical.java b/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/BusAsymmetrical.java index e300b1aaf5..8b15cc2f55 100644 --- a/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/BusAsymmetrical.java +++ b/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/BusAsymmetrical.java @@ -65,4 +65,24 @@ public boolean isFortescueRepresentation() { public boolean isPositiveSequenceAsCurrent() { return isPositiveSequenceAsCurrent; } + + public void setPositiveSequenceAsCurrent(boolean positiveSequenceAsCurrent) { + isPositiveSequenceAsCurrent = positiveSequenceAsCurrent; + } + + public void setFortescueRepresentation(boolean fortescueRepresentation) { + isFortescueRepresentation = fortescueRepresentation; + } + + public void setHasPhaseA(boolean hasPhaseA) { + this.hasPhaseA = hasPhaseA; + } + + public void setHasPhaseB(boolean hasPhaseB) { + this.hasPhaseB = hasPhaseB; + } + + public void setHasPhaseC(boolean hasPhaseC) { + this.hasPhaseC = hasPhaseC; + } } diff --git a/src/main/java/com/powsybl/openloadflow/network/impl/LfBranchImpl.java b/src/main/java/com/powsybl/openloadflow/network/impl/LfBranchImpl.java index 69671e2562..72d8826844 100644 --- a/src/main/java/com/powsybl/openloadflow/network/impl/LfBranchImpl.java +++ b/src/main/java/com/powsybl/openloadflow/network/impl/LfBranchImpl.java @@ -216,9 +216,15 @@ private static void createTransfoToAsym(TwoWindingsTransformer t2w, double zb, L if (asymBus1 != null) { side1VariableType = asymBus1.getAsymBusVariableType(); + if (!asymBus1.isFortescueRepresentation()) { + throw new PowsyblException("A three phase transformer must have its busses in Fortescue representation but bus 1 of '" + t2w.getId() + "' is in ABC representation"); + } } if (asymBus2 != null) { side2VariableType = asymBus2.getAsymBusVariableType(); + if (!asymBus2.isFortescueRepresentation()) { + throw new PowsyblException("A three phase transformer must have its busses in Fortescue representation but bus 2 of '" + t2w.getId() + "' is in ABC representation"); + } } AsymThreePhaseTransfo asym3phaseTfo = new AsymThreePhaseTransfo(leg1Type, leg2Type, stepLegConnectionType, diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java new file mode 100644 index 0000000000..4ca3d3aea2 --- /dev/null +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -0,0 +1,643 @@ +package com.powsybl.openloadflow.network.util; + +import com.powsybl.iidm.network.*; +import com.powsybl.iidm.network.extensions.*; +import com.powsybl.math.matrix.DenseMatrix; +import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; +import com.powsybl.openloadflow.util.ComplexMatrix; +import com.univocity.parsers.annotations.Parsed; +import com.univocity.parsers.common.processor.BeanListProcessor; +import com.univocity.parsers.csv.CsvParser; +import com.univocity.parsers.csv.CsvParserSettings; +import org.apache.commons.math3.complex.Complex; +import org.joda.time.DateTime; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.util.*; + +public final class AsymIeeeFeederParser { + + private AsymIeeeFeederParser() { + } + + private static List parseCsv(String resourceName, Class clazz) { + try (Reader inputReader = new InputStreamReader(Objects.requireNonNull(AsymIeeeFeederParser.class.getResourceAsStream(resourceName)), StandardCharsets.UTF_8)) { + BeanListProcessor rowProcessor = new BeanListProcessor<>(clazz); + CsvParserSettings settings = new CsvParserSettings(); + settings.setHeaderExtractionEnabled(true); + settings.setProcessor(rowProcessor); + CsvParser parser = new CsvParser(settings); + parser.parse(inputReader); + return rowProcessor.getBeans(); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + public static class LineData { + @Parsed(field = "NodeA") + String nodeA; + + @Parsed(field = "NodeB") + String nodeB; + + @Parsed(field = "Length") + double length; + + @Parsed(field = "Config") + String config; + } + + public static class TfoData { + @Parsed(field = "NodeA") + String nodeA; + + @Parsed(field = "NodeB") + String nodeB; + + @Parsed(field = "Config") + String config; + } + + public static class GenData { + @Parsed(field = "GenName") + String genName; + + @Parsed(field = "BusName") + String busName; + + @Parsed(field = "SetPoint") + double setPoint; + + } + + public static class BusData { + @Parsed(field = "BusName") + String busName; + + @Parsed(field = "UNom") + double uNom; + + } + + public static class LoadData { + @Parsed(field = "Node") + String busName; + + @Parsed(field = "Load") + String loadType; + + @Parsed(field = "Ph-1") + double ph1P; + + @Parsed(field = "Ph-1Q") + double ph1Q; + + @Parsed(field = "Ph-2") + double ph2P; + + @Parsed(field = "Ph-2Q") + double ph2Q; + + @Parsed(field = "Ph-3") + double ph3P; + + @Parsed(field = "Ph-3Q") + double ph3Q; + + } + + public static class DistriLoadData { + @Parsed(field = "NodeA") + String busNameA; + + @Parsed(field = "NodeB") + String busNameB; + + @Parsed(field = "Load") + String loadType; + + @Parsed(field = "Ph-1") + double ph1P; + + @Parsed(field = "Ph-1Q") + double ph1Q; + + @Parsed(field = "Ph-2") + double ph2P; + + @Parsed(field = "Ph-2Q") + double ph2Q; + + @Parsed(field = "Ph-3") + double ph3P; + + @Parsed(field = "Ph-3Q") + double ph3Q; + } + + public static class LineConfigData { + @Parsed(field = "Config") + String config; + + @Parsed(field = "PhaseA") + int phaseA; + + @Parsed(field = "PhaseB") + int phaseB; + + @Parsed(field = "PhaseC") + int phaseC; + + @Parsed + double r11; + + @Parsed + double x11; + + @Parsed + double r12; + + @Parsed + double x12; + + @Parsed + double r13; + + @Parsed + double x13; + + @Parsed + double r22; + + @Parsed + double x22; + + @Parsed + double r23; + + @Parsed + double x23; + + @Parsed + double r33; + + @Parsed + double x33; + + @Parsed + double b11; + + @Parsed + double b12; + + @Parsed + double b13; + + @Parsed + double b22; + + @Parsed + double b23; + + @Parsed + double b33; + } + + public static class TfoConfigData { + @Parsed(field = "Config") + String config; + + @Parsed(field = "SkVA") + double skva; + + @Parsed(field = "kV-high") + double kvHigh; + + @Parsed(field = "Winding-high") + String windingHigh; + + @Parsed(field = "kV-low") + double kvLow; + + @Parsed(field = "Winding-low") + String windingLow; + + @Parsed(field = "R") + double r; + + @Parsed(field = "X") + double x; + + } + + public static class RegulatorData { + @Parsed(field = "Line") + String line; + + @Parsed(field = "RhoA") + double rhoA; + + @Parsed(field = "RhoB") + double rhoB; + + @Parsed(field = "RhoC") + double rhoC; + + } + + private static String getBusId(String busName) { + return "Bus-" + busName; + } + + private static String getVoltageLevelId(String busName) { + return "VoltageLevel-" + busName; + } + + private static String getSubstationId(String busName) { + return "Substation-" + busName; + } + + private static void createBuses(Network network, Map firstBusTfo, String path) { + for (BusData busData : parseCsv(path + "Bus.csv", BusData.class)) { + + String substationId = getSubstationId(busData.busName); + if (firstBusTfo.containsKey(busData.busName)) { + substationId = getSubstationId(firstBusTfo.get(busData.busName)); + } + Substation s = network.getSubstation(substationId); + if (s == null) { + s = network.newSubstation() + .setId(substationId) + .add(); + } + VoltageLevel vl = s.newVoltageLevel() + .setId(getVoltageLevelId(busData.busName)) + .setTopologyKind(TopologyKind.BUS_BREAKER) + .setNominalV(busData.uNom) + .add(); + Bus bus = vl.getBusBreakerView().newBus() + .setId(getBusId(busData.busName)) + .add(); + + bus.setV(busData.uNom).setAngle(0.); + + // default settings for bus extensions, will be modified depending on the type of connected equipment : + bus.newExtension(BusAsymmetricalAdder.class) + .withBusVariableType(BusVariableType.WYE) + .withHasPhaseA(false) + .withHasPhaseB(false) + .withHasPhaseC(false) + .withPositiveSequenceAsCurrent(true) + .withFortescueRepresentation(true) + .add(); + } + } + + private static void createGenerators(Network network, String path) { + for (GenData gen : parseCsv(path + "Gen.csv", GenData.class)) { + VoltageLevel vl = network.getVoltageLevel(getVoltageLevelId(gen.busName)); + Generator generator = vl.newGenerator() + .setId(gen.genName) + .setBus(getBusId(gen.busName)) + .setMinP(-100.0) + .setMaxP(200) + .setTargetP(0.0) + .setTargetV(vl.getNominalV() * gen.setPoint) // TODO : TEST + .setVoltageRegulatorOn(true) + .add(); + + Complex zz = new Complex(0.0001, 0.0001); + Complex zn = new Complex(0.0001, 0.0001); + + generator.newExtension(GeneratorFortescueAdder.class) + .withRz(zz.getReal()) + .withXz(zz.getImaginary()) + .withRn(zn.getReal()) + .withXn(zn.getImaginary()) + .add(); + + // modification of bus extension due to generating unit + network.getBusBreakerView().getBus(getBusId(gen.busName)).getExtension(BusAsymmetrical.class).setPositiveSequenceAsCurrent(false); + + } + } + + private static List parseTfos(String path) { + + List listTfos = new ArrayList<>(); + for (TfoData tfo : parseCsv(path + "Tfo.csv", TfoData.class)) { + listTfos.add(tfo); + } + + return listTfos; + } + + private static Map getFirstBusTfo(List listTfos) { + // used to create a substation with the name of the first bus for a tfo + Map firstBusTfo = new HashMap<>(); + for (TfoData tfo : listTfos) { + firstBusTfo.put(tfo.nodeB, tfo.nodeA); + } + + return firstBusTfo; + } + + private static void createLoad(Network network, String loadName, String busName, String loadType, + double pa, double qa, double pb, double qb, double pc, double qc) { + VoltageLevel vl = network.getVoltageLevel(getVoltageLevelId(busName)); + Load load = vl.newLoad() + .setId(loadName) + .setBus(getBusId(busName)) + .setP0(0.) + .setQ0(0.) + .add(); + + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); + LoadConnectionType loadConnectionType; + LoadType loadTypeOut; + if (loadType.equals("Y-PQ")) { + loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; + } else if (loadType.equals("D-PQ")) { + loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; + } else if (loadType.equals("Y-Z")) { + loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + extensionBus.setFortescueRepresentation(false); + } else if (loadType.equals("D-Z")) { + loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + extensionBus.setFortescueRepresentation(false); + } else if (loadType.equals("Y-I")) { + loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_CURRENT; + extensionBus.setFortescueRepresentation(false); + } else if (loadType.equals("D-I")) { + loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_CURRENT; + extensionBus.setFortescueRepresentation(false); + } else { + throw new IllegalStateException("Unknown load type in csv at bus : " + busName); + } + + load.newExtension(LoadAsymmetricalAdder.class) + .withDeltaPa(pa / 1000.) + .withDeltaQa(qa / 1000.) + .withDeltaPb(pb / 1000.) + .withDeltaQb(qb / 1000.) + .withDeltaPc(pc / 1000.) + .withDeltaQc(qc / 1000.) + .withConnectionType(loadConnectionType) + .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + + } + + private static void createLoads(Network network, String path) { + + for (LoadData loadData : parseCsv(path + "SpotLoad.csv", LoadData.class)) { + + String loadName = "LOAD_" + loadData.busName + "-" + loadData.loadType; + + createLoad(network, loadName, loadData.busName, loadData.loadType, + loadData.ph1P, loadData.ph1Q, loadData.ph2P, loadData.ph2Q, loadData.ph3P, loadData.ph3Q); + } + } + + private static void createDistriLoads(Network network, String path) { + + for (DistriLoadData loadData : parseCsv(path + "DistributedLoad.csv", DistriLoadData.class)) { + String loadName = "LOAD_" + loadData.busNameA + "-" + loadData.busNameB + "-" + loadData.loadType; + + createLoad(network, loadName, loadData.busNameA, loadData.loadType, + loadData.ph1P, loadData.ph1Q, loadData.ph2P, loadData.ph2Q, loadData.ph3P, loadData.ph3Q); + } + } + + private static void createLines(Network network, String path) { + Map lineConfig = new HashMap<>(); + for (LineConfigData lineCode : parseCsv(path + "LineConfig.csv", LineConfigData.class)) { + lineConfig.put(lineCode.config, lineCode); + } + Map regulatorDataMap = new HashMap<>(); + for (RegulatorData regulatorData : parseCsv(path + "Regulator.csv", RegulatorData.class)) { + String lineName = "Line-" + regulatorData.line; + regulatorDataMap.put(lineName, regulatorData); + } + + for (LineData line : parseCsv(path + "Line.csv", LineData.class)) { + LineConfigData lineConfigData = lineConfig.get(line.config); + var l = network.newLine() + .setId("Line-" + line.nodeA + "-" + line.nodeB) + .setVoltageLevel1(getVoltageLevelId(line.nodeA)) + .setBus1(getBusId(line.nodeA)) + .setVoltageLevel2(getVoltageLevelId(line.nodeB)) + .setBus2(getBusId(line.nodeB)) + .setR(1.0 * line.length / 1000) + .setX(1.0 * line.length / 1000) + .add(); + + l.newExtension(LineFortescueAdder.class) + .withOpenPhaseA(false) + .withOpenPhaseB(false) + .withOpenPhaseC(false) + .withRz(1.0 * line.length / 1000) + .withXz(1.0 * line.length / 1000) + .add(); + + double micro = 0.000001; + double feetInMile = 5280; + double yCoef = 1. / 3.; + + // building of Yabc from given Y impedance matrix Zy + ComplexMatrix zy = new ComplexMatrix(3, 3); + zy.set(1, 1, new Complex(lineConfigData.r11, lineConfigData.x11)); + zy.set(1, 2, new Complex(lineConfigData.r12, lineConfigData.x12)); + zy.set(1, 3, new Complex(lineConfigData.r13, lineConfigData.x13)); + zy.set(2, 1, new Complex(lineConfigData.r12, lineConfigData.x12)); + zy.set(2, 2, new Complex(lineConfigData.r22, lineConfigData.x22)); + zy.set(2, 3, new Complex(lineConfigData.r23, lineConfigData.x23)); + zy.set(3, 1, new Complex(lineConfigData.r13, lineConfigData.x13)); + zy.set(3, 2, new Complex(lineConfigData.r23, lineConfigData.x23)); + zy.set(3, 3, new Complex(lineConfigData.r33, lineConfigData.x33)); + + ComplexMatrix b = new ComplexMatrix(3, 3); + + b.set(1, 1, new Complex(0, micro * lineConfigData.b11)); + b.set(1, 2, new Complex(0, micro * lineConfigData.b12)); + b.set(1, 3, new Complex(0, micro * lineConfigData.b13)); + b.set(2, 1, new Complex(0, micro * lineConfigData.b12)); + b.set(2, 2, new Complex(0, micro * lineConfigData.b22)); + b.set(2, 3, new Complex(0, micro * lineConfigData.b23)); + b.set(3, 1, new Complex(0, micro * lineConfigData.b13)); + b.set(3, 2, new Complex(0, micro * lineConfigData.b23)); + b.set(3, 3, new Complex(0, micro * lineConfigData.b33)); + + boolean hasPhaseA = lineConfigData.phaseA == 1; + boolean hasPhaseB = lineConfigData.phaseB == 1; + boolean hasPhaseC = lineConfigData.phaseC == 1; + + ComplexMatrix yabc = LineAsymmetrical.getAdmittanceMatrixFromImpedanceAndBmatrix(zy, b, + hasPhaseA, hasPhaseB, hasPhaseC, line.length / feetInMile); + if (regulatorDataMap.containsKey(l.getId())) { + // take into account effect of regulator + RegulatorData regulatorData = regulatorDataMap.get(l.getId()); + ComplexMatrix rho = new ComplexMatrix(6, 6); + rho.set(1, 1, new Complex(regulatorData.rhoA, 0.)); + rho.set(2, 2, new Complex(regulatorData.rhoB, 0.)); + rho.set(3, 3, new Complex(regulatorData.rhoC, 0.)); + rho.set(4, 4, new Complex(1., 0.)); + rho.set(5, 5, new Complex(1., 0.)); + rho.set(6, 6, new Complex(1., 0.)); + DenseMatrix yabcRho = rho.getRealCartesianMatrix().times(yabc.getRealCartesianMatrix().times(rho.getRealCartesianMatrix())); + yabc = ComplexMatrix.getComplexMatrixFromRealCartesian(yabcRho); + } + + l.newExtension(LineAsymmetricalAdder.class) + .withYabc(ComplexMatrix.getMatrixScaled(yabc, yCoef)) + .add(); + + // modification of bus extension depending on line connections: + var extensionBus1 = network.getBusBreakerView().getBus(getBusId(line.nodeA)).getExtension(BusAsymmetrical.class); + var extensionBus2 = network.getBusBreakerView().getBus(getBusId(line.nodeB)).getExtension(BusAsymmetrical.class); + + extensionBus1.setHasPhaseA(extensionBus1.isHasPhaseA() || hasPhaseA); + extensionBus1.setHasPhaseB(extensionBus1.isHasPhaseB() || hasPhaseB); + extensionBus1.setHasPhaseC(extensionBus1.isHasPhaseC() || hasPhaseC); + + extensionBus2.setHasPhaseA(extensionBus2.isHasPhaseA() || hasPhaseA); + extensionBus2.setHasPhaseB(extensionBus2.isHasPhaseB() || hasPhaseB); + extensionBus2.setHasPhaseC(extensionBus2.isHasPhaseC() || hasPhaseC); + + } + } + + private static void createTfos(Network network, String path) { + Map tfoConfigDataMap = new HashMap<>(); + for (TfoConfigData tfoConfig : parseCsv(path + "TfoConfig.csv", TfoConfigData.class)) { + tfoConfigDataMap.put(tfoConfig.config, tfoConfig); + } + for (TfoData tfoData : parseCsv(path + "Tfo.csv", TfoData.class)) { + TfoConfigData tfoConfigData = tfoConfigDataMap.get(tfoData.config); + double ratedUhigh = tfoConfigData.kvHigh; + double ratedUlow = tfoConfigData.kvLow; + double sBase = tfoConfigData.skva / 1000.; + double rTpc = tfoConfigData.r; + double xTpc = tfoConfigData.x; + double zBase = ratedUhigh * ratedUlow / sBase; + double rT = rTpc * zBase / 100.; + double xT = xTpc * zBase / 100.; + + var tfo = network.getSubstation(getSubstationId(tfoData.nodeA)).newTwoWindingsTransformer() + .setId("Tfo-" + tfoData.nodeA + "-" + tfoData.nodeB) + .setVoltageLevel1(network.getVoltageLevel(getVoltageLevelId(tfoData.nodeA)).getId()) + .setBus1(getBusId(tfoData.nodeA)) + .setConnectableBus1(getBusId(tfoData.nodeA)) + .setRatedU1(ratedUhigh) + .setVoltageLevel2(network.getVoltageLevel(getVoltageLevelId(tfoData.nodeB)).getId()) + .setBus2(getBusId(tfoData.nodeB)) + .setConnectableBus2(getBusId(tfoData.nodeB)) + .setRatedU2(ratedUlow) + .setR(rT) + .setX(xT) + .setG(0.0D) + .setB(0.0D) + .setRatedS(sBase) + .add(); + + WindingConnectionType windingConnectionType1; + if (tfoConfigData.windingHigh.equals("Gr.Y") || tfoConfigData.windingHigh.equals("Gr.W")) { + windingConnectionType1 = WindingConnectionType.Y_GROUNDED; + } else { + windingConnectionType1 = WindingConnectionType.DELTA; + } + + WindingConnectionType windingConnectionType2; + if (tfoConfigData.windingLow.equals("Gr.Y") || tfoConfigData.windingLow.equals("Gr.W")) { + windingConnectionType2 = WindingConnectionType.Y_GROUNDED; + } else { + windingConnectionType2 = WindingConnectionType.DELTA; + } + + tfo.newExtension(TwoWindingsTransformerFortescueAdder.class) + .withRz(rT) + .withXz(xT) + .withConnectionType1(windingConnectionType1) + .withConnectionType2(windingConnectionType2) + .withGroundingX1(0.0000) + .withGroundingX2(0.0000) + .withFreeFluxes(true) + .add(); + + Complex zPhase = new Complex(rTpc, xTpc).multiply(zBase / 3. / 100.); + Complex yPhase = new Complex(0., 0.); + + tfo.newExtension(Tfo3PhasesAdder.class) + .withIsOpenPhaseA1(false) + .withIsOpenPhaseB1(false) + .withIsOpenPhaseC1(false) + .withYa(buildSinglePhaseAdmittanceMatrix(zPhase, yPhase, yPhase)) + .withYb(buildSinglePhaseAdmittanceMatrix(zPhase, yPhase, yPhase)) + .withYc(buildSinglePhaseAdmittanceMatrix(zPhase, yPhase, yPhase)) + .add(); + + // modification of bus extension depending on line connections: + var extensionBus1 = network.getBusBreakerView().getBus(getBusId(tfoData.nodeA)).getExtension(BusAsymmetrical.class); + var extensionBus2 = network.getBusBreakerView().getBus(getBusId(tfoData.nodeB)).getExtension(BusAsymmetrical.class); + + extensionBus1.setHasPhaseA(true); + extensionBus1.setHasPhaseB(true); + extensionBus1.setHasPhaseC(true); + + extensionBus2.setHasPhaseA(true); + extensionBus2.setHasPhaseB(true); + extensionBus2.setHasPhaseC(true); + + extensionBus1.setFortescueRepresentation(true); + extensionBus2.setFortescueRepresentation(true); + } + } + + public static ComplexMatrix buildSinglePhaseAdmittanceMatrix(Complex z, Complex y1, Complex y2) { + ComplexMatrix cm = new ComplexMatrix(2, 2); + cm.set(1, 1, y1.add(z.reciprocal())); + cm.set(1, 2, z.reciprocal().multiply(-1.)); + cm.set(2, 1, z.reciprocal().multiply(-1.)); + cm.set(2, 2, y2.add(z.reciprocal())); + + return cm; + } + + public static Network create(String path) { + return create(NetworkFactory.findDefault(), path); + } + + public static Network create(NetworkFactory networkFactory, String path) { + Network network = networkFactory.createNetwork("EuropeanLvTestFeeder", "csv"); + network.setCaseDate(DateTime.parse("2023-04-11T23:59:00.000+01:00")); + + // for substation naming when there are tfos: + List listTfos = parseTfos(path); + Map firstBusTfo = getFirstBusTfo(listTfos); + + createBuses(network, firstBusTfo, path); + createLines(network, path); + createGenerators(network, path); + createLoads(network, path); + createDistriLoads(network, path); + createTfos(network, path); + + return network; + } + +} diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java new file mode 100644 index 0000000000..5b70c85e15 --- /dev/null +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -0,0 +1,352 @@ +package com.powsybl.openloadflow.network.util; + +import com.powsybl.commons.PowsyblException; +import com.powsybl.iidm.network.*; +import com.powsybl.iidm.network.extensions.*; +import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; +import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; +import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; +import com.univocity.parsers.annotations.Parsed; +import com.univocity.parsers.common.processor.BeanListProcessor; +import com.univocity.parsers.csv.CsvParser; +import com.univocity.parsers.csv.CsvParserSettings; +import org.apache.commons.math3.complex.Complex; +import org.joda.time.DateTime; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +public final class AsymLvFeederParser { + private AsymLvFeederParser() { + } + + private static List parseCsv(String resourceName, Class clazz) { + try (Reader inputReader = new InputStreamReader(Objects.requireNonNull(AsymLvFeederParser.class.getResourceAsStream(resourceName)), StandardCharsets.UTF_8)) { + BeanListProcessor rowProcessor = new BeanListProcessor<>(clazz); + CsvParserSettings settings = new CsvParserSettings(); + settings.setHeaderExtractionEnabled(true); + settings.setProcessor(rowProcessor); + CsvParser parser = new CsvParser(settings); + parser.parse(inputReader); + return rowProcessor.getBeans(); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + private static String getBusId(int busName) { + return "Bus-" + busName; + } + + private static String getVoltageLevelId(int busName) { + return "VoltageLevel-" + busName; + } + + private static String getSubstationId(int busName) { + return "Substation-" + busName; + } + + public static class BusCoord { + @Parsed(field = "Busname") + int busName; + + @Parsed + double x; + + @Parsed + double y; + } + + public static class Line { + @Parsed(field = "Name") + String name; + + @Parsed(field = "Bus1") + int bus1; + + @Parsed(field = "Bus2") + int bus2; + + @Parsed(field = "Phases") + String phases; + + @Parsed(field = "Length") + double length; + + @Parsed(field = "Units") + String units; + + @Parsed(field = "LineCode") + String code; + } + + public static class LineCode { + @Parsed(field = "Name") + String name; + + @Parsed + int nphases; + + @Parsed(field = "R1") + double r1; + + @Parsed(field = "X1") + double x1; + + @Parsed(field = "R0") + double r0; + + @Parsed(field = "X0") + double x0; + + @Parsed(field = "C1") + double c1; + + @Parsed(field = "C0") + double c0; + + @Parsed(field = "Units") + String units; + } + + public static class Load { + @Parsed(field = "Name") + String name; + + @Parsed + int numPhases; + + @Parsed(field = "Bus") + int bus; + + @Parsed + char phases; + + @Parsed + double kV; + + @Parsed(field = "Model") + int model; + + @Parsed(field = "Connection") + String connection; + + @Parsed + double kW; + + @Parsed(field = "PF") + double pf; + + @Parsed(field = "Yearly") + String yearly; + } + + public static class Transformer { + @Parsed(field = "Name") + String name; + + @Parsed + int phases; + + @Parsed + String bus1; + + @Parsed + int bus2; + + @Parsed(field = "kV_pri") + double kvPri; + + @Parsed(field = "kV_sec") + double kvSec; + + @Parsed(field = "MVA") + double mva; + + @Parsed(field = "Conn_pri") + String connPri; + + @Parsed(field = "Conn_sec") + String connSec; + + @Parsed(field = "%XHL") + double xhl; + + @Parsed(field = "% resistance") + double resistance; + } + + private static void createBuses(Network network, String path) { + for (BusCoord busCoord : parseCsv(path + "Buscoords.csv", BusCoord.class)) { + String substationId = getSubstationId(busCoord.busName); + Substation s = network.getSubstation(substationId); + if (s == null) { + s = network.newSubstation() + .setId(substationId) + .add(); + } + VoltageLevel vl = s.newVoltageLevel() + .setId(getVoltageLevelId(busCoord.busName)) + .setTopologyKind(TopologyKind.BUS_BREAKER) + .setNominalV(1) + .add(); + Bus bus = vl.getBusBreakerView().newBus() + .setId(getBusId(busCoord.busName)) + .add(); + + // default settings for bus extensions, will be modified depending on the type of connected equipment : + bus.newExtension(BusAsymmetricalAdder.class) + .withBusVariableType(BusVariableType.WYE) + .withHasPhaseA(true) + .withHasPhaseB(true) + .withHasPhaseC(true) + .withPositiveSequenceAsCurrent(true) + .withFortescueRepresentation(true) + .add(); + } + } + + private static void createLines(Network network, String path) { + Map lineCodes = new HashMap<>(); + for (LineCode lineCode : parseCsv(path + "LineCodes.csv", LineCode.class)) { + lineCodes.put(lineCode.name, lineCode); + } + double coeff = 1 / 1000.; + for (Line line : parseCsv(path + "Lines.csv", Line.class)) { + LineCode lineCode = lineCodes.get(line.code); + var l = network.newLine() + .setId("Line-" + line.bus1 + "-" + line.bus2) + .setVoltageLevel1(getVoltageLevelId(line.bus1)) + .setBus1(getBusId(line.bus1)) + .setVoltageLevel2(getVoltageLevelId(line.bus2)) + .setBus2(getBusId(line.bus2)) + .setR(lineCode.r1 * line.length * coeff) + .setX(lineCode.x1 * line.length * coeff) + .add(); + l.newExtension(LineFortescueAdder.class) + .withRz(lineCode.r0 * line.length * coeff) + .withXz(lineCode.x0 * line.length * coeff) + .add(); + } + } + + private static LoadConnectionType getConnectionType(Load load) { + if (load.connection.equals("wye")) { + return LoadConnectionType.Y; + } + throw new PowsyblException("Unknown load connection: " + load.connection); + } + + private static void createLoads(Network network, String path) { + for (Load load : parseCsv(path + "Loads.csv", Load.class)) { + var vl = network.getVoltageLevel(getVoltageLevelId(load.bus)); + double p0 = load.kW / 1000; + double q0 = p0 * load.pf; + var l = vl.newLoad() + .setId("Load-" + load.bus) + .setBus(getBusId(load.bus)) + .setP0(0.) + .setQ0(0.) + .add(); + double defaultLoad = 0.000; + double deltaPa = defaultLoad; + double deltaQa = defaultLoad; + double deltaPb = defaultLoad; + double deltaQb = defaultLoad; + double deltaPc = defaultLoad; + double deltaQc = defaultLoad; + switch (load.phases) { + case 'A': + deltaPa += p0; + deltaQa += q0; + break; + case 'B': + deltaPb += p0; + deltaQb += q0; + break; + case 'C': + deltaPc += p0; + deltaQc += q0; + break; + default: + throw new PowsyblException("Unknown phase: " + load.phases); + } + l.newExtension(LoadAsymmetricalAdder.class) + .withConnectionType(getConnectionType(load)) + .withDeltaPa(deltaPa) + .withDeltaQa(deltaQa) + .withDeltaPb(deltaPb) + .withDeltaQb(deltaQb) + .withDeltaPc(deltaPc) + .withDeltaQc(deltaQc) + .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + } + } + + private static void createSource(Network network) { + int busName = 1; + VoltageLevel vl = network.getVoltageLevel(getVoltageLevelId(busName)); + Generator generator = vl.newGenerator() + .setId("G150") + .setBus(getBusId(busName)) + .setMinP(-100.0) + .setMaxP(200) + .setTargetP(0) + .setTargetV(vl.getNominalV() * 1.05) + .setVoltageRegulatorOn(true) + .add(); + + Complex zz = new Complex(0.0001, 0.0001); // 0.0001 , 0.001 + Complex zn = new Complex(0.0001, 0.0001); // 0.001 , 0.01 + + generator.newExtension(GeneratorFortescueAdder.class) + .withRz(zz.getReal()) + .withXz(zz.getImaginary()) + .withRn(zn.getReal()) + .withXn(zn.getImaginary()) + .add(); + + // modification of bus extension due to generating unit + network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class).setPositiveSequenceAsCurrent(false); + } + + private static WindingConnectionType getConnectionType(String conn) { + switch (conn) { + case "Delta": + return WindingConnectionType.DELTA; + case "Wye": + return WindingConnectionType.Y; + default: + throw new PowsyblException("Connection type not supported: " + conn); + } + } + + public static Network create(String path) { + return create(NetworkFactory.findDefault(), path); + } + + public static Network create(NetworkFactory networkFactory, String path) { + Network network = networkFactory.createNetwork("EuropeanLvTestFeeder", "csv"); + network.setCaseDate(DateTime.parse("2023-04-11T23:59:00.000+01:00")); + + createBuses(network, path); + createSource(network); + createLines(network, path); + createLoads(network, path); + return network; + } + +} diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym13BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym13BusFeederTest.java index f076e6d356..196ce73bd6 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym13BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym13BusFeederTest.java @@ -309,7 +309,7 @@ void ieee13LoadWithConstantImpedanceDeltaTest() { assertVoltageEquals(4.290533459921324, bus632); assertVoltageEquals(4.2520625000874075, bus645); assertVoltageEquals(4.243258426216129, bus646); - assertVoltageEquals(4.154403168622116, bus652); + assertVoltageEquals(4.165204333227582, bus652); } @Test diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index c4ea034fef..2c6edd1e9b 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -923,7 +923,7 @@ public static Network ieee34LoadFeeder() { bus832.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(BusVariableType.WYE) .withPositiveSequenceAsCurrent(true) - .withFortescueRepresentation(false) + .withFortescueRepresentation(true) .add(); double p832 = 0.; @@ -934,12 +934,12 @@ public static Network ieee34LoadFeeder() { .setP0(p832) .setQ0(q832) .newZipModel() - .setC0p(0.) + .setC0p(1.) .setC1p(0.) - .setC2p(1.) - .setC0q(0.) + .setC2p(0.) + .setC0q(1.) .setC1q(0.) - .setC2q(1.) + .setC2q(0.) .add() .add(); @@ -969,7 +969,7 @@ public static Network ieee34LoadFeeder() { bus888.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(BusVariableType.WYE) .withPositiveSequenceAsCurrent(true) - .withFortescueRepresentation(false) + .withFortescueRepresentation(true) .add(); // Bus 890 diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java new file mode 100644 index 0000000000..d489c65980 --- /dev/null +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -0,0 +1,98 @@ +package com.powsybl.openloadflow.util; + +import com.powsybl.iidm.network.Network; +import com.powsybl.loadflow.LoadFlow; +import com.powsybl.loadflow.LoadFlowParameters; +import com.powsybl.loadflow.LoadFlowResult; +import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.openloadflow.OpenLoadFlowParameters; +import com.powsybl.openloadflow.OpenLoadFlowProvider; +import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; +import com.powsybl.openloadflow.network.util.AsymLvFeederParser; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class AsymIeeeFeederParserTest { + + private LoadFlow.Runner loadFlowRunner; + private LoadFlowParameters parameters; + + @BeforeEach + void setUp() { + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) + .setDistributedSlack(false); + + OpenLoadFlowParameters.create(parameters) + .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) + .setMaxNewtonRaphsonIterations(100) + .setMaxActivePowerMismatch(0.0001) + .setMaxReactivePowerMismatch(0.0001) + .setNewtonRaphsonConvEpsPerEq(0.0001) + .setMaxVoltageMismatch(0.0001) + .setMaxSusceptanceMismatch(0.0001) + .setMaxAngleMismatch(0.0001) + .setMaxRatioMismatch(0.0001) + .setAsymmetrical(true); + } + + @Test + void test13BussesTest() { + + Network network = AsymIeeeFeederParser.create("/ieeeFeeder13/"); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + assertVoltageEquals(4.276427533655057, network.getBusBreakerView().getBus("Bus-632")); + } + + @Test + void test34BussesTest() { + + Network network = AsymIeeeFeederParser.create("/ieeeFeeder34/"); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + assertVoltageEquals(26.145, network.getBusBreakerView().getBus("Bus-800")); + assertVoltageEquals(25.86703194305272, network.getBusBreakerView().getBus("Bus-832")); + } + + @Test + void test123BussesTest() { + + Network network = AsymIeeeFeederParser.create("/ieeeFeeder123/"); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + assertVoltageEquals(4.16, network.getBusBreakerView().getBus("Bus-150")); + assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); + } + + @Disabled + @Test + void testLvFeedersTest() { + + OpenLoadFlowParameters.create(parameters) + .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) + .setMaxNewtonRaphsonIterations(100) + .setMaxActivePowerMismatch(0.0000001) + .setMaxReactivePowerMismatch(0.0000001) + .setNewtonRaphsonConvEpsPerEq(0.0000001) + .setMaxVoltageMismatch(0.00001) + .setMaxSusceptanceMismatch(0.0001) + .setMaxAngleMismatch(0.0001) + .setMaxRatioMismatch(0.0001) + .setAsymmetrical(true); + + Network network = AsymLvFeederParser.create("/lvFeeder/"); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + } + +} diff --git a/src/test/resources/ieeeFeeder123/Bus.csv b/src/test/resources/ieeeFeeder123/Bus.csv new file mode 100644 index 0000000000..033b1a0ab3 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Bus.csv @@ -0,0 +1,120 @@ +BusName,UNom +150,4.16 +1,4.16 +2,4.16 +3,4.16 +4,4.16 +5,4.16 +6,4.16 +7,4.16 +8,4.16 +12,4.16 +9,4.16 +13,4.16 +14,4.16 +18,4.16 +11,4.16 +10,4.16 +15,4.16 +16,4.16 +17,4.16 +19,4.16 +21,4.16 +20,4.16 +22,4.16 +23,4.16 +24,4.16 +25,4.16 +26,4.16 +28,4.16 +27,4.16 +31,4.16 +33,4.16 +29,4.16 +30,4.16 +250,4.16 +32,4.16 +34,4.16 +35,4.16 +36,4.16 +40,4.16 +37,4.16 +38,4.16 +39,4.16 +41,4.16 +42,4.16 +43,4.16 +44,4.16 +45,4.16 +47,4.16 +46,4.16 +48,4.16 +49,4.16 +50,4.16 +51,4.16 +151,4.16 +52,4.16 +53,4.16 +54,4.16 +57,4.16 +55,4.16 +56,4.16 +58,4.16 +60,4.16 +59,4.16 +61,4.16 +62,4.16 +63,4.16 +64,4.16 +65,4.16 +66,4.16 +67,4.16 +68,4.16 +72,4.16 +69,4.16 +70,4.16 +71,4.16 +73,4.16 +76,4.16 +74,4.16 +75,4.16 +77,4.16 +78,4.16 +79,4.16 +80,4.16 +81,4.16 +82,4.16 +84,4.16 +83,4.16 +85,4.16 +86,4.16 +87,4.16 +88,4.16 +89,4.16 +90,4.16 +91,4.16 +92,4.16 +93,4.16 +94,4.16 +95,4.16 +96,4.16 +97,4.16 +98,4.16 +99,4.16 +100,4.16 +450,4.16 +101,4.16 +102,4.16 +105,4.16 +103,4.16 +104,4.16 +106,4.16 +108,4.16 +107,4.16 +109,4.16 +300,4.16 +110,4.16 +111,4.16 +112,4.16 +113,4.16 +114,4.16 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder123/DistributedLoad.csv b/src/test/resources/ieeeFeeder123/DistributedLoad.csv new file mode 100644 index 0000000000..65cf9c2d6e --- /dev/null +++ b/src/test/resources/ieeeFeeder123/DistributedLoad.csv @@ -0,0 +1 @@ +NodeA,NodeB,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q diff --git a/src/test/resources/ieeeFeeder123/Gen.csv b/src/test/resources/ieeeFeeder123/Gen.csv new file mode 100644 index 0000000000..5b4542d8fa --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Gen.csv @@ -0,0 +1,2 @@ +GenName,busName,SetPoint +G150,150,1.0 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder123/Line.csv b/src/test/resources/ieeeFeeder123/Line.csv new file mode 100644 index 0000000000..b2a8bf6652 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Line.csv @@ -0,0 +1,119 @@ +NodeA,NodeB,Length,Config +1,2,175,10 +1,3,250,11 +1,7,300,1 +3,4,200,11 +3,5,325,11 +5,6,250,11 +7,8,200,1 +8,12,225,10 +8,9,225,9 +8,13,300,1 +9,14,425,9 +13,34,150,11 +13,18,825,2 +14,11,250,9 +14,10,250,9 +15,16,375,11 +15,17,350,11 +18,19,250,9 +18,21,300,2 +19,20,325,9 +21,22,525,10 +21,23,250,2 +23,24,550,11 +23,25,275,2 +25,26,350,7 +25,28,200,2 +26,27,275,7 +26,31,225,11 +27,33,500,9 +28,29,300,2 +29,30,350,2 +30,250,200,2 +31,32,300,11 +34,15,100,11 +35,36,650,8 +35,40,250,1 +36,37,300,9 +36,38,250,10 +38,39,325,10 +40,41,325,11 +40,42,250,1 +42,43,500,10 +42,44,200,1 +44,45,200,9 +44,47,250,1 +45,46,300,9 +47,48,150,4 +47,49,250,4 +49,50,250,4 +50,51,250,4 +51,151,500,4 +52,53,200,1 +53,54,125,1 +54,55,275,1 +54,57,350,3 +55,56,275,1 +57,58,250,10 +57,60,750,3 +58,59,250,10 +60,61,550,5 +60,62,250,12 +62,63,175,12 +63,64,350,12 +64,65,425,12 +65,66,325,12 +67,68,200,9 +67,72,275,3 +67,97,250,3 +68,69,275,9 +69,70,325,9 +70,71,275,9 +72,73,275,11 +72,76,200,3 +73,74,350,11 +74,75,400,11 +76,77,400,6 +76,86,700,3 +77,78,100,6 +78,79,225,6 +78,80,475,6 +80,81,475,6 +81,82,250,6 +81,84,675,11 +82,83,250,6 +84,85,475,11 +86,87,450,6 +87,88,175,9 +87,89,275,6 +89,90,225,10 +89,91,225,6 +91,92,300,11 +91,93,225,6 +93,94,275,9 +93,95,300,6 +95,96,200,10 +97,98,275,3 +98,99,550,3 +99,100,300,3 +100,450,800,3 +101,102,225,11 +101,105,275,3 +102,103,325,11 +103,104,700,11 +105,106,225,10 +105,108,325,3 +106,107,575,10 +108,109,450,9 +108,300,1000,3 +109,110,300,9 +110,111,575,9 +110,112,125,9 +112,113,525,9 +113,114,325,9 +18,35,375,4 +150,1,400,1 +13,52,400,1 +60,67,350,6 +97,101,250,3 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder123/LineConfig.csv b/src/test/resources/ieeeFeeder123/LineConfig.csv new file mode 100644 index 0000000000..6345fc3ead --- /dev/null +++ b/src/test/resources/ieeeFeeder123/LineConfig.csv @@ -0,0 +1,14 @@ +Config,PhaseA,PhaseB,PhaseC,r11,x11,r12,x12,r13,x13,r22,x22,r23,x23,r33,x33,b11,b12,b13,b22,b23,b33 +1,1,1,1,0.4576,1.0780,0.1560,0.5017,0.1535,0.3849,0.4666,1.0482,0.1580,0.4236,0.4615,1.0651,5.6765,-1.8319,-0.6982,5.9809,-1.1645,5.3971 +2,1,1,1,0.4666,1.0482,0.1580,0.4236,0.1560,0.5017,0.4615,1.0651,0.1535,0.3849,0.4576,1.0780,5.9809,-1.1645,-1.8319,5.3971,-0.6982,5.6765 +3,1,1,1,0.4615,1.0651,0.1535,0.3849,0.1580,0.4236,0.4576,1.0780,0.1560,0.5017,0.4666,1.0482,5.3971,-0.6982,-1.1645,5.6765,-1.8319,5.9809 +4,1,1,1,0.4615,1.0651,0.1580,0.4236,0.1535,0.3849,0.4666,1.0482,0.1560,0.5017,0.4576,1.0780,5.3971,-1.1645,-0.6982,5.9809,-1.8319,5.6765 +5,1,1,1,0.4666,1.0482,0.1560,0.5017,0.1580,0.4236,0.4576,1.0780,0.1535,0.3849,0.4615,1.0651,5.9809,-1.8319,-1.1645,5.6765,-0.6982,5.3971 +6,1,1,1,0.4576,1.0780,0.1535,0.3849,0.1560,0.5017,0.4615,1.0651,0.1580,0.4236,0.4666,1.0482,5.6765,-0.6982,-1.8319,5.3971,-1.1645,5.9809 +7,1,0,1,0.4576,1.0780,0.0000,0.0000,0.1535,0.3849,0.0000,0.0000,0.0000,0.0000,0.4615,1.0651,5.1154,0.0000,-1.0549,0.0000,0.0000,5.1704 +8,1,1,0,0.4576,1.0780,0.1535,0.3849,0.0000,0.0000,0.4615,1.0651,0.0000,0.0000,0.0000,0.0000,5.1154,-1.0549,0.0000,5.1704,0.0000,0.0000 +9,1,0,0,1.3292,1.3475,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.5193,0.0000,0.0000,0.0000,0.0000,0.0000 +10,0,1,0,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.3292,1.3475,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.5193,0.0000,0.0000 +11,0,0,1,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.3292,1.3475,0.0000,0.0000,0.0000,0.0000,0.0000,4.5193 +12,1,1,1,1.5209,0.7521,0.5198,0.2775,0.4924,0.2157,1.5329,0.7162,0.5198,0.2775,1.5209,0.7521,67.2242,0.0000,0.0000,67.2242,0.0000,67.2242 + diff --git a/src/test/resources/ieeeFeeder123/Regulator.csv b/src/test/resources/ieeeFeeder123/Regulator.csv new file mode 100644 index 0000000000..b680c8f64f --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Regulator.csv @@ -0,0 +1,5 @@ +Line,RhoA,RhoB,RhoC +150-1,1.0437,1.0438,1.0438 +60-67,1.05,1.00624,1.03123 +25-26,1.0,1.0,0.9937 +9-14,0.9937,1.0,1.0 diff --git a/src/test/resources/ieeeFeeder123/SpotLoad.csv b/src/test/resources/ieeeFeeder123/SpotLoad.csv new file mode 100644 index 0000000000..d3327baa38 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/SpotLoad.csv @@ -0,0 +1,86 @@ +Node,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +1,Y-PQ,40,20,0,0,0,0 +2,Y-PQ,0,0,20,10,0,0 +4,Y-PQ,0,0,0,0,40,20 +5,Y-I,0,0,0,0,20,10 +6,Y-Z,0,0,0,0,40,20 +7,Y-PQ,20,10,0,0,0,0 +9,Y-PQ,40,20,0,0,0,0 +10,Y-I,20,10,0,0,0,0 +11,Y-Z,40,20,0,0,0,0 +12,Y-PQ,0,0,20,10,0,0 +16,Y-PQ,0,0,0,0,40,20 +17,Y-PQ,0,0,0,0,20,10 +19,Y-PQ,40,20,0,0,0,0 +20,Y-I,40,20,0,0,0,0 +22,Y-Z,0,0,40,20,0,0 +24,Y-PQ,0,0,0,0,40,20 +28,Y-I,40,20,0,0,0,0 +29,Y-Z,40,20,0,0,0,0 +30,Y-PQ,0,0,0,0,40,20 +31,Y-PQ,0,0,0,0,20,10 +32,Y-PQ,0,0,0,0,20,10 +33,Y-I,40,20,0,0,0,0 +34,Y-Z,0,0,0,0,40,20 +35,D-PQ,40,20,0,0,0,0 +37,Y-Z,40,20,0,0,0,0 +38,Y-I,0,0,20,10,0,0 +39,Y-PQ,0,0,20,10,0,0 +41,Y-PQ,0,0,0,0,20,10 +42,Y-PQ,20,10,0,0,0,0 +43,Y-Z,0,0,40,20,0,0 +45,Y-I,20,10,0,0,0,0 +46,Y-PQ,20,10,0,0,0,0 +47,Y-I,35,25,35,25,35,25 +48,Y-Z,70,50,70,50,70,50 +49,Y-PQ,35,25,70,50,35,20 +50,Y-PQ,0,0,0,0,40,20 +51,Y-PQ,20,10,0,0,0,0 +52,Y-PQ,40,20,0,0,0,0 +53,Y-PQ,40,20,0,0,0,0 +55,Y-Z,20,10,0,0,0,0 +56,Y-PQ,0,0,20,10,0,0 +58,Y-I,0,0,20,10,0,0 +59,Y-PQ,0,0,20,10,0,0 +60,Y-PQ,20,10,0,0,0,0 +62,Y-Z,0,0,0,0,40,20 +63,Y-PQ,40,20,0,0,0,0 +64,Y-I,0,0,75,35,0,0 +65,D-Z,35,25,35,25,70,50 +66,Y-PQ,0,0,0,0,75,35 +68,Y-PQ,20,10,0,0,0,0 +69,Y-PQ,40,20,0,0,0,0 +70,Y-PQ,20,10,0,0,0,0 +71,Y-PQ,40,20,0,0,0,0 +73,Y-PQ,0,0,0,0,40,20 +74,Y-Z,0,0,0,0,40,20 +75,Y-PQ,0,0,0,0,40,20 +76,D-I,105,80,70,50,70,50 +77,Y-PQ,0,0,40,20,0,0 +79,Y-Z,40,20,0,0,0,0 +80,Y-PQ,0,0,40,20,0,0 +82,Y-PQ,40,20,0,0,0,0 +83,Y-PQ,0,-200,0,-200,20,-190 +84,Y-PQ,0,0,0,0,20,10 +85,Y-PQ,0,0,0,0,40,20 +86,Y-PQ,0,0,20,10,0,0 +87,Y-PQ,0,0,40,20,0,0 +88,Y-PQ,40,-30,0,0,0,0 +90,Y-I,0,0,40,-30,0,0 +92,Y-PQ,0,0,0,0,40,-30 +94,Y-PQ,40,20,0,0,0,0 +95,Y-PQ,0,0,20,10,0,0 +96,Y-PQ,0,0,20,10,0,0 +98,Y-PQ,40,20,0,0,0,0 +99,Y-PQ,0,0,40,20,0,0 +100,Y-Z,0,0,0,0,40,20 +102,Y-PQ,0,0,0,0,20,10 +103,Y-PQ,0,0,0,0,40,20 +104,Y-PQ,0,0,0,0,40,20 +106,Y-PQ,0,0,40,20,0,0 +107,Y-PQ,0,0,40,20,0,0 +109,Y-PQ,40,20,0,0,0,0 +111,Y-PQ,20,10,0,0,0,0 +112,Y-I,20,10,0,0,0,0 +113,Y-Z,40,20,0,0,0,0 +114,Y-PQ,20,10,0,0,0,0 diff --git a/src/test/resources/ieeeFeeder123/Tfo.csv b/src/test/resources/ieeeFeeder123/Tfo.csv new file mode 100644 index 0000000000..7cc8d7f924 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Tfo.csv @@ -0,0 +1 @@ +NodeA,NodeB,Config \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder123/TfoConfig.csv b/src/test/resources/ieeeFeeder123/TfoConfig.csv new file mode 100644 index 0000000000..af208d5f88 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/TfoConfig.csv @@ -0,0 +1 @@ +Config,SkVA,kV-high,Winding-high,kV-low,Winding-low,R,X diff --git a/src/test/resources/ieeeFeeder13/Bus.csv b/src/test/resources/ieeeFeeder13/Bus.csv new file mode 100644 index 0000000000..048c44ba55 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Bus.csv @@ -0,0 +1,13 @@ +BusName,UNom +650,4.16 +632,4.16 +633,4.16 +634,0.48 +645,4.16 +646,4.16 +684,4.16 +611,4.16 +652,4.16 +680,4.16 +675,4.16 +671,4.16 diff --git a/src/test/resources/ieeeFeeder13/DistributedLoad.csv b/src/test/resources/ieeeFeeder13/DistributedLoad.csv new file mode 100644 index 0000000000..1462655e5d --- /dev/null +++ b/src/test/resources/ieeeFeeder13/DistributedLoad.csv @@ -0,0 +1,2 @@ +NodeA,NodeB,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +632,671,Y-PQ,17,10,66,38,117,68 diff --git a/src/test/resources/ieeeFeeder13/Gen.csv b/src/test/resources/ieeeFeeder13/Gen.csv new file mode 100644 index 0000000000..19dfc82448 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Gen.csv @@ -0,0 +1,2 @@ +GenName,busName,SetPoint +G650,650,1.0 diff --git a/src/test/resources/ieeeFeeder13/Line.csv b/src/test/resources/ieeeFeeder13/Line.csv new file mode 100644 index 0000000000..9e1ad5d5e3 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Line.csv @@ -0,0 +1,11 @@ +NodeA,NodeB,Length,Config +632,645,500,603 +632,633,500,602 +645,646,300,603 +650,632,2000,601 +684,652,800,607 +632,671,2000,601 +671,684,300,604 +671,680,1000,601 +684,611,300,605 +671,675,500,606 diff --git a/src/test/resources/ieeeFeeder13/LineConfig.csv b/src/test/resources/ieeeFeeder13/LineConfig.csv new file mode 100644 index 0000000000..e3cee9907f --- /dev/null +++ b/src/test/resources/ieeeFeeder13/LineConfig.csv @@ -0,0 +1,8 @@ +Config,PhaseA,PhaseB,PhaseC,r11,x11,r12,x12,r13,x13,r22,x22,r23,x23,r33,x33,b11,b12,b13,b22,b23,b33 +601,1,1,1,0.3465,1.0179,0.1560,0.5017,0.1580,0.4236,0.3375,1.0478,0.1535,0.3849,0.3414,1.0348,6.2998,-1.9958,-1.2595,5.9597,-0.7417,5.6386 +602,1,1,1,0.7526,1.1814,0.1580,0.4236,0.1560,0.5017,0.7475,1.1983,0.1535,0.3849,0.7436,1.2112,5.6990,-1.0817,-1.6905,5.1795,-0.6588,5.4246 +603,0,1,1,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.3294,1.3471,0.2066,0.4591,1.3238,1.3569,0.0000,0.0000,0.0000,4.7097,-0.8999,4.6658 +604,1,0,1,1.3238,1.3569,0.0000,0.0000,0.2066,0.4591,0.0000,0.0000,0.0000,0.0000,1.3294,1.3471,4.6658,0.0000,-0.8999,0.0000,0.0000,4.7097 +605,0,0,1,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.3292,1.3475,0.0000,0.0000,0.0000,0.0000,0.0000,4.5193 +606,1,1,1,0.7982,0.4463,0.3192,0.0328,0.2849,-0.0143,0.7891,0.4041,0.3192,0.0328,0.7982,0.4463,96.8897,0.0000,0.0000,96.8897,0.0000,96.8897 +607,1,0,0,1.3425,0.5124,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,88.9912,0.0000,0.0000,0.0000,0.0000,0.0000 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder13/Regulator.csv b/src/test/resources/ieeeFeeder13/Regulator.csv new file mode 100644 index 0000000000..8fa3bf4830 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Regulator.csv @@ -0,0 +1,2 @@ +Line,RhoA,RhoB,RhoC +650-632,1.0625,1.05,1.0687 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder13/SpotLoad.csv b/src/test/resources/ieeeFeeder13/SpotLoad.csv new file mode 100644 index 0000000000..7c49850bcd --- /dev/null +++ b/src/test/resources/ieeeFeeder13/SpotLoad.csv @@ -0,0 +1,10 @@ +Node,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +634,Y-PQ,160,110,120,90,120,90 +645,Y-PQ,0,0,170,125,0,0 +646,D-Z,0,0,230,132,0,0 +652,Y-Z,128,86,0,0,0,0 +671,D-PQ,385,220,385,220,555,371 +675,Y-PQ,485,190,68,60,290,212 +675,Y-Z,0,-200,0,-200,0,-200 +611,Y-I,0,0,0,0,170,80 +611,Y-Z,0,0,0,0,0,-100 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder13/Tfo.csv b/src/test/resources/ieeeFeeder13/Tfo.csv new file mode 100644 index 0000000000..50122c84ac --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Tfo.csv @@ -0,0 +1,2 @@ +NodeA,NodeB,Config +633,634,XFM-1 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder13/TfoConfig.csv b/src/test/resources/ieeeFeeder13/TfoConfig.csv new file mode 100644 index 0000000000..b9f8c2ff30 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/TfoConfig.csv @@ -0,0 +1,3 @@ +Config,SkVA,kV-high,Winding-high,kV-low,Winding-low,R,X +Substation,5000,115,D,4.16,Gr.Y,1,8 +XFM-1,500,4.16,Gr.W,0.48,Gr.W,1.1,2 diff --git a/src/test/resources/ieeeFeeder34/Bus.csv b/src/test/resources/ieeeFeeder34/Bus.csv new file mode 100644 index 0000000000..c41c848a80 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Bus.csv @@ -0,0 +1,35 @@ +BusName,UNom +800,24.9 +802,24.9 +806,24.9 +808,24.9 +810,24.9 +812,24.9 +814,24.9 +850,24.9 +816,24.9 +818,24.9 +820,24.9 +822,24.9 +824,24.9 +826,24.9 +828,24.9 +830,24.9 +832,24.9 +834,24.9 +836,24.9 +840,24.9 +842,24.9 +844,24.9 +846,24.9 +848,24.9 +852,24.9 +854,24.9 +856,24.9 +858,24.9 +864,24.9 +860,24.9 +862,24.9 +838,24.9 +888,4.16 +890,4.16 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/DistributedLoad.csv b/src/test/resources/ieeeFeeder34/DistributedLoad.csv new file mode 100644 index 0000000000..81aa998ff6 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/DistributedLoad.csv @@ -0,0 +1,19 @@ +NodeA,NodeB,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +802,806,Y-PQ,0,0,30,15,25,14 +808,810,Y-I,0,0,16,8,0,0 +818,820,Y-Z,34,17,0,0,0,0 +820,822,Y-PQ,135,70,0,0,0,0 +816,824,D-I,0,0,5,2,0,0 +824,826,Y-I,0,0,40,20,4,2 +828,830,Y-PQ,7,3,0,0,0,0 +854,856,Y-PQ,0,0,4,2,0,0 +832,858,D-PQ,7,3,2,1,6,3 +858,864,Y-PQ,2,1,0,0,0,0 +858,834,D-PQ,4,2,15,8,13,7 +834,860,D-Z,16,8,20,10,110,55 +860,836,D-PQ,30,15,10,6,42,22 +836,840,D-I,18,9,22,11,0,0 +862,838,Y-PQ,0,0,28,14,0,0 +842,844,Y-PQ,9,5,0,0,0,0 +844,846,Y-PQ,0,0,25,12,20,11 +846,848,Y-PQ,0,0,23,11,0,0 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/Gen.csv b/src/test/resources/ieeeFeeder34/Gen.csv new file mode 100644 index 0000000000..5e5fce36a7 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Gen.csv @@ -0,0 +1,2 @@ +GenName,busName,SetPoint +G800,800,1.05 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/Line.csv b/src/test/resources/ieeeFeeder34/Line.csv new file mode 100644 index 0000000000..46d005d707 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Line.csv @@ -0,0 +1,33 @@ +NodeA,NodeB,Length,Config +800,802,2580,300 +802,806,1730,300 +806,808,32230,300 +808,810,5804,303 +808,812,37500,300 +812,814,29730,300 +814,850,10,301 +816,818,1710,302 +816,824,10210,301 +818,820,48150,302 +820,822,13740,302 +824,826,3030,303 +824,828,840,301 +828,830,20440,301 +830,854,520,301 +832,858,4900,301 +834,860,2020,301 +834,842,280,301 +836,840,860,301 +836,862,280,301 +842,844,1350,301 +844,846,3640,301 +846,848,530,301 +850,816,310,301 +852,832,10,301 +854,856,23330,303 +854,852,36830,301 +858,864,1620,302 +858,834,5830,301 +860,836,2680,301 +862,838,4860,304 +888,890,10560,300 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/LineConfig.csv b/src/test/resources/ieeeFeeder34/LineConfig.csv new file mode 100644 index 0000000000..50858fe88d --- /dev/null +++ b/src/test/resources/ieeeFeeder34/LineConfig.csv @@ -0,0 +1,6 @@ +Config,PhaseA,PhaseB,PhaseC,r11,x11,r12,x12,r13,x13,r22,x22,r23,x23,r33,x33,b11,b12,b13,b22,b23,b33 +300,1,1,1,1.3368,1.3343,0.2101,0.5779,0.2130,0.5015,1.3238,1.3569,0.2066,0.4591,1.3294,1.3471,5.3350,-1.5313,-0.9943,5.0979,-0.6212,4.8880 +301,1,1,1,1.9300,1.4115,0.2327,0.6442,0.2359,0.5691,1.9157,1.4281,0.2288,0.5238,1.9219,1.4209,5.1207,-1.4364,-0.9402,4.9055,-0.5951,4.7154 +302,1,0,0,2.7995,1.4855,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.2251,0.0000,0.0000,0.0000,0.0000,0.0000 +303,0,1,0,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,2.7995,1.4855,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.2251,0.0000,0.0000 +304,0,1,0,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.9217,1.4212,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.3637,0.0000,0.0000 diff --git a/src/test/resources/ieeeFeeder34/Regulator.csv b/src/test/resources/ieeeFeeder34/Regulator.csv new file mode 100644 index 0000000000..f1b24d136b --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Regulator.csv @@ -0,0 +1,3 @@ +Line,RhoA,RhoB,RhoC +814-850,1.075,1.03117,1.03133 +852-832,1.0812,1.0687,1.075 diff --git a/src/test/resources/ieeeFeeder34/SpotLoad.csv b/src/test/resources/ieeeFeeder34/SpotLoad.csv new file mode 100644 index 0000000000..84f9f6f194 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/SpotLoad.csv @@ -0,0 +1,7 @@ +Node,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +860,Y-PQ,20,16,20,16,20,16 +840,Y-I,9,7,9,7,9,7 +844,Y-Z,135,5,135,5,135,5 +848,D-PQ,20,-134,20,-134,20,-134 +890,D-I,150,75,150,75,150,75 +830,D-Z,10,5,10,5,25,10 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/Tfo.csv b/src/test/resources/ieeeFeeder34/Tfo.csv new file mode 100644 index 0000000000..b531a06915 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Tfo.csv @@ -0,0 +1,2 @@ +NodeA,NodeB,Config +832,888,XFM-1 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/TfoConfig.csv b/src/test/resources/ieeeFeeder34/TfoConfig.csv new file mode 100644 index 0000000000..63035a3040 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/TfoConfig.csv @@ -0,0 +1,3 @@ +Config,SkVA,kV-high,Winding-high,kV-low,Winding-low,R,X +Substation,2500,69,D,24.9,Gr.W,1,8 +XFM-1,500,24.9,Gr.W,4.16,Gr.W,1.9,4.08 \ No newline at end of file diff --git a/src/test/resources/lvFeeder/Buscoords.csv b/src/test/resources/lvFeeder/Buscoords.csv new file mode 100644 index 0000000000..623890f156 --- /dev/null +++ b/src/test/resources/lvFeeder/Buscoords.csv @@ -0,0 +1,908 @@ +#Bus Coordinates,, +Busname, x, y +1,390872.663,392887.379 +2,390871.596,392887.638 +3,390871.481,392887.643 +4,390871.379,392887.608 +5,390871.305,392887.55 +6,390871.234,392887.42 +7,390868.779,392877.637 +8,390868.753,392877.186 +9,390868.753,392876.81 +10,390868.804,392876.484 +11,390868.904,392876.259 +12,390869.079,392876.108 +13,390869.18,392876.008 +14,390869.5,392875.857 +15,390872.292,392875.208 +16,390872.314,392875.302 +17,390875.678,392874.422 +18,390872.316,392875.346 +19,390875.907,392874.353 +20,390872.312,392875.392 +21,390876.142,392874.223 +22,390872.303,392875.433 +23,390876.44,392873.903 +24,390872.288,392875.482 +25,390877.003,392873.341 +26,390872.263,392875.532 +27,390880.364,392878.196 +28,390884.19,392866.433 +29,390872.239,392875.581 +30,390881.306,392879.522 +31,390879.232,392879.305 +32,390886.111,392864.602 +33,390872.17,392875.71 +34,390885,392880 +35,390879.208,392879.353 +36,390890.1695,392868.642 +37,390891.919,392859.065 +38,390872.092,392875.822 +39,390879.183,392879.426 +40,390890.444,392868.351 +41,390891.41,392869.955 +42,390895.963,392855.237 +43,390891.775,392858.903 +44,390872.073,392875.85 +45,390879.159,392879.522 +46,390890.571,392868.223 +47,390893,392874 +48,390899.026,392852.352 +49,390891.742,392858.804 +50,390872.038,392875.883 +51,390879.159,392879.763 +52,390890.754,392868.168 +53,390899.475,392851.944 +54,390899.491,392852.791 +55,390891.759,392858.689 +56,390871.964,392875.93 +57,390879.232,392879.956 +58,390890.936,392868.168 +59,390901.469,392850.053 +60,390899.548,392852.823 +61,390891.775,392858.59 +62,390871.892,392875.96 +63,390879.907,392880.679 +64,390891.045,392868.168 +65,390901.87,392849.664 +66,390907.23,392855.97 +67,390899.618,392852.847 +68,390891.825,392858.508 +69,390871.812,392875.983 +70,390881,392884 +71,390891.246,392868.241 +72,390906.932,392845.428 +73,390907,392860 +74,390907,392860 +75,390899.793,392852.887 +76,390891.972,392858.324 +77,390871.436,392876.083 +78,390892.048,392868.97 +79,390908.613,392843.857 +80,390899.889,392852.926 +81,390892.512,392857.808 +82,390870.935,392876.183 +83,390896,392870 +84,390909.025,392843.57 +85,390899.982,392852.987 +86,390893.558,392856.82 +87,390870.634,392876.259 +88,390909.878,392843.014 +89,390900.06,392853.057 +90,390893.775,392856.555 +91,390870.525,392876.285 +92,390910.741,392842.593 +93,390893.803,392856.496 +94,390870.492,392876.296 +95,390911.23,392842.324 +96,390893.8,392856.41 +97,390870.458,392876.31 +98,390911.556,392842.152 +99,390893.781,392856.378 +100,390870.383,392876.359 +101,390911.997,392841.898 +102,390890.706,392852.332 +103,390870.157,392876.534 +104,390912.282,392841.942 +105,390912.282,392841.72 +106,390890.64,392852.121 +107,390912.63,392841.967 +108,390912.43,392841.6 +109,390890.511,392851.689 +110,390913.032,392842.011 +111,390917.463,392836.015 +112,390883.277,392842.144 +113,390913.637,392842.13 +114,390918.004,392835.491 +115,390876.523,392833.895 +116,390914.4,392842.345 +117,390918.765,392836.293 +118,390915.488,392832.839 +119,390875.778,392833.236 +120,390914.924,392842.567 +121,390918.949,392836.229 +122,390919.135,392836.684 +123,390910.895,392828.11 +124,390875.199,392832.8 +125,390915.64,392842.933 +126,390919.115,392836.199 +127,390920.876,392838.518 +128,390908.834,392825.979 +129,390874.662,392832.48 +130,390916.403,392843.351 +131,390919.234,392836.205 +132,390923.576,392835.814 +133,390925.817,392843.725 +134,390908.271,392825.3 +135,390872.865,392831.803 +136,390917.072,392843.826 +137,390919.412,392836.253 +138,390923.799,392835.572 +139,390929.524,392847.569 +140,390907.615,392824.551 +141,390871.466,392831.607 +142,390918.076,392844.727 +143,390919.608,392836.348 +144,390923.973,392835.3 +145,390932.015,392850.135 +146,390907.053,392823.802 +147,390871.226,392831.623 +148,390922.542,392849.331 +149,390919.762,392836.466 +150,390924.07,392835.058 +151,390934.503,392852.697 +152,390935.584,392846.448 +153,390906.491,392822.865 +154,390871.173,392831.687 +155,390923.521,392850.328 +156,390919.905,392836.632 +157,390924.128,392834.671 +158,390941.046,392859.545 +159,390935.817,392846.24 +160,390906.35,392822.584 +161,390871.128,392831.801 +162,390915.061,392858.471 +163,390927.222,392854.1 +164,390920.012,392836.805 +165,390924.169,392834.201 +166,390943.336,392861.907 +167,390935.995,392846.017 +168,390905.502,392821.012 +169,390871.1,392832.049 +170,390913.478,392860.025 +171,390931.986,392859.25 +172,390920.077,392836.965 +173,390924.246,392833.853 +174,390946.01,392864.771 +175,390946.317,392858.942 +176,390936.05,392845.912 +177,390905.189,392820.053 +178,390910,392863 +179,390932.788,392860.118 +180,390930.205,392860.892 +181,390920.101,392837.143 +182,390924.411,392833.475 +183,390946.422,392865.19 +184,390946.618,392858.602 +185,390936.119,392845.666 +186,390905.022,392819.323 +187,390935.932,392863.545 +188,390923.046,392867.911 +189,390920.095,392837.297 +190,390924.644,392833.165 +191,390948.046,392866.84 +192,390946.652,392865.034 +193,390946.84,392858.223 +194,390936.242,392845.027 +195,390904.938,392818.655 +196,390941.568,392869.643 +197,390921.647,392869.283 +198,390923.824,392868.734 +199,390920.042,392837.481 +200,390924.934,392832.865 +201,390948.693,392867.51 +202,390946.807,392864.979 +203,390946.971,392857.897 +204,390936.288,392844.648 +205,390905.001,392817.821 +206,390939.128,392871.786 +207,390943.019,392871.212 +208,390917,392871 +209,390923.916,392868.865 +210,390919.804,392837.861 +211,390925.39,392832.419 +212,390946.962,392864.97 +213,390947.023,392857.622 +214,390936.388,392844.4 +215,390905.251,392816.298 +216,390931.512,392879.201 +217,390945.597,392874.081 +218,390923.961,392868.986 +219,390919.412,392838.407 +220,390926.643,392831.209 +221,390947.126,392865.015 +222,390947.089,392857.034 +223,390936.61,392843.936 +224,390905.69,392815.026 +225,390927,392880 +226,390946.519,392875.104 +227,390923.967,392869.089 +228,390926.75,392831.106 +229,390947.326,392865.134 +230,390947.18,392856.577 +231,390936.749,392843.721 +232,390906.065,392814.191 +233,390937.556,392882.924 +234,390947.273,392875.942 +235,390923.916,392869.238 +236,390926.805,392831.065 +237,390947.49,392865.261 +238,390947.287,392856.272 +239,390936.874,392843.589 +240,390906.399,392813.691 +241,390936.301,392884.111 +242,390923.807,392869.387 +243,390926.875,392831.043 +244,390947.59,392865.397 +245,390947.457,392855.998 +246,390938.352,392842.126 +247,390907.213,392812.685 +248,390931,392884 +249,390931,392884 +250,390923.606,392869.587 +251,390926.945,392831.047 +252,390947.626,392865.525 +253,390947.784,392855.658 +254,390938.796,392841.703 +255,390910.805,392815.497 +256,390907.752,392812.019 +257,390922.855,392870.303 +258,390927.019,392831.072 +259,390947.635,392865.698 +260,390949.052,392854.417 +261,390938.914,392841.633 +262,390911.309,392815.876 +263,390909.871,392809.604 +264,390921,392875 +265,390927.156,392831.157 +266,390947.599,392865.889 +267,390949.358,392854.138 +268,390936.706,392838.972 +269,390939.032,392841.62 +270,390911.514,392816.081 +271,390913.165,392812.297 +272,390910.583,392808.793 +273,390927.282,392831.268 +274,390947.508,392866.043 +275,390949.516,392854.033 +276,390935,392836 +277,390939.171,392841.613 +278,390911.683,392816.381 +279,390913.42,392812.472 +280,390913.173,392805.861 +281,390927.695,392831.755 +282,390947.071,392866.462 +283,390949.636,392853.999 +284,390939.296,392841.627 +285,390911.851,392816.885 +286,390913.648,392812.586 +287,390914.334,392804.546 +288,390912.467,392805.282 +289,390931,392831 +290,390946.507,392867.044 +291,390949.096,392853.309 +292,390949.744,392853.995 +293,390939.414,392841.675 +294,390912.001,392817.334 +295,390913.996,392812.686 +296,390914.839,392803.916 +297,390909.292,392803.146 +298,390948.848,392852.992 +299,390949.819,392854.01 +300,390939.539,392841.731 +301,390912.188,392817.651 +302,390915.584,392813.037 +303,390918.269,392799.909 +304,390908.726,392802.519 +305,390948.3925,392852.4855 +306,390949.898,392854.051 +307,390940.115,392842.278 +308,390912.454,392818.024 +309,390915.882,392813.133 +310,390918.529,392799.613 +311,390908.548,392802.302 +312,390947.472,392851.557 +313,390950.032,392854.156 +314,390943,392844 +315,390912.783,392818.365 +316,390916.093,392813.229 +317,390919.05,392800 +318,390923.291,392794.191 +319,390908.47,392802.178 +320,390946,392848 +321,390950.481,392854.63 +322,390913.191,392818.747 +323,390916.33,392813.352 +324,390921.636,392802.118 +325,390925.511,392791.533 +326,390908.408,392802.069 +327,390952,392853 +328,390913.426,392818.962 +329,390916.549,392813.501 +330,390922.556,392802.836 +331,390932.594,392797.299 +332,390929.7419,392786.3729 +333,390908.354,392801.937 +334,390914.512,392819.906 +335,390918.357,392814.966 +336,390924.531,392804.433 +337,390935,392800 +338,390934.963,392790.74 +339,390930.511,392785.435 +340,390908.323,392801.829 +341,390914.975,392820.221 +342,390923,392816 +343,390926.15,392805.742 +344,390923.88,392805.165 +345,390937.605,392792.915 +346,390931.168,392784.63 +347,390908.308,392801.736 +348,390915.149,392820.308 +349,390929,392807 +350,390923.819,392805.287 +351,390937.856,392793.111 +352,390931.703,392784.132 +353,390908.308,392801.651 +354,390915.29,392820.348 +355,390923.758,392805.422 +356,390937.949,392793.204 +357,390932.46,392783.603 +358,390908.315,392801.581 +359,390915.397,392820.355 +360,390923.744,392805.551 +361,390938.005,392793.278 +362,390932.953,392783.3 +363,390908.339,392801.503 +364,390915.451,392820.348 +365,390923.772,392805.686 +366,390938.024,392793.371 +367,390933.748,392782.903 +368,390908.385,392801.426 +369,390915.511,392820.295 +370,390923.86,392805.862 +371,390938.024,392793.483 +372,390934.599,392782.657 +373,390908.689,392801.043 +374,390915.592,392820.188 +375,390924.022,392806.038 +376,390938.005,392793.623 +377,390935.584,392782.524 +378,390910.98,392798.157 +379,390907.282,392801.155 +380,390915.907,392819.679 +381,390925.152,392806.998 +382,390937.968,392793.744 +383,390936.303,392782.505 +384,390913.208,392795.42 +385,390898.776,392802.817 +386,390906.36,392802.282 +387,390918,392819 +388,390926,392812 +389,390937.912,392793.827 +390,390937.155,392782.6 +391,390913.3067,392795.2978 +392,390895.655,392803.358 +393,390901.454,392808.389 +394,390937.791,392793.949 +395,390938.366,392782.884 +396,390910.051,392792.872 +397,390915.116,392793.058 +398,390895.344,392803.443 +399,390901.096,392808.831 +400,390937.344,392794.349 +401,390939.237,392783.187 +402,390909.746,392792.659 +403,390916.015,392791.999 +404,390895.119,392803.443 +405,390900.933,392809.018 +406,390937,392798 +407,390940.013,392783.622 +408,390909.563,392792.553 +409,390918.607,392788.706 +410,390915.753,392791.725 +411,390894.893,392803.386 +412,390900.791,392809.106 +413,390940.732,392784.113 +414,390909.433,392792.492 +415,390922.398,392784.096 +416,390915.69,392791.654 +417,390894.074,392802.85 +418,390900.539,392809.227 +419,390941.549,392784.768 +420,390909.212,392792.415 +421,390923.197,392783.136 +422,390915.654,392791.598 +423,390893.905,392802.681 +424,390897.659,392810.609 +425,390942.91,392785.874 +426,390942.91,392785.874 +427,390908.473,392792.172 +428,390923.398,392782.888 +429,390915.626,392791.52 +430,390893.792,392802.483 +431,390896.587,392810.976 +432,390947.433,392789.686 +433,390947.433,392789.686 +434,390907.642,392791.928 +435,390923.491,392782.749 +436,390915.619,392791.449 +437,390893.764,392802.258 +438,390896.22,392811.089 +439,390953.846,392795.059 +440,390953.846,392795.059 +441,390907.177,392791.783 +442,390923.553,392782.625 +443,390915.619,392791.371 +444,390893.82,392802.004 +445,390895.542,392811.117 +446,390958.463,392798.896 +447,390958.463,392798.896 +448,390906.751,392791.616 +449,390923.584,392782.517 +450,390915.633,392791.293 +451,390894.441,392801.355 +452,390894.949,392811.145 +453,390959.827,392800.103 +454,390959.827,392800.103 +455,390906.364,392791.414 +456,390923.6,392782.346 +457,390915.654,392791.243 +458,390894,392797 +459,390894.3,392810.976 +460,390963.865,392803.674 +461,390963.865,392803.674 +462,390957.305,392802.791 +463,390905.762,392791.025 +464,390923.584,392782.192 +465,390915.683,392791.215 +466,390893.764,392810.637 +467,390968.351,392807.642 +468,390968.351,392807.642 +469,390964.469,392803.03 +470,390956.915,392803.162 +471,390905.366,392790.721 +472,390923.538,392782.052 +473,390915.718,392791.18 +474,390891.2225,392808.691 +475,390970.015,392809.073 +476,390970.015,392809.073 +477,390956.693,392803.354 +478,390905.122,392790.469 +479,390923.476,392781.898 +480,390915.775,392791.151 +481,390891.138,392808.521 +482,390973.535,392812.101 +483,390973.535,392812.101 +484,390963.033,392816.614 +485,390956.52,392803.452 +486,390905.015,392790.34 +487,390923.352,392781.774 +488,390915.881,392791.116 +489,390891.11,392808.352 +490,390978.625,392816.388 +491,390978.625,392816.388 +492,390962.663,392817.058 +493,390965.49,392819.862 +494,390956.242,392803.57 +495,390904.962,392790.248 +496,390923.073,392781.511 +497,390916.016,392791.08 +498,390891.166,392808.126 +499,390981.879,392818.818 +500,390981.879,392818.818 +501,390962.507,392817.246 +502,390964,392822 +503,390955.804,392803.705 +504,390904.939,392790.18 +505,390916.237,392776.136 +506,390916.108,392791.052 +507,390891.336,392807.872 +508,390982.421,392819.26 +509,390982.421,392819.26 +510,390962.384,392817.32 +511,390955.501,392803.823 +512,390904.924,392790.081 +513,390912.695,392780.428 +514,390915.185,392775.311 +515,390916.186,392791.017 +516,390983.883,392820.451 +517,390983.883,392820.451 +518,390979.167,392822.695 +519,390962.253,392817.337 +520,390955.316,392803.946 +521,390904.932,392790.005 +522,390908,392779 +523,390914.619,392774.864 +524,390916.242,392790.981 +525,390985.003,392821.271 +526,390985.003,392821.271 +527,390977.209,392824.691 +528,390962.138,392817.312 +529,390955.18,392804.057 +530,390905.076,392789.479 +531,390914.548,392774.783 +532,390916.278,392790.932 +533,390986.567,392822.332 +534,390986.567,392822.332 +535,390975.743,392826.352 +536,390962.023,392817.271 +537,390954.784,392804.457 +538,390903.887,392790.99 +539,390904,392784 +540,390914.494,392774.721 +541,390916.292,392790.868 +542,390987.709,392823.028 +543,390987.709,392823.028 +544,390975.138,392827.039 +545,390961.735,392817.041 +546,390951.688,392807.795 +547,390902.523,392792.617 +548,390914.467,392774.649 +549,390916.278,392790.783 +550,390991,392824.805 +551,390991,392824.805 +552,390974.926,392827.234 +553,390977.781,392829.754 +554,390961.464,392816.787 +555,390951.538,392807.965 +556,390897,392791 +557,390914.449,392774.569 +558,390916.242,392790.733 +559,390993.403,392826.054 +560,390993.403,392826.054 +561,390974.831,392827.281 +562,390976,392832 +563,390958,392817 +564,390951.458,392808.125 +565,390914.458,392774.497 +566,390916.157,392790.648 +567,390993.936,392826.331 +568,390993.936,392826.331 +569,390991.104,392829.14 +570,390974.676,392827.311 +571,390951.428,392808.325 +572,390914.476,392774.425 +573,390994.064,392826.393 +574,390994.064,392826.393 +575,390990.836,392829.546 +576,390974.581,392827.311 +577,390951.428,392808.505 +578,390914.701,392774.115 +579,390997.536,392828.07 +580,390997.536,392828.07 +581,390993.888,392826.66 +582,390990.662,392829.86 +583,390974.467,392827.299 +584,390951.458,392808.71 +585,390910.991,392771.178 +586,390915.202,392773.458 +587,390999.985,392829.212 +588,390999.985,392829.212 +589,390993.812,392826.748 +590,390990.534,392830.185 +591,390974.378,392827.252 +592,390951.553,392808.9 +593,390910.777,392771.009 +594,390917.646,392770.357 +595,391004.98,392831.301 +596,391000.5776,392829.4599 +597,390993.745,392826.807 +598,390989.572,392833.322 +599,390973.854,392826.853 +600,390951.713,392809.099 +601,390910.657,392770.943 +602,390910.518,392764.593 +603,390920.545,392766.731 +604,391009.465,392833.089 +605,391009.465,392833.089 +606,391000.5776,392829.4599 +607,390996.172,392840.26 +608,390996.172,392840.26 +609,390993.64,392826.841 +610,390989.096,392834.773 +611,390969,392827 +612,390951.838,392809.199 +613,390910.547,392770.91 +614,390909,392760 +615,390923.419,392763.338 +616,391008.023,392836.745 +617,391012.375,392834.183 +618,391012.375,392834.183 +619,390996,392843 +620,390993.577,392826.832 +621,390988.794,392835.423 +622,390952.418,392809.569 +623,390910.454,392770.899 +624,390922.171,392762.286 +625,390924.232,392762.387 +626,391006.125,392841.751 +627,390993.509,392826.794 +628,390988.562,392835.841 +629,390954,392812 +630,390910.307,392770.899 +631,390921.888,392762.003 +632,390924.414,392762.164 +633,391005.565,392843.218 +634,390993.467,392826.744 +635,390988.132,392836.432 +636,390909.959,392770.941 +637,390921.726,392761.781 +638,390924.515,392762.063 +639,391002,392847 +640,390993.45,392826.677 +641,390987.226,392837.535 +642,390909.718,392770.968 +643,390921.524,392761.458 +644,390924.636,392761.963 +645,390993.459,392826.609 +646,390986.947,392837.814 +647,390909.412,392771.006 +648,390921.12,392760.65 +649,390924.798,392761.882 +650,390993.492,392826.521 +651,390986.866,392837.895 +652,390909.225,392771.017 +653,390920.797,392760.044 +654,390924.98,392761.862 +655,390993.551,392826.412 +656,390986.773,392837.93 +657,390987.307,392838.185 +658,390909.056,392771.023 +659,390920.534,392759.64 +660,390925.182,392761.882 +661,390993.787,392826.134 +662,390986.68,392837.93 +663,390987.923,392838.51 +664,390908.771,392771.012 +665,390920.231,392759.236 +666,390925.444,392762.018 +667,390993.989,392825.97 +668,390986.587,392837.907 +669,390990.478,392839.868 +670,390908.492,392770.984 +671,390919.948,392758.933 +672,390925.74,392761.64 +673,390926.091,392762.508 +674,390994.166,392825.873 +675,390986.018,392837.512 +676,390990,392841 +677,390908.361,392770.963 +678,390919.443,392758.468 +679,390925.919,392761.414 +680,390929.951,392765.901 +681,390994.528,392825.697 +682,390981,392837 +683,390908.218,392770.935 +684,390917.785,392756.994 +685,390926.062,392761.188 +686,390932.739,392768.301 +687,390908.087,392770.886 +688,390913,392755 +689,390926.169,392760.95 +690,390938.131,392762.197 +691,390940.702,392775.184 +692,390907.934,392770.815 +693,390926.216,392760.76 +694,390937.548,392761.707 +695,390939.539,392760.604 +696,390947.039,392768.131 +697,390942.352,392776.625 +698,390907.699,392770.684 +699,390926.24,392760.45 +700,390937.379,392761.539 +701,390943,392758 +702,390949,392763 +703,390944.148,392778.217 +704,390907.124,392770.224 +705,390926.204,392759.927 +706,390937.285,392761.418 +707,390948.941,392782.353 +708,390944.182,392778.111 +709,390906.396,392769.568 +710,390925.585,392756.048 +711,390937.231,392761.343 +712,390954.592,392787.288 +713,390951.513,392779.362 +714,390944.201,392778.008 +715,390906.33,392769.502 +716,390925.095,392752.863 +717,390937.197,392761.256 +718,390960.503,392792.29 +719,390951.779,392779.034 +720,390944.201,392777.911 +721,390906.287,392769.442 +722,390924.96,392751.851 +723,390937.177,392761.175 +724,390962.999,392794.377 +725,390966.597,392785.202 +726,390951.873,392778.903 +727,390944.188,392777.802 +728,390906.259,392769.376 +729,390924.892,392750.924 +730,390937.177,392761.081 +731,390966.383,392797.222 +732,390967.383,392784.225 +733,390951.956,392778.754 +734,390944.156,392777.718 +735,390906.248,392769.3 +736,390924.876,392750.418 +737,390937.191,392761.007 +738,390970.344,392800.554 +739,390967.79,392783.707 +740,390952.012,392778.624 +741,390944.072,392777.609 +742,390906.248,392769.229 +743,390924.892,392750.014 +744,390937.231,392760.926 +745,390973.519,392803.236 +746,390965.176,392781.034 +747,390967.869,392783.614 +748,390952.068,392778.466 +749,390943.95,392777.499 +750,390906.259,392769.163 +751,390924.96,392749.676 +752,390937.285,392760.845 +753,390974.708,392804.22 +754,390977.441,392798.798 +755,390965,392778 +756,390967.938,392783.559 +757,390952.106,392778.307 +758,390943.847,392777.429 +759,390906.303,392769.081 +760,390925.078,392749.289 +761,390937.393,392760.704 +762,390976.271,392805.664 +763,390980.72,392795.089 +764,390968.007,392783.531 +765,390952.134,392778.084 +766,390943.737,392777.377 +767,390906.369,392768.988 +768,390925.23,392748.952 +769,390938.215,392759.66 +770,390980.319,392808.983 +771,390978.194,392792.523 +772,390980.83,392795.019 +773,390968.132,392783.517 +774,390952.161,392777.776 +775,390943.66,392777.358 +776,390906.708,392768.567 +777,390925.5,392748.446 +778,390940,392756 +779,390983.29,392812.012 +780,390978,392789 +781,390980.951,392794.989 +782,390968.299,392783.573 +783,390952.189,392777.45 +784,390943.563,392777.358 +785,390906,392764 +786,390926.112,392747.463 +787,390985.762,392814.221 +788,390981.082,392794.959 +789,390968.41,392783.642 +790,390952.227,392777.236 +791,390943.473,392777.377 +792,390926.444,392747.366 +793,390924.179,392748.181 +794,390988.243,392815.901 +795,390981.202,392794.959 +796,390968.576,392783.781 +797,390952.283,392777.022 +798,390943.39,392777.416 +799,390926.734,392747.283 +800,390921.1,392749.367 +801,390988.444,392815.944 +802,390990.626,392817.377 +803,390981.333,392794.979 +804,390969.687,392784.793 +805,390952.311,392776.92 +806,390943.306,392777.506 +807,390926.982,392747.256 +808,390918.462,392750.361 +809,390988.65,392815.95 +810,390993.25,392818.98 +811,390993.25,392818.98 +812,390981.413,392795.009 +813,390973,392785 +814,390952.366,392776.761 +815,390943.035,392777.828 +816,390927.176,392747.256 +817,390917,392751 +818,390988.854,392815.918 +819,390995.557,392820.131 +820,390995.557,392820.131 +821,390981.524,392795.079 +822,390952.441,392776.622 +823,390942.694,392778.175 +824,390927.369,392747.297 +825,390989.048,392815.851 +826,390997.983,392821.471 +827,390997.983,392821.471 +828,390982.359,392795.763 +829,390952.581,392776.445 +830,390942.333,392778.516 +831,390927.535,392747.339 +832,390989.227,392815.749 +833,390999.996,392822.532 +834,390999.996,392822.532 +835,390986,392795 +836,390954.1,392774.61 +837,390927.645,392747.394 +838,390989.385,392815.617 +839,391002.28,392823.399 +840,391002.28,392823.399 +841,390954.732,392773.897 +842,390927.77,392747.463 +843,390989.516,392815.458 +844,391004.255,392819.014 +845,391005.615,392824.81 +846,391005.615,392824.81 +847,390955.053,392773.535 +848,390927.935,392747.601 +849,390989.5735,392815.3755 +850,391004.582,392818.391 +851,391009.67,392826.423 +852,391009.67,392826.423 +853,390955.134,392773.465 +854,390928.184,392747.849 +855,390990.602,392813.363 +856,391005.27,392816.532 +857,391016.001,392829.07 +858,391016.001,392829.07 +859,390955.204,392773.418 +860,390931,392748 +861,390935,392751 +862,390991.411,392812.136 +863,391006.257,392814.424 +864,391018.607,392830.063 +865,391018.607,392830.063 +866,390955.285,392773.378 +867,390991.997,392810.992 +868,391006.471,392814.211 +869,391020.304,392830.435 +870,391020.304,392830.435 +871,390955.355,392773.36 +872,390992.556,392809.765 +873,391006.765,392813.971 +874,391005.777,392813.73 +875,391021.504,392830.435 +876,391021.504,392830.435 +877,390955.425,392773.355 +878,390993.762,392807.804 +879,391007.112,392813.917 +880,391004.149,392812.61 +881,391022.496,392830.239 +882,391022.496,392830.239 +883,390955.495,392773.355 +884,390994.075,392807.334 +885,391007.646,392813.917 +886,391005,392808 +887,390955.564,392773.36 +888,390994.421,392806.816 +889,390992.316,392804.712 +890,391008.286,392814.131 +891,390956.756,392773.691 +892,390994.97,392805.953 +893,390990.811,392802.497 +894,391010.609,392815.358 +895,390952.377,392769.85 +896,390960,392774 +897,390995.113,392805.81 +898,390991,392798 +899,391014,392812 +900,390952,392766 +901,390995.257,392805.718 +902,390995.401,392805.718 +903,390995.584,392805.758 +904,390995.885,392805.914 +905,390996.355,392806.267 +906,391001,392805 diff --git a/src/test/resources/lvFeeder/LineCodes.csv b/src/test/resources/lvFeeder/LineCodes.csv new file mode 100644 index 0000000000..f603a0cd0f --- /dev/null +++ b/src/test/resources/lvFeeder/LineCodes.csv @@ -0,0 +1,12 @@ +# Line Codes defined by matrix values,,,,,,,, +Name,nphases,R1,X1,R0,X0,C1,C0,Units +2c_.007,3,3.97,0.099,3.97,0.099,0,0,km +2c_.0225,3,1.257,0.085,1.257,0.085,0,0,km +2c_16,3,1.15,0.088,1.2,0.088,0,0,km +35_SAC_XSC,3,0.868,0.092,0.76,0.092,0,0,km +4c_.06,3,0.469,0.075,1.581,0.091,0,0,km +4c_.1,3,0.274,0.073,0.959,0.079,0,0,km +4c_.35,3,0.089,0.0675,0.319,0.076,0,0,km +4c_185,3,0.166,0.068,0.58,0.078,0,0,km +4c_70,3,0.446,0.071,1.505,0.083,0,0,km +4c_95_SAC_XC,3,0.322,0.074,0.804,0.093,0,0,km diff --git a/src/test/resources/lvFeeder/Lines.csv b/src/test/resources/lvFeeder/Lines.csv new file mode 100644 index 0000000000..fa35170156 --- /dev/null +++ b/src/test/resources/lvFeeder/Lines.csv @@ -0,0 +1,907 @@ +# Line definitions ,,,,,, +Name,Bus1,Bus2,Phases,Length,Units,LineCode +LINE1,1,2,ABC,1.098,m,4c_70 +LINE2,2,3,ABC,0.11511,m,4c_70 +LINE3,3,4,ABC,0.10784,m,4c_70 +LINE4,4,5,ABC,0.094021,m,4c_70 +LINE5,5,6,ABC,0.14812,m,4c_70 +LINE6,6,7,ABC,10.0863,m,4c_70 +LINE7,7,8,ABC,0.45175,m,4c_70 +LINE8,8,9,ABC,0.376,m,4c_70 +LINE9,9,10,ABC,0.32997,m,4c_70 +LINE10,10,11,ABC,0.24622,m,4c_70 +LINE11,11,12,ABC,0.23114,m,4c_70 +LINE12,12,13,ABC,0.14213,m,4c_70 +LINE13,13,14,ABC,0.35384,m,4c_70 +LINE14,14,15,ABC,2.8664,m,4c_70 +LINE15,15,16,ABC,0.09654,m,2c_.007 +LINE16,15,17,ABC,3.476,m,4c_70 +LINE17,16,18,ABC,0.044045,m,2c_.007 +LINE18,17,19,ABC,0.23917,m,4c_70 +LINE19,18,20,ABC,0.046174,m,2c_.007 +LINE20,19,21,ABC,0.26856,m,4c_70 +LINE21,20,22,ABC,0.041976,m,2c_.007 +LINE22,21,23,ABC,0.43727,m,4c_70 +LINE23,22,24,ABC,0.051245,m,2c_.007 +LINE24,23,25,ABC,0.7955,m,4c_70 +LINE25,24,26,ABC,0.055902,m,2c_.007 +LINE26,25,27,ABC,5.9049,m,2c_16 +LINE27,25,28,ABC,9.9686,m,4c_70 +LINE28,26,29,ABC,0.054562,m,2c_.007 +LINE29,27,30,ABC,1.6265,m,2c_16 +LINE30,27,31,ABC,1.5847,m,2c_16 +LINE31,28,32,ABC,2.6538,m,4c_70 +LINE32,29,33,ABC,0.14629,m,2c_.007 +LINE33,30,34,ABC,3.7248,m,2c_16 +LINE34,31,35,ABC,0.053666,m,2c_16 +LINE35,32,36,ABC,5.7265,m,2c_16 +LINE36,32,37,ABC,8.0244,m,4c_70 +LINE37,33,38,ABC,0.13648,m,2c_.007 +LINE38,35,39,ABC,0.077162,m,2c_16 +LINE39,36,40,ABC,0.40004,m,2c_16 +LINE40,36,41,ABC,1.8063,m,2c_16 +LINE41,37,42,ABC,5.5684,m,4c_70 +LINE42,37,43,ABC,0.21675,m,4c_185 +LINE43,38,44,ABC,0.033838,m,2c_.007 +LINE44,39,45,ABC,0.098955,m,2c_16 +LINE45,40,46,ABC,0.18031,m,2c_16 +LINE46,41,47,ABC,4.3463,m,2c_16 +LINE47,42,48,ABC,4.2078,m,4c_70 +LINE48,43,49,ABC,0.10436,m,4c_185 +LINE49,44,50,ABC,0.048104,m,2c_.007 +LINE50,45,51,ABC,0.241,m,2c_16 +LINE51,46,52,ABC,0.19109,m,2c_16 +LINE52,48,53,ABC,0.60668,m,4c_70 +LINE53,48,54,ABC,0.63949,m,4c_70 +LINE54,49,55,ABC,0.11625,m,4c_185 +LINE55,50,56,ABC,0.087664,m,2c_.007 +LINE56,51,57,ABC,0.20634,m,2c_16 +LINE57,52,58,ABC,0.182,m,2c_16 +LINE58,53,59,ABC,2.7481,m,4c_70 +LINE59,54,60,ABC,0.065368,m,4c_70 +LINE60,55,61,ABC,0.10028,m,4c_185 +LINE61,56,62,ABC,0.078,m,2c_.007 +LINE62,57,63,ABC,0.98912,m,2c_16 +LINE63,58,64,ABC,0.109,m,2c_16 +LINE64,59,65,ABC,0.55868,m,4c_70 +LINE65,59,66,ABC,8.2583,m,2c_16 +LINE66,60,67,ABC,0.074,m,4c_70 +LINE67,61,68,ABC,0.096042,m,4c_185 +LINE68,62,69,ABC,0.083241,m,2c_.007 +LINE69,63,70,ABC,3.4962,m,2c_16 +LINE70,64,71,ABC,0.21385,m,2c_16 +LINE71,65,72,ABC,6.6006,m,4c_70 +LINE72,66,73,ABC,4.0366,m,2c_16 +LINE73,66,74,ABC,4.0366,m,2c_16 +LINE74,67,75,ABC,0.17951,m,4c_70 +LINE75,68,76,ABC,0.23551,m,4c_185 +LINE76,69,77,ABC,0.38907,m,2c_.007 +LINE77,71,78,ABC,1.0838,m,2c_16 +LINE78,72,79,ABC,2.3008,m,4c_70 +LINE79,75,80,ABC,0.10362,m,4c_70 +LINE80,76,81,ABC,0.7469,m,4c_185 +LINE81,77,82,ABC,0.51088,m,2c_.007 +LINE82,78,83,ABC,4.084,m,2c_16 +LINE83,79,84,ABC,0.50211,m,4c_70 +LINE84,80,85,ABC,0.11122,m,4c_70 +LINE85,81,86,ABC,1.4388,m,4c_185 +LINE86,82,87,ABC,0.31045,m,2c_.007 +LINE87,84,88,ABC,1.0182,m,4c_70 +LINE88,85,89,ABC,0.1048,m,4c_70 +LINE89,86,90,ABC,0.34251,m,4c_185 +LINE90,87,91,ABC,0.11206,m,2c_.007 +LINE91,88,92,ABC,0.96021,m,4c_70 +LINE92,90,93,ABC,0.065307,m,4c_185 +LINE93,91,94,ABC,0.034785,m,2c_.007 +LINE94,92,95,ABC,0.55811,m,4c_70 +LINE95,93,96,ABC,0.086052,m,4c_185 +LINE96,94,97,ABC,0.03677,m,2c_.007 +LINE97,95,98,ABC,0.36859,m,4c_70 +LINE98,96,99,ABC,0.037216,m,4c_185 +LINE99,97,100,ABC,0.089588,m,2c_.007 +LINE100,98,101,ABC,0.50892,m,4c_70 +LINE101,99,102,ABC,5.0819,m,4c_185 +LINE102,100,103,ABC,0.28583,m,2c_.007 +LINE103,101,104,ABC,0.28838,m,4c_.35 +LINE104,101,105,ABC,0.33602,m,4c_70 +LINE105,102,106,ABC,0.22108,m,4c_185 +LINE106,104,107,ABC,0.3489,m,4c_.35 +LINE107,105,108,ABC,0.19054,m,4c_70 +LINE108,106,109,ABC,0.45085,m,4c_185 +LINE109,107,110,ABC,0.4044,m,4c_.35 +LINE110,108,111,ABC,7.5182,m,4c_70 +LINE111,109,112,ABC,11.9766,m,4c_185 +LINE112,110,113,ABC,0.61659,m,4c_.35 +LINE113,111,114,ABC,0.75316,m,4c_70 +LINE114,112,115,ABC,10.6613,m,4c_185 +LINE115,113,116,ABC,0.79271,m,4c_.35 +LINE116,114,117,ABC,1.1056,m,4c_.35 +LINE117,114,118,ABC,3.6556,m,4c_.1 +LINE118,115,119,ABC,0.99464,m,4c_185 +LINE119,116,120,ABC,0.56909,m,4c_.35 +LINE120,117,121,ABC,0.19481,m,2c_.007 +LINE121,117,122,ABC,0.53831,m,4c_.35 +LINE122,118,123,ABC,6.5924,m,4c_.1 +LINE123,119,124,ABC,0.7248,m,4c_185 +LINE124,120,125,ABC,0.80412,m,4c_.35 +LINE125,121,126,ABC,0.16869,m,2c_.007 +LINE126,122,127,ABC,2.5288,m,4c_.35 +LINE127,123,128,ABC,2.9646,m,4c_.1 +LINE128,124,129,ABC,0.62512,m,4c_185 +LINE129,125,130,ABC,0.87,m,4c_.35 +LINE130,126,131,ABC,0.11915,m,2c_.007 +LINE131,127,132,ABC,3.8212,m,2c_16 +LINE132,127,133,ABC,7.1782,m,4c_.35 +LINE133,128,134,ABC,0.88205,m,4c_.1 +LINE134,129,135,ABC,1.9203,m,4c_185 +LINE135,130,136,ABC,0.82048,m,4c_.35 +LINE136,131,137,ABC,0.18436,m,2c_.007 +LINE137,132,138,ABC,0.32908,m,2c_16 +LINE138,133,139,ABC,5.3402,m,4c_.35 +LINE139,134,140,ABC,0.99566,m,4c_.1 +LINE140,135,141,ABC,1.4127,m,4c_185 +LINE141,136,142,ABC,1.349,m,4c_.35 +LINE142,137,143,ABC,0.21781,m,2c_.007 +LINE143,138,144,ABC,0.32289,m,2c_16 +LINE144,139,145,ABC,3.5762,m,4c_.35 +LINE145,140,146,ABC,0.9364,m,4c_.1 +LINE146,141,147,ABC,0.24053,m,4c_185 +LINE147,142,148,ABC,6.4142,m,4c_.35 +LINE148,143,149,ABC,0.19401,m,2c_.007 +LINE149,144,150,ABC,0.26072,m,2c_16 +LINE150,145,151,ABC,3.5713,m,4c_.35 +LINE151,145,152,ABC,5.1314,m,2c_16 +LINE152,146,153,ABC,1.0926,m,4c_.1 +LINE153,147,154,ABC,0.083096,m,4c_185 +LINE154,148,155,ABC,1.3973,m,4c_.35 +LINE155,149,156,ABC,0.2191,m,2c_.007 +LINE156,150,157,ABC,0.39132,m,2c_16 +LINE157,151,158,ABC,9.4713,m,4c_.35 +LINE158,152,159,ABC,0.31233,m,2c_16 +LINE159,153,160,ABC,0.31439,m,4c_.1 +LINE160,154,161,ABC,0.12256,m,4c_185 +LINE161,155,162,ABC,11.7422,m,2c_16 +LINE162,155,163,ABC,5.2844,m,4c_.35 +LINE163,156,164,ABC,0.20342,m,2c_.007 +LINE164,157,165,ABC,0.47178,m,2c_16 +LINE165,158,166,ABC,3.2899,m,4c_.35 +LINE166,159,167,ABC,0.28533,m,2c_16 +LINE167,160,168,ABC,1.7861,m,4c_.1 +LINE168,161,169,ABC,0.24958,m,4c_185 +LINE169,162,170,ABC,2.2183,m,2c_16 +LINE170,163,171,ABC,7.0156,m,4c_.35 +LINE171,164,172,ABC,0.1727,m,2c_.007 +LINE172,165,173,ABC,0.35642,m,2c_16 +LINE173,166,174,ABC,3.9183,m,4c_.35 +LINE174,166,175,ABC,4.2045,m,2c_16 +LINE175,167,176,ABC,0.11853,m,2c_16 +LINE176,168,177,ABC,1.0088,m,4c_.1 +LINE177,170,178,ABC,4.5768,m,2c_16 +LINE178,171,179,ABC,1.1818,m,4c_.35 +LINE179,171,180,ABC,2.4224,m,2c_16 +LINE180,172,181,ABC,0.17961,m,2c_.007 +LINE181,173,182,ABC,0.41244,m,2c_16 +LINE182,174,183,ABC,0.58763,m,4c_.35 +LINE183,175,184,ABC,0.45409,m,2c_16 +LINE184,176,185,ABC,0.25549,m,2c_16 +LINE185,177,186,ABC,0.74886,m,4c_.1 +LINE186,179,187,ABC,4.6507,m,4c_.35 +LINE187,180,188,ABC,10.0258,m,2c_16 +LINE188,181,189,ABC,0.15412,m,2c_.007 +LINE189,182,190,ABC,0.3878,m,2c_16 +LINE190,183,191,ABC,2.3151,m,4c_.35 +LINE191,183,192,ABC,0.27791,m,4c_.35 +LINE192,184,193,ABC,0.43923,m,2c_16 +LINE193,185,194,ABC,0.65073,m,2c_16 +LINE194,186,195,ABC,0.67326,m,4c_.1 +LINE195,187,196,ABC,8.3036,m,4c_.35 +LINE196,188,197,ABC,1.9595,m,2c_16 +LINE197,188,198,ABC,1.1325,m,2c_16 +LINE198,189,199,ABC,0.19148,m,2c_.007 +LINE199,190,200,ABC,0.41725,m,2c_16 +LINE200,191,201,ABC,0.9314,m,4c_.35 +LINE201,192,202,ABC,0.16447,m,4c_.35 +LINE202,193,203,ABC,0.35134,m,2c_16 +LINE203,194,204,ABC,0.38178,m,2c_16 +LINE204,195,205,ABC,0.83638,m,4c_.1 +LINE205,196,206,ABC,3.2475,m,2c_16 +LINE206,196,207,ABC,2.1371,m,4c_.35 +LINE207,197,208,ABC,4.9541,m,2c_16 +LINE208,198,209,ABC,0.16008,m,2c_16 +LINE209,199,210,ABC,0.44838,m,2c_.007 +LINE210,200,211,ABC,0.63785,m,2c_16 +LINE211,202,212,ABC,0.15526,m,4c_.35 +LINE212,203,213,ABC,0.27987,m,2c_16 +LINE213,204,214,ABC,0.2674,m,2c_16 +LINE214,205,215,ABC,1.5434,m,4c_.1 +LINE215,206,216,ABC,10.6295,m,2c_16 +LINE216,207,217,ABC,3.8571,m,4c_.35 +LINE217,209,218,ABC,0.1291,m,2c_16 +LINE218,210,219,ABC,0.67215,m,2c_.007 +LINE219,211,220,ABC,1.7419,m,2c_16 +LINE220,212,221,ABC,0.17006,m,4c_.35 +LINE221,213,222,ABC,0.59169,m,2c_16 +LINE222,214,223,ABC,0.51437,m,2c_16 +LINE223,215,224,ABC,1.3456,m,4c_.1 +LINE224,216,225,ABC,4.5822,m,2c_16 +LINE225,217,226,ABC,1.3772,m,4c_.35 +LINE226,218,227,ABC,0.10317,m,2c_16 +LINE227,220,228,ABC,0.14852,m,2c_16 +LINE228,221,229,ABC,0.23273,m,4c_.35 +LINE229,222,230,ABC,0.46597,m,2c_16 +LINE230,223,231,ABC,0.25602,m,2c_16 +LINE231,224,232,ABC,0.91534,m,4c_.1 +LINE232,226,233,ABC,11.8949,m,2c_16 +LINE233,226,234,ABC,1.1273,m,4c_.35 +LINE234,227,235,ABC,0.15749,m,2c_16 +LINE235,228,236,ABC,0.0686,m,2c_16 +LINE236,229,237,ABC,0.20742,m,4c_.35 +LINE237,230,238,ABC,0.32322,m,2c_16 +LINE238,231,239,ABC,0.18179,m,2c_16 +LINE239,232,240,ABC,0.6013,m,4c_.1 +LINE240,233,241,ABC,1.7274,m,2c_16 +LINE241,235,242,ABC,0.18461,m,2c_16 +LINE242,236,243,ABC,0.073376,m,2c_16 +LINE243,237,244,ABC,0.16881,m,4c_.35 +LINE244,238,245,ABC,0.32245,m,2c_16 +LINE245,239,246,ABC,2.0796,m,2c_16 +LINE246,240,247,ABC,1.2941,m,4c_.1 +LINE247,241,248,ABC,5.3022,m,2c_16 +LINE248,241,249,ABC,5.3022,m,2c_16 +LINE249,242,250,ABC,0.28355,m,2c_16 +LINE250,243,251,ABC,0.070114,m,2c_16 +LINE251,244,252,ABC,0.13297,m,4c_.35 +LINE252,245,253,ABC,0.47173,m,2c_16 +LINE253,246,254,ABC,0.61324,m,2c_16 +LINE254,247,255,ABC,4.5618,m,2c_16 +LINE255,247,256,ABC,0.85678,m,4c_.1 +LINE256,250,257,ABC,1.0376,m,2c_16 +LINE257,251,258,ABC,0.07811,m,2c_16 +LINE258,252,259,ABC,0.17323,m,4c_.35 +LINE259,253,260,ABC,1.7742,m,2c_16 +LINE260,254,261,ABC,0.1372,m,2c_16 +LINE261,255,262,ABC,0.6306,m,2c_16 +LINE262,256,263,ABC,3.2128,m,4c_.1 +LINE263,257,264,ABC,5.05,m,2c_16 +LINE264,258,265,ABC,0.16123,m,2c_16 +LINE265,259,266,ABC,0.19436,m,4c_.35 +LINE266,260,267,ABC,0.4141,m,2c_16 +LINE267,261,268,ABC,3.4578,m,2c_16 +LINE268,261,269,ABC,0.11871,m,2c_16 +LINE269,262,270,ABC,0.28991,m,2c_16 +LINE270,263,271,ABC,4.2547,m,2c_16 +LINE271,263,272,ABC,1.0792,m,4c_.1 +LINE272,265,273,ABC,0.16792,m,2c_16 +LINE273,266,274,ABC,0.17888,m,4c_.35 +LINE274,267,275,ABC,0.18971,m,2c_16 +LINE275,268,276,ABC,3.4268,m,2c_16 +LINE276,269,277,ABC,0.13918,m,2c_16 +LINE277,270,278,ABC,0.34433,m,2c_16 +LINE278,271,279,ABC,0.30927,m,2c_16 +LINE279,272,280,ABC,3.9121,m,4c_.1 +LINE280,273,281,ABC,0.63854,m,2c_16 +LINE281,274,282,ABC,0.60542,m,4c_.35 +LINE282,275,283,ABC,0.12472,m,2c_16 +LINE283,277,284,ABC,0.12578,m,2c_16 +LINE284,278,285,ABC,0.53126,m,2c_16 +LINE285,279,286,ABC,0.25491,m,2c_16 +LINE286,280,287,ABC,1.7542,m,4c_.06 +LINE287,280,288,ABC,0.91306,m,4c_.1 +LINE288,281,289,ABC,3.3901,m,2c_16 +LINE289,282,290,ABC,0.81044,m,4c_.35 +LINE290,283,291,ABC,0.87618,m,2c_16 +LINE291,283,292,ABC,0.10807,m,2c_16 +LINE292,284,293,ABC,0.12739,m,2c_16 +LINE293,285,294,ABC,0.47339,m,2c_16 +LINE294,286,295,ABC,0.36208,m,2c_16 +LINE295,287,296,ABC,0.80742,m,4c_.06 +LINE296,288,297,ABC,3.8266,m,4c_.1 +LINE297,291,298,ABC,0.40248,m,2c_16 +LINE298,292,299,ABC,0.076485,m,2c_16 +LINE299,293,300,ABC,0.13697,m,2c_16 +LINE300,294,301,ABC,0.36805,m,2c_16 +LINE301,295,302,ABC,1.6263,m,2c_16 +LINE302,296,303,ABC,5.2746,m,4c_.06 +LINE303,297,304,ABC,0.84468,m,4c_.1 +LINE304,298,305,ABC,0.68119,m,2c_16 +LINE305,299,306,ABC,0.089006,m,2c_16 +LINE306,300,307,ABC,0.79435,m,2c_16 +LINE307,301,308,ABC,0.45813,m,2c_16 +LINE308,302,309,ABC,0.31308,m,2c_16 +LINE309,303,310,ABC,0.39397,m,4c_.06 +LINE310,304,311,ABC,0.28067,m,4c_.1 +LINE311,305,312,ABC,1.3075,m,2c_16 +LINE312,306,313,ABC,0.17024,m,2c_16 +LINE313,307,314,ABC,3.3598,m,2c_16 +LINE314,308,315,ABC,0.47384,m,2c_16 +LINE315,309,316,ABC,0.23181,m,2c_16 +LINE316,310,317,ABC,0.64903,m,2c_16 +LINE317,310,318,ABC,7.2163,m,4c_.06 +LINE318,311,319,ABC,0.14649,m,4c_.1 +LINE319,312,320,ABC,3.8495,m,2c_16 +LINE320,313,321,ABC,0.6529,m,2c_16 +LINE321,315,322,ABC,0.55892,m,2c_16 +LINE322,316,323,ABC,0.26702,m,2c_16 +LINE323,317,324,ABC,3.3427,m,2c_16 +LINE324,318,325,ABC,3.4631,m,4c_.06 +LINE325,319,326,ABC,0.1254,m,4c_.1 +LINE326,321,327,ABC,2.2281,m,2c_16 +LINE327,322,328,ABC,0.31851,m,2c_16 +LINE328,323,329,ABC,0.26488,m,2c_16 +LINE329,324,330,ABC,1.167,m,2c_16 +LINE330,325,331,ABC,9.1332,m,2c_16 +LINE331,325,332,ABC,6.6729,m,4c_.06 +LINE332,326,333,ABC,0.14262,m,4c_.1 +LINE333,328,334,ABC,1.4389,m,2c_16 +LINE334,329,335,ABC,2.327,m,2c_16 +LINE335,330,336,ABC,2.5399,m,2c_16 +LINE336,331,337,ABC,3.6172,m,2c_16 +LINE337,332,338,ABC,6.8067,m,2c_16 +LINE338,332,339,ABC,1.2129,m,4c_.06 +LINE339,333,340,ABC,0.11236,m,4c_.1 +LINE340,334,341,ABC,0.55999,m,2c_16 +LINE341,335,342,ABC,4.7567,m,2c_16 +LINE342,336,343,ABC,2.082,m,2c_16 +LINE343,336,344,ABC,0.9796,m,2c_16 +LINE344,338,345,ABC,3.4221,m,2c_16 +LINE345,339,346,ABC,1.0391,m,4c_.06 +LINE346,340,347,ABC,0.094202,m,4c_.1 +LINE347,341,348,ABC,0.19454,m,2c_16 +LINE348,343,349,ABC,3.1153,m,2c_16 +LINE349,344,350,ABC,0.1364,m,2c_16 +LINE350,345,351,ABC,0.31846,m,2c_16 +LINE351,346,352,ABC,0.73091,m,4c_.06 +LINE352,347,353,ABC,0.085,m,4c_.1 +LINE353,348,354,ABC,0.14656,m,2c_16 +LINE354,350,355,ABC,0.14814,m,2c_16 +LINE355,351,356,ABC,0.13152,m,2c_16 +LINE356,352,357,ABC,0.92352,m,4c_.06 +LINE357,353,358,ABC,0.070349,m,4c_.1 +LINE358,354,359,ABC,0.10723,m,2c_16 +LINE359,355,360,ABC,0.12976,m,2c_16 +LINE360,356,361,ABC,0.092801,m,2c_16 +LINE361,357,362,ABC,0.57867,m,4c_.06 +LINE362,358,363,ABC,0.081609,m,4c_.1 +LINE363,359,364,ABC,0.054452,m,2c_16 +LINE364,360,365,ABC,0.13787,m,2c_16 +LINE365,361,366,ABC,0.094921,m,2c_16 +LINE366,362,367,ABC,0.88861,m,4c_.06 +LINE367,363,368,ABC,0.089694,m,4c_.1 +LINE368,364,369,ABC,0.080056,m,2c_16 +LINE369,365,370,ABC,0.19677,m,2c_16 +LINE370,366,371,ABC,0.112,m,2c_16 +LINE371,367,372,ABC,0.88584,m,4c_.06 +LINE372,368,373,ABC,0.48898,m,4c_.1 +LINE373,369,374,ABC,0.1342,m,2c_16 +LINE374,370,375,ABC,0.23921,m,2c_16 +LINE375,371,376,ABC,0.14128,m,2c_16 +LINE376,372,377,ABC,0.99394,m,4c_.06 +LINE377,373,378,ABC,3.6848,m,4c_.1 +LINE378,373,379,ABC,1.4115,m,2c_16 +LINE379,374,380,ABC,0.59859,m,2c_16 +LINE380,375,381,ABC,1.4827,m,2c_16 +LINE381,376,382,ABC,0.12653,m,2c_16 +LINE382,377,383,ABC,0.71925,m,4c_.06 +LINE383,378,384,ABC,3.5292,m,4c_.1 +LINE384,379,385,ABC,8.6668,m,2c_16 +LINE385,379,386,ABC,1.4561,m,2c_16 +LINE386,380,387,ABC,2.2004,m,2c_16 +LINE387,381,388,ABC,5.0734,m,2c_16 +LINE388,382,389,ABC,0.10012,m,2c_16 +LINE389,383,390,ABC,0.85728,m,4c_.06 +LINE390,384,391,ABC,0.15711,m,4c_.1 +LINE391,385,392,ABC,3.1675,m,2c_16 +LINE392,386,393,ABC,7.8335,m,2c_16 +LINE393,389,394,ABC,0.17183,m,2c_16 +LINE394,390,395,ABC,1.2439,m,4c_.06 +LINE395,391,396,ABC,4.0601,m,2c_16 +LINE396,391,397,ABC,2.8793,m,4c_.1 +LINE397,392,398,ABC,0.32241,m,2c_16 +LINE398,393,399,ABC,0.5688,m,2c_16 +LINE399,394,400,ABC,0.59984,m,2c_16 +LINE400,395,401,ABC,0.9222,m,4c_.06 +LINE401,396,402,ABC,0.37201,m,2c_16 +LINE402,397,403,ABC,1.3891,m,4c_.1 +LINE403,398,404,ABC,0.225,m,2c_16 +LINE404,399,405,ABC,0.24807,m,2c_16 +LINE405,400,406,ABC,3.6672,m,2c_16 +LINE406,401,407,ABC,0.88961,m,4c_.06 +LINE407,402,408,ABC,0.21148,m,2c_16 +LINE408,403,409,ABC,4.1907,m,4c_.1 +LINE409,403,410,ABC,0.3791,m,4c_.1 +LINE410,404,411,ABC,0.23308,m,2c_16 +LINE411,405,412,ABC,0.16706,m,2c_16 +LINE412,407,413,ABC,0.87066,m,4c_.06 +LINE413,408,414,ABC,0.1436,m,2c_16 +LINE414,409,415,ABC,5.9686,m,4c_.1 +LINE415,410,416,ABC,0.094921,m,4c_.1 +LINE416,411,417,ABC,0.9788,m,2c_16 +LINE417,412,418,ABC,0.27954,m,2c_16 +LINE418,413,419,ABC,1.0471,m,4c_.06 +LINE419,414,420,ABC,0.23403,m,2c_16 +LINE420,415,421,ABC,1.249,m,4c_.1 +LINE421,416,422,ABC,0.066573,m,4c_.1 +LINE422,417,423,ABC,0.239,m,2c_16 +LINE423,418,424,ABC,3.1944,m,2c_16 +LINE424,419,425,ABC,1.7537,m,4c_.06 +LINE425,419,426,ABC,1.7537,m,4c_.06 +LINE426,420,427,ABC,0.77793,m,2c_16 +LINE427,421,428,ABC,0.31923,m,4c_.1 +LINE428,422,429,ABC,0.082873,m,4c_.1 +LINE429,423,430,ABC,0.22798,m,2c_16 +LINE430,424,431,ABC,1.1331,m,2c_16 +LINE431,425,432,ABC,5.9151,m,4c_.06 +LINE432,425,433,ABC,5.9151,m,4c_.06 +LINE433,427,434,ABC,0.86608,m,2c_16 +LINE434,428,435,ABC,0.16724,m,4c_.1 +LINE435,429,436,ABC,0.071344,m,4c_.1 +LINE436,430,437,ABC,0.22674,m,2c_16 +LINE437,431,438,ABC,0.384,m,2c_16 +LINE438,432,439,ABC,8.3663,m,4c_.06 +LINE439,432,440,ABC,8.3663,m,4c_.06 +LINE440,434,441,ABC,0.48708,m,2c_16 +LINE441,435,442,ABC,0.13864,m,4c_.1 +LINE442,436,443,ABC,0.078,m,4c_.1 +LINE443,437,444,ABC,0.2601,m,2c_16 +LINE444,438,445,ABC,0.67858,m,2c_16 +LINE445,439,446,ABC,6.0033,m,4c_.06 +LINE446,439,447,ABC,6.0033,m,4c_.06 +LINE447,441,448,ABC,0.45756,m,2c_16 +LINE448,442,449,ABC,0.11236,m,4c_.1 +LINE449,443,450,ABC,0.079246,m,4c_.1 +LINE450,444,451,ABC,0.89824,m,2c_16 +LINE451,445,452,ABC,0.59366,m,2c_16 +LINE452,446,453,ABC,1.8214,m,4c_.06 +LINE453,446,454,ABC,1.8214,m,4c_.06 +LINE454,448,455,ABC,0.43655,m,2c_16 +LINE455,449,456,ABC,0.17175,m,4c_.1 +LINE456,450,457,ABC,0.054231,m,4c_.1 +LINE457,451,458,ABC,4.3773,m,2c_16 +LINE458,452,459,ABC,0.67064,m,2c_16 +LINE459,453,460,ABC,5.3905,m,4c_.06 +LINE460,453,461,ABC,5.3905,m,4c_.06 +LINE461,453,462,ABC,3.6859,m,2c_16 +LINE462,455,463,ABC,0.71675,m,2c_16 +LINE463,456,464,ABC,0.15483,m,4c_.1 +LINE464,457,465,ABC,0.040311,m,4c_.1 +LINE465,459,466,ABC,0.63421,m,2c_16 +LINE466,460,467,ABC,5.9891,m,4c_.06 +LINE467,460,468,ABC,5.9891,m,4c_.06 +LINE468,460,469,ABC,0.88292,m,4c_.06 +LINE469,462,470,ABC,0.53828,m,2c_16 +LINE470,463,471,ABC,0.49923,m,2c_16 +LINE471,464,472,ABC,0.14736,m,4c_.1 +LINE472,465,473,ABC,0.049497,m,4c_.1 +LINE473,466,474,ABC,3.201,m,2c_16 +LINE474,467,475,ABC,2.1947,m,4c_.06 +LINE475,467,476,ABC,2.1947,m,4c_.06 +LINE476,470,477,ABC,0.29351,m,2c_16 +LINE477,471,478,ABC,0.35077,m,2c_16 +LINE478,472,479,ABC,0.16601,m,4c_.1 +LINE479,473,480,ABC,0.063953,m,4c_.1 +LINE480,474,481,ABC,0.18984,m,2c_16 +LINE481,475,482,ABC,4.6432,m,4c_.06 +LINE482,475,483,ABC,4.6432,m,4c_.06 +LINE483,475,484,ABC,10.2769,m,2c_16 +LINE484,477,485,ABC,0.19883,m,2c_16 +LINE485,478,486,ABC,0.1676,m,2c_16 +LINE486,479,487,ABC,0.17536,m,4c_.1 +LINE487,480,488,ABC,0.11163,m,4c_.1 +LINE488,481,489,ABC,0.1713,m,2c_16 +LINE489,482,490,ABC,6.6548,m,4c_.06 +LINE490,482,491,ABC,6.6548,m,4c_.06 +LINE491,484,492,ABC,0.57796,m,2c_16 +LINE492,484,493,ABC,4.0726,m,2c_16 +LINE493,485,494,ABC,0.30201,m,2c_16 +LINE494,486,495,ABC,0.10617,m,2c_16 +LINE495,487,496,ABC,0.38342,m,4c_.1 +LINE496,488,497,ABC,0.13972,m,4c_.1 +LINE497,489,498,ABC,0.23283,m,2c_16 +LINE498,490,499,ABC,4.0612,m,4c_.06 +LINE499,490,500,ABC,4.0612,m,4c_.06 +LINE500,492,501,ABC,0.24429,m,2c_16 +LINE501,493,502,ABC,2.606,m,2c_16 +LINE502,494,503,ABC,0.45833,m,2c_16 +LINE503,495,504,ABC,0.071784,m,2c_16 +LINE504,496,505,ABC,8.6961,m,4c_.1 +LINE505,497,506,ABC,0.096167,m,4c_.1 +LINE506,498,507,ABC,0.30564,m,2c_16 +LINE507,499,508,ABC,0.69938,m,4c_.06 +LINE508,499,509,ABC,0.69938,m,4c_.06 +LINE509,501,510,ABC,0.14354,m,2c_16 +LINE510,503,511,ABC,0.32517,m,2c_16 +LINE511,504,512,ABC,0.10013,m,2c_16 +LINE512,505,513,ABC,5.5648,m,2c_16 +LINE513,505,514,ABC,1.3369,m,4c_.1 +LINE514,506,515,ABC,0.085492,m,4c_.1 +LINE515,508,516,ABC,1.8857,m,4c_.06 +LINE516,508,517,ABC,1.8857,m,4c_.06 +LINE517,508,518,ABC,4.7316,m,2c_16 +LINE518,510,519,ABC,0.1321,m,2c_16 +LINE519,511,520,ABC,0.22216,m,2c_16 +LINE520,512,521,ABC,0.07642,m,2c_16 +LINE521,513,522,ABC,4.9074,m,2c_16 +LINE522,514,523,ABC,0.72122,m,4c_.1 +LINE523,515,524,ABC,0.066573,m,4c_.1 +LINE524,516,525,ABC,1.3881,m,4c_.06 +LINE525,516,526,ABC,1.3881,m,4c_.06 +LINE526,518,527,ABC,2.796,m,2c_16 +LINE527,519,528,ABC,0.11769,m,2c_16 +LINE528,520,529,ABC,0.17555,m,2c_16 +LINE529,521,530,ABC,0.54535,m,2c_16 +LINE530,523,531,ABC,0.10771,m,4c_.1 +LINE531,524,532,ABC,0.060803,m,4c_.1 +LINE532,525,533,ABC,1.8899,m,4c_.06 +LINE533,525,534,ABC,1.8899,m,4c_.06 +LINE534,527,535,ABC,2.2154,m,2c_16 +LINE535,528,536,ABC,0.12209,m,2c_16 +LINE536,529,537,ABC,0.56286,m,2c_16 +LINE537,530,538,ABC,1.9227,m,2c_16 +LINE538,530,539,ABC,5.5837,m,2c_16 +LINE539,531,540,ABC,0.082219,m,4c_.1 +LINE540,532,541,ABC,0.065513,m,4c_.1 +LINE541,533,542,ABC,1.3374,m,4c_.06 +LINE542,533,543,ABC,1.3374,m,4c_.06 +LINE543,535,544,ABC,0.91542,m,2c_16 +LINE544,536,545,ABC,0.36857,m,2c_16 +LINE545,537,546,ABC,4.5527,m,2c_16 +LINE546,538,547,ABC,2.1231,m,2c_16 +LINE547,540,548,ABC,0.076896,m,4c_.1 +LINE548,541,549,ABC,0.086145,m,4c_.1 +LINE549,542,550,ABC,3.7401,m,4c_.06 +LINE550,542,551,ABC,3.7401,m,4c_.06 +LINE551,544,552,ABC,0.28804,m,2c_16 +LINE552,544,553,ABC,3.789,m,2c_16 +LINE553,545,554,ABC,0.37143,m,2c_16 +LINE554,546,555,ABC,0.22672,m,2c_16 +LINE555,547,556,ABC,5.7548,m,2c_16 +LINE556,548,557,ABC,0.082,m,4c_.1 +LINE557,549,558,ABC,0.061612,m,4c_.1 +LINE558,550,559,ABC,2.7082,m,4c_.06 +LINE559,550,560,ABC,2.7082,m,4c_.06 +LINE560,552,561,ABC,0.10599,m,2c_16 +LINE561,553,562,ABC,2.8664,m,2c_16 +LINE562,554,563,ABC,3.4705,m,2c_16 +LINE563,555,564,ABC,0.17889,m,2c_16 +LINE564,557,565,ABC,0.07256,m,4c_.1 +LINE565,558,566,ABC,0.12021,m,4c_.1 +LINE566,559,567,ABC,0.60068,m,4c_.06 +LINE567,559,568,ABC,0.60068,m,4c_.06 +LINE568,559,569,ABC,3.8482,m,2c_16 +LINE569,561,570,ABC,0.15788,m,2c_16 +LINE570,564,571,ABC,0.20224,m,2c_16 +LINE571,565,572,ABC,0.074216,m,4c_.1 +LINE572,567,573,ABC,0.14223,m,4c_.06 +LINE573,567,574,ABC,0.14223,m,4c_.06 +LINE574,569,575,ABC,0.48648,m,2c_16 +LINE575,570,576,ABC,0.095,m,2c_16 +LINE576,571,577,ABC,0.18,m,2c_16 +LINE577,572,578,ABC,0.38305,m,4c_.1 +LINE578,573,579,ABC,3.8558,m,4c_.06 +LINE579,573,580,ABC,3.8558,m,4c_.06 +LINE580,573,581,ABC,0.31979,m,4c_.06 +LINE581,575,582,ABC,0.35899,m,2c_16 +LINE582,576,583,ABC,0.11463,m,2c_16 +LINE583,577,584,ABC,0.20718,m,2c_16 +LINE584,578,585,ABC,4.7318,m,2c_16 +LINE585,578,586,ABC,0.82623,m,4c_.1 +LINE586,579,587,ABC,2.7022,m,4c_.06 +LINE587,579,588,ABC,2.7022,m,4c_.06 +LINE588,581,589,ABC,0.11628,m,4c_.06 +LINE589,582,590,ABC,0.3493,m,2c_16 +LINE590,583,591,ABC,0.10065,m,2c_16 +LINE591,584,592,ABC,0.21243,m,2c_16 +LINE592,585,593,ABC,0.27268,m,2c_16 +LINE593,586,594,ABC,3.9483,m,4c_.1 +LINE594,587,595,ABC,5.4142,m,4c_.06 +LINE595,587,596,ABC,0.64238,m,4c_.06 +LINE596,589,597,ABC,0.089275,m,4c_.06 +LINE597,590,598,ABC,3.2812,m,2c_16 +LINE598,591,599,ABC,0.65862,m,2c_16 +LINE599,592,600,ABC,0.25534,m,2c_16 +LINE600,593,601,ABC,0.13695,m,2c_16 +LINE601,594,602,ABC,9.1669,m,2c_16 +LINE602,594,603,ABC,4.6424,m,4c_.1 +LINE603,595,604,ABC,4.8283,m,4c_.06 +LINE604,595,605,ABC,4.8283,m,4c_.06 +LINE605,595,606,ABC,4.7719,m,4c_.06 +LINE606,596,607,ABC,11.6642,m,2c_16 +LINE607,596,608,ABC,11.6642,m,2c_16 +LINE608,597,609,ABC,0.11037,m,4c_.06 +LINE609,598,610,ABC,1.5271,m,2c_16 +LINE610,599,611,ABC,4.8562,m,2c_16 +LINE611,600,612,ABC,0.16008,m,2c_16 +LINE612,601,613,ABC,0.11484,m,2c_16 +LINE613,602,614,ABC,4.8374,m,2c_16 +LINE614,603,615,ABC,4.4466,m,4c_.1 +LINE615,604,616,ABC,3.9301,m,2c_.0225 +LINE616,604,617,ABC,3.1088,m,4c_.06 +LINE617,604,618,ABC,3.1088,m,4c_.06 +LINE618,607,619,ABC,2.7454,m,2c_16 +LINE619,609,620,ABC,0.06364,m,4c_.06 +LINE620,610,621,ABC,0.71673,m,2c_16 +LINE621,612,622,ABC,0.68797,m,2c_16 +LINE622,613,623,ABC,0.093648,m,2c_16 +LINE623,615,624,ABC,1.6322,m,2c_16 +LINE624,615,625,ABC,1.2511,m,4c_.1 +LINE625,616,626,ABC,5.3537,m,2c_.0225 +LINE626,620,627,ABC,0.077897,m,4c_.06 +LINE627,621,628,ABC,0.47807,m,2c_16 +LINE628,622,629,ABC,2.9004,m,2c_16 +LINE629,623,630,ABC,0.147,m,2c_16 +LINE630,624,631,ABC,0.40022,m,2c_16 +LINE631,625,632,ABC,0.28784,m,4c_.1 +LINE632,626,633,ABC,1.5703,m,2c_.0225 +LINE633,627,634,ABC,0.065299,m,4c_.06 +LINE634,628,635,ABC,0.73088,m,2c_16 +LINE635,630,636,ABC,0.35053,m,2c_16 +LINE636,631,637,ABC,0.27482,m,2c_16 +LINE637,632,638,ABC,0.14284,m,4c_.1 +LINE638,633,639,ABC,5.1974,m,2c_.0225 +LINE639,634,640,ABC,0.069123,m,4c_.06 +LINE640,635,641,ABC,1.4274,m,2c_16 +LINE641,636,642,ABC,0.24251,m,2c_16 +LINE642,637,643,ABC,0.38096,m,2c_16 +LINE643,638,644,ABC,0.15697,m,4c_.1 +LINE644,640,645,ABC,0.068593,m,4c_.06 +LINE645,641,646,ABC,0.39457,m,2c_16 +LINE646,642,647,ABC,0.30835,m,2c_16 +LINE647,643,648,ABC,0.90337,m,2c_16 +LINE648,644,649,ABC,0.18112,m,4c_.1 +LINE649,645,650,ABC,0.093984,m,4c_.06 +LINE650,646,651,ABC,0.11455,m,2c_16 +LINE651,647,652,ABC,0.18732,m,2c_16 +LINE652,648,653,ABC,0.68671,m,2c_16 +LINE653,649,654,ABC,0.1831,m,4c_.1 +LINE654,650,655,ABC,0.12394,m,4c_.06 +LINE655,651,656,ABC,0.099368,m,2c_16 +LINE656,651,657,ABC,0.52781,m,2c_16 +LINE657,652,658,ABC,0.16911,m,2c_16 +LINE658,653,659,ABC,0.48206,m,2c_16 +LINE659,654,660,ABC,0.20299,m,4c_.1 +LINE660,655,661,ABC,0.36466,m,4c_.06 +LINE661,656,662,ABC,0.093,m,2c_16 +LINE662,657,663,ABC,0.69648,m,2c_16 +LINE663,658,664,ABC,0.28521,m,2c_16 +LINE664,659,665,ABC,0.505,m,2c_16 +LINE665,660,666,ABC,0.29519,m,4c_.1 +LINE666,661,667,ABC,0.26019,m,4c_.06 +LINE667,662,668,ABC,0.095802,m,2c_16 +LINE668,663,669,ABC,2.8935,m,2c_16 +LINE669,664,670,ABC,0.2804,m,2c_16 +LINE670,665,671,ABC,0.41461,m,2c_16 +LINE671,666,672,ABC,0.4801,m,2c_16 +LINE672,666,673,ABC,0.81161,m,4c_.1 +LINE673,667,674,ABC,0.20184,m,4c_.06 +LINE674,668,675,ABC,0.69267,m,2c_16 +LINE675,669,676,ABC,1.2288,m,2c_16 +LINE676,670,677,ABC,0.13267,m,2c_16 +LINE677,671,678,ABC,0.68648,m,2c_16 +LINE678,672,679,ABC,0.2883,m,2c_16 +LINE679,673,680,ABC,5.1393,m,4c_.1 +LINE680,674,681,ABC,0.40252,m,4c_.06 +LINE681,675,682,ABC,5.0441,m,2c_16 +LINE682,677,683,ABC,0.14572,m,2c_16 +LINE683,678,684,ABC,2.2185,m,2c_16 +LINE684,679,685,ABC,0.26744,m,2c_16 +LINE685,680,686,ABC,3.6787,m,4c_.1 +LINE686,683,687,ABC,0.13986,m,2c_16 +LINE687,684,688,ABC,5.1838,m,2c_16 +LINE688,685,689,ABC,0.26095,m,2c_16 +LINE689,686,690,ABC,8.1445,m,2c_16 +LINE690,686,691,ABC,10.5254,m,4c_.1 +LINE691,687,692,ABC,0.16867,m,2c_16 +LINE692,689,693,ABC,0.19573,m,2c_16 +LINE693,690,694,ABC,0.76157,m,2c_16 +LINE694,690,695,ABC,2.1261,m,2c_16 +LINE695,691,696,ABC,9.4817,m,2c_16 +LINE696,691,697,ABC,2.1907,m,4c_.1 +LINE697,692,698,ABC,0.26905,m,2c_16 +LINE698,693,699,ABC,0.31093,m,2c_16 +LINE699,694,700,ABC,0.2383,m,2c_16 +LINE700,695,701,ABC,4.3312,m,2c_16 +LINE701,696,702,ABC,5.493,m,2c_16 +LINE702,697,703,ABC,2.4,m,4c_.06 +LINE703,698,704,ABC,0.73636,m,2c_16 +LINE704,699,705,ABC,0.52424,m,2c_16 +LINE705,700,706,ABC,0.15322,m,2c_16 +LINE706,703,707,ABC,6.3308,m,4c_.06 +LINE707,703,708,ABC,0.11132,m,4c_.06 +LINE708,704,709,ABC,0.97996,m,2c_16 +LINE709,705,710,ABC,3.9281,m,2c_16 +LINE710,706,711,ABC,0.092418,m,2c_16 +LINE711,707,712,ABC,7.5025,m,4c_.06 +LINE712,707,713,ABC,3.9448,m,2c_16 +LINE713,708,714,ABC,0.10474,m,4c_.06 +LINE714,709,715,ABC,0.093338,m,2c_16 +LINE715,710,716,ABC,3.2225,m,2c_16 +LINE716,711,717,ABC,0.093408,m,2c_16 +LINE717,712,718,ABC,7.7434,m,4c_.06 +LINE718,713,719,ABC,0.4223,m,2c_16 +LINE719,714,720,ABC,0.097,m,4c_.06 +LINE720,715,721,ABC,0.073817,m,2c_16 +LINE721,716,722,ABC,1.021,m,2c_16 +LINE722,717,723,ABC,0.083433,m,2c_16 +LINE723,718,724,ABC,3.2535,m,4c_.06 +LINE724,718,725,ABC,9.3475,m,2c_16 +LINE725,719,726,ABC,0.16124,m,2c_16 +LINE726,720,727,ABC,0.10977,m,4c_.06 +LINE727,721,728,ABC,0.071694,m,2c_16 +LINE728,722,729,ABC,0.92949,m,2c_16 +LINE729,723,730,ABC,0.094,m,2c_16 +LINE730,724,731,ABC,4.421,m,4c_.06 +LINE731,725,732,ABC,1.2539,m,2c_16 +LINE732,726,733,ABC,0.17056,m,2c_16 +LINE733,727,734,ABC,0.089889,m,4c_.06 +LINE734,728,735,ABC,0.076792,m,2c_16 +LINE735,729,736,ABC,0.50625,m,2c_16 +LINE736,730,737,ABC,0.075313,m,2c_16 +LINE737,731,738,ABC,5.1761,m,4c_.06 +LINE738,732,739,ABC,0.65877,m,2c_16 +LINE739,733,740,ABC,0.14155,m,2c_16 +LINE740,734,741,ABC,0.13761,m,4c_.06 +LINE741,735,742,ABC,0.071,m,2c_16 +LINE742,736,743,ABC,0.40432,m,2c_16 +LINE743,737,744,ABC,0.090338,m,2c_16 +LINE744,738,745,ABC,4.1562,m,4c_.06 +LINE745,739,746,ABC,3.7387,m,2c_16 +LINE746,739,747,ABC,0.12202,m,2c_16 +LINE747,740,748,ABC,0.16763,m,2c_16 +LINE748,741,749,ABC,0.16427,m,4c_.06 +LINE749,742,750,ABC,0.06691,m,2c_16 +LINE750,743,751,ABC,0.34477,m,2c_16 +LINE751,744,752,ABC,0.09735,m,2c_16 +LINE752,745,753,ABC,1.5434,m,4c_.06 +LINE753,745,754,ABC,5.9227,m,2c_16 +LINE754,746,755,ABC,3.0391,m,2c_16 +LINE755,747,756,ABC,0.088238,m,2c_16 +LINE756,748,757,ABC,0.16348,m,2c_16 +LINE757,749,758,ABC,0.12454,m,4c_.06 +LINE758,750,759,ABC,0.093059,m,2c_16 +LINE759,751,760,ABC,0.40459,m,2c_16 +LINE760,752,761,ABC,0.17761,m,2c_16 +LINE761,753,762,ABC,2.1279,m,4c_.06 +LINE762,754,763,ABC,4.9506,m,2c_16 +LINE763,756,764,ABC,0.074465,m,2c_16 +LINE764,757,765,ABC,0.22475,m,2c_16 +LINE765,758,766,ABC,0.12167,m,4c_.06 +LINE766,759,767,ABC,0.11404,m,2c_16 +LINE767,760,768,ABC,0.36969,m,2c_16 +LINE768,761,769,ABC,1.3288,m,2c_16 +LINE769,762,770,ABC,5.2347,m,4c_.06 +LINE770,763,771,ABC,3.6007,m,2c_16 +LINE771,763,772,ABC,0.13038,m,2c_16 +LINE772,764,773,ABC,0.12578,m,2c_16 +LINE773,765,774,ABC,0.30918,m,2c_16 +LINE774,766,775,ABC,0.07931,m,4c_.06 +LINE775,767,776,ABC,0.54052,m,2c_16 +LINE776,768,777,ABC,0.57353,m,2c_16 +LINE777,769,778,ABC,4.0721,m,2c_16 +LINE778,770,779,ABC,4.2428,m,4c_.06 +LINE779,771,780,ABC,3.5283,m,2c_16 +LINE780,772,781,ABC,0.12466,m,2c_16 +LINE781,773,782,ABC,0.17614,m,2c_16 +LINE782,774,783,ABC,0.3272,m,2c_16 +LINE783,775,784,ABC,0.097,m,4c_.06 +LINE784,776,785,ABC,4.6216,m,2c_16 +LINE785,777,786,ABC,1.1579,m,2c_16 +LINE786,779,787,ABC,3.3152,m,4c_.06 +LINE787,781,788,ABC,0.13439,m,2c_16 +LINE788,782,789,ABC,0.1307,m,2c_16 +LINE789,783,790,ABC,0.21735,m,2c_16 +LINE790,784,791,ABC,0.091984,m,4c_.06 +LINE791,786,792,ABC,0.34588,m,2c_16 +LINE792,786,793,ABC,2.062,m,2c_16 +LINE793,787,794,ABC,2.9963,m,4c_.06 +LINE794,788,795,ABC,0.12,m,2c_16 +LINE795,789,796,ABC,0.21651,m,2c_16 +LINE796,790,797,ABC,0.22121,m,2c_16 +LINE797,791,798,ABC,0.091706,m,4c_.06 +LINE798,792,799,ABC,0.30164,m,2c_16 +LINE799,793,800,ABC,3.2995,m,2c_16 +LINE800,794,801,ABC,0.20555,m,2c_16 +LINE801,794,802,ABC,2.8031,m,4c_95_SAC_XC +LINE802,795,803,ABC,0.13252,m,2c_16 +LINE803,796,804,ABC,1.5028,m,2c_16 +LINE804,797,805,ABC,0.10577,m,2c_16 +LINE805,798,806,ABC,0.12311,m,4c_.06 +LINE806,799,807,ABC,0.24947,m,2c_16 +LINE807,800,808,ABC,2.8191,m,2c_16 +LINE808,801,809,ABC,0.20609,m,2c_16 +LINE809,802,810,ABC,3.0749,m,4c_.06 +LINE810,802,811,ABC,3.0749,m,4c_.06 +LINE811,803,812,ABC,0.08544,m,2c_16 +LINE812,804,813,ABC,3.3195,m,2c_16 +LINE813,805,814,ABC,0.16824,m,2c_16 +LINE814,806,815,ABC,0.42086,m,4c_.06 +LINE815,807,816,ABC,0.194,m,2c_16 +LINE816,808,817,ABC,1.5955,m,2c_16 +LINE817,809,818,ABC,0.20649,m,2c_16 +LINE818,810,819,ABC,2.5782,m,4c_.06 +LINE819,810,820,ABC,2.5782,m,4c_.06 +LINE820,812,821,ABC,0.13123,m,2c_16 +LINE821,814,822,ABC,0.15794,m,2c_16 +LINE822,815,823,ABC,0.48651,m,4c_.06 +LINE823,816,824,ABC,0.19731,m,2c_16 +LINE824,818,825,ABC,0.20524,m,2c_16 +LINE825,819,826,ABC,2.7715,m,4c_.06 +LINE826,819,827,ABC,2.7715,m,4c_.06 +LINE827,821,828,ABC,1.0794,m,2c_16 +LINE828,822,829,ABC,0.22567,m,2c_16 +LINE829,823,830,ABC,0.49659,m,4c_.06 +LINE830,824,831,ABC,0.17123,m,2c_16 +LINE831,825,832,ABC,0.20602,m,2c_16 +LINE832,826,833,ABC,2.2755,m,4c_.06 +LINE833,826,834,ABC,2.2755,m,4c_.06 +LINE834,828,835,ABC,3.7201,m,2c_16 +LINE835,829,836,ABC,2.3821,m,2c_16 +LINE836,831,837,ABC,0.12298,m,2c_16 +LINE837,832,838,ABC,0.20588,m,2c_16 +LINE838,833,839,ABC,2.443,m,4c_.06 +LINE839,833,840,ABC,2.443,m,4c_.06 +LINE840,836,841,ABC,0.95278,m,2c_16 +LINE841,837,842,ABC,0.14278,m,2c_16 +LINE842,838,843,ABC,0.20601,m,2c_16 +LINE843,839,844,ABC,4.8092,m,2c_.0225 +LINE844,839,845,ABC,3.6212,m,4c_.06 +LINE845,839,846,ABC,3.6212,m,4c_.06 +LINE846,841,847,ABC,0.48382,m,2c_16 +LINE847,842,848,ABC,0.2151,m,2c_16 +LINE848,843,849,ABC,0.10056,m,2c_16 +LINE849,844,850,ABC,0.7036,m,2c_.0225 +LINE850,845,851,ABC,4.364,m,4c_.06 +LINE851,845,852,ABC,4.364,m,4c_.06 +LINE852,847,853,ABC,0.10706,m,2c_16 +LINE853,848,854,ABC,0.35143,m,2c_16 +LINE854,849,855,ABC,2.2601,m,2c_16 +LINE855,850,856,ABC,1.9822,m,2c_.0225 +LINE856,851,857,ABC,6.8621,m,4c_.06 +LINE857,851,858,ABC,6.8621,m,4c_.06 +LINE858,853,859,ABC,0.084315,m,2c_16 +LINE859,854,860,ABC,2.82,m,2c_16 +LINE860,854,861,ABC,7.5091,m,2c_16 +LINE861,855,862,ABC,1.4697,m,2c_16 +LINE862,856,863,ABC,2.3276,m,2c_.0225 +LINE863,857,864,ABC,2.7888,m,4c_.06 +LINE864,857,865,ABC,2.7888,m,4c_.06 +LINE865,859,866,ABC,0.090338,m,2c_16 +LINE866,862,867,ABC,1.2854,m,2c_16 +LINE867,863,868,ABC,0.30194,m,2c_.0225 +LINE868,864,869,ABC,1.7373,m,4c_.06 +LINE869,864,870,ABC,1.7373,m,4c_.06 +LINE870,866,871,ABC,0.072277,m,2c_16 +LINE871,867,872,ABC,1.3483,m,2c_16 +LINE872,868,873,ABC,0.37952,m,2c_.0225 +LINE873,868,874,ABC,0.84439,m,2c_.0225 +LINE874,869,875,ABC,1.2,m,4c_.06 +LINE875,869,876,ABC,1.2,m,4c_.06 +LINE876,871,877,ABC,0.070178,m,2c_16 +LINE877,872,878,ABC,2.3022,m,2c_16 +LINE878,873,879,ABC,0.35118,m,2c_.0225 +LINE879,874,880,ABC,1.9761,m,2c_.0225 +LINE880,875,881,ABC,1.0112,m,4c_.06 +LINE881,875,882,ABC,1.0112,m,4c_.06 +LINE882,877,883,ABC,0.07,m,2c_16 +LINE883,878,884,ABC,0.56468,m,2c_16 +LINE884,879,885,ABC,0.534,m,2c_.0225 +LINE885,880,886,ABC,4.6879,m,2c_.0225 +LINE886,883,887,ABC,0.069181,m,2c_16 +LINE887,884,888,ABC,0.62293,m,2c_16 +LINE888,884,889,ABC,3.1574,m,35_SAC_XSC +LINE889,885,890,ABC,0.67483,m,2c_.0225 +LINE890,887,891,ABC,1.2371,m,2c_16 +LINE891,888,892,ABC,1.0228,m,2c_16 +LINE892,889,893,ABC,2.6779,m,35_SAC_XSC +LINE893,890,894,ABC,2.6271,m,2c_.0225 +LINE894,891,895,ABC,5.8249,m,2c_16 +LINE895,891,896,ABC,3.2587,m,2c_16 +LINE896,892,897,ABC,0.20223,m,2c_16 +LINE897,893,898,ABC,4.501,m,35_SAC_XSC +LINE898,894,899,ABC,4.7723,m,2c_.0225 +LINE899,895,900,ABC,3.8684,m,2c_16 +LINE900,897,901,ABC,0.17088,m,2c_16 +LINE901,901,902,ABC,0.144,m,2c_16 +LINE902,902,903,ABC,0.18732,m,2c_16 +LINE903,903,904,ABC,0.33902,m,2c_16 +LINE904,904,905,ABC,0.5878,m,2c_16 +LINE905,905,906,ABC,4.8147,m,2c_16 diff --git a/src/test/resources/lvFeeder/LoadShapes.csv b/src/test/resources/lvFeeder/LoadShapes.csv new file mode 100644 index 0000000000..a0841dec34 --- /dev/null +++ b/src/test/resources/lvFeeder/LoadShapes.csv @@ -0,0 +1,57 @@ +# Load Shapes,,,, +Name,npts,minterval,File,useactual +Shape_1,1440,1,Load_profile_1.csv,TRUE +Shape_2,1440,1,Load_profile_2.csv,TRUE +Shape_3,1440,1,Load_profile_3.csv,TRUE +Shape_4,1440,1,Load_profile_4.csv,TRUE +Shape_5,1440,1,Load_profile_5.csv,TRUE +Shape_6,1440,1,Load_profile_6.csv,TRUE +Shape_7,1440,1,Load_profile_7.csv,TRUE +Shape_8,1440,1,Load_profile_8.csv,TRUE +Shape_9,1440,1,Load_profile_9.csv,TRUE +Shape_10,1440,1,Load_profile_10.csv,TRUE +Shape_11,1440,1,Load_profile_11.csv,TRUE +Shape_12,1440,1,Load_profile_12.csv,TRUE +Shape_13,1440,1,Load_profile_13.csv,TRUE +Shape_14,1440,1,Load_profile_14.csv,TRUE +Shape_15,1440,1,Load_profile_15.csv,TRUE +Shape_16,1440,1,Load_profile_16.csv,TRUE +Shape_17,1440,1,Load_profile_17.csv,TRUE +Shape_18,1440,1,Load_profile_18.csv,TRUE +Shape_19,1440,1,Load_profile_19.csv,TRUE +Shape_20,1440,1,Load_profile_20.csv,TRUE +Shape_21,1440,1,Load_profile_21.csv,TRUE +Shape_22,1440,1,Load_profile_22.csv,TRUE +Shape_23,1440,1,Load_profile_23.csv,TRUE +Shape_24,1440,1,Load_profile_24.csv,TRUE +Shape_25,1440,1,Load_profile_25.csv,TRUE +Shape_26,1440,1,Load_profile_26.csv,TRUE +Shape_27,1440,1,Load_profile_27.csv,TRUE +Shape_28,1440,1,Load_profile_28.csv,TRUE +Shape_29,1440,1,Load_profile_29.csv,TRUE +Shape_30,1440,1,Load_profile_30.csv,TRUE +Shape_31,1440,1,Load_profile_31.csv,TRUE +Shape_32,1440,1,Load_profile_32.csv,TRUE +Shape_33,1440,1,Load_profile_33.csv,TRUE +Shape_34,1440,1,Load_profile_34.csv,TRUE +Shape_35,1440,1,Load_profile_35.csv,TRUE +Shape_36,1440,1,Load_profile_36.csv,TRUE +Shape_37,1440,1,Load_profile_37.csv,TRUE +Shape_38,1440,1,Load_profile_38.csv,TRUE +Shape_39,1440,1,Load_profile_39.csv,TRUE +Shape_40,1440,1,Load_profile_40.csv,TRUE +Shape_41,1440,1,Load_profile_41.csv,TRUE +Shape_42,1440,1,Load_profile_42.csv,TRUE +Shape_43,1440,1,Load_profile_43.csv,TRUE +Shape_44,1440,1,Load_profile_44.csv,TRUE +Shape_45,1440,1,Load_profile_45.csv,TRUE +Shape_46,1440,1,Load_profile_46.csv,TRUE +Shape_47,1440,1,Load_profile_47.csv,TRUE +Shape_48,1440,1,Load_profile_48.csv,TRUE +Shape_49,1440,1,Load_profile_49.csv,TRUE +Shape_50,1440,1,Load_profile_50.csv,TRUE +Shape_51,1440,1,Load_profile_51.csv,TRUE +Shape_52,1440,1,Load_profile_52.csv,TRUE +Shape_53,1440,1,Load_profile_53.csv,TRUE +Shape_54,1440,1,Load_profile_54.csv,TRUE +Shape_55,1440,1,Load_profile_55.csv,TRUE diff --git a/src/test/resources/lvFeeder/Loads.csv b/src/test/resources/lvFeeder/Loads.csv new file mode 100644 index 0000000000..256565141f --- /dev/null +++ b/src/test/resources/lvFeeder/Loads.csv @@ -0,0 +1,58 @@ +# Loads ,,,,,,,,, +# Model 1 is constant PQ,,,,,,,,, +Name,numPhases,Bus,phases,kV,Model,Connection,kW,PF,Yearly +LOAD1,1,34,A,0.23,1,wye,1,0.95,Shape_1 +LOAD2,1,47,B,0.23,1,wye,1,0.95,Shape_2 +LOAD3,1,70,A,0.23,1,wye,1,0.95,Shape_3 +LOAD4,1,73,A,0.23,1,wye,1,0.95,Shape_4 +LOAD5,1,74,A,0.23,1,wye,1,0.95,Shape_5 +LOAD6,1,83,B,0.23,1,wye,1,0.95,Shape_6 +LOAD7,1,178,B,0.23,1,wye,1,0.95,Shape_7 +LOAD8,1,208,C,0.23,1,wye,1,0.95,Shape_8 +LOAD9,1,225,A,0.23,1,wye,1,0.95,Shape_9 +LOAD10,1,248,B,0.23,1,wye,1,0.95,Shape_10 +LOAD11,1,249,B,0.23,1,wye,1,0.95,Shape_11 +LOAD12,1,264,C,0.23,1,wye,1,0.95,Shape_12 +LOAD13,1,276,B,0.23,1,wye,1,0.95,Shape_13 +LOAD14,1,289,A,0.23,1,wye,1,0.95,Shape_14 +LOAD15,1,314,B,0.23,1,wye,1,0.95,Shape_15 +LOAD16,1,320,C,0.23,1,wye,1,0.95,Shape_16 +LOAD17,1,327,C,0.23,1,wye,1,0.95,Shape_17 +LOAD18,1,337,C,0.23,1,wye,1,0.95,Shape_18 +LOAD19,1,342,C,0.23,1,wye,1,0.95,Shape_19 +LOAD20,1,349,A,0.23,1,wye,1,0.95,Shape_20 +LOAD21,1,387,A,0.23,1,wye,1,0.95,Shape_21 +LOAD22,1,388,A,0.23,1,wye,1,0.95,Shape_22 +LOAD23,1,406,B,0.23,1,wye,1,0.95,Shape_23 +LOAD24,1,458,C,0.23,1,wye,1,0.95,Shape_24 +LOAD25,1,502,A,0.23,1,wye,1,0.95,Shape_25 +LOAD26,1,522,B,0.23,1,wye,1,0.95,Shape_26 +LOAD27,1,539,C,0.23,1,wye,1,0.95,Shape_27 +LOAD28,1,556,C,0.23,1,wye,1,0.95,Shape_28 +LOAD29,1,562,A,0.23,1,wye,1,0.95,Shape_29 +LOAD30,1,563,A,0.23,1,wye,1,0.95,Shape_30 +LOAD31,1,611,A,0.23,1,wye,1,0.95,Shape_31 +LOAD32,1,614,C,0.23,1,wye,1,0.95,Shape_32 +LOAD33,1,619,C,0.23,1,wye,1,0.95,Shape_33 +LOAD34,1,629,A,0.23,1,wye,1,0.95,Shape_34 +LOAD35,1,639,B,0.23,1,wye,1,0.95,Shape_35 +LOAD36,1,676,B,0.23,1,wye,1,0.95,Shape_36 +LOAD37,1,682,B,0.23,1,wye,1,0.95,Shape_37 +LOAD38,1,688,B,0.23,1,wye,1,0.95,Shape_38 +LOAD39,1,701,C,0.23,1,wye,1,0.95,Shape_39 +LOAD40,1,702,B,0.23,1,wye,1,0.95,Shape_40 +LOAD41,1,755,B,0.23,1,wye,1,0.95,Shape_41 +LOAD42,1,778,C,0.23,1,wye,1,0.95,Shape_42 +LOAD43,1,780,C,0.23,1,wye,1,0.95,Shape_43 +LOAD44,1,785,B,0.23,1,wye,1,0.95,Shape_44 +LOAD45,1,813,B,0.23,1,wye,1,0.95,Shape_45 +LOAD46,1,817,A,0.23,1,wye,1,0.95,Shape_46 +LOAD47,1,835,C,0.23,1,wye,1,0.95,Shape_47 +LOAD48,1,860,A,0.23,1,wye,1,0.95,Shape_48 +LOAD49,1,861,A,0.23,1,wye,1,0.95,Shape_49 +LOAD50,1,886,B,0.23,1,wye,1,0.95,Shape_50 +LOAD51,1,896,A,0.23,1,wye,1,0.95,Shape_51 +LOAD52,1,898,A,0.23,1,wye,1,0.95,Shape_52 +LOAD53,1,899,B,0.23,1,wye,1,0.95,Shape_53 +LOAD54,1,900,A,0.23,1,wye,1,0.95,Shape_54 +LOAD55,1,906,A,0.23,1,wye,1,0.95,Shape_55 diff --git a/src/test/resources/lvFeeder/Source.csv b/src/test/resources/lvFeeder/Source.csv new file mode 100644 index 0000000000..ca83982600 --- /dev/null +++ b/src/test/resources/lvFeeder/Source.csv @@ -0,0 +1,6 @@ +# Source impedance +[Source] +Voltage=11 kV +pu=1.05 +ISC3=3000 A +ISC1=5 A diff --git a/src/test/resources/lvFeeder/Transformer.csv b/src/test/resources/lvFeeder/Transformer.csv new file mode 100644 index 0000000000..2e34814d1a --- /dev/null +++ b/src/test/resources/lvFeeder/Transformer.csv @@ -0,0 +1,3 @@ +# Substation transformer connected Delta/grounded-wye,,,,,,,,,, +Name, phases, bus1, bus2, kV_pri, kV_sec, MVA, Conn_pri, Conn_sec, %XHL,% resistance +TR1,3,SourceBus,1,11,0.416,0.8, Delta, Wye,4,0.4 From 1d9f66cb61db112d1e04eed0561536ce1e345c85 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 21:17:12 +0200 Subject: [PATCH 005/153] corrections on delta transformers Signed-off-by: JB-H --- ...bstractClosedBranchAcFlowEquationTerm.java | 47 +++++++++-- .../ClosedBranchTfoZeroIflowEquationTerm.java | 17 +++- .../AsymmetricalAcEquationSystemCreator.java | 62 ++++++++------- .../openloadflow/network/LfAsymLine.java | 2 +- .../openloadflow/ac/Asym4DeltaTest.java | 79 +++++++++++++++++++ .../openloadflow/ac/Asym4nodesFeederTest.java | 68 +++++++++------- 6 files changed, 202 insertions(+), 73 deletions(-) create mode 100644 src/test/java/com/powsybl/openloadflow/ac/Asym4DeltaTest.java diff --git a/src/main/java/com/powsybl/openloadflow/ac/equations/AbstractClosedBranchAcFlowEquationTerm.java b/src/main/java/com/powsybl/openloadflow/ac/equations/AbstractClosedBranchAcFlowEquationTerm.java index 0b237df035..ba3cd8c397 100644 --- a/src/main/java/com/powsybl/openloadflow/ac/equations/AbstractClosedBranchAcFlowEquationTerm.java +++ b/src/main/java/com/powsybl/openloadflow/ac/equations/AbstractClosedBranchAcFlowEquationTerm.java @@ -11,6 +11,7 @@ import com.powsybl.openloadflow.equations.VariableSet; import com.powsybl.openloadflow.network.LfBranch; import com.powsybl.openloadflow.network.LfBus; +import com.powsybl.openloadflow.network.extensions.AsymBusVariableType; import com.powsybl.openloadflow.util.Fortescue; import net.jafama.FastMath; @@ -70,16 +71,34 @@ protected AbstractClosedBranchAcFlowEquationTerm(LfBranch branch, LfBus bus1, Lf Objects.requireNonNull(variableSet); AcVariableType vType = getVoltageMagnitudeType(sequenceType); AcVariableType angleType = getVoltageAngleType(sequenceType); - v1Var = variableSet.getVariable(bus1.getNum(), vType); - v2Var = variableSet.getVariable(bus2.getNum(), vType); - ph1Var = variableSet.getVariable(bus1.getNum(), angleType); - ph2Var = variableSet.getVariable(bus2.getNum(), angleType); + + // if one side is DELTA, asym zero variables shouldn't be called here + if (sequenceType == Fortescue.SequenceType.POSITIVE) { + v1Var = variableSet.getVariable(bus1.getNum(), vType); + ph1Var = variableSet.getVariable(bus1.getNum(), angleType); + v2Var = variableSet.getVariable(bus2.getNum(), vType); + ph2Var = variableSet.getVariable(bus2.getNum(), angleType); + } else { + v1Var = (bus1.getAsym().getAsymBusVariableType() == AsymBusVariableType.WYE || sequenceType != Fortescue.SequenceType.ZERO) ? variableSet.getVariable(bus1.getNum(), vType) : null; + ph1Var = (bus1.getAsym().getAsymBusVariableType() == AsymBusVariableType.WYE || sequenceType != Fortescue.SequenceType.ZERO) ? variableSet.getVariable(bus1.getNum(), angleType) : null; + v2Var = (bus2.getAsym().getAsymBusVariableType() == AsymBusVariableType.WYE || sequenceType != Fortescue.SequenceType.ZERO) ? variableSet.getVariable(bus2.getNum(), vType) : null; + ph2Var = (bus2.getAsym().getAsymBusVariableType() == AsymBusVariableType.WYE || sequenceType != Fortescue.SequenceType.ZERO) ? variableSet.getVariable(bus2.getNum(), angleType) : null; + } + a1Var = deriveA1 ? variableSet.getVariable(branch.getNum(), AcVariableType.BRANCH_ALPHA1) : null; r1Var = deriveR1 ? variableSet.getVariable(branch.getNum(), AcVariableType.BRANCH_RHO1) : null; - variables.add(v1Var); - variables.add(v2Var); - variables.add(ph1Var); - variables.add(ph2Var); + if (v1Var != null) { + variables.add(v1Var); + } + if (v2Var != null) { + variables.add(v2Var); + } + if (ph1Var != null) { + variables.add(ph1Var); + } + if (ph2Var != null) { + variables.add(ph2Var); + } if (a1Var != null) { variables.add(a1Var); } @@ -93,18 +112,30 @@ public Variable getA1Var() { } protected double v1() { + if (v1Var == null) { + return 0.; + } return sv.get(v1Var.getRow()); } protected double v2() { + if (v2Var == null) { + return 0.; + } return sv.get(v2Var.getRow()); } protected double ph1() { + if (ph1Var == null) { + return 0.; + } return sv.get(ph1Var.getRow()); } protected double ph2() { + if (ph2Var == null) { + return 0.; + } return sv.get(ph2Var.getRow()); } diff --git a/src/main/java/com/powsybl/openloadflow/ac/equations/ClosedBranchTfoZeroIflowEquationTerm.java b/src/main/java/com/powsybl/openloadflow/ac/equations/ClosedBranchTfoZeroIflowEquationTerm.java index d3f7fa2df4..738da549f1 100644 --- a/src/main/java/com/powsybl/openloadflow/ac/equations/ClosedBranchTfoZeroIflowEquationTerm.java +++ b/src/main/java/com/powsybl/openloadflow/ac/equations/ClosedBranchTfoZeroIflowEquationTerm.java @@ -29,7 +29,7 @@ public class ClosedBranchTfoZeroIflowEquationTerm extends AbstractClosedBranchAc public ClosedBranchTfoZeroIflowEquationTerm(LfBranch branch, LfBus bus1, LfBus bus2, VariableSet variableSet, boolean deriveA1, boolean deriveR1, ClosedBranchTfoNegativeIflowEquationTerm.FlowType flowType) { - super(branch, bus1, bus2, variableSet, deriveA1, deriveR1, Fortescue.SequenceType.NEGATIVE); + super(branch, bus1, bus2, variableSet, deriveA1, deriveR1, Fortescue.SequenceType.ZERO); this.flowType = flowType; @@ -113,14 +113,23 @@ public static DenseMatrix getAdmittanceMatrix(Complex z0T1, Complex z0T2, Comple return getYgYgForcedFluxesAdmittanceMatrix(z0T1, z0T2, y0m, zG1, zG2, r1); } } else { - Complex y11; + Complex y11 = new Complex(0., 0.); Complex y22 = new Complex(0., 0.); Complex y12 = y22; - if (leg1Type == LegConnectionType.Y_GROUNDED && leg2Type == LegConnectionType.DELTA) { + if (leg1Type == LegConnectionType.DELTA && leg2Type == LegConnectionType.Y_GROUNDED) { + Complex tmp1 = z0T2.add(y0m.add(z0T1.reciprocal()).reciprocal()); + y22 = (zG2.multiply(3).add(tmp1)).reciprocal(); + } else if (leg1Type == LegConnectionType.Y_GROUNDED && leg2Type == LegConnectionType.DELTA) { Complex tmp2 = z0T1.add(y0m.add(z0T2.reciprocal()).reciprocal()).multiply(1 / (r1 * r1)); y11 = (zG1.multiply(3).add(tmp2)).reciprocal(); + } else if (leg1Type == LegConnectionType.Y && leg2Type == LegConnectionType.Y_GROUNDED && !isFreeFluxes) { + Complex tmp3 = z0T2.add(y0m.reciprocal()); + y22 = (zG2.multiply(3).add(tmp3)).reciprocal(); + } else if (leg1Type == LegConnectionType.Y_GROUNDED && leg2Type == LegConnectionType.Y && !isFreeFluxes) { + Complex tmp4 = z0T1.add(y0m.reciprocal()).multiply(1 / (r1 * r1)); + y11 = (zG1.multiply(3).add(tmp4)).reciprocal(); } else { - throw new IllegalArgumentException("Transfomer with winding config Yg or Y or DELTA not supported in current version of the asymmetric load flow"); + throw new IllegalArgumentException("Transfomer configuration not supported"); } // if windings are in another configuration we consider it is a zero admittance matrix return getMatrixFromBloc44(y11, y22, y12); diff --git a/src/main/java/com/powsybl/openloadflow/ac/equations/asym/AsymmetricalAcEquationSystemCreator.java b/src/main/java/com/powsybl/openloadflow/ac/equations/asym/AsymmetricalAcEquationSystemCreator.java index a9d7b2494f..9256ec961d 100644 --- a/src/main/java/com/powsybl/openloadflow/ac/equations/asym/AsymmetricalAcEquationSystemCreator.java +++ b/src/main/java/com/powsybl/openloadflow/ac/equations/asym/AsymmetricalAcEquationSystemCreator.java @@ -152,10 +152,22 @@ protected void createImpedantBranch(LfBranch branch, LfBus bus1, LfBus bus2, Equ } // no assymmetry is detected with this line, we handle the equations as Fortescue and decoupled - p1 = new ClosedBranchSide1ActiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); - q1 = new ClosedBranchSide1ReactiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); - p2 = new ClosedBranchSide2ActiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); - q2 = new ClosedBranchSide2ReactiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + if (asymBus1.isPositiveSequenceAsCurrent()) { + p1 = new ClosedBranchI1xFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + q1 = new ClosedBranchI1yFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + } else { + p1 = new ClosedBranchSide1ActiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + q1 = new ClosedBranchSide1ReactiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + } + + if (asymBus2.isPositiveSequenceAsCurrent()) { + p2 = new ClosedBranchI2xFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + q2 = new ClosedBranchI2yFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + } else { + p2 = new ClosedBranchSide2ActiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + q2 = new ClosedBranchSide2ReactiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + } + i1 = new ClosedBranchSide1CurrentMagnitudeEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1); i2 = new ClosedBranchSide2CurrentMagnitudeEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1); @@ -199,20 +211,16 @@ protected void createImpedantBranch(LfBranch branch, LfBus bus1, LfBus bus2, Equ } else { // assymmetry is detected with this line, we handle the equations as coupled between the different sequences // positive + if (asymBus1.isPositiveSequenceAsCurrent()) { + // in this case we try to model the positive sequence as current balances + p1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.ONE, SequenceType.POSITIVE); + q1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.ONE, SequenceType.POSITIVE); + } else { + p1 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.ONE, SequenceType.POSITIVE); + q1 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.ONE, SequenceType.POSITIVE); + } - // test: if we are WYE variables and there is a phase missing, the positive sequence is modeled with currents if (isBus1Wye) { - - if (asymBus1.isPositiveSequenceAsCurrent()) { - // in this case we try to model the positive sequence as current balances - p1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.ONE, SequenceType.POSITIVE); - q1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.ONE, SequenceType.POSITIVE); - } else { - p1 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.ONE, SequenceType.POSITIVE); - q1 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.ONE, SequenceType.POSITIVE); - } - - // test if (nbPhases1 == 3) { ixn1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.ONE, SequenceType.NEGATIVE); iyn1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.ONE, SequenceType.NEGATIVE); @@ -223,22 +231,19 @@ protected void createImpedantBranch(LfBranch branch, LfBus bus1, LfBus bus2, Equ } } else { - p1 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.ONE, SequenceType.POSITIVE); - q1 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.ONE, SequenceType.POSITIVE); - ixn1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.ONE, SequenceType.NEGATIVE); iyn1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.ONE, SequenceType.NEGATIVE); } - if (isBus2Wye) { + if (asymBus2.isPositiveSequenceAsCurrent()) { + p2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.TWO, SequenceType.POSITIVE); + q2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.TWO, SequenceType.POSITIVE); + } else { + p2 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.TWO, SequenceType.POSITIVE); + q2 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.TWO, SequenceType.POSITIVE); + } - if (asymBus2.isPositiveSequenceAsCurrent()) { - p2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.TWO, SequenceType.POSITIVE); - q2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.TWO, SequenceType.POSITIVE); - } else { - p2 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.TWO, SequenceType.POSITIVE); - q2 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.TWO, SequenceType.POSITIVE); - } + if (isBus2Wye) { if (nbPhases2 == 3) { ixn2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.TWO, SequenceType.NEGATIVE); @@ -249,9 +254,6 @@ protected void createImpedantBranch(LfBranch branch, LfBus bus1, LfBus bus2, Equ iyz2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.TWO, SequenceType.ZERO); } } else { - p2 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.TWO, SequenceType.POSITIVE); - q2 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.TWO, SequenceType.POSITIVE); - ixn2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.TWO, SequenceType.NEGATIVE); iyn2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.TWO, SequenceType.NEGATIVE); } diff --git a/src/main/java/com/powsybl/openloadflow/network/LfAsymLine.java b/src/main/java/com/powsybl/openloadflow/network/LfAsymLine.java index 210b431834..9c3abd6328 100644 --- a/src/main/java/com/powsybl/openloadflow/network/LfAsymLine.java +++ b/src/main/java/com/powsybl/openloadflow/network/LfAsymLine.java @@ -85,9 +85,9 @@ public LfAsymLine(ComplexMatrix yabc, boolean phaseOpenA, boolean phaseOpenB, bo this.hasPhaseC2 = hasPhaseC2; this.isSide1FortescueRepresentation = isSide1FortescueRepresentation; this.isSide2FortescueRepresentation = isSide2FortescueRepresentation; - admittanceMatrix = new LfAsymLineAdmittanceMatrix(this); this.side1VariableType = side1VariableType; this.side2VariableType = side2VariableType; + admittanceMatrix = new LfAsymLineAdmittanceMatrix(this); } public LfAsymLineAdmittanceMatrix getAdmittanceMatrix() { diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym4DeltaTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym4DeltaTest.java new file mode 100644 index 0000000000..a1e860d3a4 --- /dev/null +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym4DeltaTest.java @@ -0,0 +1,79 @@ +package com.powsybl.openloadflow.ac; + +import com.powsybl.iidm.network.Bus; +import com.powsybl.iidm.network.Network; +import com.powsybl.iidm.network.extensions.WindingConnectionType; +import com.powsybl.loadflow.LoadFlow; +import com.powsybl.loadflow.LoadFlowParameters; +import com.powsybl.loadflow.LoadFlowResult; +import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.openloadflow.OpenLoadFlowParameters; +import com.powsybl.openloadflow.OpenLoadFlowProvider; +import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.extensions.iidm.StepWindingConnectionType; +import org.apache.commons.math3.complex.Complex; +import org.junit.jupiter.api.Test; + +import static com.powsybl.openloadflow.util.LoadFlowAssert.assertAngleEquals; +import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class Asym4DeltaTest { + + private Network network; + private Bus bus1; + private Bus bus2; + private Bus bus3; + private Bus bus4; + + private LoadFlow.Runner loadFlowRunner; + private LoadFlowParameters parameters; + + @Test + void deltaY() { + + Complex zz = new Complex(0.1, 0.01); // 0.0001 , 0.001 + Complex zn = new Complex(0.1, 0.01); // 0.001 , 0.01 + Boolean isLoadBalanced = true; + WindingConnectionType w1 = WindingConnectionType.DELTA; + WindingConnectionType w2 = WindingConnectionType.Y_GROUNDED; + int numDisconnectedPhase = 0; + StepWindingConnectionType stepWindingConnectionType = StepWindingConnectionType.STEP_DOWN; + + network = Asym4nodesFeederTest.ieee4Feeder(zz, zn, isLoadBalanced, WindingConnectionType.Y_GROUNDED, w1, w2); + + bus1 = network.getBusBreakerView().getBus("B1"); + bus2 = network.getBusBreakerView().getBus("B2"); + bus3 = network.getBusBreakerView().getBus("B3"); + bus4 = network.getBusBreakerView().getBus("B4"); + + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) + .setDistributedSlack(false); + OpenLoadFlowParameters.create(parameters) + .setMaxNewtonRaphsonIterations(100) + .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) + .setAsymmetrical(true); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + + assertVoltageEquals(12.47, bus1); + assertAngleEquals(0., bus1); + assertVoltageEquals(12.433526294098483, bus2); + assertVoltageEquals(2.2804714045919776, bus3); + assertVoltageEquals(2.0355904463879693, bus4); + + // addition of an extension to have a 3 phase transformer and new load flow: + Asym4nodesFeederTest.addTfo3PhaseExtension(network, w2, stepWindingConnectionType, numDisconnectedPhase); + result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + + assertVoltageEquals(12.47, bus1); + assertAngleEquals(0., bus1); + assertVoltageEquals(12.401647497875299, bus2); + assertVoltageEquals(2.274193122764982, bus3); + assertVoltageEquals(2.0302309634844096, bus4); + } + +} diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym4nodesFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym4nodesFeederTest.java index 9f6d350649..61b612dff8 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym4nodesFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym4nodesFeederTest.java @@ -46,8 +46,8 @@ public class Asym4nodesFeederTest { @Test void ygYgUnbalancedTest() { - Complex zz = new Complex(0.1, 0.01); // 0.0001 , 0.001 - Complex zn = new Complex(0.1, 0.01); // 0.001 , 0.01 + Complex zz = new Complex(0.0001, 0.0001); // 0.0001 , 0.001 + Complex zn = new Complex(0.0001, 0.0001); // 0.001 , 0.01 Boolean isLoadBalanced = false; WindingConnectionType w1 = WindingConnectionType.Y_GROUNDED; WindingConnectionType w2 = WindingConnectionType.Y_GROUNDED; @@ -65,6 +65,7 @@ void ygYgUnbalancedTest() { parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); OpenLoadFlowParameters.create(parameters) + .setMaxNewtonRaphsonIterations(100) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setAsymmetrical(true); @@ -73,12 +74,12 @@ void ygYgUnbalancedTest() { assertVoltageEquals(7.199557856794634, bus1); assertAngleEquals(0., bus1); - assertVoltageEquals(7.133584938970962, bus2); - assertVoltageEquals(2.3420558121701402, bus3); - assertVoltageEquals(2.0966856983831206, bus4); + assertVoltageEquals(7.121540042954291, bus2); + assertVoltageEquals(2.2440043558129816, bus3); + assertVoltageEquals(1.9562695924418882, bus4); // addition of an extension to have a 3 phase transformer and new load flow: - addTfo3PhaseExtension(w2, stepWindingConnectionType, numDisconnectedPhase); + addTfo3PhaseExtension(network, w2, stepWindingConnectionType, numDisconnectedPhase); result = loadFlowRunner.run(network, parameters); assertTrue(result.isOk()); @@ -92,8 +93,8 @@ void ygYgUnbalancedTest() { @Test void ygYgTest() { - Complex zz = new Complex(0.1, 0.01); // 0.0001 , 0.001 - Complex zn = new Complex(0.1, 0.01); // 0.001 , 0.01 + Complex zz = new Complex(0.00001, 0.00001); // 0.0001 , 0.001 + Complex zn = new Complex(0.00001, 0.00001); // 0.001 , 0.01 Boolean isLoadBalanced = true; WindingConnectionType w1 = WindingConnectionType.Y_GROUNDED; WindingConnectionType w2 = WindingConnectionType.Y_GROUNDED; @@ -111,6 +112,7 @@ void ygYgTest() { parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); OpenLoadFlowParameters.create(parameters) + .setMaxNewtonRaphsonIterations(100) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setAsymmetrical(true); @@ -120,11 +122,11 @@ void ygYgTest() { assertVoltageEquals(7.199557856794634, bus1); assertAngleEquals(0., bus1); assertVoltageEquals(7.132278619390253, bus2); - assertVoltageEquals(2.344230653528591, bus3); - assertVoltageEquals(2.107863958213946, bus4); + assertVoltageEquals(2.2643149471277386, bus3); + assertVoltageEquals(2.017173369480019, bus4); // addition of an extension to have a 3 phase transformer and new load flow: - addTfo3PhaseExtension(w2, stepWindingConnectionType, numDisconnectedPhase); + addTfo3PhaseExtension(network, w2, stepWindingConnectionType, numDisconnectedPhase); result = loadFlowRunner.run(network, parameters); assertTrue(result.isOk()); @@ -174,12 +176,12 @@ void ygDeltaTest() { assertVoltageEquals(7.199557856794634, bus1); assertAngleEquals(0., bus1); - assertVoltageEquals(7.015678041873337, bus2); - assertVoltageEquals(3.842798277594563, bus3); - assertVoltageEquals(3.4440931482904062, bus4); + assertVoltageEquals(6.966398471893453, bus2); + assertVoltageEquals(3.222022038533233, bus3); + assertVoltageEquals(2.716189992104315, bus4); // addition of an extension to have a 3 phase transformer and new load flow: - addTfo3PhaseExtension(w2, stepWindingConnectionType, numDisconnectedPhase); + addTfo3PhaseExtension(network, w2, stepWindingConnectionType, numDisconnectedPhase); result = loadFlowRunner.run(network, parameters); assertTrue(result.isOk()); @@ -228,12 +230,12 @@ void deltaDeltaTest() { assertVoltageEquals(12.47, bus1); assertAngleEquals(0., bus1); - assertVoltageEquals(12.363327843118185, bus2); - assertVoltageEquals(3.919374745381408, bus3); - assertVoltageEquals(3.5306643903086035, bus4); + assertVoltageEquals(12.343319573062105, bus2); + assertVoltageEquals(3.3615589948468156, bus3); + assertVoltageEquals(2.885485615952693, bus4); // addition of an extension to have a 3 phase transformer and new load flow: - addTfo3PhaseExtension(w2, stepWindingConnectionType, numDisconnectedPhase); + addTfo3PhaseExtension(network, w2, stepWindingConnectionType, numDisconnectedPhase); result = loadFlowRunner.run(network, parameters); assertTrue(result.isOk()); @@ -282,12 +284,12 @@ void ygDeltaUnbalancedTest() { assertVoltageEquals(7.199557856794634, bus1); assertAngleEquals(0., bus1); - assertVoltageEquals(7.0078109349944375, bus2); - assertVoltageEquals(3.8315940839604075, bus3); - assertVoltageEquals(3.413967683262305, bus4); + assertVoltageEquals(6.937021164658664, bus2); + assertVoltageEquals(3.1166742441520894, bus3); + assertVoltageEquals(2.547669019028284, bus4); // addition of an extension to have a 3 phase transformer and new load flow: - addTfo3PhaseExtension(w2, stepWindingConnectionType, numDisconnectedPhase); + addTfo3PhaseExtension(network, w2, stepWindingConnectionType, numDisconnectedPhase); result = loadFlowRunner.run(network, parameters); assertTrue(result.isOk()); @@ -354,17 +356,15 @@ public static Network ieee4Feeder(Complex zz, Complex zn, boolean isLoadBalanced .setBus(bus1.getId()) .setMinP(-100.0) .setMaxP(200) - .setTargetP(0) + .setTargetP(2) .setTargetV(v1nom) .setVoltageRegulatorOn(true) .add(); gen1.newExtension(GeneratorFortescueAdder.class) .withRz(zz.getReal()) - //.withXz(0.001) .withXz(zz.getImaginary()) .withRn(zn.getReal()) - //.withXn(0.01) .withXn(zn.getImaginary()) .add(); @@ -388,6 +388,7 @@ public static Network ieee4Feeder(Complex zz, Complex zn, boolean isLoadBalanced bus2.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(side1VariableType) + .withPositiveSequenceAsCurrent(true) .add(); // Bus3 @@ -405,6 +406,7 @@ public static Network ieee4Feeder(Complex zz, Complex zn, boolean isLoadBalanced bus3.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(side2VariableType) + .withPositiveSequenceAsCurrent(true) .add(); // Bus4 @@ -426,6 +428,7 @@ public static Network ieee4Feeder(Complex zz, Complex zn, boolean isLoadBalanced bus4.setV(v3nom).setAngle(0.); bus4.newExtension(BusAsymmetricalAdder.class) + .withPositiveSequenceAsCurrent(true) .withBusVariableType(side2VariableType) .add(); @@ -562,9 +565,14 @@ public static Network ieee4Feeder(Complex zz, Complex zn, boolean isLoadBalanced .setB2(0.0) .add(); + // addition of asymmetrical extensions + ComplexMatrix yabc12 = ComplexMatrix.getMatrixScaled(ywyeabc, feetInMile / length1InFeet); + if (side1VariableType == BusVariableType.DELTA) { + yabc12 = ComplexMatrix.getMatrixScaled(yDeltaabc, feetInMile / length1InFeet); + } // addition of asymmetrical extensions line12.newExtension(LineAsymmetricalAdder.class) - .withYabc(ComplexMatrix.getMatrixScaled(ywyeabc, feetInMile / length1InFeet)) + .withYabc(yabc12) .add(); line12.newExtension(LineFortescueAdder.class) @@ -620,8 +628,8 @@ public static Network ieee4Feeder(Complex zz, Complex zn, boolean isLoadBalanced } double zBase = ratedU3 * ratedU3 / sBase; - double rT23 = zBase / 3. / 100; - double xT23 = 6. * zBase / 3. / 100; + double rT23 = zBase / 100; + double xT23 = 6. * zBase / 100; var t23 = substation23.newTwoWindingsTransformer() .setId("T2W_B2_B3") .setVoltageLevel1(vl2.getId()) @@ -652,7 +660,7 @@ public static Network ieee4Feeder(Complex zz, Complex zn, boolean isLoadBalanced return network; } - public void addTfo3PhaseExtension(WindingConnectionType w2, StepWindingConnectionType stepWindingConnectionType, int numDisconnectedPhase) { + public static void addTfo3PhaseExtension(Network network, WindingConnectionType w2, StepWindingConnectionType stepWindingConnectionType, int numDisconnectedPhase) { TwoWindingsTransformer t2w = network.getTwoWindingsTransformer("T2W_B2_B3"); // step up case, we use Vbase of transformer = Vnom From 18dace373152531a16e346eafe380d2123652bca Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 006/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 3d34777d6d33d0832b0e900aaef48c8c34dd21ab Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 007/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From c94bbf797adb8146f9f025baf7819f45ed99dc78 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 008/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../extensions/iidm/BusAsymmetrical.java | 20 + .../network/impl/LfBranchImpl.java | 6 + .../network/util/AsymIeeeFeederParser.java | 643 +++++++++++++ .../network/util/AsymLvFeederParser.java | 352 +++++++ .../openloadflow/ac/Asym13BusFeederTest.java | 2 +- .../openloadflow/ac/Asym34BusFeederTest.java | 12 +- .../util/AsymIeeeFeederParserTest.java | 98 ++ src/test/resources/ieeeFeeder123/Bus.csv | 120 +++ .../ieeeFeeder123/DistributedLoad.csv | 1 + src/test/resources/ieeeFeeder123/Gen.csv | 2 + src/test/resources/ieeeFeeder123/Line.csv | 119 +++ .../resources/ieeeFeeder123/LineConfig.csv | 14 + .../resources/ieeeFeeder123/Regulator.csv | 5 + src/test/resources/ieeeFeeder123/SpotLoad.csv | 86 ++ src/test/resources/ieeeFeeder123/Tfo.csv | 1 + .../resources/ieeeFeeder123/TfoConfig.csv | 1 + src/test/resources/ieeeFeeder13/Bus.csv | 13 + .../ieeeFeeder13/DistributedLoad.csv | 2 + src/test/resources/ieeeFeeder13/Gen.csv | 2 + src/test/resources/ieeeFeeder13/Line.csv | 11 + .../resources/ieeeFeeder13/LineConfig.csv | 8 + src/test/resources/ieeeFeeder13/Regulator.csv | 2 + src/test/resources/ieeeFeeder13/SpotLoad.csv | 10 + src/test/resources/ieeeFeeder13/Tfo.csv | 2 + src/test/resources/ieeeFeeder13/TfoConfig.csv | 3 + src/test/resources/ieeeFeeder34/Bus.csv | 35 + .../ieeeFeeder34/DistributedLoad.csv | 19 + src/test/resources/ieeeFeeder34/Gen.csv | 2 + src/test/resources/ieeeFeeder34/Line.csv | 33 + .../resources/ieeeFeeder34/LineConfig.csv | 6 + src/test/resources/ieeeFeeder34/Regulator.csv | 3 + src/test/resources/ieeeFeeder34/SpotLoad.csv | 7 + src/test/resources/ieeeFeeder34/Tfo.csv | 2 + src/test/resources/ieeeFeeder34/TfoConfig.csv | 3 + src/test/resources/lvFeeder/Buscoords.csv | 908 ++++++++++++++++++ src/test/resources/lvFeeder/LineCodes.csv | 12 + src/test/resources/lvFeeder/Lines.csv | 907 +++++++++++++++++ src/test/resources/lvFeeder/LoadShapes.csv | 57 ++ src/test/resources/lvFeeder/Loads.csv | 58 ++ src/test/resources/lvFeeder/Source.csv | 6 + src/test/resources/lvFeeder/Transformer.csv | 3 + 41 files changed, 3589 insertions(+), 7 deletions(-) create mode 100644 src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java create mode 100644 src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java create mode 100644 src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java create mode 100644 src/test/resources/ieeeFeeder123/Bus.csv create mode 100644 src/test/resources/ieeeFeeder123/DistributedLoad.csv create mode 100644 src/test/resources/ieeeFeeder123/Gen.csv create mode 100644 src/test/resources/ieeeFeeder123/Line.csv create mode 100644 src/test/resources/ieeeFeeder123/LineConfig.csv create mode 100644 src/test/resources/ieeeFeeder123/Regulator.csv create mode 100644 src/test/resources/ieeeFeeder123/SpotLoad.csv create mode 100644 src/test/resources/ieeeFeeder123/Tfo.csv create mode 100644 src/test/resources/ieeeFeeder123/TfoConfig.csv create mode 100644 src/test/resources/ieeeFeeder13/Bus.csv create mode 100644 src/test/resources/ieeeFeeder13/DistributedLoad.csv create mode 100644 src/test/resources/ieeeFeeder13/Gen.csv create mode 100644 src/test/resources/ieeeFeeder13/Line.csv create mode 100644 src/test/resources/ieeeFeeder13/LineConfig.csv create mode 100644 src/test/resources/ieeeFeeder13/Regulator.csv create mode 100644 src/test/resources/ieeeFeeder13/SpotLoad.csv create mode 100644 src/test/resources/ieeeFeeder13/Tfo.csv create mode 100644 src/test/resources/ieeeFeeder13/TfoConfig.csv create mode 100644 src/test/resources/ieeeFeeder34/Bus.csv create mode 100644 src/test/resources/ieeeFeeder34/DistributedLoad.csv create mode 100644 src/test/resources/ieeeFeeder34/Gen.csv create mode 100644 src/test/resources/ieeeFeeder34/Line.csv create mode 100644 src/test/resources/ieeeFeeder34/LineConfig.csv create mode 100644 src/test/resources/ieeeFeeder34/Regulator.csv create mode 100644 src/test/resources/ieeeFeeder34/SpotLoad.csv create mode 100644 src/test/resources/ieeeFeeder34/Tfo.csv create mode 100644 src/test/resources/ieeeFeeder34/TfoConfig.csv create mode 100644 src/test/resources/lvFeeder/Buscoords.csv create mode 100644 src/test/resources/lvFeeder/LineCodes.csv create mode 100644 src/test/resources/lvFeeder/Lines.csv create mode 100644 src/test/resources/lvFeeder/LoadShapes.csv create mode 100644 src/test/resources/lvFeeder/Loads.csv create mode 100644 src/test/resources/lvFeeder/Source.csv create mode 100644 src/test/resources/lvFeeder/Transformer.csv diff --git a/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/BusAsymmetrical.java b/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/BusAsymmetrical.java index e300b1aaf5..8b15cc2f55 100644 --- a/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/BusAsymmetrical.java +++ b/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/BusAsymmetrical.java @@ -65,4 +65,24 @@ public boolean isFortescueRepresentation() { public boolean isPositiveSequenceAsCurrent() { return isPositiveSequenceAsCurrent; } + + public void setPositiveSequenceAsCurrent(boolean positiveSequenceAsCurrent) { + isPositiveSequenceAsCurrent = positiveSequenceAsCurrent; + } + + public void setFortescueRepresentation(boolean fortescueRepresentation) { + isFortescueRepresentation = fortescueRepresentation; + } + + public void setHasPhaseA(boolean hasPhaseA) { + this.hasPhaseA = hasPhaseA; + } + + public void setHasPhaseB(boolean hasPhaseB) { + this.hasPhaseB = hasPhaseB; + } + + public void setHasPhaseC(boolean hasPhaseC) { + this.hasPhaseC = hasPhaseC; + } } diff --git a/src/main/java/com/powsybl/openloadflow/network/impl/LfBranchImpl.java b/src/main/java/com/powsybl/openloadflow/network/impl/LfBranchImpl.java index 69671e2562..72d8826844 100644 --- a/src/main/java/com/powsybl/openloadflow/network/impl/LfBranchImpl.java +++ b/src/main/java/com/powsybl/openloadflow/network/impl/LfBranchImpl.java @@ -216,9 +216,15 @@ private static void createTransfoToAsym(TwoWindingsTransformer t2w, double zb, L if (asymBus1 != null) { side1VariableType = asymBus1.getAsymBusVariableType(); + if (!asymBus1.isFortescueRepresentation()) { + throw new PowsyblException("A three phase transformer must have its busses in Fortescue representation but bus 1 of '" + t2w.getId() + "' is in ABC representation"); + } } if (asymBus2 != null) { side2VariableType = asymBus2.getAsymBusVariableType(); + if (!asymBus2.isFortescueRepresentation()) { + throw new PowsyblException("A three phase transformer must have its busses in Fortescue representation but bus 2 of '" + t2w.getId() + "' is in ABC representation"); + } } AsymThreePhaseTransfo asym3phaseTfo = new AsymThreePhaseTransfo(leg1Type, leg2Type, stepLegConnectionType, diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java new file mode 100644 index 0000000000..4ca3d3aea2 --- /dev/null +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -0,0 +1,643 @@ +package com.powsybl.openloadflow.network.util; + +import com.powsybl.iidm.network.*; +import com.powsybl.iidm.network.extensions.*; +import com.powsybl.math.matrix.DenseMatrix; +import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; +import com.powsybl.openloadflow.util.ComplexMatrix; +import com.univocity.parsers.annotations.Parsed; +import com.univocity.parsers.common.processor.BeanListProcessor; +import com.univocity.parsers.csv.CsvParser; +import com.univocity.parsers.csv.CsvParserSettings; +import org.apache.commons.math3.complex.Complex; +import org.joda.time.DateTime; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.util.*; + +public final class AsymIeeeFeederParser { + + private AsymIeeeFeederParser() { + } + + private static List parseCsv(String resourceName, Class clazz) { + try (Reader inputReader = new InputStreamReader(Objects.requireNonNull(AsymIeeeFeederParser.class.getResourceAsStream(resourceName)), StandardCharsets.UTF_8)) { + BeanListProcessor rowProcessor = new BeanListProcessor<>(clazz); + CsvParserSettings settings = new CsvParserSettings(); + settings.setHeaderExtractionEnabled(true); + settings.setProcessor(rowProcessor); + CsvParser parser = new CsvParser(settings); + parser.parse(inputReader); + return rowProcessor.getBeans(); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + public static class LineData { + @Parsed(field = "NodeA") + String nodeA; + + @Parsed(field = "NodeB") + String nodeB; + + @Parsed(field = "Length") + double length; + + @Parsed(field = "Config") + String config; + } + + public static class TfoData { + @Parsed(field = "NodeA") + String nodeA; + + @Parsed(field = "NodeB") + String nodeB; + + @Parsed(field = "Config") + String config; + } + + public static class GenData { + @Parsed(field = "GenName") + String genName; + + @Parsed(field = "BusName") + String busName; + + @Parsed(field = "SetPoint") + double setPoint; + + } + + public static class BusData { + @Parsed(field = "BusName") + String busName; + + @Parsed(field = "UNom") + double uNom; + + } + + public static class LoadData { + @Parsed(field = "Node") + String busName; + + @Parsed(field = "Load") + String loadType; + + @Parsed(field = "Ph-1") + double ph1P; + + @Parsed(field = "Ph-1Q") + double ph1Q; + + @Parsed(field = "Ph-2") + double ph2P; + + @Parsed(field = "Ph-2Q") + double ph2Q; + + @Parsed(field = "Ph-3") + double ph3P; + + @Parsed(field = "Ph-3Q") + double ph3Q; + + } + + public static class DistriLoadData { + @Parsed(field = "NodeA") + String busNameA; + + @Parsed(field = "NodeB") + String busNameB; + + @Parsed(field = "Load") + String loadType; + + @Parsed(field = "Ph-1") + double ph1P; + + @Parsed(field = "Ph-1Q") + double ph1Q; + + @Parsed(field = "Ph-2") + double ph2P; + + @Parsed(field = "Ph-2Q") + double ph2Q; + + @Parsed(field = "Ph-3") + double ph3P; + + @Parsed(field = "Ph-3Q") + double ph3Q; + } + + public static class LineConfigData { + @Parsed(field = "Config") + String config; + + @Parsed(field = "PhaseA") + int phaseA; + + @Parsed(field = "PhaseB") + int phaseB; + + @Parsed(field = "PhaseC") + int phaseC; + + @Parsed + double r11; + + @Parsed + double x11; + + @Parsed + double r12; + + @Parsed + double x12; + + @Parsed + double r13; + + @Parsed + double x13; + + @Parsed + double r22; + + @Parsed + double x22; + + @Parsed + double r23; + + @Parsed + double x23; + + @Parsed + double r33; + + @Parsed + double x33; + + @Parsed + double b11; + + @Parsed + double b12; + + @Parsed + double b13; + + @Parsed + double b22; + + @Parsed + double b23; + + @Parsed + double b33; + } + + public static class TfoConfigData { + @Parsed(field = "Config") + String config; + + @Parsed(field = "SkVA") + double skva; + + @Parsed(field = "kV-high") + double kvHigh; + + @Parsed(field = "Winding-high") + String windingHigh; + + @Parsed(field = "kV-low") + double kvLow; + + @Parsed(field = "Winding-low") + String windingLow; + + @Parsed(field = "R") + double r; + + @Parsed(field = "X") + double x; + + } + + public static class RegulatorData { + @Parsed(field = "Line") + String line; + + @Parsed(field = "RhoA") + double rhoA; + + @Parsed(field = "RhoB") + double rhoB; + + @Parsed(field = "RhoC") + double rhoC; + + } + + private static String getBusId(String busName) { + return "Bus-" + busName; + } + + private static String getVoltageLevelId(String busName) { + return "VoltageLevel-" + busName; + } + + private static String getSubstationId(String busName) { + return "Substation-" + busName; + } + + private static void createBuses(Network network, Map firstBusTfo, String path) { + for (BusData busData : parseCsv(path + "Bus.csv", BusData.class)) { + + String substationId = getSubstationId(busData.busName); + if (firstBusTfo.containsKey(busData.busName)) { + substationId = getSubstationId(firstBusTfo.get(busData.busName)); + } + Substation s = network.getSubstation(substationId); + if (s == null) { + s = network.newSubstation() + .setId(substationId) + .add(); + } + VoltageLevel vl = s.newVoltageLevel() + .setId(getVoltageLevelId(busData.busName)) + .setTopologyKind(TopologyKind.BUS_BREAKER) + .setNominalV(busData.uNom) + .add(); + Bus bus = vl.getBusBreakerView().newBus() + .setId(getBusId(busData.busName)) + .add(); + + bus.setV(busData.uNom).setAngle(0.); + + // default settings for bus extensions, will be modified depending on the type of connected equipment : + bus.newExtension(BusAsymmetricalAdder.class) + .withBusVariableType(BusVariableType.WYE) + .withHasPhaseA(false) + .withHasPhaseB(false) + .withHasPhaseC(false) + .withPositiveSequenceAsCurrent(true) + .withFortescueRepresentation(true) + .add(); + } + } + + private static void createGenerators(Network network, String path) { + for (GenData gen : parseCsv(path + "Gen.csv", GenData.class)) { + VoltageLevel vl = network.getVoltageLevel(getVoltageLevelId(gen.busName)); + Generator generator = vl.newGenerator() + .setId(gen.genName) + .setBus(getBusId(gen.busName)) + .setMinP(-100.0) + .setMaxP(200) + .setTargetP(0.0) + .setTargetV(vl.getNominalV() * gen.setPoint) // TODO : TEST + .setVoltageRegulatorOn(true) + .add(); + + Complex zz = new Complex(0.0001, 0.0001); + Complex zn = new Complex(0.0001, 0.0001); + + generator.newExtension(GeneratorFortescueAdder.class) + .withRz(zz.getReal()) + .withXz(zz.getImaginary()) + .withRn(zn.getReal()) + .withXn(zn.getImaginary()) + .add(); + + // modification of bus extension due to generating unit + network.getBusBreakerView().getBus(getBusId(gen.busName)).getExtension(BusAsymmetrical.class).setPositiveSequenceAsCurrent(false); + + } + } + + private static List parseTfos(String path) { + + List listTfos = new ArrayList<>(); + for (TfoData tfo : parseCsv(path + "Tfo.csv", TfoData.class)) { + listTfos.add(tfo); + } + + return listTfos; + } + + private static Map getFirstBusTfo(List listTfos) { + // used to create a substation with the name of the first bus for a tfo + Map firstBusTfo = new HashMap<>(); + for (TfoData tfo : listTfos) { + firstBusTfo.put(tfo.nodeB, tfo.nodeA); + } + + return firstBusTfo; + } + + private static void createLoad(Network network, String loadName, String busName, String loadType, + double pa, double qa, double pb, double qb, double pc, double qc) { + VoltageLevel vl = network.getVoltageLevel(getVoltageLevelId(busName)); + Load load = vl.newLoad() + .setId(loadName) + .setBus(getBusId(busName)) + .setP0(0.) + .setQ0(0.) + .add(); + + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); + LoadConnectionType loadConnectionType; + LoadType loadTypeOut; + if (loadType.equals("Y-PQ")) { + loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; + } else if (loadType.equals("D-PQ")) { + loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; + } else if (loadType.equals("Y-Z")) { + loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + extensionBus.setFortescueRepresentation(false); + } else if (loadType.equals("D-Z")) { + loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + extensionBus.setFortescueRepresentation(false); + } else if (loadType.equals("Y-I")) { + loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_CURRENT; + extensionBus.setFortescueRepresentation(false); + } else if (loadType.equals("D-I")) { + loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_CURRENT; + extensionBus.setFortescueRepresentation(false); + } else { + throw new IllegalStateException("Unknown load type in csv at bus : " + busName); + } + + load.newExtension(LoadAsymmetricalAdder.class) + .withDeltaPa(pa / 1000.) + .withDeltaQa(qa / 1000.) + .withDeltaPb(pb / 1000.) + .withDeltaQb(qb / 1000.) + .withDeltaPc(pc / 1000.) + .withDeltaQc(qc / 1000.) + .withConnectionType(loadConnectionType) + .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + + } + + private static void createLoads(Network network, String path) { + + for (LoadData loadData : parseCsv(path + "SpotLoad.csv", LoadData.class)) { + + String loadName = "LOAD_" + loadData.busName + "-" + loadData.loadType; + + createLoad(network, loadName, loadData.busName, loadData.loadType, + loadData.ph1P, loadData.ph1Q, loadData.ph2P, loadData.ph2Q, loadData.ph3P, loadData.ph3Q); + } + } + + private static void createDistriLoads(Network network, String path) { + + for (DistriLoadData loadData : parseCsv(path + "DistributedLoad.csv", DistriLoadData.class)) { + String loadName = "LOAD_" + loadData.busNameA + "-" + loadData.busNameB + "-" + loadData.loadType; + + createLoad(network, loadName, loadData.busNameA, loadData.loadType, + loadData.ph1P, loadData.ph1Q, loadData.ph2P, loadData.ph2Q, loadData.ph3P, loadData.ph3Q); + } + } + + private static void createLines(Network network, String path) { + Map lineConfig = new HashMap<>(); + for (LineConfigData lineCode : parseCsv(path + "LineConfig.csv", LineConfigData.class)) { + lineConfig.put(lineCode.config, lineCode); + } + Map regulatorDataMap = new HashMap<>(); + for (RegulatorData regulatorData : parseCsv(path + "Regulator.csv", RegulatorData.class)) { + String lineName = "Line-" + regulatorData.line; + regulatorDataMap.put(lineName, regulatorData); + } + + for (LineData line : parseCsv(path + "Line.csv", LineData.class)) { + LineConfigData lineConfigData = lineConfig.get(line.config); + var l = network.newLine() + .setId("Line-" + line.nodeA + "-" + line.nodeB) + .setVoltageLevel1(getVoltageLevelId(line.nodeA)) + .setBus1(getBusId(line.nodeA)) + .setVoltageLevel2(getVoltageLevelId(line.nodeB)) + .setBus2(getBusId(line.nodeB)) + .setR(1.0 * line.length / 1000) + .setX(1.0 * line.length / 1000) + .add(); + + l.newExtension(LineFortescueAdder.class) + .withOpenPhaseA(false) + .withOpenPhaseB(false) + .withOpenPhaseC(false) + .withRz(1.0 * line.length / 1000) + .withXz(1.0 * line.length / 1000) + .add(); + + double micro = 0.000001; + double feetInMile = 5280; + double yCoef = 1. / 3.; + + // building of Yabc from given Y impedance matrix Zy + ComplexMatrix zy = new ComplexMatrix(3, 3); + zy.set(1, 1, new Complex(lineConfigData.r11, lineConfigData.x11)); + zy.set(1, 2, new Complex(lineConfigData.r12, lineConfigData.x12)); + zy.set(1, 3, new Complex(lineConfigData.r13, lineConfigData.x13)); + zy.set(2, 1, new Complex(lineConfigData.r12, lineConfigData.x12)); + zy.set(2, 2, new Complex(lineConfigData.r22, lineConfigData.x22)); + zy.set(2, 3, new Complex(lineConfigData.r23, lineConfigData.x23)); + zy.set(3, 1, new Complex(lineConfigData.r13, lineConfigData.x13)); + zy.set(3, 2, new Complex(lineConfigData.r23, lineConfigData.x23)); + zy.set(3, 3, new Complex(lineConfigData.r33, lineConfigData.x33)); + + ComplexMatrix b = new ComplexMatrix(3, 3); + + b.set(1, 1, new Complex(0, micro * lineConfigData.b11)); + b.set(1, 2, new Complex(0, micro * lineConfigData.b12)); + b.set(1, 3, new Complex(0, micro * lineConfigData.b13)); + b.set(2, 1, new Complex(0, micro * lineConfigData.b12)); + b.set(2, 2, new Complex(0, micro * lineConfigData.b22)); + b.set(2, 3, new Complex(0, micro * lineConfigData.b23)); + b.set(3, 1, new Complex(0, micro * lineConfigData.b13)); + b.set(3, 2, new Complex(0, micro * lineConfigData.b23)); + b.set(3, 3, new Complex(0, micro * lineConfigData.b33)); + + boolean hasPhaseA = lineConfigData.phaseA == 1; + boolean hasPhaseB = lineConfigData.phaseB == 1; + boolean hasPhaseC = lineConfigData.phaseC == 1; + + ComplexMatrix yabc = LineAsymmetrical.getAdmittanceMatrixFromImpedanceAndBmatrix(zy, b, + hasPhaseA, hasPhaseB, hasPhaseC, line.length / feetInMile); + if (regulatorDataMap.containsKey(l.getId())) { + // take into account effect of regulator + RegulatorData regulatorData = regulatorDataMap.get(l.getId()); + ComplexMatrix rho = new ComplexMatrix(6, 6); + rho.set(1, 1, new Complex(regulatorData.rhoA, 0.)); + rho.set(2, 2, new Complex(regulatorData.rhoB, 0.)); + rho.set(3, 3, new Complex(regulatorData.rhoC, 0.)); + rho.set(4, 4, new Complex(1., 0.)); + rho.set(5, 5, new Complex(1., 0.)); + rho.set(6, 6, new Complex(1., 0.)); + DenseMatrix yabcRho = rho.getRealCartesianMatrix().times(yabc.getRealCartesianMatrix().times(rho.getRealCartesianMatrix())); + yabc = ComplexMatrix.getComplexMatrixFromRealCartesian(yabcRho); + } + + l.newExtension(LineAsymmetricalAdder.class) + .withYabc(ComplexMatrix.getMatrixScaled(yabc, yCoef)) + .add(); + + // modification of bus extension depending on line connections: + var extensionBus1 = network.getBusBreakerView().getBus(getBusId(line.nodeA)).getExtension(BusAsymmetrical.class); + var extensionBus2 = network.getBusBreakerView().getBus(getBusId(line.nodeB)).getExtension(BusAsymmetrical.class); + + extensionBus1.setHasPhaseA(extensionBus1.isHasPhaseA() || hasPhaseA); + extensionBus1.setHasPhaseB(extensionBus1.isHasPhaseB() || hasPhaseB); + extensionBus1.setHasPhaseC(extensionBus1.isHasPhaseC() || hasPhaseC); + + extensionBus2.setHasPhaseA(extensionBus2.isHasPhaseA() || hasPhaseA); + extensionBus2.setHasPhaseB(extensionBus2.isHasPhaseB() || hasPhaseB); + extensionBus2.setHasPhaseC(extensionBus2.isHasPhaseC() || hasPhaseC); + + } + } + + private static void createTfos(Network network, String path) { + Map tfoConfigDataMap = new HashMap<>(); + for (TfoConfigData tfoConfig : parseCsv(path + "TfoConfig.csv", TfoConfigData.class)) { + tfoConfigDataMap.put(tfoConfig.config, tfoConfig); + } + for (TfoData tfoData : parseCsv(path + "Tfo.csv", TfoData.class)) { + TfoConfigData tfoConfigData = tfoConfigDataMap.get(tfoData.config); + double ratedUhigh = tfoConfigData.kvHigh; + double ratedUlow = tfoConfigData.kvLow; + double sBase = tfoConfigData.skva / 1000.; + double rTpc = tfoConfigData.r; + double xTpc = tfoConfigData.x; + double zBase = ratedUhigh * ratedUlow / sBase; + double rT = rTpc * zBase / 100.; + double xT = xTpc * zBase / 100.; + + var tfo = network.getSubstation(getSubstationId(tfoData.nodeA)).newTwoWindingsTransformer() + .setId("Tfo-" + tfoData.nodeA + "-" + tfoData.nodeB) + .setVoltageLevel1(network.getVoltageLevel(getVoltageLevelId(tfoData.nodeA)).getId()) + .setBus1(getBusId(tfoData.nodeA)) + .setConnectableBus1(getBusId(tfoData.nodeA)) + .setRatedU1(ratedUhigh) + .setVoltageLevel2(network.getVoltageLevel(getVoltageLevelId(tfoData.nodeB)).getId()) + .setBus2(getBusId(tfoData.nodeB)) + .setConnectableBus2(getBusId(tfoData.nodeB)) + .setRatedU2(ratedUlow) + .setR(rT) + .setX(xT) + .setG(0.0D) + .setB(0.0D) + .setRatedS(sBase) + .add(); + + WindingConnectionType windingConnectionType1; + if (tfoConfigData.windingHigh.equals("Gr.Y") || tfoConfigData.windingHigh.equals("Gr.W")) { + windingConnectionType1 = WindingConnectionType.Y_GROUNDED; + } else { + windingConnectionType1 = WindingConnectionType.DELTA; + } + + WindingConnectionType windingConnectionType2; + if (tfoConfigData.windingLow.equals("Gr.Y") || tfoConfigData.windingLow.equals("Gr.W")) { + windingConnectionType2 = WindingConnectionType.Y_GROUNDED; + } else { + windingConnectionType2 = WindingConnectionType.DELTA; + } + + tfo.newExtension(TwoWindingsTransformerFortescueAdder.class) + .withRz(rT) + .withXz(xT) + .withConnectionType1(windingConnectionType1) + .withConnectionType2(windingConnectionType2) + .withGroundingX1(0.0000) + .withGroundingX2(0.0000) + .withFreeFluxes(true) + .add(); + + Complex zPhase = new Complex(rTpc, xTpc).multiply(zBase / 3. / 100.); + Complex yPhase = new Complex(0., 0.); + + tfo.newExtension(Tfo3PhasesAdder.class) + .withIsOpenPhaseA1(false) + .withIsOpenPhaseB1(false) + .withIsOpenPhaseC1(false) + .withYa(buildSinglePhaseAdmittanceMatrix(zPhase, yPhase, yPhase)) + .withYb(buildSinglePhaseAdmittanceMatrix(zPhase, yPhase, yPhase)) + .withYc(buildSinglePhaseAdmittanceMatrix(zPhase, yPhase, yPhase)) + .add(); + + // modification of bus extension depending on line connections: + var extensionBus1 = network.getBusBreakerView().getBus(getBusId(tfoData.nodeA)).getExtension(BusAsymmetrical.class); + var extensionBus2 = network.getBusBreakerView().getBus(getBusId(tfoData.nodeB)).getExtension(BusAsymmetrical.class); + + extensionBus1.setHasPhaseA(true); + extensionBus1.setHasPhaseB(true); + extensionBus1.setHasPhaseC(true); + + extensionBus2.setHasPhaseA(true); + extensionBus2.setHasPhaseB(true); + extensionBus2.setHasPhaseC(true); + + extensionBus1.setFortescueRepresentation(true); + extensionBus2.setFortescueRepresentation(true); + } + } + + public static ComplexMatrix buildSinglePhaseAdmittanceMatrix(Complex z, Complex y1, Complex y2) { + ComplexMatrix cm = new ComplexMatrix(2, 2); + cm.set(1, 1, y1.add(z.reciprocal())); + cm.set(1, 2, z.reciprocal().multiply(-1.)); + cm.set(2, 1, z.reciprocal().multiply(-1.)); + cm.set(2, 2, y2.add(z.reciprocal())); + + return cm; + } + + public static Network create(String path) { + return create(NetworkFactory.findDefault(), path); + } + + public static Network create(NetworkFactory networkFactory, String path) { + Network network = networkFactory.createNetwork("EuropeanLvTestFeeder", "csv"); + network.setCaseDate(DateTime.parse("2023-04-11T23:59:00.000+01:00")); + + // for substation naming when there are tfos: + List listTfos = parseTfos(path); + Map firstBusTfo = getFirstBusTfo(listTfos); + + createBuses(network, firstBusTfo, path); + createLines(network, path); + createGenerators(network, path); + createLoads(network, path); + createDistriLoads(network, path); + createTfos(network, path); + + return network; + } + +} diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java new file mode 100644 index 0000000000..5b70c85e15 --- /dev/null +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -0,0 +1,352 @@ +package com.powsybl.openloadflow.network.util; + +import com.powsybl.commons.PowsyblException; +import com.powsybl.iidm.network.*; +import com.powsybl.iidm.network.extensions.*; +import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; +import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; +import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; +import com.univocity.parsers.annotations.Parsed; +import com.univocity.parsers.common.processor.BeanListProcessor; +import com.univocity.parsers.csv.CsvParser; +import com.univocity.parsers.csv.CsvParserSettings; +import org.apache.commons.math3.complex.Complex; +import org.joda.time.DateTime; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +public final class AsymLvFeederParser { + private AsymLvFeederParser() { + } + + private static List parseCsv(String resourceName, Class clazz) { + try (Reader inputReader = new InputStreamReader(Objects.requireNonNull(AsymLvFeederParser.class.getResourceAsStream(resourceName)), StandardCharsets.UTF_8)) { + BeanListProcessor rowProcessor = new BeanListProcessor<>(clazz); + CsvParserSettings settings = new CsvParserSettings(); + settings.setHeaderExtractionEnabled(true); + settings.setProcessor(rowProcessor); + CsvParser parser = new CsvParser(settings); + parser.parse(inputReader); + return rowProcessor.getBeans(); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + private static String getBusId(int busName) { + return "Bus-" + busName; + } + + private static String getVoltageLevelId(int busName) { + return "VoltageLevel-" + busName; + } + + private static String getSubstationId(int busName) { + return "Substation-" + busName; + } + + public static class BusCoord { + @Parsed(field = "Busname") + int busName; + + @Parsed + double x; + + @Parsed + double y; + } + + public static class Line { + @Parsed(field = "Name") + String name; + + @Parsed(field = "Bus1") + int bus1; + + @Parsed(field = "Bus2") + int bus2; + + @Parsed(field = "Phases") + String phases; + + @Parsed(field = "Length") + double length; + + @Parsed(field = "Units") + String units; + + @Parsed(field = "LineCode") + String code; + } + + public static class LineCode { + @Parsed(field = "Name") + String name; + + @Parsed + int nphases; + + @Parsed(field = "R1") + double r1; + + @Parsed(field = "X1") + double x1; + + @Parsed(field = "R0") + double r0; + + @Parsed(field = "X0") + double x0; + + @Parsed(field = "C1") + double c1; + + @Parsed(field = "C0") + double c0; + + @Parsed(field = "Units") + String units; + } + + public static class Load { + @Parsed(field = "Name") + String name; + + @Parsed + int numPhases; + + @Parsed(field = "Bus") + int bus; + + @Parsed + char phases; + + @Parsed + double kV; + + @Parsed(field = "Model") + int model; + + @Parsed(field = "Connection") + String connection; + + @Parsed + double kW; + + @Parsed(field = "PF") + double pf; + + @Parsed(field = "Yearly") + String yearly; + } + + public static class Transformer { + @Parsed(field = "Name") + String name; + + @Parsed + int phases; + + @Parsed + String bus1; + + @Parsed + int bus2; + + @Parsed(field = "kV_pri") + double kvPri; + + @Parsed(field = "kV_sec") + double kvSec; + + @Parsed(field = "MVA") + double mva; + + @Parsed(field = "Conn_pri") + String connPri; + + @Parsed(field = "Conn_sec") + String connSec; + + @Parsed(field = "%XHL") + double xhl; + + @Parsed(field = "% resistance") + double resistance; + } + + private static void createBuses(Network network, String path) { + for (BusCoord busCoord : parseCsv(path + "Buscoords.csv", BusCoord.class)) { + String substationId = getSubstationId(busCoord.busName); + Substation s = network.getSubstation(substationId); + if (s == null) { + s = network.newSubstation() + .setId(substationId) + .add(); + } + VoltageLevel vl = s.newVoltageLevel() + .setId(getVoltageLevelId(busCoord.busName)) + .setTopologyKind(TopologyKind.BUS_BREAKER) + .setNominalV(1) + .add(); + Bus bus = vl.getBusBreakerView().newBus() + .setId(getBusId(busCoord.busName)) + .add(); + + // default settings for bus extensions, will be modified depending on the type of connected equipment : + bus.newExtension(BusAsymmetricalAdder.class) + .withBusVariableType(BusVariableType.WYE) + .withHasPhaseA(true) + .withHasPhaseB(true) + .withHasPhaseC(true) + .withPositiveSequenceAsCurrent(true) + .withFortescueRepresentation(true) + .add(); + } + } + + private static void createLines(Network network, String path) { + Map lineCodes = new HashMap<>(); + for (LineCode lineCode : parseCsv(path + "LineCodes.csv", LineCode.class)) { + lineCodes.put(lineCode.name, lineCode); + } + double coeff = 1 / 1000.; + for (Line line : parseCsv(path + "Lines.csv", Line.class)) { + LineCode lineCode = lineCodes.get(line.code); + var l = network.newLine() + .setId("Line-" + line.bus1 + "-" + line.bus2) + .setVoltageLevel1(getVoltageLevelId(line.bus1)) + .setBus1(getBusId(line.bus1)) + .setVoltageLevel2(getVoltageLevelId(line.bus2)) + .setBus2(getBusId(line.bus2)) + .setR(lineCode.r1 * line.length * coeff) + .setX(lineCode.x1 * line.length * coeff) + .add(); + l.newExtension(LineFortescueAdder.class) + .withRz(lineCode.r0 * line.length * coeff) + .withXz(lineCode.x0 * line.length * coeff) + .add(); + } + } + + private static LoadConnectionType getConnectionType(Load load) { + if (load.connection.equals("wye")) { + return LoadConnectionType.Y; + } + throw new PowsyblException("Unknown load connection: " + load.connection); + } + + private static void createLoads(Network network, String path) { + for (Load load : parseCsv(path + "Loads.csv", Load.class)) { + var vl = network.getVoltageLevel(getVoltageLevelId(load.bus)); + double p0 = load.kW / 1000; + double q0 = p0 * load.pf; + var l = vl.newLoad() + .setId("Load-" + load.bus) + .setBus(getBusId(load.bus)) + .setP0(0.) + .setQ0(0.) + .add(); + double defaultLoad = 0.000; + double deltaPa = defaultLoad; + double deltaQa = defaultLoad; + double deltaPb = defaultLoad; + double deltaQb = defaultLoad; + double deltaPc = defaultLoad; + double deltaQc = defaultLoad; + switch (load.phases) { + case 'A': + deltaPa += p0; + deltaQa += q0; + break; + case 'B': + deltaPb += p0; + deltaQb += q0; + break; + case 'C': + deltaPc += p0; + deltaQc += q0; + break; + default: + throw new PowsyblException("Unknown phase: " + load.phases); + } + l.newExtension(LoadAsymmetricalAdder.class) + .withConnectionType(getConnectionType(load)) + .withDeltaPa(deltaPa) + .withDeltaQa(deltaQa) + .withDeltaPb(deltaPb) + .withDeltaQb(deltaQb) + .withDeltaPc(deltaPc) + .withDeltaQc(deltaQc) + .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + } + } + + private static void createSource(Network network) { + int busName = 1; + VoltageLevel vl = network.getVoltageLevel(getVoltageLevelId(busName)); + Generator generator = vl.newGenerator() + .setId("G150") + .setBus(getBusId(busName)) + .setMinP(-100.0) + .setMaxP(200) + .setTargetP(0) + .setTargetV(vl.getNominalV() * 1.05) + .setVoltageRegulatorOn(true) + .add(); + + Complex zz = new Complex(0.0001, 0.0001); // 0.0001 , 0.001 + Complex zn = new Complex(0.0001, 0.0001); // 0.001 , 0.01 + + generator.newExtension(GeneratorFortescueAdder.class) + .withRz(zz.getReal()) + .withXz(zz.getImaginary()) + .withRn(zn.getReal()) + .withXn(zn.getImaginary()) + .add(); + + // modification of bus extension due to generating unit + network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class).setPositiveSequenceAsCurrent(false); + } + + private static WindingConnectionType getConnectionType(String conn) { + switch (conn) { + case "Delta": + return WindingConnectionType.DELTA; + case "Wye": + return WindingConnectionType.Y; + default: + throw new PowsyblException("Connection type not supported: " + conn); + } + } + + public static Network create(String path) { + return create(NetworkFactory.findDefault(), path); + } + + public static Network create(NetworkFactory networkFactory, String path) { + Network network = networkFactory.createNetwork("EuropeanLvTestFeeder", "csv"); + network.setCaseDate(DateTime.parse("2023-04-11T23:59:00.000+01:00")); + + createBuses(network, path); + createSource(network); + createLines(network, path); + createLoads(network, path); + return network; + } + +} diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym13BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym13BusFeederTest.java index f076e6d356..196ce73bd6 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym13BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym13BusFeederTest.java @@ -309,7 +309,7 @@ void ieee13LoadWithConstantImpedanceDeltaTest() { assertVoltageEquals(4.290533459921324, bus632); assertVoltageEquals(4.2520625000874075, bus645); assertVoltageEquals(4.243258426216129, bus646); - assertVoltageEquals(4.154403168622116, bus652); + assertVoltageEquals(4.165204333227582, bus652); } @Test diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index c4ea034fef..2c6edd1e9b 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -923,7 +923,7 @@ public static Network ieee34LoadFeeder() { bus832.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(BusVariableType.WYE) .withPositiveSequenceAsCurrent(true) - .withFortescueRepresentation(false) + .withFortescueRepresentation(true) .add(); double p832 = 0.; @@ -934,12 +934,12 @@ public static Network ieee34LoadFeeder() { .setP0(p832) .setQ0(q832) .newZipModel() - .setC0p(0.) + .setC0p(1.) .setC1p(0.) - .setC2p(1.) - .setC0q(0.) + .setC2p(0.) + .setC0q(1.) .setC1q(0.) - .setC2q(1.) + .setC2q(0.) .add() .add(); @@ -969,7 +969,7 @@ public static Network ieee34LoadFeeder() { bus888.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(BusVariableType.WYE) .withPositiveSequenceAsCurrent(true) - .withFortescueRepresentation(false) + .withFortescueRepresentation(true) .add(); // Bus 890 diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java new file mode 100644 index 0000000000..d489c65980 --- /dev/null +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -0,0 +1,98 @@ +package com.powsybl.openloadflow.util; + +import com.powsybl.iidm.network.Network; +import com.powsybl.loadflow.LoadFlow; +import com.powsybl.loadflow.LoadFlowParameters; +import com.powsybl.loadflow.LoadFlowResult; +import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.openloadflow.OpenLoadFlowParameters; +import com.powsybl.openloadflow.OpenLoadFlowProvider; +import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; +import com.powsybl.openloadflow.network.util.AsymLvFeederParser; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class AsymIeeeFeederParserTest { + + private LoadFlow.Runner loadFlowRunner; + private LoadFlowParameters parameters; + + @BeforeEach + void setUp() { + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) + .setDistributedSlack(false); + + OpenLoadFlowParameters.create(parameters) + .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) + .setMaxNewtonRaphsonIterations(100) + .setMaxActivePowerMismatch(0.0001) + .setMaxReactivePowerMismatch(0.0001) + .setNewtonRaphsonConvEpsPerEq(0.0001) + .setMaxVoltageMismatch(0.0001) + .setMaxSusceptanceMismatch(0.0001) + .setMaxAngleMismatch(0.0001) + .setMaxRatioMismatch(0.0001) + .setAsymmetrical(true); + } + + @Test + void test13BussesTest() { + + Network network = AsymIeeeFeederParser.create("/ieeeFeeder13/"); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + assertVoltageEquals(4.276427533655057, network.getBusBreakerView().getBus("Bus-632")); + } + + @Test + void test34BussesTest() { + + Network network = AsymIeeeFeederParser.create("/ieeeFeeder34/"); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + assertVoltageEquals(26.145, network.getBusBreakerView().getBus("Bus-800")); + assertVoltageEquals(25.86703194305272, network.getBusBreakerView().getBus("Bus-832")); + } + + @Test + void test123BussesTest() { + + Network network = AsymIeeeFeederParser.create("/ieeeFeeder123/"); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + assertVoltageEquals(4.16, network.getBusBreakerView().getBus("Bus-150")); + assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); + } + + @Disabled + @Test + void testLvFeedersTest() { + + OpenLoadFlowParameters.create(parameters) + .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) + .setMaxNewtonRaphsonIterations(100) + .setMaxActivePowerMismatch(0.0000001) + .setMaxReactivePowerMismatch(0.0000001) + .setNewtonRaphsonConvEpsPerEq(0.0000001) + .setMaxVoltageMismatch(0.00001) + .setMaxSusceptanceMismatch(0.0001) + .setMaxAngleMismatch(0.0001) + .setMaxRatioMismatch(0.0001) + .setAsymmetrical(true); + + Network network = AsymLvFeederParser.create("/lvFeeder/"); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + } + +} diff --git a/src/test/resources/ieeeFeeder123/Bus.csv b/src/test/resources/ieeeFeeder123/Bus.csv new file mode 100644 index 0000000000..033b1a0ab3 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Bus.csv @@ -0,0 +1,120 @@ +BusName,UNom +150,4.16 +1,4.16 +2,4.16 +3,4.16 +4,4.16 +5,4.16 +6,4.16 +7,4.16 +8,4.16 +12,4.16 +9,4.16 +13,4.16 +14,4.16 +18,4.16 +11,4.16 +10,4.16 +15,4.16 +16,4.16 +17,4.16 +19,4.16 +21,4.16 +20,4.16 +22,4.16 +23,4.16 +24,4.16 +25,4.16 +26,4.16 +28,4.16 +27,4.16 +31,4.16 +33,4.16 +29,4.16 +30,4.16 +250,4.16 +32,4.16 +34,4.16 +35,4.16 +36,4.16 +40,4.16 +37,4.16 +38,4.16 +39,4.16 +41,4.16 +42,4.16 +43,4.16 +44,4.16 +45,4.16 +47,4.16 +46,4.16 +48,4.16 +49,4.16 +50,4.16 +51,4.16 +151,4.16 +52,4.16 +53,4.16 +54,4.16 +57,4.16 +55,4.16 +56,4.16 +58,4.16 +60,4.16 +59,4.16 +61,4.16 +62,4.16 +63,4.16 +64,4.16 +65,4.16 +66,4.16 +67,4.16 +68,4.16 +72,4.16 +69,4.16 +70,4.16 +71,4.16 +73,4.16 +76,4.16 +74,4.16 +75,4.16 +77,4.16 +78,4.16 +79,4.16 +80,4.16 +81,4.16 +82,4.16 +84,4.16 +83,4.16 +85,4.16 +86,4.16 +87,4.16 +88,4.16 +89,4.16 +90,4.16 +91,4.16 +92,4.16 +93,4.16 +94,4.16 +95,4.16 +96,4.16 +97,4.16 +98,4.16 +99,4.16 +100,4.16 +450,4.16 +101,4.16 +102,4.16 +105,4.16 +103,4.16 +104,4.16 +106,4.16 +108,4.16 +107,4.16 +109,4.16 +300,4.16 +110,4.16 +111,4.16 +112,4.16 +113,4.16 +114,4.16 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder123/DistributedLoad.csv b/src/test/resources/ieeeFeeder123/DistributedLoad.csv new file mode 100644 index 0000000000..65cf9c2d6e --- /dev/null +++ b/src/test/resources/ieeeFeeder123/DistributedLoad.csv @@ -0,0 +1 @@ +NodeA,NodeB,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q diff --git a/src/test/resources/ieeeFeeder123/Gen.csv b/src/test/resources/ieeeFeeder123/Gen.csv new file mode 100644 index 0000000000..5b4542d8fa --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Gen.csv @@ -0,0 +1,2 @@ +GenName,busName,SetPoint +G150,150,1.0 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder123/Line.csv b/src/test/resources/ieeeFeeder123/Line.csv new file mode 100644 index 0000000000..b2a8bf6652 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Line.csv @@ -0,0 +1,119 @@ +NodeA,NodeB,Length,Config +1,2,175,10 +1,3,250,11 +1,7,300,1 +3,4,200,11 +3,5,325,11 +5,6,250,11 +7,8,200,1 +8,12,225,10 +8,9,225,9 +8,13,300,1 +9,14,425,9 +13,34,150,11 +13,18,825,2 +14,11,250,9 +14,10,250,9 +15,16,375,11 +15,17,350,11 +18,19,250,9 +18,21,300,2 +19,20,325,9 +21,22,525,10 +21,23,250,2 +23,24,550,11 +23,25,275,2 +25,26,350,7 +25,28,200,2 +26,27,275,7 +26,31,225,11 +27,33,500,9 +28,29,300,2 +29,30,350,2 +30,250,200,2 +31,32,300,11 +34,15,100,11 +35,36,650,8 +35,40,250,1 +36,37,300,9 +36,38,250,10 +38,39,325,10 +40,41,325,11 +40,42,250,1 +42,43,500,10 +42,44,200,1 +44,45,200,9 +44,47,250,1 +45,46,300,9 +47,48,150,4 +47,49,250,4 +49,50,250,4 +50,51,250,4 +51,151,500,4 +52,53,200,1 +53,54,125,1 +54,55,275,1 +54,57,350,3 +55,56,275,1 +57,58,250,10 +57,60,750,3 +58,59,250,10 +60,61,550,5 +60,62,250,12 +62,63,175,12 +63,64,350,12 +64,65,425,12 +65,66,325,12 +67,68,200,9 +67,72,275,3 +67,97,250,3 +68,69,275,9 +69,70,325,9 +70,71,275,9 +72,73,275,11 +72,76,200,3 +73,74,350,11 +74,75,400,11 +76,77,400,6 +76,86,700,3 +77,78,100,6 +78,79,225,6 +78,80,475,6 +80,81,475,6 +81,82,250,6 +81,84,675,11 +82,83,250,6 +84,85,475,11 +86,87,450,6 +87,88,175,9 +87,89,275,6 +89,90,225,10 +89,91,225,6 +91,92,300,11 +91,93,225,6 +93,94,275,9 +93,95,300,6 +95,96,200,10 +97,98,275,3 +98,99,550,3 +99,100,300,3 +100,450,800,3 +101,102,225,11 +101,105,275,3 +102,103,325,11 +103,104,700,11 +105,106,225,10 +105,108,325,3 +106,107,575,10 +108,109,450,9 +108,300,1000,3 +109,110,300,9 +110,111,575,9 +110,112,125,9 +112,113,525,9 +113,114,325,9 +18,35,375,4 +150,1,400,1 +13,52,400,1 +60,67,350,6 +97,101,250,3 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder123/LineConfig.csv b/src/test/resources/ieeeFeeder123/LineConfig.csv new file mode 100644 index 0000000000..6345fc3ead --- /dev/null +++ b/src/test/resources/ieeeFeeder123/LineConfig.csv @@ -0,0 +1,14 @@ +Config,PhaseA,PhaseB,PhaseC,r11,x11,r12,x12,r13,x13,r22,x22,r23,x23,r33,x33,b11,b12,b13,b22,b23,b33 +1,1,1,1,0.4576,1.0780,0.1560,0.5017,0.1535,0.3849,0.4666,1.0482,0.1580,0.4236,0.4615,1.0651,5.6765,-1.8319,-0.6982,5.9809,-1.1645,5.3971 +2,1,1,1,0.4666,1.0482,0.1580,0.4236,0.1560,0.5017,0.4615,1.0651,0.1535,0.3849,0.4576,1.0780,5.9809,-1.1645,-1.8319,5.3971,-0.6982,5.6765 +3,1,1,1,0.4615,1.0651,0.1535,0.3849,0.1580,0.4236,0.4576,1.0780,0.1560,0.5017,0.4666,1.0482,5.3971,-0.6982,-1.1645,5.6765,-1.8319,5.9809 +4,1,1,1,0.4615,1.0651,0.1580,0.4236,0.1535,0.3849,0.4666,1.0482,0.1560,0.5017,0.4576,1.0780,5.3971,-1.1645,-0.6982,5.9809,-1.8319,5.6765 +5,1,1,1,0.4666,1.0482,0.1560,0.5017,0.1580,0.4236,0.4576,1.0780,0.1535,0.3849,0.4615,1.0651,5.9809,-1.8319,-1.1645,5.6765,-0.6982,5.3971 +6,1,1,1,0.4576,1.0780,0.1535,0.3849,0.1560,0.5017,0.4615,1.0651,0.1580,0.4236,0.4666,1.0482,5.6765,-0.6982,-1.8319,5.3971,-1.1645,5.9809 +7,1,0,1,0.4576,1.0780,0.0000,0.0000,0.1535,0.3849,0.0000,0.0000,0.0000,0.0000,0.4615,1.0651,5.1154,0.0000,-1.0549,0.0000,0.0000,5.1704 +8,1,1,0,0.4576,1.0780,0.1535,0.3849,0.0000,0.0000,0.4615,1.0651,0.0000,0.0000,0.0000,0.0000,5.1154,-1.0549,0.0000,5.1704,0.0000,0.0000 +9,1,0,0,1.3292,1.3475,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.5193,0.0000,0.0000,0.0000,0.0000,0.0000 +10,0,1,0,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.3292,1.3475,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.5193,0.0000,0.0000 +11,0,0,1,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.3292,1.3475,0.0000,0.0000,0.0000,0.0000,0.0000,4.5193 +12,1,1,1,1.5209,0.7521,0.5198,0.2775,0.4924,0.2157,1.5329,0.7162,0.5198,0.2775,1.5209,0.7521,67.2242,0.0000,0.0000,67.2242,0.0000,67.2242 + diff --git a/src/test/resources/ieeeFeeder123/Regulator.csv b/src/test/resources/ieeeFeeder123/Regulator.csv new file mode 100644 index 0000000000..b680c8f64f --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Regulator.csv @@ -0,0 +1,5 @@ +Line,RhoA,RhoB,RhoC +150-1,1.0437,1.0438,1.0438 +60-67,1.05,1.00624,1.03123 +25-26,1.0,1.0,0.9937 +9-14,0.9937,1.0,1.0 diff --git a/src/test/resources/ieeeFeeder123/SpotLoad.csv b/src/test/resources/ieeeFeeder123/SpotLoad.csv new file mode 100644 index 0000000000..d3327baa38 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/SpotLoad.csv @@ -0,0 +1,86 @@ +Node,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +1,Y-PQ,40,20,0,0,0,0 +2,Y-PQ,0,0,20,10,0,0 +4,Y-PQ,0,0,0,0,40,20 +5,Y-I,0,0,0,0,20,10 +6,Y-Z,0,0,0,0,40,20 +7,Y-PQ,20,10,0,0,0,0 +9,Y-PQ,40,20,0,0,0,0 +10,Y-I,20,10,0,0,0,0 +11,Y-Z,40,20,0,0,0,0 +12,Y-PQ,0,0,20,10,0,0 +16,Y-PQ,0,0,0,0,40,20 +17,Y-PQ,0,0,0,0,20,10 +19,Y-PQ,40,20,0,0,0,0 +20,Y-I,40,20,0,0,0,0 +22,Y-Z,0,0,40,20,0,0 +24,Y-PQ,0,0,0,0,40,20 +28,Y-I,40,20,0,0,0,0 +29,Y-Z,40,20,0,0,0,0 +30,Y-PQ,0,0,0,0,40,20 +31,Y-PQ,0,0,0,0,20,10 +32,Y-PQ,0,0,0,0,20,10 +33,Y-I,40,20,0,0,0,0 +34,Y-Z,0,0,0,0,40,20 +35,D-PQ,40,20,0,0,0,0 +37,Y-Z,40,20,0,0,0,0 +38,Y-I,0,0,20,10,0,0 +39,Y-PQ,0,0,20,10,0,0 +41,Y-PQ,0,0,0,0,20,10 +42,Y-PQ,20,10,0,0,0,0 +43,Y-Z,0,0,40,20,0,0 +45,Y-I,20,10,0,0,0,0 +46,Y-PQ,20,10,0,0,0,0 +47,Y-I,35,25,35,25,35,25 +48,Y-Z,70,50,70,50,70,50 +49,Y-PQ,35,25,70,50,35,20 +50,Y-PQ,0,0,0,0,40,20 +51,Y-PQ,20,10,0,0,0,0 +52,Y-PQ,40,20,0,0,0,0 +53,Y-PQ,40,20,0,0,0,0 +55,Y-Z,20,10,0,0,0,0 +56,Y-PQ,0,0,20,10,0,0 +58,Y-I,0,0,20,10,0,0 +59,Y-PQ,0,0,20,10,0,0 +60,Y-PQ,20,10,0,0,0,0 +62,Y-Z,0,0,0,0,40,20 +63,Y-PQ,40,20,0,0,0,0 +64,Y-I,0,0,75,35,0,0 +65,D-Z,35,25,35,25,70,50 +66,Y-PQ,0,0,0,0,75,35 +68,Y-PQ,20,10,0,0,0,0 +69,Y-PQ,40,20,0,0,0,0 +70,Y-PQ,20,10,0,0,0,0 +71,Y-PQ,40,20,0,0,0,0 +73,Y-PQ,0,0,0,0,40,20 +74,Y-Z,0,0,0,0,40,20 +75,Y-PQ,0,0,0,0,40,20 +76,D-I,105,80,70,50,70,50 +77,Y-PQ,0,0,40,20,0,0 +79,Y-Z,40,20,0,0,0,0 +80,Y-PQ,0,0,40,20,0,0 +82,Y-PQ,40,20,0,0,0,0 +83,Y-PQ,0,-200,0,-200,20,-190 +84,Y-PQ,0,0,0,0,20,10 +85,Y-PQ,0,0,0,0,40,20 +86,Y-PQ,0,0,20,10,0,0 +87,Y-PQ,0,0,40,20,0,0 +88,Y-PQ,40,-30,0,0,0,0 +90,Y-I,0,0,40,-30,0,0 +92,Y-PQ,0,0,0,0,40,-30 +94,Y-PQ,40,20,0,0,0,0 +95,Y-PQ,0,0,20,10,0,0 +96,Y-PQ,0,0,20,10,0,0 +98,Y-PQ,40,20,0,0,0,0 +99,Y-PQ,0,0,40,20,0,0 +100,Y-Z,0,0,0,0,40,20 +102,Y-PQ,0,0,0,0,20,10 +103,Y-PQ,0,0,0,0,40,20 +104,Y-PQ,0,0,0,0,40,20 +106,Y-PQ,0,0,40,20,0,0 +107,Y-PQ,0,0,40,20,0,0 +109,Y-PQ,40,20,0,0,0,0 +111,Y-PQ,20,10,0,0,0,0 +112,Y-I,20,10,0,0,0,0 +113,Y-Z,40,20,0,0,0,0 +114,Y-PQ,20,10,0,0,0,0 diff --git a/src/test/resources/ieeeFeeder123/Tfo.csv b/src/test/resources/ieeeFeeder123/Tfo.csv new file mode 100644 index 0000000000..7cc8d7f924 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Tfo.csv @@ -0,0 +1 @@ +NodeA,NodeB,Config \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder123/TfoConfig.csv b/src/test/resources/ieeeFeeder123/TfoConfig.csv new file mode 100644 index 0000000000..af208d5f88 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/TfoConfig.csv @@ -0,0 +1 @@ +Config,SkVA,kV-high,Winding-high,kV-low,Winding-low,R,X diff --git a/src/test/resources/ieeeFeeder13/Bus.csv b/src/test/resources/ieeeFeeder13/Bus.csv new file mode 100644 index 0000000000..048c44ba55 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Bus.csv @@ -0,0 +1,13 @@ +BusName,UNom +650,4.16 +632,4.16 +633,4.16 +634,0.48 +645,4.16 +646,4.16 +684,4.16 +611,4.16 +652,4.16 +680,4.16 +675,4.16 +671,4.16 diff --git a/src/test/resources/ieeeFeeder13/DistributedLoad.csv b/src/test/resources/ieeeFeeder13/DistributedLoad.csv new file mode 100644 index 0000000000..1462655e5d --- /dev/null +++ b/src/test/resources/ieeeFeeder13/DistributedLoad.csv @@ -0,0 +1,2 @@ +NodeA,NodeB,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +632,671,Y-PQ,17,10,66,38,117,68 diff --git a/src/test/resources/ieeeFeeder13/Gen.csv b/src/test/resources/ieeeFeeder13/Gen.csv new file mode 100644 index 0000000000..19dfc82448 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Gen.csv @@ -0,0 +1,2 @@ +GenName,busName,SetPoint +G650,650,1.0 diff --git a/src/test/resources/ieeeFeeder13/Line.csv b/src/test/resources/ieeeFeeder13/Line.csv new file mode 100644 index 0000000000..9e1ad5d5e3 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Line.csv @@ -0,0 +1,11 @@ +NodeA,NodeB,Length,Config +632,645,500,603 +632,633,500,602 +645,646,300,603 +650,632,2000,601 +684,652,800,607 +632,671,2000,601 +671,684,300,604 +671,680,1000,601 +684,611,300,605 +671,675,500,606 diff --git a/src/test/resources/ieeeFeeder13/LineConfig.csv b/src/test/resources/ieeeFeeder13/LineConfig.csv new file mode 100644 index 0000000000..e3cee9907f --- /dev/null +++ b/src/test/resources/ieeeFeeder13/LineConfig.csv @@ -0,0 +1,8 @@ +Config,PhaseA,PhaseB,PhaseC,r11,x11,r12,x12,r13,x13,r22,x22,r23,x23,r33,x33,b11,b12,b13,b22,b23,b33 +601,1,1,1,0.3465,1.0179,0.1560,0.5017,0.1580,0.4236,0.3375,1.0478,0.1535,0.3849,0.3414,1.0348,6.2998,-1.9958,-1.2595,5.9597,-0.7417,5.6386 +602,1,1,1,0.7526,1.1814,0.1580,0.4236,0.1560,0.5017,0.7475,1.1983,0.1535,0.3849,0.7436,1.2112,5.6990,-1.0817,-1.6905,5.1795,-0.6588,5.4246 +603,0,1,1,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.3294,1.3471,0.2066,0.4591,1.3238,1.3569,0.0000,0.0000,0.0000,4.7097,-0.8999,4.6658 +604,1,0,1,1.3238,1.3569,0.0000,0.0000,0.2066,0.4591,0.0000,0.0000,0.0000,0.0000,1.3294,1.3471,4.6658,0.0000,-0.8999,0.0000,0.0000,4.7097 +605,0,0,1,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.3292,1.3475,0.0000,0.0000,0.0000,0.0000,0.0000,4.5193 +606,1,1,1,0.7982,0.4463,0.3192,0.0328,0.2849,-0.0143,0.7891,0.4041,0.3192,0.0328,0.7982,0.4463,96.8897,0.0000,0.0000,96.8897,0.0000,96.8897 +607,1,0,0,1.3425,0.5124,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,88.9912,0.0000,0.0000,0.0000,0.0000,0.0000 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder13/Regulator.csv b/src/test/resources/ieeeFeeder13/Regulator.csv new file mode 100644 index 0000000000..8fa3bf4830 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Regulator.csv @@ -0,0 +1,2 @@ +Line,RhoA,RhoB,RhoC +650-632,1.0625,1.05,1.0687 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder13/SpotLoad.csv b/src/test/resources/ieeeFeeder13/SpotLoad.csv new file mode 100644 index 0000000000..7c49850bcd --- /dev/null +++ b/src/test/resources/ieeeFeeder13/SpotLoad.csv @@ -0,0 +1,10 @@ +Node,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +634,Y-PQ,160,110,120,90,120,90 +645,Y-PQ,0,0,170,125,0,0 +646,D-Z,0,0,230,132,0,0 +652,Y-Z,128,86,0,0,0,0 +671,D-PQ,385,220,385,220,555,371 +675,Y-PQ,485,190,68,60,290,212 +675,Y-Z,0,-200,0,-200,0,-200 +611,Y-I,0,0,0,0,170,80 +611,Y-Z,0,0,0,0,0,-100 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder13/Tfo.csv b/src/test/resources/ieeeFeeder13/Tfo.csv new file mode 100644 index 0000000000..50122c84ac --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Tfo.csv @@ -0,0 +1,2 @@ +NodeA,NodeB,Config +633,634,XFM-1 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder13/TfoConfig.csv b/src/test/resources/ieeeFeeder13/TfoConfig.csv new file mode 100644 index 0000000000..b9f8c2ff30 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/TfoConfig.csv @@ -0,0 +1,3 @@ +Config,SkVA,kV-high,Winding-high,kV-low,Winding-low,R,X +Substation,5000,115,D,4.16,Gr.Y,1,8 +XFM-1,500,4.16,Gr.W,0.48,Gr.W,1.1,2 diff --git a/src/test/resources/ieeeFeeder34/Bus.csv b/src/test/resources/ieeeFeeder34/Bus.csv new file mode 100644 index 0000000000..c41c848a80 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Bus.csv @@ -0,0 +1,35 @@ +BusName,UNom +800,24.9 +802,24.9 +806,24.9 +808,24.9 +810,24.9 +812,24.9 +814,24.9 +850,24.9 +816,24.9 +818,24.9 +820,24.9 +822,24.9 +824,24.9 +826,24.9 +828,24.9 +830,24.9 +832,24.9 +834,24.9 +836,24.9 +840,24.9 +842,24.9 +844,24.9 +846,24.9 +848,24.9 +852,24.9 +854,24.9 +856,24.9 +858,24.9 +864,24.9 +860,24.9 +862,24.9 +838,24.9 +888,4.16 +890,4.16 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/DistributedLoad.csv b/src/test/resources/ieeeFeeder34/DistributedLoad.csv new file mode 100644 index 0000000000..81aa998ff6 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/DistributedLoad.csv @@ -0,0 +1,19 @@ +NodeA,NodeB,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +802,806,Y-PQ,0,0,30,15,25,14 +808,810,Y-I,0,0,16,8,0,0 +818,820,Y-Z,34,17,0,0,0,0 +820,822,Y-PQ,135,70,0,0,0,0 +816,824,D-I,0,0,5,2,0,0 +824,826,Y-I,0,0,40,20,4,2 +828,830,Y-PQ,7,3,0,0,0,0 +854,856,Y-PQ,0,0,4,2,0,0 +832,858,D-PQ,7,3,2,1,6,3 +858,864,Y-PQ,2,1,0,0,0,0 +858,834,D-PQ,4,2,15,8,13,7 +834,860,D-Z,16,8,20,10,110,55 +860,836,D-PQ,30,15,10,6,42,22 +836,840,D-I,18,9,22,11,0,0 +862,838,Y-PQ,0,0,28,14,0,0 +842,844,Y-PQ,9,5,0,0,0,0 +844,846,Y-PQ,0,0,25,12,20,11 +846,848,Y-PQ,0,0,23,11,0,0 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/Gen.csv b/src/test/resources/ieeeFeeder34/Gen.csv new file mode 100644 index 0000000000..5e5fce36a7 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Gen.csv @@ -0,0 +1,2 @@ +GenName,busName,SetPoint +G800,800,1.05 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/Line.csv b/src/test/resources/ieeeFeeder34/Line.csv new file mode 100644 index 0000000000..46d005d707 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Line.csv @@ -0,0 +1,33 @@ +NodeA,NodeB,Length,Config +800,802,2580,300 +802,806,1730,300 +806,808,32230,300 +808,810,5804,303 +808,812,37500,300 +812,814,29730,300 +814,850,10,301 +816,818,1710,302 +816,824,10210,301 +818,820,48150,302 +820,822,13740,302 +824,826,3030,303 +824,828,840,301 +828,830,20440,301 +830,854,520,301 +832,858,4900,301 +834,860,2020,301 +834,842,280,301 +836,840,860,301 +836,862,280,301 +842,844,1350,301 +844,846,3640,301 +846,848,530,301 +850,816,310,301 +852,832,10,301 +854,856,23330,303 +854,852,36830,301 +858,864,1620,302 +858,834,5830,301 +860,836,2680,301 +862,838,4860,304 +888,890,10560,300 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/LineConfig.csv b/src/test/resources/ieeeFeeder34/LineConfig.csv new file mode 100644 index 0000000000..50858fe88d --- /dev/null +++ b/src/test/resources/ieeeFeeder34/LineConfig.csv @@ -0,0 +1,6 @@ +Config,PhaseA,PhaseB,PhaseC,r11,x11,r12,x12,r13,x13,r22,x22,r23,x23,r33,x33,b11,b12,b13,b22,b23,b33 +300,1,1,1,1.3368,1.3343,0.2101,0.5779,0.2130,0.5015,1.3238,1.3569,0.2066,0.4591,1.3294,1.3471,5.3350,-1.5313,-0.9943,5.0979,-0.6212,4.8880 +301,1,1,1,1.9300,1.4115,0.2327,0.6442,0.2359,0.5691,1.9157,1.4281,0.2288,0.5238,1.9219,1.4209,5.1207,-1.4364,-0.9402,4.9055,-0.5951,4.7154 +302,1,0,0,2.7995,1.4855,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.2251,0.0000,0.0000,0.0000,0.0000,0.0000 +303,0,1,0,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,2.7995,1.4855,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.2251,0.0000,0.0000 +304,0,1,0,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.9217,1.4212,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.3637,0.0000,0.0000 diff --git a/src/test/resources/ieeeFeeder34/Regulator.csv b/src/test/resources/ieeeFeeder34/Regulator.csv new file mode 100644 index 0000000000..f1b24d136b --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Regulator.csv @@ -0,0 +1,3 @@ +Line,RhoA,RhoB,RhoC +814-850,1.075,1.03117,1.03133 +852-832,1.0812,1.0687,1.075 diff --git a/src/test/resources/ieeeFeeder34/SpotLoad.csv b/src/test/resources/ieeeFeeder34/SpotLoad.csv new file mode 100644 index 0000000000..84f9f6f194 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/SpotLoad.csv @@ -0,0 +1,7 @@ +Node,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +860,Y-PQ,20,16,20,16,20,16 +840,Y-I,9,7,9,7,9,7 +844,Y-Z,135,5,135,5,135,5 +848,D-PQ,20,-134,20,-134,20,-134 +890,D-I,150,75,150,75,150,75 +830,D-Z,10,5,10,5,25,10 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/Tfo.csv b/src/test/resources/ieeeFeeder34/Tfo.csv new file mode 100644 index 0000000000..b531a06915 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Tfo.csv @@ -0,0 +1,2 @@ +NodeA,NodeB,Config +832,888,XFM-1 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/TfoConfig.csv b/src/test/resources/ieeeFeeder34/TfoConfig.csv new file mode 100644 index 0000000000..63035a3040 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/TfoConfig.csv @@ -0,0 +1,3 @@ +Config,SkVA,kV-high,Winding-high,kV-low,Winding-low,R,X +Substation,2500,69,D,24.9,Gr.W,1,8 +XFM-1,500,24.9,Gr.W,4.16,Gr.W,1.9,4.08 \ No newline at end of file diff --git a/src/test/resources/lvFeeder/Buscoords.csv b/src/test/resources/lvFeeder/Buscoords.csv new file mode 100644 index 0000000000..623890f156 --- /dev/null +++ b/src/test/resources/lvFeeder/Buscoords.csv @@ -0,0 +1,908 @@ +#Bus Coordinates,, +Busname, x, y +1,390872.663,392887.379 +2,390871.596,392887.638 +3,390871.481,392887.643 +4,390871.379,392887.608 +5,390871.305,392887.55 +6,390871.234,392887.42 +7,390868.779,392877.637 +8,390868.753,392877.186 +9,390868.753,392876.81 +10,390868.804,392876.484 +11,390868.904,392876.259 +12,390869.079,392876.108 +13,390869.18,392876.008 +14,390869.5,392875.857 +15,390872.292,392875.208 +16,390872.314,392875.302 +17,390875.678,392874.422 +18,390872.316,392875.346 +19,390875.907,392874.353 +20,390872.312,392875.392 +21,390876.142,392874.223 +22,390872.303,392875.433 +23,390876.44,392873.903 +24,390872.288,392875.482 +25,390877.003,392873.341 +26,390872.263,392875.532 +27,390880.364,392878.196 +28,390884.19,392866.433 +29,390872.239,392875.581 +30,390881.306,392879.522 +31,390879.232,392879.305 +32,390886.111,392864.602 +33,390872.17,392875.71 +34,390885,392880 +35,390879.208,392879.353 +36,390890.1695,392868.642 +37,390891.919,392859.065 +38,390872.092,392875.822 +39,390879.183,392879.426 +40,390890.444,392868.351 +41,390891.41,392869.955 +42,390895.963,392855.237 +43,390891.775,392858.903 +44,390872.073,392875.85 +45,390879.159,392879.522 +46,390890.571,392868.223 +47,390893,392874 +48,390899.026,392852.352 +49,390891.742,392858.804 +50,390872.038,392875.883 +51,390879.159,392879.763 +52,390890.754,392868.168 +53,390899.475,392851.944 +54,390899.491,392852.791 +55,390891.759,392858.689 +56,390871.964,392875.93 +57,390879.232,392879.956 +58,390890.936,392868.168 +59,390901.469,392850.053 +60,390899.548,392852.823 +61,390891.775,392858.59 +62,390871.892,392875.96 +63,390879.907,392880.679 +64,390891.045,392868.168 +65,390901.87,392849.664 +66,390907.23,392855.97 +67,390899.618,392852.847 +68,390891.825,392858.508 +69,390871.812,392875.983 +70,390881,392884 +71,390891.246,392868.241 +72,390906.932,392845.428 +73,390907,392860 +74,390907,392860 +75,390899.793,392852.887 +76,390891.972,392858.324 +77,390871.436,392876.083 +78,390892.048,392868.97 +79,390908.613,392843.857 +80,390899.889,392852.926 +81,390892.512,392857.808 +82,390870.935,392876.183 +83,390896,392870 +84,390909.025,392843.57 +85,390899.982,392852.987 +86,390893.558,392856.82 +87,390870.634,392876.259 +88,390909.878,392843.014 +89,390900.06,392853.057 +90,390893.775,392856.555 +91,390870.525,392876.285 +92,390910.741,392842.593 +93,390893.803,392856.496 +94,390870.492,392876.296 +95,390911.23,392842.324 +96,390893.8,392856.41 +97,390870.458,392876.31 +98,390911.556,392842.152 +99,390893.781,392856.378 +100,390870.383,392876.359 +101,390911.997,392841.898 +102,390890.706,392852.332 +103,390870.157,392876.534 +104,390912.282,392841.942 +105,390912.282,392841.72 +106,390890.64,392852.121 +107,390912.63,392841.967 +108,390912.43,392841.6 +109,390890.511,392851.689 +110,390913.032,392842.011 +111,390917.463,392836.015 +112,390883.277,392842.144 +113,390913.637,392842.13 +114,390918.004,392835.491 +115,390876.523,392833.895 +116,390914.4,392842.345 +117,390918.765,392836.293 +118,390915.488,392832.839 +119,390875.778,392833.236 +120,390914.924,392842.567 +121,390918.949,392836.229 +122,390919.135,392836.684 +123,390910.895,392828.11 +124,390875.199,392832.8 +125,390915.64,392842.933 +126,390919.115,392836.199 +127,390920.876,392838.518 +128,390908.834,392825.979 +129,390874.662,392832.48 +130,390916.403,392843.351 +131,390919.234,392836.205 +132,390923.576,392835.814 +133,390925.817,392843.725 +134,390908.271,392825.3 +135,390872.865,392831.803 +136,390917.072,392843.826 +137,390919.412,392836.253 +138,390923.799,392835.572 +139,390929.524,392847.569 +140,390907.615,392824.551 +141,390871.466,392831.607 +142,390918.076,392844.727 +143,390919.608,392836.348 +144,390923.973,392835.3 +145,390932.015,392850.135 +146,390907.053,392823.802 +147,390871.226,392831.623 +148,390922.542,392849.331 +149,390919.762,392836.466 +150,390924.07,392835.058 +151,390934.503,392852.697 +152,390935.584,392846.448 +153,390906.491,392822.865 +154,390871.173,392831.687 +155,390923.521,392850.328 +156,390919.905,392836.632 +157,390924.128,392834.671 +158,390941.046,392859.545 +159,390935.817,392846.24 +160,390906.35,392822.584 +161,390871.128,392831.801 +162,390915.061,392858.471 +163,390927.222,392854.1 +164,390920.012,392836.805 +165,390924.169,392834.201 +166,390943.336,392861.907 +167,390935.995,392846.017 +168,390905.502,392821.012 +169,390871.1,392832.049 +170,390913.478,392860.025 +171,390931.986,392859.25 +172,390920.077,392836.965 +173,390924.246,392833.853 +174,390946.01,392864.771 +175,390946.317,392858.942 +176,390936.05,392845.912 +177,390905.189,392820.053 +178,390910,392863 +179,390932.788,392860.118 +180,390930.205,392860.892 +181,390920.101,392837.143 +182,390924.411,392833.475 +183,390946.422,392865.19 +184,390946.618,392858.602 +185,390936.119,392845.666 +186,390905.022,392819.323 +187,390935.932,392863.545 +188,390923.046,392867.911 +189,390920.095,392837.297 +190,390924.644,392833.165 +191,390948.046,392866.84 +192,390946.652,392865.034 +193,390946.84,392858.223 +194,390936.242,392845.027 +195,390904.938,392818.655 +196,390941.568,392869.643 +197,390921.647,392869.283 +198,390923.824,392868.734 +199,390920.042,392837.481 +200,390924.934,392832.865 +201,390948.693,392867.51 +202,390946.807,392864.979 +203,390946.971,392857.897 +204,390936.288,392844.648 +205,390905.001,392817.821 +206,390939.128,392871.786 +207,390943.019,392871.212 +208,390917,392871 +209,390923.916,392868.865 +210,390919.804,392837.861 +211,390925.39,392832.419 +212,390946.962,392864.97 +213,390947.023,392857.622 +214,390936.388,392844.4 +215,390905.251,392816.298 +216,390931.512,392879.201 +217,390945.597,392874.081 +218,390923.961,392868.986 +219,390919.412,392838.407 +220,390926.643,392831.209 +221,390947.126,392865.015 +222,390947.089,392857.034 +223,390936.61,392843.936 +224,390905.69,392815.026 +225,390927,392880 +226,390946.519,392875.104 +227,390923.967,392869.089 +228,390926.75,392831.106 +229,390947.326,392865.134 +230,390947.18,392856.577 +231,390936.749,392843.721 +232,390906.065,392814.191 +233,390937.556,392882.924 +234,390947.273,392875.942 +235,390923.916,392869.238 +236,390926.805,392831.065 +237,390947.49,392865.261 +238,390947.287,392856.272 +239,390936.874,392843.589 +240,390906.399,392813.691 +241,390936.301,392884.111 +242,390923.807,392869.387 +243,390926.875,392831.043 +244,390947.59,392865.397 +245,390947.457,392855.998 +246,390938.352,392842.126 +247,390907.213,392812.685 +248,390931,392884 +249,390931,392884 +250,390923.606,392869.587 +251,390926.945,392831.047 +252,390947.626,392865.525 +253,390947.784,392855.658 +254,390938.796,392841.703 +255,390910.805,392815.497 +256,390907.752,392812.019 +257,390922.855,392870.303 +258,390927.019,392831.072 +259,390947.635,392865.698 +260,390949.052,392854.417 +261,390938.914,392841.633 +262,390911.309,392815.876 +263,390909.871,392809.604 +264,390921,392875 +265,390927.156,392831.157 +266,390947.599,392865.889 +267,390949.358,392854.138 +268,390936.706,392838.972 +269,390939.032,392841.62 +270,390911.514,392816.081 +271,390913.165,392812.297 +272,390910.583,392808.793 +273,390927.282,392831.268 +274,390947.508,392866.043 +275,390949.516,392854.033 +276,390935,392836 +277,390939.171,392841.613 +278,390911.683,392816.381 +279,390913.42,392812.472 +280,390913.173,392805.861 +281,390927.695,392831.755 +282,390947.071,392866.462 +283,390949.636,392853.999 +284,390939.296,392841.627 +285,390911.851,392816.885 +286,390913.648,392812.586 +287,390914.334,392804.546 +288,390912.467,392805.282 +289,390931,392831 +290,390946.507,392867.044 +291,390949.096,392853.309 +292,390949.744,392853.995 +293,390939.414,392841.675 +294,390912.001,392817.334 +295,390913.996,392812.686 +296,390914.839,392803.916 +297,390909.292,392803.146 +298,390948.848,392852.992 +299,390949.819,392854.01 +300,390939.539,392841.731 +301,390912.188,392817.651 +302,390915.584,392813.037 +303,390918.269,392799.909 +304,390908.726,392802.519 +305,390948.3925,392852.4855 +306,390949.898,392854.051 +307,390940.115,392842.278 +308,390912.454,392818.024 +309,390915.882,392813.133 +310,390918.529,392799.613 +311,390908.548,392802.302 +312,390947.472,392851.557 +313,390950.032,392854.156 +314,390943,392844 +315,390912.783,392818.365 +316,390916.093,392813.229 +317,390919.05,392800 +318,390923.291,392794.191 +319,390908.47,392802.178 +320,390946,392848 +321,390950.481,392854.63 +322,390913.191,392818.747 +323,390916.33,392813.352 +324,390921.636,392802.118 +325,390925.511,392791.533 +326,390908.408,392802.069 +327,390952,392853 +328,390913.426,392818.962 +329,390916.549,392813.501 +330,390922.556,392802.836 +331,390932.594,392797.299 +332,390929.7419,392786.3729 +333,390908.354,392801.937 +334,390914.512,392819.906 +335,390918.357,392814.966 +336,390924.531,392804.433 +337,390935,392800 +338,390934.963,392790.74 +339,390930.511,392785.435 +340,390908.323,392801.829 +341,390914.975,392820.221 +342,390923,392816 +343,390926.15,392805.742 +344,390923.88,392805.165 +345,390937.605,392792.915 +346,390931.168,392784.63 +347,390908.308,392801.736 +348,390915.149,392820.308 +349,390929,392807 +350,390923.819,392805.287 +351,390937.856,392793.111 +352,390931.703,392784.132 +353,390908.308,392801.651 +354,390915.29,392820.348 +355,390923.758,392805.422 +356,390937.949,392793.204 +357,390932.46,392783.603 +358,390908.315,392801.581 +359,390915.397,392820.355 +360,390923.744,392805.551 +361,390938.005,392793.278 +362,390932.953,392783.3 +363,390908.339,392801.503 +364,390915.451,392820.348 +365,390923.772,392805.686 +366,390938.024,392793.371 +367,390933.748,392782.903 +368,390908.385,392801.426 +369,390915.511,392820.295 +370,390923.86,392805.862 +371,390938.024,392793.483 +372,390934.599,392782.657 +373,390908.689,392801.043 +374,390915.592,392820.188 +375,390924.022,392806.038 +376,390938.005,392793.623 +377,390935.584,392782.524 +378,390910.98,392798.157 +379,390907.282,392801.155 +380,390915.907,392819.679 +381,390925.152,392806.998 +382,390937.968,392793.744 +383,390936.303,392782.505 +384,390913.208,392795.42 +385,390898.776,392802.817 +386,390906.36,392802.282 +387,390918,392819 +388,390926,392812 +389,390937.912,392793.827 +390,390937.155,392782.6 +391,390913.3067,392795.2978 +392,390895.655,392803.358 +393,390901.454,392808.389 +394,390937.791,392793.949 +395,390938.366,392782.884 +396,390910.051,392792.872 +397,390915.116,392793.058 +398,390895.344,392803.443 +399,390901.096,392808.831 +400,390937.344,392794.349 +401,390939.237,392783.187 +402,390909.746,392792.659 +403,390916.015,392791.999 +404,390895.119,392803.443 +405,390900.933,392809.018 +406,390937,392798 +407,390940.013,392783.622 +408,390909.563,392792.553 +409,390918.607,392788.706 +410,390915.753,392791.725 +411,390894.893,392803.386 +412,390900.791,392809.106 +413,390940.732,392784.113 +414,390909.433,392792.492 +415,390922.398,392784.096 +416,390915.69,392791.654 +417,390894.074,392802.85 +418,390900.539,392809.227 +419,390941.549,392784.768 +420,390909.212,392792.415 +421,390923.197,392783.136 +422,390915.654,392791.598 +423,390893.905,392802.681 +424,390897.659,392810.609 +425,390942.91,392785.874 +426,390942.91,392785.874 +427,390908.473,392792.172 +428,390923.398,392782.888 +429,390915.626,392791.52 +430,390893.792,392802.483 +431,390896.587,392810.976 +432,390947.433,392789.686 +433,390947.433,392789.686 +434,390907.642,392791.928 +435,390923.491,392782.749 +436,390915.619,392791.449 +437,390893.764,392802.258 +438,390896.22,392811.089 +439,390953.846,392795.059 +440,390953.846,392795.059 +441,390907.177,392791.783 +442,390923.553,392782.625 +443,390915.619,392791.371 +444,390893.82,392802.004 +445,390895.542,392811.117 +446,390958.463,392798.896 +447,390958.463,392798.896 +448,390906.751,392791.616 +449,390923.584,392782.517 +450,390915.633,392791.293 +451,390894.441,392801.355 +452,390894.949,392811.145 +453,390959.827,392800.103 +454,390959.827,392800.103 +455,390906.364,392791.414 +456,390923.6,392782.346 +457,390915.654,392791.243 +458,390894,392797 +459,390894.3,392810.976 +460,390963.865,392803.674 +461,390963.865,392803.674 +462,390957.305,392802.791 +463,390905.762,392791.025 +464,390923.584,392782.192 +465,390915.683,392791.215 +466,390893.764,392810.637 +467,390968.351,392807.642 +468,390968.351,392807.642 +469,390964.469,392803.03 +470,390956.915,392803.162 +471,390905.366,392790.721 +472,390923.538,392782.052 +473,390915.718,392791.18 +474,390891.2225,392808.691 +475,390970.015,392809.073 +476,390970.015,392809.073 +477,390956.693,392803.354 +478,390905.122,392790.469 +479,390923.476,392781.898 +480,390915.775,392791.151 +481,390891.138,392808.521 +482,390973.535,392812.101 +483,390973.535,392812.101 +484,390963.033,392816.614 +485,390956.52,392803.452 +486,390905.015,392790.34 +487,390923.352,392781.774 +488,390915.881,392791.116 +489,390891.11,392808.352 +490,390978.625,392816.388 +491,390978.625,392816.388 +492,390962.663,392817.058 +493,390965.49,392819.862 +494,390956.242,392803.57 +495,390904.962,392790.248 +496,390923.073,392781.511 +497,390916.016,392791.08 +498,390891.166,392808.126 +499,390981.879,392818.818 +500,390981.879,392818.818 +501,390962.507,392817.246 +502,390964,392822 +503,390955.804,392803.705 +504,390904.939,392790.18 +505,390916.237,392776.136 +506,390916.108,392791.052 +507,390891.336,392807.872 +508,390982.421,392819.26 +509,390982.421,392819.26 +510,390962.384,392817.32 +511,390955.501,392803.823 +512,390904.924,392790.081 +513,390912.695,392780.428 +514,390915.185,392775.311 +515,390916.186,392791.017 +516,390983.883,392820.451 +517,390983.883,392820.451 +518,390979.167,392822.695 +519,390962.253,392817.337 +520,390955.316,392803.946 +521,390904.932,392790.005 +522,390908,392779 +523,390914.619,392774.864 +524,390916.242,392790.981 +525,390985.003,392821.271 +526,390985.003,392821.271 +527,390977.209,392824.691 +528,390962.138,392817.312 +529,390955.18,392804.057 +530,390905.076,392789.479 +531,390914.548,392774.783 +532,390916.278,392790.932 +533,390986.567,392822.332 +534,390986.567,392822.332 +535,390975.743,392826.352 +536,390962.023,392817.271 +537,390954.784,392804.457 +538,390903.887,392790.99 +539,390904,392784 +540,390914.494,392774.721 +541,390916.292,392790.868 +542,390987.709,392823.028 +543,390987.709,392823.028 +544,390975.138,392827.039 +545,390961.735,392817.041 +546,390951.688,392807.795 +547,390902.523,392792.617 +548,390914.467,392774.649 +549,390916.278,392790.783 +550,390991,392824.805 +551,390991,392824.805 +552,390974.926,392827.234 +553,390977.781,392829.754 +554,390961.464,392816.787 +555,390951.538,392807.965 +556,390897,392791 +557,390914.449,392774.569 +558,390916.242,392790.733 +559,390993.403,392826.054 +560,390993.403,392826.054 +561,390974.831,392827.281 +562,390976,392832 +563,390958,392817 +564,390951.458,392808.125 +565,390914.458,392774.497 +566,390916.157,392790.648 +567,390993.936,392826.331 +568,390993.936,392826.331 +569,390991.104,392829.14 +570,390974.676,392827.311 +571,390951.428,392808.325 +572,390914.476,392774.425 +573,390994.064,392826.393 +574,390994.064,392826.393 +575,390990.836,392829.546 +576,390974.581,392827.311 +577,390951.428,392808.505 +578,390914.701,392774.115 +579,390997.536,392828.07 +580,390997.536,392828.07 +581,390993.888,392826.66 +582,390990.662,392829.86 +583,390974.467,392827.299 +584,390951.458,392808.71 +585,390910.991,392771.178 +586,390915.202,392773.458 +587,390999.985,392829.212 +588,390999.985,392829.212 +589,390993.812,392826.748 +590,390990.534,392830.185 +591,390974.378,392827.252 +592,390951.553,392808.9 +593,390910.777,392771.009 +594,390917.646,392770.357 +595,391004.98,392831.301 +596,391000.5776,392829.4599 +597,390993.745,392826.807 +598,390989.572,392833.322 +599,390973.854,392826.853 +600,390951.713,392809.099 +601,390910.657,392770.943 +602,390910.518,392764.593 +603,390920.545,392766.731 +604,391009.465,392833.089 +605,391009.465,392833.089 +606,391000.5776,392829.4599 +607,390996.172,392840.26 +608,390996.172,392840.26 +609,390993.64,392826.841 +610,390989.096,392834.773 +611,390969,392827 +612,390951.838,392809.199 +613,390910.547,392770.91 +614,390909,392760 +615,390923.419,392763.338 +616,391008.023,392836.745 +617,391012.375,392834.183 +618,391012.375,392834.183 +619,390996,392843 +620,390993.577,392826.832 +621,390988.794,392835.423 +622,390952.418,392809.569 +623,390910.454,392770.899 +624,390922.171,392762.286 +625,390924.232,392762.387 +626,391006.125,392841.751 +627,390993.509,392826.794 +628,390988.562,392835.841 +629,390954,392812 +630,390910.307,392770.899 +631,390921.888,392762.003 +632,390924.414,392762.164 +633,391005.565,392843.218 +634,390993.467,392826.744 +635,390988.132,392836.432 +636,390909.959,392770.941 +637,390921.726,392761.781 +638,390924.515,392762.063 +639,391002,392847 +640,390993.45,392826.677 +641,390987.226,392837.535 +642,390909.718,392770.968 +643,390921.524,392761.458 +644,390924.636,392761.963 +645,390993.459,392826.609 +646,390986.947,392837.814 +647,390909.412,392771.006 +648,390921.12,392760.65 +649,390924.798,392761.882 +650,390993.492,392826.521 +651,390986.866,392837.895 +652,390909.225,392771.017 +653,390920.797,392760.044 +654,390924.98,392761.862 +655,390993.551,392826.412 +656,390986.773,392837.93 +657,390987.307,392838.185 +658,390909.056,392771.023 +659,390920.534,392759.64 +660,390925.182,392761.882 +661,390993.787,392826.134 +662,390986.68,392837.93 +663,390987.923,392838.51 +664,390908.771,392771.012 +665,390920.231,392759.236 +666,390925.444,392762.018 +667,390993.989,392825.97 +668,390986.587,392837.907 +669,390990.478,392839.868 +670,390908.492,392770.984 +671,390919.948,392758.933 +672,390925.74,392761.64 +673,390926.091,392762.508 +674,390994.166,392825.873 +675,390986.018,392837.512 +676,390990,392841 +677,390908.361,392770.963 +678,390919.443,392758.468 +679,390925.919,392761.414 +680,390929.951,392765.901 +681,390994.528,392825.697 +682,390981,392837 +683,390908.218,392770.935 +684,390917.785,392756.994 +685,390926.062,392761.188 +686,390932.739,392768.301 +687,390908.087,392770.886 +688,390913,392755 +689,390926.169,392760.95 +690,390938.131,392762.197 +691,390940.702,392775.184 +692,390907.934,392770.815 +693,390926.216,392760.76 +694,390937.548,392761.707 +695,390939.539,392760.604 +696,390947.039,392768.131 +697,390942.352,392776.625 +698,390907.699,392770.684 +699,390926.24,392760.45 +700,390937.379,392761.539 +701,390943,392758 +702,390949,392763 +703,390944.148,392778.217 +704,390907.124,392770.224 +705,390926.204,392759.927 +706,390937.285,392761.418 +707,390948.941,392782.353 +708,390944.182,392778.111 +709,390906.396,392769.568 +710,390925.585,392756.048 +711,390937.231,392761.343 +712,390954.592,392787.288 +713,390951.513,392779.362 +714,390944.201,392778.008 +715,390906.33,392769.502 +716,390925.095,392752.863 +717,390937.197,392761.256 +718,390960.503,392792.29 +719,390951.779,392779.034 +720,390944.201,392777.911 +721,390906.287,392769.442 +722,390924.96,392751.851 +723,390937.177,392761.175 +724,390962.999,392794.377 +725,390966.597,392785.202 +726,390951.873,392778.903 +727,390944.188,392777.802 +728,390906.259,392769.376 +729,390924.892,392750.924 +730,390937.177,392761.081 +731,390966.383,392797.222 +732,390967.383,392784.225 +733,390951.956,392778.754 +734,390944.156,392777.718 +735,390906.248,392769.3 +736,390924.876,392750.418 +737,390937.191,392761.007 +738,390970.344,392800.554 +739,390967.79,392783.707 +740,390952.012,392778.624 +741,390944.072,392777.609 +742,390906.248,392769.229 +743,390924.892,392750.014 +744,390937.231,392760.926 +745,390973.519,392803.236 +746,390965.176,392781.034 +747,390967.869,392783.614 +748,390952.068,392778.466 +749,390943.95,392777.499 +750,390906.259,392769.163 +751,390924.96,392749.676 +752,390937.285,392760.845 +753,390974.708,392804.22 +754,390977.441,392798.798 +755,390965,392778 +756,390967.938,392783.559 +757,390952.106,392778.307 +758,390943.847,392777.429 +759,390906.303,392769.081 +760,390925.078,392749.289 +761,390937.393,392760.704 +762,390976.271,392805.664 +763,390980.72,392795.089 +764,390968.007,392783.531 +765,390952.134,392778.084 +766,390943.737,392777.377 +767,390906.369,392768.988 +768,390925.23,392748.952 +769,390938.215,392759.66 +770,390980.319,392808.983 +771,390978.194,392792.523 +772,390980.83,392795.019 +773,390968.132,392783.517 +774,390952.161,392777.776 +775,390943.66,392777.358 +776,390906.708,392768.567 +777,390925.5,392748.446 +778,390940,392756 +779,390983.29,392812.012 +780,390978,392789 +781,390980.951,392794.989 +782,390968.299,392783.573 +783,390952.189,392777.45 +784,390943.563,392777.358 +785,390906,392764 +786,390926.112,392747.463 +787,390985.762,392814.221 +788,390981.082,392794.959 +789,390968.41,392783.642 +790,390952.227,392777.236 +791,390943.473,392777.377 +792,390926.444,392747.366 +793,390924.179,392748.181 +794,390988.243,392815.901 +795,390981.202,392794.959 +796,390968.576,392783.781 +797,390952.283,392777.022 +798,390943.39,392777.416 +799,390926.734,392747.283 +800,390921.1,392749.367 +801,390988.444,392815.944 +802,390990.626,392817.377 +803,390981.333,392794.979 +804,390969.687,392784.793 +805,390952.311,392776.92 +806,390943.306,392777.506 +807,390926.982,392747.256 +808,390918.462,392750.361 +809,390988.65,392815.95 +810,390993.25,392818.98 +811,390993.25,392818.98 +812,390981.413,392795.009 +813,390973,392785 +814,390952.366,392776.761 +815,390943.035,392777.828 +816,390927.176,392747.256 +817,390917,392751 +818,390988.854,392815.918 +819,390995.557,392820.131 +820,390995.557,392820.131 +821,390981.524,392795.079 +822,390952.441,392776.622 +823,390942.694,392778.175 +824,390927.369,392747.297 +825,390989.048,392815.851 +826,390997.983,392821.471 +827,390997.983,392821.471 +828,390982.359,392795.763 +829,390952.581,392776.445 +830,390942.333,392778.516 +831,390927.535,392747.339 +832,390989.227,392815.749 +833,390999.996,392822.532 +834,390999.996,392822.532 +835,390986,392795 +836,390954.1,392774.61 +837,390927.645,392747.394 +838,390989.385,392815.617 +839,391002.28,392823.399 +840,391002.28,392823.399 +841,390954.732,392773.897 +842,390927.77,392747.463 +843,390989.516,392815.458 +844,391004.255,392819.014 +845,391005.615,392824.81 +846,391005.615,392824.81 +847,390955.053,392773.535 +848,390927.935,392747.601 +849,390989.5735,392815.3755 +850,391004.582,392818.391 +851,391009.67,392826.423 +852,391009.67,392826.423 +853,390955.134,392773.465 +854,390928.184,392747.849 +855,390990.602,392813.363 +856,391005.27,392816.532 +857,391016.001,392829.07 +858,391016.001,392829.07 +859,390955.204,392773.418 +860,390931,392748 +861,390935,392751 +862,390991.411,392812.136 +863,391006.257,392814.424 +864,391018.607,392830.063 +865,391018.607,392830.063 +866,390955.285,392773.378 +867,390991.997,392810.992 +868,391006.471,392814.211 +869,391020.304,392830.435 +870,391020.304,392830.435 +871,390955.355,392773.36 +872,390992.556,392809.765 +873,391006.765,392813.971 +874,391005.777,392813.73 +875,391021.504,392830.435 +876,391021.504,392830.435 +877,390955.425,392773.355 +878,390993.762,392807.804 +879,391007.112,392813.917 +880,391004.149,392812.61 +881,391022.496,392830.239 +882,391022.496,392830.239 +883,390955.495,392773.355 +884,390994.075,392807.334 +885,391007.646,392813.917 +886,391005,392808 +887,390955.564,392773.36 +888,390994.421,392806.816 +889,390992.316,392804.712 +890,391008.286,392814.131 +891,390956.756,392773.691 +892,390994.97,392805.953 +893,390990.811,392802.497 +894,391010.609,392815.358 +895,390952.377,392769.85 +896,390960,392774 +897,390995.113,392805.81 +898,390991,392798 +899,391014,392812 +900,390952,392766 +901,390995.257,392805.718 +902,390995.401,392805.718 +903,390995.584,392805.758 +904,390995.885,392805.914 +905,390996.355,392806.267 +906,391001,392805 diff --git a/src/test/resources/lvFeeder/LineCodes.csv b/src/test/resources/lvFeeder/LineCodes.csv new file mode 100644 index 0000000000..f603a0cd0f --- /dev/null +++ b/src/test/resources/lvFeeder/LineCodes.csv @@ -0,0 +1,12 @@ +# Line Codes defined by matrix values,,,,,,,, +Name,nphases,R1,X1,R0,X0,C1,C0,Units +2c_.007,3,3.97,0.099,3.97,0.099,0,0,km +2c_.0225,3,1.257,0.085,1.257,0.085,0,0,km +2c_16,3,1.15,0.088,1.2,0.088,0,0,km +35_SAC_XSC,3,0.868,0.092,0.76,0.092,0,0,km +4c_.06,3,0.469,0.075,1.581,0.091,0,0,km +4c_.1,3,0.274,0.073,0.959,0.079,0,0,km +4c_.35,3,0.089,0.0675,0.319,0.076,0,0,km +4c_185,3,0.166,0.068,0.58,0.078,0,0,km +4c_70,3,0.446,0.071,1.505,0.083,0,0,km +4c_95_SAC_XC,3,0.322,0.074,0.804,0.093,0,0,km diff --git a/src/test/resources/lvFeeder/Lines.csv b/src/test/resources/lvFeeder/Lines.csv new file mode 100644 index 0000000000..fa35170156 --- /dev/null +++ b/src/test/resources/lvFeeder/Lines.csv @@ -0,0 +1,907 @@ +# Line definitions ,,,,,, +Name,Bus1,Bus2,Phases,Length,Units,LineCode +LINE1,1,2,ABC,1.098,m,4c_70 +LINE2,2,3,ABC,0.11511,m,4c_70 +LINE3,3,4,ABC,0.10784,m,4c_70 +LINE4,4,5,ABC,0.094021,m,4c_70 +LINE5,5,6,ABC,0.14812,m,4c_70 +LINE6,6,7,ABC,10.0863,m,4c_70 +LINE7,7,8,ABC,0.45175,m,4c_70 +LINE8,8,9,ABC,0.376,m,4c_70 +LINE9,9,10,ABC,0.32997,m,4c_70 +LINE10,10,11,ABC,0.24622,m,4c_70 +LINE11,11,12,ABC,0.23114,m,4c_70 +LINE12,12,13,ABC,0.14213,m,4c_70 +LINE13,13,14,ABC,0.35384,m,4c_70 +LINE14,14,15,ABC,2.8664,m,4c_70 +LINE15,15,16,ABC,0.09654,m,2c_.007 +LINE16,15,17,ABC,3.476,m,4c_70 +LINE17,16,18,ABC,0.044045,m,2c_.007 +LINE18,17,19,ABC,0.23917,m,4c_70 +LINE19,18,20,ABC,0.046174,m,2c_.007 +LINE20,19,21,ABC,0.26856,m,4c_70 +LINE21,20,22,ABC,0.041976,m,2c_.007 +LINE22,21,23,ABC,0.43727,m,4c_70 +LINE23,22,24,ABC,0.051245,m,2c_.007 +LINE24,23,25,ABC,0.7955,m,4c_70 +LINE25,24,26,ABC,0.055902,m,2c_.007 +LINE26,25,27,ABC,5.9049,m,2c_16 +LINE27,25,28,ABC,9.9686,m,4c_70 +LINE28,26,29,ABC,0.054562,m,2c_.007 +LINE29,27,30,ABC,1.6265,m,2c_16 +LINE30,27,31,ABC,1.5847,m,2c_16 +LINE31,28,32,ABC,2.6538,m,4c_70 +LINE32,29,33,ABC,0.14629,m,2c_.007 +LINE33,30,34,ABC,3.7248,m,2c_16 +LINE34,31,35,ABC,0.053666,m,2c_16 +LINE35,32,36,ABC,5.7265,m,2c_16 +LINE36,32,37,ABC,8.0244,m,4c_70 +LINE37,33,38,ABC,0.13648,m,2c_.007 +LINE38,35,39,ABC,0.077162,m,2c_16 +LINE39,36,40,ABC,0.40004,m,2c_16 +LINE40,36,41,ABC,1.8063,m,2c_16 +LINE41,37,42,ABC,5.5684,m,4c_70 +LINE42,37,43,ABC,0.21675,m,4c_185 +LINE43,38,44,ABC,0.033838,m,2c_.007 +LINE44,39,45,ABC,0.098955,m,2c_16 +LINE45,40,46,ABC,0.18031,m,2c_16 +LINE46,41,47,ABC,4.3463,m,2c_16 +LINE47,42,48,ABC,4.2078,m,4c_70 +LINE48,43,49,ABC,0.10436,m,4c_185 +LINE49,44,50,ABC,0.048104,m,2c_.007 +LINE50,45,51,ABC,0.241,m,2c_16 +LINE51,46,52,ABC,0.19109,m,2c_16 +LINE52,48,53,ABC,0.60668,m,4c_70 +LINE53,48,54,ABC,0.63949,m,4c_70 +LINE54,49,55,ABC,0.11625,m,4c_185 +LINE55,50,56,ABC,0.087664,m,2c_.007 +LINE56,51,57,ABC,0.20634,m,2c_16 +LINE57,52,58,ABC,0.182,m,2c_16 +LINE58,53,59,ABC,2.7481,m,4c_70 +LINE59,54,60,ABC,0.065368,m,4c_70 +LINE60,55,61,ABC,0.10028,m,4c_185 +LINE61,56,62,ABC,0.078,m,2c_.007 +LINE62,57,63,ABC,0.98912,m,2c_16 +LINE63,58,64,ABC,0.109,m,2c_16 +LINE64,59,65,ABC,0.55868,m,4c_70 +LINE65,59,66,ABC,8.2583,m,2c_16 +LINE66,60,67,ABC,0.074,m,4c_70 +LINE67,61,68,ABC,0.096042,m,4c_185 +LINE68,62,69,ABC,0.083241,m,2c_.007 +LINE69,63,70,ABC,3.4962,m,2c_16 +LINE70,64,71,ABC,0.21385,m,2c_16 +LINE71,65,72,ABC,6.6006,m,4c_70 +LINE72,66,73,ABC,4.0366,m,2c_16 +LINE73,66,74,ABC,4.0366,m,2c_16 +LINE74,67,75,ABC,0.17951,m,4c_70 +LINE75,68,76,ABC,0.23551,m,4c_185 +LINE76,69,77,ABC,0.38907,m,2c_.007 +LINE77,71,78,ABC,1.0838,m,2c_16 +LINE78,72,79,ABC,2.3008,m,4c_70 +LINE79,75,80,ABC,0.10362,m,4c_70 +LINE80,76,81,ABC,0.7469,m,4c_185 +LINE81,77,82,ABC,0.51088,m,2c_.007 +LINE82,78,83,ABC,4.084,m,2c_16 +LINE83,79,84,ABC,0.50211,m,4c_70 +LINE84,80,85,ABC,0.11122,m,4c_70 +LINE85,81,86,ABC,1.4388,m,4c_185 +LINE86,82,87,ABC,0.31045,m,2c_.007 +LINE87,84,88,ABC,1.0182,m,4c_70 +LINE88,85,89,ABC,0.1048,m,4c_70 +LINE89,86,90,ABC,0.34251,m,4c_185 +LINE90,87,91,ABC,0.11206,m,2c_.007 +LINE91,88,92,ABC,0.96021,m,4c_70 +LINE92,90,93,ABC,0.065307,m,4c_185 +LINE93,91,94,ABC,0.034785,m,2c_.007 +LINE94,92,95,ABC,0.55811,m,4c_70 +LINE95,93,96,ABC,0.086052,m,4c_185 +LINE96,94,97,ABC,0.03677,m,2c_.007 +LINE97,95,98,ABC,0.36859,m,4c_70 +LINE98,96,99,ABC,0.037216,m,4c_185 +LINE99,97,100,ABC,0.089588,m,2c_.007 +LINE100,98,101,ABC,0.50892,m,4c_70 +LINE101,99,102,ABC,5.0819,m,4c_185 +LINE102,100,103,ABC,0.28583,m,2c_.007 +LINE103,101,104,ABC,0.28838,m,4c_.35 +LINE104,101,105,ABC,0.33602,m,4c_70 +LINE105,102,106,ABC,0.22108,m,4c_185 +LINE106,104,107,ABC,0.3489,m,4c_.35 +LINE107,105,108,ABC,0.19054,m,4c_70 +LINE108,106,109,ABC,0.45085,m,4c_185 +LINE109,107,110,ABC,0.4044,m,4c_.35 +LINE110,108,111,ABC,7.5182,m,4c_70 +LINE111,109,112,ABC,11.9766,m,4c_185 +LINE112,110,113,ABC,0.61659,m,4c_.35 +LINE113,111,114,ABC,0.75316,m,4c_70 +LINE114,112,115,ABC,10.6613,m,4c_185 +LINE115,113,116,ABC,0.79271,m,4c_.35 +LINE116,114,117,ABC,1.1056,m,4c_.35 +LINE117,114,118,ABC,3.6556,m,4c_.1 +LINE118,115,119,ABC,0.99464,m,4c_185 +LINE119,116,120,ABC,0.56909,m,4c_.35 +LINE120,117,121,ABC,0.19481,m,2c_.007 +LINE121,117,122,ABC,0.53831,m,4c_.35 +LINE122,118,123,ABC,6.5924,m,4c_.1 +LINE123,119,124,ABC,0.7248,m,4c_185 +LINE124,120,125,ABC,0.80412,m,4c_.35 +LINE125,121,126,ABC,0.16869,m,2c_.007 +LINE126,122,127,ABC,2.5288,m,4c_.35 +LINE127,123,128,ABC,2.9646,m,4c_.1 +LINE128,124,129,ABC,0.62512,m,4c_185 +LINE129,125,130,ABC,0.87,m,4c_.35 +LINE130,126,131,ABC,0.11915,m,2c_.007 +LINE131,127,132,ABC,3.8212,m,2c_16 +LINE132,127,133,ABC,7.1782,m,4c_.35 +LINE133,128,134,ABC,0.88205,m,4c_.1 +LINE134,129,135,ABC,1.9203,m,4c_185 +LINE135,130,136,ABC,0.82048,m,4c_.35 +LINE136,131,137,ABC,0.18436,m,2c_.007 +LINE137,132,138,ABC,0.32908,m,2c_16 +LINE138,133,139,ABC,5.3402,m,4c_.35 +LINE139,134,140,ABC,0.99566,m,4c_.1 +LINE140,135,141,ABC,1.4127,m,4c_185 +LINE141,136,142,ABC,1.349,m,4c_.35 +LINE142,137,143,ABC,0.21781,m,2c_.007 +LINE143,138,144,ABC,0.32289,m,2c_16 +LINE144,139,145,ABC,3.5762,m,4c_.35 +LINE145,140,146,ABC,0.9364,m,4c_.1 +LINE146,141,147,ABC,0.24053,m,4c_185 +LINE147,142,148,ABC,6.4142,m,4c_.35 +LINE148,143,149,ABC,0.19401,m,2c_.007 +LINE149,144,150,ABC,0.26072,m,2c_16 +LINE150,145,151,ABC,3.5713,m,4c_.35 +LINE151,145,152,ABC,5.1314,m,2c_16 +LINE152,146,153,ABC,1.0926,m,4c_.1 +LINE153,147,154,ABC,0.083096,m,4c_185 +LINE154,148,155,ABC,1.3973,m,4c_.35 +LINE155,149,156,ABC,0.2191,m,2c_.007 +LINE156,150,157,ABC,0.39132,m,2c_16 +LINE157,151,158,ABC,9.4713,m,4c_.35 +LINE158,152,159,ABC,0.31233,m,2c_16 +LINE159,153,160,ABC,0.31439,m,4c_.1 +LINE160,154,161,ABC,0.12256,m,4c_185 +LINE161,155,162,ABC,11.7422,m,2c_16 +LINE162,155,163,ABC,5.2844,m,4c_.35 +LINE163,156,164,ABC,0.20342,m,2c_.007 +LINE164,157,165,ABC,0.47178,m,2c_16 +LINE165,158,166,ABC,3.2899,m,4c_.35 +LINE166,159,167,ABC,0.28533,m,2c_16 +LINE167,160,168,ABC,1.7861,m,4c_.1 +LINE168,161,169,ABC,0.24958,m,4c_185 +LINE169,162,170,ABC,2.2183,m,2c_16 +LINE170,163,171,ABC,7.0156,m,4c_.35 +LINE171,164,172,ABC,0.1727,m,2c_.007 +LINE172,165,173,ABC,0.35642,m,2c_16 +LINE173,166,174,ABC,3.9183,m,4c_.35 +LINE174,166,175,ABC,4.2045,m,2c_16 +LINE175,167,176,ABC,0.11853,m,2c_16 +LINE176,168,177,ABC,1.0088,m,4c_.1 +LINE177,170,178,ABC,4.5768,m,2c_16 +LINE178,171,179,ABC,1.1818,m,4c_.35 +LINE179,171,180,ABC,2.4224,m,2c_16 +LINE180,172,181,ABC,0.17961,m,2c_.007 +LINE181,173,182,ABC,0.41244,m,2c_16 +LINE182,174,183,ABC,0.58763,m,4c_.35 +LINE183,175,184,ABC,0.45409,m,2c_16 +LINE184,176,185,ABC,0.25549,m,2c_16 +LINE185,177,186,ABC,0.74886,m,4c_.1 +LINE186,179,187,ABC,4.6507,m,4c_.35 +LINE187,180,188,ABC,10.0258,m,2c_16 +LINE188,181,189,ABC,0.15412,m,2c_.007 +LINE189,182,190,ABC,0.3878,m,2c_16 +LINE190,183,191,ABC,2.3151,m,4c_.35 +LINE191,183,192,ABC,0.27791,m,4c_.35 +LINE192,184,193,ABC,0.43923,m,2c_16 +LINE193,185,194,ABC,0.65073,m,2c_16 +LINE194,186,195,ABC,0.67326,m,4c_.1 +LINE195,187,196,ABC,8.3036,m,4c_.35 +LINE196,188,197,ABC,1.9595,m,2c_16 +LINE197,188,198,ABC,1.1325,m,2c_16 +LINE198,189,199,ABC,0.19148,m,2c_.007 +LINE199,190,200,ABC,0.41725,m,2c_16 +LINE200,191,201,ABC,0.9314,m,4c_.35 +LINE201,192,202,ABC,0.16447,m,4c_.35 +LINE202,193,203,ABC,0.35134,m,2c_16 +LINE203,194,204,ABC,0.38178,m,2c_16 +LINE204,195,205,ABC,0.83638,m,4c_.1 +LINE205,196,206,ABC,3.2475,m,2c_16 +LINE206,196,207,ABC,2.1371,m,4c_.35 +LINE207,197,208,ABC,4.9541,m,2c_16 +LINE208,198,209,ABC,0.16008,m,2c_16 +LINE209,199,210,ABC,0.44838,m,2c_.007 +LINE210,200,211,ABC,0.63785,m,2c_16 +LINE211,202,212,ABC,0.15526,m,4c_.35 +LINE212,203,213,ABC,0.27987,m,2c_16 +LINE213,204,214,ABC,0.2674,m,2c_16 +LINE214,205,215,ABC,1.5434,m,4c_.1 +LINE215,206,216,ABC,10.6295,m,2c_16 +LINE216,207,217,ABC,3.8571,m,4c_.35 +LINE217,209,218,ABC,0.1291,m,2c_16 +LINE218,210,219,ABC,0.67215,m,2c_.007 +LINE219,211,220,ABC,1.7419,m,2c_16 +LINE220,212,221,ABC,0.17006,m,4c_.35 +LINE221,213,222,ABC,0.59169,m,2c_16 +LINE222,214,223,ABC,0.51437,m,2c_16 +LINE223,215,224,ABC,1.3456,m,4c_.1 +LINE224,216,225,ABC,4.5822,m,2c_16 +LINE225,217,226,ABC,1.3772,m,4c_.35 +LINE226,218,227,ABC,0.10317,m,2c_16 +LINE227,220,228,ABC,0.14852,m,2c_16 +LINE228,221,229,ABC,0.23273,m,4c_.35 +LINE229,222,230,ABC,0.46597,m,2c_16 +LINE230,223,231,ABC,0.25602,m,2c_16 +LINE231,224,232,ABC,0.91534,m,4c_.1 +LINE232,226,233,ABC,11.8949,m,2c_16 +LINE233,226,234,ABC,1.1273,m,4c_.35 +LINE234,227,235,ABC,0.15749,m,2c_16 +LINE235,228,236,ABC,0.0686,m,2c_16 +LINE236,229,237,ABC,0.20742,m,4c_.35 +LINE237,230,238,ABC,0.32322,m,2c_16 +LINE238,231,239,ABC,0.18179,m,2c_16 +LINE239,232,240,ABC,0.6013,m,4c_.1 +LINE240,233,241,ABC,1.7274,m,2c_16 +LINE241,235,242,ABC,0.18461,m,2c_16 +LINE242,236,243,ABC,0.073376,m,2c_16 +LINE243,237,244,ABC,0.16881,m,4c_.35 +LINE244,238,245,ABC,0.32245,m,2c_16 +LINE245,239,246,ABC,2.0796,m,2c_16 +LINE246,240,247,ABC,1.2941,m,4c_.1 +LINE247,241,248,ABC,5.3022,m,2c_16 +LINE248,241,249,ABC,5.3022,m,2c_16 +LINE249,242,250,ABC,0.28355,m,2c_16 +LINE250,243,251,ABC,0.070114,m,2c_16 +LINE251,244,252,ABC,0.13297,m,4c_.35 +LINE252,245,253,ABC,0.47173,m,2c_16 +LINE253,246,254,ABC,0.61324,m,2c_16 +LINE254,247,255,ABC,4.5618,m,2c_16 +LINE255,247,256,ABC,0.85678,m,4c_.1 +LINE256,250,257,ABC,1.0376,m,2c_16 +LINE257,251,258,ABC,0.07811,m,2c_16 +LINE258,252,259,ABC,0.17323,m,4c_.35 +LINE259,253,260,ABC,1.7742,m,2c_16 +LINE260,254,261,ABC,0.1372,m,2c_16 +LINE261,255,262,ABC,0.6306,m,2c_16 +LINE262,256,263,ABC,3.2128,m,4c_.1 +LINE263,257,264,ABC,5.05,m,2c_16 +LINE264,258,265,ABC,0.16123,m,2c_16 +LINE265,259,266,ABC,0.19436,m,4c_.35 +LINE266,260,267,ABC,0.4141,m,2c_16 +LINE267,261,268,ABC,3.4578,m,2c_16 +LINE268,261,269,ABC,0.11871,m,2c_16 +LINE269,262,270,ABC,0.28991,m,2c_16 +LINE270,263,271,ABC,4.2547,m,2c_16 +LINE271,263,272,ABC,1.0792,m,4c_.1 +LINE272,265,273,ABC,0.16792,m,2c_16 +LINE273,266,274,ABC,0.17888,m,4c_.35 +LINE274,267,275,ABC,0.18971,m,2c_16 +LINE275,268,276,ABC,3.4268,m,2c_16 +LINE276,269,277,ABC,0.13918,m,2c_16 +LINE277,270,278,ABC,0.34433,m,2c_16 +LINE278,271,279,ABC,0.30927,m,2c_16 +LINE279,272,280,ABC,3.9121,m,4c_.1 +LINE280,273,281,ABC,0.63854,m,2c_16 +LINE281,274,282,ABC,0.60542,m,4c_.35 +LINE282,275,283,ABC,0.12472,m,2c_16 +LINE283,277,284,ABC,0.12578,m,2c_16 +LINE284,278,285,ABC,0.53126,m,2c_16 +LINE285,279,286,ABC,0.25491,m,2c_16 +LINE286,280,287,ABC,1.7542,m,4c_.06 +LINE287,280,288,ABC,0.91306,m,4c_.1 +LINE288,281,289,ABC,3.3901,m,2c_16 +LINE289,282,290,ABC,0.81044,m,4c_.35 +LINE290,283,291,ABC,0.87618,m,2c_16 +LINE291,283,292,ABC,0.10807,m,2c_16 +LINE292,284,293,ABC,0.12739,m,2c_16 +LINE293,285,294,ABC,0.47339,m,2c_16 +LINE294,286,295,ABC,0.36208,m,2c_16 +LINE295,287,296,ABC,0.80742,m,4c_.06 +LINE296,288,297,ABC,3.8266,m,4c_.1 +LINE297,291,298,ABC,0.40248,m,2c_16 +LINE298,292,299,ABC,0.076485,m,2c_16 +LINE299,293,300,ABC,0.13697,m,2c_16 +LINE300,294,301,ABC,0.36805,m,2c_16 +LINE301,295,302,ABC,1.6263,m,2c_16 +LINE302,296,303,ABC,5.2746,m,4c_.06 +LINE303,297,304,ABC,0.84468,m,4c_.1 +LINE304,298,305,ABC,0.68119,m,2c_16 +LINE305,299,306,ABC,0.089006,m,2c_16 +LINE306,300,307,ABC,0.79435,m,2c_16 +LINE307,301,308,ABC,0.45813,m,2c_16 +LINE308,302,309,ABC,0.31308,m,2c_16 +LINE309,303,310,ABC,0.39397,m,4c_.06 +LINE310,304,311,ABC,0.28067,m,4c_.1 +LINE311,305,312,ABC,1.3075,m,2c_16 +LINE312,306,313,ABC,0.17024,m,2c_16 +LINE313,307,314,ABC,3.3598,m,2c_16 +LINE314,308,315,ABC,0.47384,m,2c_16 +LINE315,309,316,ABC,0.23181,m,2c_16 +LINE316,310,317,ABC,0.64903,m,2c_16 +LINE317,310,318,ABC,7.2163,m,4c_.06 +LINE318,311,319,ABC,0.14649,m,4c_.1 +LINE319,312,320,ABC,3.8495,m,2c_16 +LINE320,313,321,ABC,0.6529,m,2c_16 +LINE321,315,322,ABC,0.55892,m,2c_16 +LINE322,316,323,ABC,0.26702,m,2c_16 +LINE323,317,324,ABC,3.3427,m,2c_16 +LINE324,318,325,ABC,3.4631,m,4c_.06 +LINE325,319,326,ABC,0.1254,m,4c_.1 +LINE326,321,327,ABC,2.2281,m,2c_16 +LINE327,322,328,ABC,0.31851,m,2c_16 +LINE328,323,329,ABC,0.26488,m,2c_16 +LINE329,324,330,ABC,1.167,m,2c_16 +LINE330,325,331,ABC,9.1332,m,2c_16 +LINE331,325,332,ABC,6.6729,m,4c_.06 +LINE332,326,333,ABC,0.14262,m,4c_.1 +LINE333,328,334,ABC,1.4389,m,2c_16 +LINE334,329,335,ABC,2.327,m,2c_16 +LINE335,330,336,ABC,2.5399,m,2c_16 +LINE336,331,337,ABC,3.6172,m,2c_16 +LINE337,332,338,ABC,6.8067,m,2c_16 +LINE338,332,339,ABC,1.2129,m,4c_.06 +LINE339,333,340,ABC,0.11236,m,4c_.1 +LINE340,334,341,ABC,0.55999,m,2c_16 +LINE341,335,342,ABC,4.7567,m,2c_16 +LINE342,336,343,ABC,2.082,m,2c_16 +LINE343,336,344,ABC,0.9796,m,2c_16 +LINE344,338,345,ABC,3.4221,m,2c_16 +LINE345,339,346,ABC,1.0391,m,4c_.06 +LINE346,340,347,ABC,0.094202,m,4c_.1 +LINE347,341,348,ABC,0.19454,m,2c_16 +LINE348,343,349,ABC,3.1153,m,2c_16 +LINE349,344,350,ABC,0.1364,m,2c_16 +LINE350,345,351,ABC,0.31846,m,2c_16 +LINE351,346,352,ABC,0.73091,m,4c_.06 +LINE352,347,353,ABC,0.085,m,4c_.1 +LINE353,348,354,ABC,0.14656,m,2c_16 +LINE354,350,355,ABC,0.14814,m,2c_16 +LINE355,351,356,ABC,0.13152,m,2c_16 +LINE356,352,357,ABC,0.92352,m,4c_.06 +LINE357,353,358,ABC,0.070349,m,4c_.1 +LINE358,354,359,ABC,0.10723,m,2c_16 +LINE359,355,360,ABC,0.12976,m,2c_16 +LINE360,356,361,ABC,0.092801,m,2c_16 +LINE361,357,362,ABC,0.57867,m,4c_.06 +LINE362,358,363,ABC,0.081609,m,4c_.1 +LINE363,359,364,ABC,0.054452,m,2c_16 +LINE364,360,365,ABC,0.13787,m,2c_16 +LINE365,361,366,ABC,0.094921,m,2c_16 +LINE366,362,367,ABC,0.88861,m,4c_.06 +LINE367,363,368,ABC,0.089694,m,4c_.1 +LINE368,364,369,ABC,0.080056,m,2c_16 +LINE369,365,370,ABC,0.19677,m,2c_16 +LINE370,366,371,ABC,0.112,m,2c_16 +LINE371,367,372,ABC,0.88584,m,4c_.06 +LINE372,368,373,ABC,0.48898,m,4c_.1 +LINE373,369,374,ABC,0.1342,m,2c_16 +LINE374,370,375,ABC,0.23921,m,2c_16 +LINE375,371,376,ABC,0.14128,m,2c_16 +LINE376,372,377,ABC,0.99394,m,4c_.06 +LINE377,373,378,ABC,3.6848,m,4c_.1 +LINE378,373,379,ABC,1.4115,m,2c_16 +LINE379,374,380,ABC,0.59859,m,2c_16 +LINE380,375,381,ABC,1.4827,m,2c_16 +LINE381,376,382,ABC,0.12653,m,2c_16 +LINE382,377,383,ABC,0.71925,m,4c_.06 +LINE383,378,384,ABC,3.5292,m,4c_.1 +LINE384,379,385,ABC,8.6668,m,2c_16 +LINE385,379,386,ABC,1.4561,m,2c_16 +LINE386,380,387,ABC,2.2004,m,2c_16 +LINE387,381,388,ABC,5.0734,m,2c_16 +LINE388,382,389,ABC,0.10012,m,2c_16 +LINE389,383,390,ABC,0.85728,m,4c_.06 +LINE390,384,391,ABC,0.15711,m,4c_.1 +LINE391,385,392,ABC,3.1675,m,2c_16 +LINE392,386,393,ABC,7.8335,m,2c_16 +LINE393,389,394,ABC,0.17183,m,2c_16 +LINE394,390,395,ABC,1.2439,m,4c_.06 +LINE395,391,396,ABC,4.0601,m,2c_16 +LINE396,391,397,ABC,2.8793,m,4c_.1 +LINE397,392,398,ABC,0.32241,m,2c_16 +LINE398,393,399,ABC,0.5688,m,2c_16 +LINE399,394,400,ABC,0.59984,m,2c_16 +LINE400,395,401,ABC,0.9222,m,4c_.06 +LINE401,396,402,ABC,0.37201,m,2c_16 +LINE402,397,403,ABC,1.3891,m,4c_.1 +LINE403,398,404,ABC,0.225,m,2c_16 +LINE404,399,405,ABC,0.24807,m,2c_16 +LINE405,400,406,ABC,3.6672,m,2c_16 +LINE406,401,407,ABC,0.88961,m,4c_.06 +LINE407,402,408,ABC,0.21148,m,2c_16 +LINE408,403,409,ABC,4.1907,m,4c_.1 +LINE409,403,410,ABC,0.3791,m,4c_.1 +LINE410,404,411,ABC,0.23308,m,2c_16 +LINE411,405,412,ABC,0.16706,m,2c_16 +LINE412,407,413,ABC,0.87066,m,4c_.06 +LINE413,408,414,ABC,0.1436,m,2c_16 +LINE414,409,415,ABC,5.9686,m,4c_.1 +LINE415,410,416,ABC,0.094921,m,4c_.1 +LINE416,411,417,ABC,0.9788,m,2c_16 +LINE417,412,418,ABC,0.27954,m,2c_16 +LINE418,413,419,ABC,1.0471,m,4c_.06 +LINE419,414,420,ABC,0.23403,m,2c_16 +LINE420,415,421,ABC,1.249,m,4c_.1 +LINE421,416,422,ABC,0.066573,m,4c_.1 +LINE422,417,423,ABC,0.239,m,2c_16 +LINE423,418,424,ABC,3.1944,m,2c_16 +LINE424,419,425,ABC,1.7537,m,4c_.06 +LINE425,419,426,ABC,1.7537,m,4c_.06 +LINE426,420,427,ABC,0.77793,m,2c_16 +LINE427,421,428,ABC,0.31923,m,4c_.1 +LINE428,422,429,ABC,0.082873,m,4c_.1 +LINE429,423,430,ABC,0.22798,m,2c_16 +LINE430,424,431,ABC,1.1331,m,2c_16 +LINE431,425,432,ABC,5.9151,m,4c_.06 +LINE432,425,433,ABC,5.9151,m,4c_.06 +LINE433,427,434,ABC,0.86608,m,2c_16 +LINE434,428,435,ABC,0.16724,m,4c_.1 +LINE435,429,436,ABC,0.071344,m,4c_.1 +LINE436,430,437,ABC,0.22674,m,2c_16 +LINE437,431,438,ABC,0.384,m,2c_16 +LINE438,432,439,ABC,8.3663,m,4c_.06 +LINE439,432,440,ABC,8.3663,m,4c_.06 +LINE440,434,441,ABC,0.48708,m,2c_16 +LINE441,435,442,ABC,0.13864,m,4c_.1 +LINE442,436,443,ABC,0.078,m,4c_.1 +LINE443,437,444,ABC,0.2601,m,2c_16 +LINE444,438,445,ABC,0.67858,m,2c_16 +LINE445,439,446,ABC,6.0033,m,4c_.06 +LINE446,439,447,ABC,6.0033,m,4c_.06 +LINE447,441,448,ABC,0.45756,m,2c_16 +LINE448,442,449,ABC,0.11236,m,4c_.1 +LINE449,443,450,ABC,0.079246,m,4c_.1 +LINE450,444,451,ABC,0.89824,m,2c_16 +LINE451,445,452,ABC,0.59366,m,2c_16 +LINE452,446,453,ABC,1.8214,m,4c_.06 +LINE453,446,454,ABC,1.8214,m,4c_.06 +LINE454,448,455,ABC,0.43655,m,2c_16 +LINE455,449,456,ABC,0.17175,m,4c_.1 +LINE456,450,457,ABC,0.054231,m,4c_.1 +LINE457,451,458,ABC,4.3773,m,2c_16 +LINE458,452,459,ABC,0.67064,m,2c_16 +LINE459,453,460,ABC,5.3905,m,4c_.06 +LINE460,453,461,ABC,5.3905,m,4c_.06 +LINE461,453,462,ABC,3.6859,m,2c_16 +LINE462,455,463,ABC,0.71675,m,2c_16 +LINE463,456,464,ABC,0.15483,m,4c_.1 +LINE464,457,465,ABC,0.040311,m,4c_.1 +LINE465,459,466,ABC,0.63421,m,2c_16 +LINE466,460,467,ABC,5.9891,m,4c_.06 +LINE467,460,468,ABC,5.9891,m,4c_.06 +LINE468,460,469,ABC,0.88292,m,4c_.06 +LINE469,462,470,ABC,0.53828,m,2c_16 +LINE470,463,471,ABC,0.49923,m,2c_16 +LINE471,464,472,ABC,0.14736,m,4c_.1 +LINE472,465,473,ABC,0.049497,m,4c_.1 +LINE473,466,474,ABC,3.201,m,2c_16 +LINE474,467,475,ABC,2.1947,m,4c_.06 +LINE475,467,476,ABC,2.1947,m,4c_.06 +LINE476,470,477,ABC,0.29351,m,2c_16 +LINE477,471,478,ABC,0.35077,m,2c_16 +LINE478,472,479,ABC,0.16601,m,4c_.1 +LINE479,473,480,ABC,0.063953,m,4c_.1 +LINE480,474,481,ABC,0.18984,m,2c_16 +LINE481,475,482,ABC,4.6432,m,4c_.06 +LINE482,475,483,ABC,4.6432,m,4c_.06 +LINE483,475,484,ABC,10.2769,m,2c_16 +LINE484,477,485,ABC,0.19883,m,2c_16 +LINE485,478,486,ABC,0.1676,m,2c_16 +LINE486,479,487,ABC,0.17536,m,4c_.1 +LINE487,480,488,ABC,0.11163,m,4c_.1 +LINE488,481,489,ABC,0.1713,m,2c_16 +LINE489,482,490,ABC,6.6548,m,4c_.06 +LINE490,482,491,ABC,6.6548,m,4c_.06 +LINE491,484,492,ABC,0.57796,m,2c_16 +LINE492,484,493,ABC,4.0726,m,2c_16 +LINE493,485,494,ABC,0.30201,m,2c_16 +LINE494,486,495,ABC,0.10617,m,2c_16 +LINE495,487,496,ABC,0.38342,m,4c_.1 +LINE496,488,497,ABC,0.13972,m,4c_.1 +LINE497,489,498,ABC,0.23283,m,2c_16 +LINE498,490,499,ABC,4.0612,m,4c_.06 +LINE499,490,500,ABC,4.0612,m,4c_.06 +LINE500,492,501,ABC,0.24429,m,2c_16 +LINE501,493,502,ABC,2.606,m,2c_16 +LINE502,494,503,ABC,0.45833,m,2c_16 +LINE503,495,504,ABC,0.071784,m,2c_16 +LINE504,496,505,ABC,8.6961,m,4c_.1 +LINE505,497,506,ABC,0.096167,m,4c_.1 +LINE506,498,507,ABC,0.30564,m,2c_16 +LINE507,499,508,ABC,0.69938,m,4c_.06 +LINE508,499,509,ABC,0.69938,m,4c_.06 +LINE509,501,510,ABC,0.14354,m,2c_16 +LINE510,503,511,ABC,0.32517,m,2c_16 +LINE511,504,512,ABC,0.10013,m,2c_16 +LINE512,505,513,ABC,5.5648,m,2c_16 +LINE513,505,514,ABC,1.3369,m,4c_.1 +LINE514,506,515,ABC,0.085492,m,4c_.1 +LINE515,508,516,ABC,1.8857,m,4c_.06 +LINE516,508,517,ABC,1.8857,m,4c_.06 +LINE517,508,518,ABC,4.7316,m,2c_16 +LINE518,510,519,ABC,0.1321,m,2c_16 +LINE519,511,520,ABC,0.22216,m,2c_16 +LINE520,512,521,ABC,0.07642,m,2c_16 +LINE521,513,522,ABC,4.9074,m,2c_16 +LINE522,514,523,ABC,0.72122,m,4c_.1 +LINE523,515,524,ABC,0.066573,m,4c_.1 +LINE524,516,525,ABC,1.3881,m,4c_.06 +LINE525,516,526,ABC,1.3881,m,4c_.06 +LINE526,518,527,ABC,2.796,m,2c_16 +LINE527,519,528,ABC,0.11769,m,2c_16 +LINE528,520,529,ABC,0.17555,m,2c_16 +LINE529,521,530,ABC,0.54535,m,2c_16 +LINE530,523,531,ABC,0.10771,m,4c_.1 +LINE531,524,532,ABC,0.060803,m,4c_.1 +LINE532,525,533,ABC,1.8899,m,4c_.06 +LINE533,525,534,ABC,1.8899,m,4c_.06 +LINE534,527,535,ABC,2.2154,m,2c_16 +LINE535,528,536,ABC,0.12209,m,2c_16 +LINE536,529,537,ABC,0.56286,m,2c_16 +LINE537,530,538,ABC,1.9227,m,2c_16 +LINE538,530,539,ABC,5.5837,m,2c_16 +LINE539,531,540,ABC,0.082219,m,4c_.1 +LINE540,532,541,ABC,0.065513,m,4c_.1 +LINE541,533,542,ABC,1.3374,m,4c_.06 +LINE542,533,543,ABC,1.3374,m,4c_.06 +LINE543,535,544,ABC,0.91542,m,2c_16 +LINE544,536,545,ABC,0.36857,m,2c_16 +LINE545,537,546,ABC,4.5527,m,2c_16 +LINE546,538,547,ABC,2.1231,m,2c_16 +LINE547,540,548,ABC,0.076896,m,4c_.1 +LINE548,541,549,ABC,0.086145,m,4c_.1 +LINE549,542,550,ABC,3.7401,m,4c_.06 +LINE550,542,551,ABC,3.7401,m,4c_.06 +LINE551,544,552,ABC,0.28804,m,2c_16 +LINE552,544,553,ABC,3.789,m,2c_16 +LINE553,545,554,ABC,0.37143,m,2c_16 +LINE554,546,555,ABC,0.22672,m,2c_16 +LINE555,547,556,ABC,5.7548,m,2c_16 +LINE556,548,557,ABC,0.082,m,4c_.1 +LINE557,549,558,ABC,0.061612,m,4c_.1 +LINE558,550,559,ABC,2.7082,m,4c_.06 +LINE559,550,560,ABC,2.7082,m,4c_.06 +LINE560,552,561,ABC,0.10599,m,2c_16 +LINE561,553,562,ABC,2.8664,m,2c_16 +LINE562,554,563,ABC,3.4705,m,2c_16 +LINE563,555,564,ABC,0.17889,m,2c_16 +LINE564,557,565,ABC,0.07256,m,4c_.1 +LINE565,558,566,ABC,0.12021,m,4c_.1 +LINE566,559,567,ABC,0.60068,m,4c_.06 +LINE567,559,568,ABC,0.60068,m,4c_.06 +LINE568,559,569,ABC,3.8482,m,2c_16 +LINE569,561,570,ABC,0.15788,m,2c_16 +LINE570,564,571,ABC,0.20224,m,2c_16 +LINE571,565,572,ABC,0.074216,m,4c_.1 +LINE572,567,573,ABC,0.14223,m,4c_.06 +LINE573,567,574,ABC,0.14223,m,4c_.06 +LINE574,569,575,ABC,0.48648,m,2c_16 +LINE575,570,576,ABC,0.095,m,2c_16 +LINE576,571,577,ABC,0.18,m,2c_16 +LINE577,572,578,ABC,0.38305,m,4c_.1 +LINE578,573,579,ABC,3.8558,m,4c_.06 +LINE579,573,580,ABC,3.8558,m,4c_.06 +LINE580,573,581,ABC,0.31979,m,4c_.06 +LINE581,575,582,ABC,0.35899,m,2c_16 +LINE582,576,583,ABC,0.11463,m,2c_16 +LINE583,577,584,ABC,0.20718,m,2c_16 +LINE584,578,585,ABC,4.7318,m,2c_16 +LINE585,578,586,ABC,0.82623,m,4c_.1 +LINE586,579,587,ABC,2.7022,m,4c_.06 +LINE587,579,588,ABC,2.7022,m,4c_.06 +LINE588,581,589,ABC,0.11628,m,4c_.06 +LINE589,582,590,ABC,0.3493,m,2c_16 +LINE590,583,591,ABC,0.10065,m,2c_16 +LINE591,584,592,ABC,0.21243,m,2c_16 +LINE592,585,593,ABC,0.27268,m,2c_16 +LINE593,586,594,ABC,3.9483,m,4c_.1 +LINE594,587,595,ABC,5.4142,m,4c_.06 +LINE595,587,596,ABC,0.64238,m,4c_.06 +LINE596,589,597,ABC,0.089275,m,4c_.06 +LINE597,590,598,ABC,3.2812,m,2c_16 +LINE598,591,599,ABC,0.65862,m,2c_16 +LINE599,592,600,ABC,0.25534,m,2c_16 +LINE600,593,601,ABC,0.13695,m,2c_16 +LINE601,594,602,ABC,9.1669,m,2c_16 +LINE602,594,603,ABC,4.6424,m,4c_.1 +LINE603,595,604,ABC,4.8283,m,4c_.06 +LINE604,595,605,ABC,4.8283,m,4c_.06 +LINE605,595,606,ABC,4.7719,m,4c_.06 +LINE606,596,607,ABC,11.6642,m,2c_16 +LINE607,596,608,ABC,11.6642,m,2c_16 +LINE608,597,609,ABC,0.11037,m,4c_.06 +LINE609,598,610,ABC,1.5271,m,2c_16 +LINE610,599,611,ABC,4.8562,m,2c_16 +LINE611,600,612,ABC,0.16008,m,2c_16 +LINE612,601,613,ABC,0.11484,m,2c_16 +LINE613,602,614,ABC,4.8374,m,2c_16 +LINE614,603,615,ABC,4.4466,m,4c_.1 +LINE615,604,616,ABC,3.9301,m,2c_.0225 +LINE616,604,617,ABC,3.1088,m,4c_.06 +LINE617,604,618,ABC,3.1088,m,4c_.06 +LINE618,607,619,ABC,2.7454,m,2c_16 +LINE619,609,620,ABC,0.06364,m,4c_.06 +LINE620,610,621,ABC,0.71673,m,2c_16 +LINE621,612,622,ABC,0.68797,m,2c_16 +LINE622,613,623,ABC,0.093648,m,2c_16 +LINE623,615,624,ABC,1.6322,m,2c_16 +LINE624,615,625,ABC,1.2511,m,4c_.1 +LINE625,616,626,ABC,5.3537,m,2c_.0225 +LINE626,620,627,ABC,0.077897,m,4c_.06 +LINE627,621,628,ABC,0.47807,m,2c_16 +LINE628,622,629,ABC,2.9004,m,2c_16 +LINE629,623,630,ABC,0.147,m,2c_16 +LINE630,624,631,ABC,0.40022,m,2c_16 +LINE631,625,632,ABC,0.28784,m,4c_.1 +LINE632,626,633,ABC,1.5703,m,2c_.0225 +LINE633,627,634,ABC,0.065299,m,4c_.06 +LINE634,628,635,ABC,0.73088,m,2c_16 +LINE635,630,636,ABC,0.35053,m,2c_16 +LINE636,631,637,ABC,0.27482,m,2c_16 +LINE637,632,638,ABC,0.14284,m,4c_.1 +LINE638,633,639,ABC,5.1974,m,2c_.0225 +LINE639,634,640,ABC,0.069123,m,4c_.06 +LINE640,635,641,ABC,1.4274,m,2c_16 +LINE641,636,642,ABC,0.24251,m,2c_16 +LINE642,637,643,ABC,0.38096,m,2c_16 +LINE643,638,644,ABC,0.15697,m,4c_.1 +LINE644,640,645,ABC,0.068593,m,4c_.06 +LINE645,641,646,ABC,0.39457,m,2c_16 +LINE646,642,647,ABC,0.30835,m,2c_16 +LINE647,643,648,ABC,0.90337,m,2c_16 +LINE648,644,649,ABC,0.18112,m,4c_.1 +LINE649,645,650,ABC,0.093984,m,4c_.06 +LINE650,646,651,ABC,0.11455,m,2c_16 +LINE651,647,652,ABC,0.18732,m,2c_16 +LINE652,648,653,ABC,0.68671,m,2c_16 +LINE653,649,654,ABC,0.1831,m,4c_.1 +LINE654,650,655,ABC,0.12394,m,4c_.06 +LINE655,651,656,ABC,0.099368,m,2c_16 +LINE656,651,657,ABC,0.52781,m,2c_16 +LINE657,652,658,ABC,0.16911,m,2c_16 +LINE658,653,659,ABC,0.48206,m,2c_16 +LINE659,654,660,ABC,0.20299,m,4c_.1 +LINE660,655,661,ABC,0.36466,m,4c_.06 +LINE661,656,662,ABC,0.093,m,2c_16 +LINE662,657,663,ABC,0.69648,m,2c_16 +LINE663,658,664,ABC,0.28521,m,2c_16 +LINE664,659,665,ABC,0.505,m,2c_16 +LINE665,660,666,ABC,0.29519,m,4c_.1 +LINE666,661,667,ABC,0.26019,m,4c_.06 +LINE667,662,668,ABC,0.095802,m,2c_16 +LINE668,663,669,ABC,2.8935,m,2c_16 +LINE669,664,670,ABC,0.2804,m,2c_16 +LINE670,665,671,ABC,0.41461,m,2c_16 +LINE671,666,672,ABC,0.4801,m,2c_16 +LINE672,666,673,ABC,0.81161,m,4c_.1 +LINE673,667,674,ABC,0.20184,m,4c_.06 +LINE674,668,675,ABC,0.69267,m,2c_16 +LINE675,669,676,ABC,1.2288,m,2c_16 +LINE676,670,677,ABC,0.13267,m,2c_16 +LINE677,671,678,ABC,0.68648,m,2c_16 +LINE678,672,679,ABC,0.2883,m,2c_16 +LINE679,673,680,ABC,5.1393,m,4c_.1 +LINE680,674,681,ABC,0.40252,m,4c_.06 +LINE681,675,682,ABC,5.0441,m,2c_16 +LINE682,677,683,ABC,0.14572,m,2c_16 +LINE683,678,684,ABC,2.2185,m,2c_16 +LINE684,679,685,ABC,0.26744,m,2c_16 +LINE685,680,686,ABC,3.6787,m,4c_.1 +LINE686,683,687,ABC,0.13986,m,2c_16 +LINE687,684,688,ABC,5.1838,m,2c_16 +LINE688,685,689,ABC,0.26095,m,2c_16 +LINE689,686,690,ABC,8.1445,m,2c_16 +LINE690,686,691,ABC,10.5254,m,4c_.1 +LINE691,687,692,ABC,0.16867,m,2c_16 +LINE692,689,693,ABC,0.19573,m,2c_16 +LINE693,690,694,ABC,0.76157,m,2c_16 +LINE694,690,695,ABC,2.1261,m,2c_16 +LINE695,691,696,ABC,9.4817,m,2c_16 +LINE696,691,697,ABC,2.1907,m,4c_.1 +LINE697,692,698,ABC,0.26905,m,2c_16 +LINE698,693,699,ABC,0.31093,m,2c_16 +LINE699,694,700,ABC,0.2383,m,2c_16 +LINE700,695,701,ABC,4.3312,m,2c_16 +LINE701,696,702,ABC,5.493,m,2c_16 +LINE702,697,703,ABC,2.4,m,4c_.06 +LINE703,698,704,ABC,0.73636,m,2c_16 +LINE704,699,705,ABC,0.52424,m,2c_16 +LINE705,700,706,ABC,0.15322,m,2c_16 +LINE706,703,707,ABC,6.3308,m,4c_.06 +LINE707,703,708,ABC,0.11132,m,4c_.06 +LINE708,704,709,ABC,0.97996,m,2c_16 +LINE709,705,710,ABC,3.9281,m,2c_16 +LINE710,706,711,ABC,0.092418,m,2c_16 +LINE711,707,712,ABC,7.5025,m,4c_.06 +LINE712,707,713,ABC,3.9448,m,2c_16 +LINE713,708,714,ABC,0.10474,m,4c_.06 +LINE714,709,715,ABC,0.093338,m,2c_16 +LINE715,710,716,ABC,3.2225,m,2c_16 +LINE716,711,717,ABC,0.093408,m,2c_16 +LINE717,712,718,ABC,7.7434,m,4c_.06 +LINE718,713,719,ABC,0.4223,m,2c_16 +LINE719,714,720,ABC,0.097,m,4c_.06 +LINE720,715,721,ABC,0.073817,m,2c_16 +LINE721,716,722,ABC,1.021,m,2c_16 +LINE722,717,723,ABC,0.083433,m,2c_16 +LINE723,718,724,ABC,3.2535,m,4c_.06 +LINE724,718,725,ABC,9.3475,m,2c_16 +LINE725,719,726,ABC,0.16124,m,2c_16 +LINE726,720,727,ABC,0.10977,m,4c_.06 +LINE727,721,728,ABC,0.071694,m,2c_16 +LINE728,722,729,ABC,0.92949,m,2c_16 +LINE729,723,730,ABC,0.094,m,2c_16 +LINE730,724,731,ABC,4.421,m,4c_.06 +LINE731,725,732,ABC,1.2539,m,2c_16 +LINE732,726,733,ABC,0.17056,m,2c_16 +LINE733,727,734,ABC,0.089889,m,4c_.06 +LINE734,728,735,ABC,0.076792,m,2c_16 +LINE735,729,736,ABC,0.50625,m,2c_16 +LINE736,730,737,ABC,0.075313,m,2c_16 +LINE737,731,738,ABC,5.1761,m,4c_.06 +LINE738,732,739,ABC,0.65877,m,2c_16 +LINE739,733,740,ABC,0.14155,m,2c_16 +LINE740,734,741,ABC,0.13761,m,4c_.06 +LINE741,735,742,ABC,0.071,m,2c_16 +LINE742,736,743,ABC,0.40432,m,2c_16 +LINE743,737,744,ABC,0.090338,m,2c_16 +LINE744,738,745,ABC,4.1562,m,4c_.06 +LINE745,739,746,ABC,3.7387,m,2c_16 +LINE746,739,747,ABC,0.12202,m,2c_16 +LINE747,740,748,ABC,0.16763,m,2c_16 +LINE748,741,749,ABC,0.16427,m,4c_.06 +LINE749,742,750,ABC,0.06691,m,2c_16 +LINE750,743,751,ABC,0.34477,m,2c_16 +LINE751,744,752,ABC,0.09735,m,2c_16 +LINE752,745,753,ABC,1.5434,m,4c_.06 +LINE753,745,754,ABC,5.9227,m,2c_16 +LINE754,746,755,ABC,3.0391,m,2c_16 +LINE755,747,756,ABC,0.088238,m,2c_16 +LINE756,748,757,ABC,0.16348,m,2c_16 +LINE757,749,758,ABC,0.12454,m,4c_.06 +LINE758,750,759,ABC,0.093059,m,2c_16 +LINE759,751,760,ABC,0.40459,m,2c_16 +LINE760,752,761,ABC,0.17761,m,2c_16 +LINE761,753,762,ABC,2.1279,m,4c_.06 +LINE762,754,763,ABC,4.9506,m,2c_16 +LINE763,756,764,ABC,0.074465,m,2c_16 +LINE764,757,765,ABC,0.22475,m,2c_16 +LINE765,758,766,ABC,0.12167,m,4c_.06 +LINE766,759,767,ABC,0.11404,m,2c_16 +LINE767,760,768,ABC,0.36969,m,2c_16 +LINE768,761,769,ABC,1.3288,m,2c_16 +LINE769,762,770,ABC,5.2347,m,4c_.06 +LINE770,763,771,ABC,3.6007,m,2c_16 +LINE771,763,772,ABC,0.13038,m,2c_16 +LINE772,764,773,ABC,0.12578,m,2c_16 +LINE773,765,774,ABC,0.30918,m,2c_16 +LINE774,766,775,ABC,0.07931,m,4c_.06 +LINE775,767,776,ABC,0.54052,m,2c_16 +LINE776,768,777,ABC,0.57353,m,2c_16 +LINE777,769,778,ABC,4.0721,m,2c_16 +LINE778,770,779,ABC,4.2428,m,4c_.06 +LINE779,771,780,ABC,3.5283,m,2c_16 +LINE780,772,781,ABC,0.12466,m,2c_16 +LINE781,773,782,ABC,0.17614,m,2c_16 +LINE782,774,783,ABC,0.3272,m,2c_16 +LINE783,775,784,ABC,0.097,m,4c_.06 +LINE784,776,785,ABC,4.6216,m,2c_16 +LINE785,777,786,ABC,1.1579,m,2c_16 +LINE786,779,787,ABC,3.3152,m,4c_.06 +LINE787,781,788,ABC,0.13439,m,2c_16 +LINE788,782,789,ABC,0.1307,m,2c_16 +LINE789,783,790,ABC,0.21735,m,2c_16 +LINE790,784,791,ABC,0.091984,m,4c_.06 +LINE791,786,792,ABC,0.34588,m,2c_16 +LINE792,786,793,ABC,2.062,m,2c_16 +LINE793,787,794,ABC,2.9963,m,4c_.06 +LINE794,788,795,ABC,0.12,m,2c_16 +LINE795,789,796,ABC,0.21651,m,2c_16 +LINE796,790,797,ABC,0.22121,m,2c_16 +LINE797,791,798,ABC,0.091706,m,4c_.06 +LINE798,792,799,ABC,0.30164,m,2c_16 +LINE799,793,800,ABC,3.2995,m,2c_16 +LINE800,794,801,ABC,0.20555,m,2c_16 +LINE801,794,802,ABC,2.8031,m,4c_95_SAC_XC +LINE802,795,803,ABC,0.13252,m,2c_16 +LINE803,796,804,ABC,1.5028,m,2c_16 +LINE804,797,805,ABC,0.10577,m,2c_16 +LINE805,798,806,ABC,0.12311,m,4c_.06 +LINE806,799,807,ABC,0.24947,m,2c_16 +LINE807,800,808,ABC,2.8191,m,2c_16 +LINE808,801,809,ABC,0.20609,m,2c_16 +LINE809,802,810,ABC,3.0749,m,4c_.06 +LINE810,802,811,ABC,3.0749,m,4c_.06 +LINE811,803,812,ABC,0.08544,m,2c_16 +LINE812,804,813,ABC,3.3195,m,2c_16 +LINE813,805,814,ABC,0.16824,m,2c_16 +LINE814,806,815,ABC,0.42086,m,4c_.06 +LINE815,807,816,ABC,0.194,m,2c_16 +LINE816,808,817,ABC,1.5955,m,2c_16 +LINE817,809,818,ABC,0.20649,m,2c_16 +LINE818,810,819,ABC,2.5782,m,4c_.06 +LINE819,810,820,ABC,2.5782,m,4c_.06 +LINE820,812,821,ABC,0.13123,m,2c_16 +LINE821,814,822,ABC,0.15794,m,2c_16 +LINE822,815,823,ABC,0.48651,m,4c_.06 +LINE823,816,824,ABC,0.19731,m,2c_16 +LINE824,818,825,ABC,0.20524,m,2c_16 +LINE825,819,826,ABC,2.7715,m,4c_.06 +LINE826,819,827,ABC,2.7715,m,4c_.06 +LINE827,821,828,ABC,1.0794,m,2c_16 +LINE828,822,829,ABC,0.22567,m,2c_16 +LINE829,823,830,ABC,0.49659,m,4c_.06 +LINE830,824,831,ABC,0.17123,m,2c_16 +LINE831,825,832,ABC,0.20602,m,2c_16 +LINE832,826,833,ABC,2.2755,m,4c_.06 +LINE833,826,834,ABC,2.2755,m,4c_.06 +LINE834,828,835,ABC,3.7201,m,2c_16 +LINE835,829,836,ABC,2.3821,m,2c_16 +LINE836,831,837,ABC,0.12298,m,2c_16 +LINE837,832,838,ABC,0.20588,m,2c_16 +LINE838,833,839,ABC,2.443,m,4c_.06 +LINE839,833,840,ABC,2.443,m,4c_.06 +LINE840,836,841,ABC,0.95278,m,2c_16 +LINE841,837,842,ABC,0.14278,m,2c_16 +LINE842,838,843,ABC,0.20601,m,2c_16 +LINE843,839,844,ABC,4.8092,m,2c_.0225 +LINE844,839,845,ABC,3.6212,m,4c_.06 +LINE845,839,846,ABC,3.6212,m,4c_.06 +LINE846,841,847,ABC,0.48382,m,2c_16 +LINE847,842,848,ABC,0.2151,m,2c_16 +LINE848,843,849,ABC,0.10056,m,2c_16 +LINE849,844,850,ABC,0.7036,m,2c_.0225 +LINE850,845,851,ABC,4.364,m,4c_.06 +LINE851,845,852,ABC,4.364,m,4c_.06 +LINE852,847,853,ABC,0.10706,m,2c_16 +LINE853,848,854,ABC,0.35143,m,2c_16 +LINE854,849,855,ABC,2.2601,m,2c_16 +LINE855,850,856,ABC,1.9822,m,2c_.0225 +LINE856,851,857,ABC,6.8621,m,4c_.06 +LINE857,851,858,ABC,6.8621,m,4c_.06 +LINE858,853,859,ABC,0.084315,m,2c_16 +LINE859,854,860,ABC,2.82,m,2c_16 +LINE860,854,861,ABC,7.5091,m,2c_16 +LINE861,855,862,ABC,1.4697,m,2c_16 +LINE862,856,863,ABC,2.3276,m,2c_.0225 +LINE863,857,864,ABC,2.7888,m,4c_.06 +LINE864,857,865,ABC,2.7888,m,4c_.06 +LINE865,859,866,ABC,0.090338,m,2c_16 +LINE866,862,867,ABC,1.2854,m,2c_16 +LINE867,863,868,ABC,0.30194,m,2c_.0225 +LINE868,864,869,ABC,1.7373,m,4c_.06 +LINE869,864,870,ABC,1.7373,m,4c_.06 +LINE870,866,871,ABC,0.072277,m,2c_16 +LINE871,867,872,ABC,1.3483,m,2c_16 +LINE872,868,873,ABC,0.37952,m,2c_.0225 +LINE873,868,874,ABC,0.84439,m,2c_.0225 +LINE874,869,875,ABC,1.2,m,4c_.06 +LINE875,869,876,ABC,1.2,m,4c_.06 +LINE876,871,877,ABC,0.070178,m,2c_16 +LINE877,872,878,ABC,2.3022,m,2c_16 +LINE878,873,879,ABC,0.35118,m,2c_.0225 +LINE879,874,880,ABC,1.9761,m,2c_.0225 +LINE880,875,881,ABC,1.0112,m,4c_.06 +LINE881,875,882,ABC,1.0112,m,4c_.06 +LINE882,877,883,ABC,0.07,m,2c_16 +LINE883,878,884,ABC,0.56468,m,2c_16 +LINE884,879,885,ABC,0.534,m,2c_.0225 +LINE885,880,886,ABC,4.6879,m,2c_.0225 +LINE886,883,887,ABC,0.069181,m,2c_16 +LINE887,884,888,ABC,0.62293,m,2c_16 +LINE888,884,889,ABC,3.1574,m,35_SAC_XSC +LINE889,885,890,ABC,0.67483,m,2c_.0225 +LINE890,887,891,ABC,1.2371,m,2c_16 +LINE891,888,892,ABC,1.0228,m,2c_16 +LINE892,889,893,ABC,2.6779,m,35_SAC_XSC +LINE893,890,894,ABC,2.6271,m,2c_.0225 +LINE894,891,895,ABC,5.8249,m,2c_16 +LINE895,891,896,ABC,3.2587,m,2c_16 +LINE896,892,897,ABC,0.20223,m,2c_16 +LINE897,893,898,ABC,4.501,m,35_SAC_XSC +LINE898,894,899,ABC,4.7723,m,2c_.0225 +LINE899,895,900,ABC,3.8684,m,2c_16 +LINE900,897,901,ABC,0.17088,m,2c_16 +LINE901,901,902,ABC,0.144,m,2c_16 +LINE902,902,903,ABC,0.18732,m,2c_16 +LINE903,903,904,ABC,0.33902,m,2c_16 +LINE904,904,905,ABC,0.5878,m,2c_16 +LINE905,905,906,ABC,4.8147,m,2c_16 diff --git a/src/test/resources/lvFeeder/LoadShapes.csv b/src/test/resources/lvFeeder/LoadShapes.csv new file mode 100644 index 0000000000..a0841dec34 --- /dev/null +++ b/src/test/resources/lvFeeder/LoadShapes.csv @@ -0,0 +1,57 @@ +# Load Shapes,,,, +Name,npts,minterval,File,useactual +Shape_1,1440,1,Load_profile_1.csv,TRUE +Shape_2,1440,1,Load_profile_2.csv,TRUE +Shape_3,1440,1,Load_profile_3.csv,TRUE +Shape_4,1440,1,Load_profile_4.csv,TRUE +Shape_5,1440,1,Load_profile_5.csv,TRUE +Shape_6,1440,1,Load_profile_6.csv,TRUE +Shape_7,1440,1,Load_profile_7.csv,TRUE +Shape_8,1440,1,Load_profile_8.csv,TRUE +Shape_9,1440,1,Load_profile_9.csv,TRUE +Shape_10,1440,1,Load_profile_10.csv,TRUE +Shape_11,1440,1,Load_profile_11.csv,TRUE +Shape_12,1440,1,Load_profile_12.csv,TRUE +Shape_13,1440,1,Load_profile_13.csv,TRUE +Shape_14,1440,1,Load_profile_14.csv,TRUE +Shape_15,1440,1,Load_profile_15.csv,TRUE +Shape_16,1440,1,Load_profile_16.csv,TRUE +Shape_17,1440,1,Load_profile_17.csv,TRUE +Shape_18,1440,1,Load_profile_18.csv,TRUE +Shape_19,1440,1,Load_profile_19.csv,TRUE +Shape_20,1440,1,Load_profile_20.csv,TRUE +Shape_21,1440,1,Load_profile_21.csv,TRUE +Shape_22,1440,1,Load_profile_22.csv,TRUE +Shape_23,1440,1,Load_profile_23.csv,TRUE +Shape_24,1440,1,Load_profile_24.csv,TRUE +Shape_25,1440,1,Load_profile_25.csv,TRUE +Shape_26,1440,1,Load_profile_26.csv,TRUE +Shape_27,1440,1,Load_profile_27.csv,TRUE +Shape_28,1440,1,Load_profile_28.csv,TRUE +Shape_29,1440,1,Load_profile_29.csv,TRUE +Shape_30,1440,1,Load_profile_30.csv,TRUE +Shape_31,1440,1,Load_profile_31.csv,TRUE +Shape_32,1440,1,Load_profile_32.csv,TRUE +Shape_33,1440,1,Load_profile_33.csv,TRUE +Shape_34,1440,1,Load_profile_34.csv,TRUE +Shape_35,1440,1,Load_profile_35.csv,TRUE +Shape_36,1440,1,Load_profile_36.csv,TRUE +Shape_37,1440,1,Load_profile_37.csv,TRUE +Shape_38,1440,1,Load_profile_38.csv,TRUE +Shape_39,1440,1,Load_profile_39.csv,TRUE +Shape_40,1440,1,Load_profile_40.csv,TRUE +Shape_41,1440,1,Load_profile_41.csv,TRUE +Shape_42,1440,1,Load_profile_42.csv,TRUE +Shape_43,1440,1,Load_profile_43.csv,TRUE +Shape_44,1440,1,Load_profile_44.csv,TRUE +Shape_45,1440,1,Load_profile_45.csv,TRUE +Shape_46,1440,1,Load_profile_46.csv,TRUE +Shape_47,1440,1,Load_profile_47.csv,TRUE +Shape_48,1440,1,Load_profile_48.csv,TRUE +Shape_49,1440,1,Load_profile_49.csv,TRUE +Shape_50,1440,1,Load_profile_50.csv,TRUE +Shape_51,1440,1,Load_profile_51.csv,TRUE +Shape_52,1440,1,Load_profile_52.csv,TRUE +Shape_53,1440,1,Load_profile_53.csv,TRUE +Shape_54,1440,1,Load_profile_54.csv,TRUE +Shape_55,1440,1,Load_profile_55.csv,TRUE diff --git a/src/test/resources/lvFeeder/Loads.csv b/src/test/resources/lvFeeder/Loads.csv new file mode 100644 index 0000000000..256565141f --- /dev/null +++ b/src/test/resources/lvFeeder/Loads.csv @@ -0,0 +1,58 @@ +# Loads ,,,,,,,,, +# Model 1 is constant PQ,,,,,,,,, +Name,numPhases,Bus,phases,kV,Model,Connection,kW,PF,Yearly +LOAD1,1,34,A,0.23,1,wye,1,0.95,Shape_1 +LOAD2,1,47,B,0.23,1,wye,1,0.95,Shape_2 +LOAD3,1,70,A,0.23,1,wye,1,0.95,Shape_3 +LOAD4,1,73,A,0.23,1,wye,1,0.95,Shape_4 +LOAD5,1,74,A,0.23,1,wye,1,0.95,Shape_5 +LOAD6,1,83,B,0.23,1,wye,1,0.95,Shape_6 +LOAD7,1,178,B,0.23,1,wye,1,0.95,Shape_7 +LOAD8,1,208,C,0.23,1,wye,1,0.95,Shape_8 +LOAD9,1,225,A,0.23,1,wye,1,0.95,Shape_9 +LOAD10,1,248,B,0.23,1,wye,1,0.95,Shape_10 +LOAD11,1,249,B,0.23,1,wye,1,0.95,Shape_11 +LOAD12,1,264,C,0.23,1,wye,1,0.95,Shape_12 +LOAD13,1,276,B,0.23,1,wye,1,0.95,Shape_13 +LOAD14,1,289,A,0.23,1,wye,1,0.95,Shape_14 +LOAD15,1,314,B,0.23,1,wye,1,0.95,Shape_15 +LOAD16,1,320,C,0.23,1,wye,1,0.95,Shape_16 +LOAD17,1,327,C,0.23,1,wye,1,0.95,Shape_17 +LOAD18,1,337,C,0.23,1,wye,1,0.95,Shape_18 +LOAD19,1,342,C,0.23,1,wye,1,0.95,Shape_19 +LOAD20,1,349,A,0.23,1,wye,1,0.95,Shape_20 +LOAD21,1,387,A,0.23,1,wye,1,0.95,Shape_21 +LOAD22,1,388,A,0.23,1,wye,1,0.95,Shape_22 +LOAD23,1,406,B,0.23,1,wye,1,0.95,Shape_23 +LOAD24,1,458,C,0.23,1,wye,1,0.95,Shape_24 +LOAD25,1,502,A,0.23,1,wye,1,0.95,Shape_25 +LOAD26,1,522,B,0.23,1,wye,1,0.95,Shape_26 +LOAD27,1,539,C,0.23,1,wye,1,0.95,Shape_27 +LOAD28,1,556,C,0.23,1,wye,1,0.95,Shape_28 +LOAD29,1,562,A,0.23,1,wye,1,0.95,Shape_29 +LOAD30,1,563,A,0.23,1,wye,1,0.95,Shape_30 +LOAD31,1,611,A,0.23,1,wye,1,0.95,Shape_31 +LOAD32,1,614,C,0.23,1,wye,1,0.95,Shape_32 +LOAD33,1,619,C,0.23,1,wye,1,0.95,Shape_33 +LOAD34,1,629,A,0.23,1,wye,1,0.95,Shape_34 +LOAD35,1,639,B,0.23,1,wye,1,0.95,Shape_35 +LOAD36,1,676,B,0.23,1,wye,1,0.95,Shape_36 +LOAD37,1,682,B,0.23,1,wye,1,0.95,Shape_37 +LOAD38,1,688,B,0.23,1,wye,1,0.95,Shape_38 +LOAD39,1,701,C,0.23,1,wye,1,0.95,Shape_39 +LOAD40,1,702,B,0.23,1,wye,1,0.95,Shape_40 +LOAD41,1,755,B,0.23,1,wye,1,0.95,Shape_41 +LOAD42,1,778,C,0.23,1,wye,1,0.95,Shape_42 +LOAD43,1,780,C,0.23,1,wye,1,0.95,Shape_43 +LOAD44,1,785,B,0.23,1,wye,1,0.95,Shape_44 +LOAD45,1,813,B,0.23,1,wye,1,0.95,Shape_45 +LOAD46,1,817,A,0.23,1,wye,1,0.95,Shape_46 +LOAD47,1,835,C,0.23,1,wye,1,0.95,Shape_47 +LOAD48,1,860,A,0.23,1,wye,1,0.95,Shape_48 +LOAD49,1,861,A,0.23,1,wye,1,0.95,Shape_49 +LOAD50,1,886,B,0.23,1,wye,1,0.95,Shape_50 +LOAD51,1,896,A,0.23,1,wye,1,0.95,Shape_51 +LOAD52,1,898,A,0.23,1,wye,1,0.95,Shape_52 +LOAD53,1,899,B,0.23,1,wye,1,0.95,Shape_53 +LOAD54,1,900,A,0.23,1,wye,1,0.95,Shape_54 +LOAD55,1,906,A,0.23,1,wye,1,0.95,Shape_55 diff --git a/src/test/resources/lvFeeder/Source.csv b/src/test/resources/lvFeeder/Source.csv new file mode 100644 index 0000000000..ca83982600 --- /dev/null +++ b/src/test/resources/lvFeeder/Source.csv @@ -0,0 +1,6 @@ +# Source impedance +[Source] +Voltage=11 kV +pu=1.05 +ISC3=3000 A +ISC1=5 A diff --git a/src/test/resources/lvFeeder/Transformer.csv b/src/test/resources/lvFeeder/Transformer.csv new file mode 100644 index 0000000000..2e34814d1a --- /dev/null +++ b/src/test/resources/lvFeeder/Transformer.csv @@ -0,0 +1,3 @@ +# Substation transformer connected Delta/grounded-wye,,,,,,,,,, +Name, phases, bus1, bus2, kV_pri, kV_sec, MVA, Conn_pri, Conn_sec, %XHL,% resistance +TR1,3,SourceBus,1,11,0.416,0.8, Delta, Wye,4,0.4 From 4dda0f1a0bf2d4bd553295af07d41eec935cbf2e Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 21:17:12 +0200 Subject: [PATCH 009/153] corrections on delta transformers Signed-off-by: JB-H --- ...bstractClosedBranchAcFlowEquationTerm.java | 47 +++++++++-- .../ClosedBranchTfoZeroIflowEquationTerm.java | 17 +++- .../AsymmetricalAcEquationSystemCreator.java | 62 ++++++++------- .../openloadflow/network/LfAsymLine.java | 2 +- .../openloadflow/ac/Asym4DeltaTest.java | 79 +++++++++++++++++++ .../openloadflow/ac/Asym4nodesFeederTest.java | 68 +++++++++------- 6 files changed, 202 insertions(+), 73 deletions(-) create mode 100644 src/test/java/com/powsybl/openloadflow/ac/Asym4DeltaTest.java diff --git a/src/main/java/com/powsybl/openloadflow/ac/equations/AbstractClosedBranchAcFlowEquationTerm.java b/src/main/java/com/powsybl/openloadflow/ac/equations/AbstractClosedBranchAcFlowEquationTerm.java index 0b237df035..ba3cd8c397 100644 --- a/src/main/java/com/powsybl/openloadflow/ac/equations/AbstractClosedBranchAcFlowEquationTerm.java +++ b/src/main/java/com/powsybl/openloadflow/ac/equations/AbstractClosedBranchAcFlowEquationTerm.java @@ -11,6 +11,7 @@ import com.powsybl.openloadflow.equations.VariableSet; import com.powsybl.openloadflow.network.LfBranch; import com.powsybl.openloadflow.network.LfBus; +import com.powsybl.openloadflow.network.extensions.AsymBusVariableType; import com.powsybl.openloadflow.util.Fortescue; import net.jafama.FastMath; @@ -70,16 +71,34 @@ protected AbstractClosedBranchAcFlowEquationTerm(LfBranch branch, LfBus bus1, Lf Objects.requireNonNull(variableSet); AcVariableType vType = getVoltageMagnitudeType(sequenceType); AcVariableType angleType = getVoltageAngleType(sequenceType); - v1Var = variableSet.getVariable(bus1.getNum(), vType); - v2Var = variableSet.getVariable(bus2.getNum(), vType); - ph1Var = variableSet.getVariable(bus1.getNum(), angleType); - ph2Var = variableSet.getVariable(bus2.getNum(), angleType); + + // if one side is DELTA, asym zero variables shouldn't be called here + if (sequenceType == Fortescue.SequenceType.POSITIVE) { + v1Var = variableSet.getVariable(bus1.getNum(), vType); + ph1Var = variableSet.getVariable(bus1.getNum(), angleType); + v2Var = variableSet.getVariable(bus2.getNum(), vType); + ph2Var = variableSet.getVariable(bus2.getNum(), angleType); + } else { + v1Var = (bus1.getAsym().getAsymBusVariableType() == AsymBusVariableType.WYE || sequenceType != Fortescue.SequenceType.ZERO) ? variableSet.getVariable(bus1.getNum(), vType) : null; + ph1Var = (bus1.getAsym().getAsymBusVariableType() == AsymBusVariableType.WYE || sequenceType != Fortescue.SequenceType.ZERO) ? variableSet.getVariable(bus1.getNum(), angleType) : null; + v2Var = (bus2.getAsym().getAsymBusVariableType() == AsymBusVariableType.WYE || sequenceType != Fortescue.SequenceType.ZERO) ? variableSet.getVariable(bus2.getNum(), vType) : null; + ph2Var = (bus2.getAsym().getAsymBusVariableType() == AsymBusVariableType.WYE || sequenceType != Fortescue.SequenceType.ZERO) ? variableSet.getVariable(bus2.getNum(), angleType) : null; + } + a1Var = deriveA1 ? variableSet.getVariable(branch.getNum(), AcVariableType.BRANCH_ALPHA1) : null; r1Var = deriveR1 ? variableSet.getVariable(branch.getNum(), AcVariableType.BRANCH_RHO1) : null; - variables.add(v1Var); - variables.add(v2Var); - variables.add(ph1Var); - variables.add(ph2Var); + if (v1Var != null) { + variables.add(v1Var); + } + if (v2Var != null) { + variables.add(v2Var); + } + if (ph1Var != null) { + variables.add(ph1Var); + } + if (ph2Var != null) { + variables.add(ph2Var); + } if (a1Var != null) { variables.add(a1Var); } @@ -93,18 +112,30 @@ public Variable getA1Var() { } protected double v1() { + if (v1Var == null) { + return 0.; + } return sv.get(v1Var.getRow()); } protected double v2() { + if (v2Var == null) { + return 0.; + } return sv.get(v2Var.getRow()); } protected double ph1() { + if (ph1Var == null) { + return 0.; + } return sv.get(ph1Var.getRow()); } protected double ph2() { + if (ph2Var == null) { + return 0.; + } return sv.get(ph2Var.getRow()); } diff --git a/src/main/java/com/powsybl/openloadflow/ac/equations/ClosedBranchTfoZeroIflowEquationTerm.java b/src/main/java/com/powsybl/openloadflow/ac/equations/ClosedBranchTfoZeroIflowEquationTerm.java index d3f7fa2df4..738da549f1 100644 --- a/src/main/java/com/powsybl/openloadflow/ac/equations/ClosedBranchTfoZeroIflowEquationTerm.java +++ b/src/main/java/com/powsybl/openloadflow/ac/equations/ClosedBranchTfoZeroIflowEquationTerm.java @@ -29,7 +29,7 @@ public class ClosedBranchTfoZeroIflowEquationTerm extends AbstractClosedBranchAc public ClosedBranchTfoZeroIflowEquationTerm(LfBranch branch, LfBus bus1, LfBus bus2, VariableSet variableSet, boolean deriveA1, boolean deriveR1, ClosedBranchTfoNegativeIflowEquationTerm.FlowType flowType) { - super(branch, bus1, bus2, variableSet, deriveA1, deriveR1, Fortescue.SequenceType.NEGATIVE); + super(branch, bus1, bus2, variableSet, deriveA1, deriveR1, Fortescue.SequenceType.ZERO); this.flowType = flowType; @@ -113,14 +113,23 @@ public static DenseMatrix getAdmittanceMatrix(Complex z0T1, Complex z0T2, Comple return getYgYgForcedFluxesAdmittanceMatrix(z0T1, z0T2, y0m, zG1, zG2, r1); } } else { - Complex y11; + Complex y11 = new Complex(0., 0.); Complex y22 = new Complex(0., 0.); Complex y12 = y22; - if (leg1Type == LegConnectionType.Y_GROUNDED && leg2Type == LegConnectionType.DELTA) { + if (leg1Type == LegConnectionType.DELTA && leg2Type == LegConnectionType.Y_GROUNDED) { + Complex tmp1 = z0T2.add(y0m.add(z0T1.reciprocal()).reciprocal()); + y22 = (zG2.multiply(3).add(tmp1)).reciprocal(); + } else if (leg1Type == LegConnectionType.Y_GROUNDED && leg2Type == LegConnectionType.DELTA) { Complex tmp2 = z0T1.add(y0m.add(z0T2.reciprocal()).reciprocal()).multiply(1 / (r1 * r1)); y11 = (zG1.multiply(3).add(tmp2)).reciprocal(); + } else if (leg1Type == LegConnectionType.Y && leg2Type == LegConnectionType.Y_GROUNDED && !isFreeFluxes) { + Complex tmp3 = z0T2.add(y0m.reciprocal()); + y22 = (zG2.multiply(3).add(tmp3)).reciprocal(); + } else if (leg1Type == LegConnectionType.Y_GROUNDED && leg2Type == LegConnectionType.Y && !isFreeFluxes) { + Complex tmp4 = z0T1.add(y0m.reciprocal()).multiply(1 / (r1 * r1)); + y11 = (zG1.multiply(3).add(tmp4)).reciprocal(); } else { - throw new IllegalArgumentException("Transfomer with winding config Yg or Y or DELTA not supported in current version of the asymmetric load flow"); + throw new IllegalArgumentException("Transfomer configuration not supported"); } // if windings are in another configuration we consider it is a zero admittance matrix return getMatrixFromBloc44(y11, y22, y12); diff --git a/src/main/java/com/powsybl/openloadflow/ac/equations/asym/AsymmetricalAcEquationSystemCreator.java b/src/main/java/com/powsybl/openloadflow/ac/equations/asym/AsymmetricalAcEquationSystemCreator.java index a9d7b2494f..9256ec961d 100644 --- a/src/main/java/com/powsybl/openloadflow/ac/equations/asym/AsymmetricalAcEquationSystemCreator.java +++ b/src/main/java/com/powsybl/openloadflow/ac/equations/asym/AsymmetricalAcEquationSystemCreator.java @@ -152,10 +152,22 @@ protected void createImpedantBranch(LfBranch branch, LfBus bus1, LfBus bus2, Equ } // no assymmetry is detected with this line, we handle the equations as Fortescue and decoupled - p1 = new ClosedBranchSide1ActiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); - q1 = new ClosedBranchSide1ReactiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); - p2 = new ClosedBranchSide2ActiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); - q2 = new ClosedBranchSide2ReactiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + if (asymBus1.isPositiveSequenceAsCurrent()) { + p1 = new ClosedBranchI1xFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + q1 = new ClosedBranchI1yFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + } else { + p1 = new ClosedBranchSide1ActiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + q1 = new ClosedBranchSide1ReactiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + } + + if (asymBus2.isPositiveSequenceAsCurrent()) { + p2 = new ClosedBranchI2xFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + q2 = new ClosedBranchI2yFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + } else { + p2 = new ClosedBranchSide2ActiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + q2 = new ClosedBranchSide2ReactiveFlowEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1, SequenceType.POSITIVE); + } + i1 = new ClosedBranchSide1CurrentMagnitudeEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1); i2 = new ClosedBranchSide2CurrentMagnitudeEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), deriveA1, deriveR1); @@ -199,20 +211,16 @@ protected void createImpedantBranch(LfBranch branch, LfBus bus1, LfBus bus2, Equ } else { // assymmetry is detected with this line, we handle the equations as coupled between the different sequences // positive + if (asymBus1.isPositiveSequenceAsCurrent()) { + // in this case we try to model the positive sequence as current balances + p1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.ONE, SequenceType.POSITIVE); + q1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.ONE, SequenceType.POSITIVE); + } else { + p1 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.ONE, SequenceType.POSITIVE); + q1 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.ONE, SequenceType.POSITIVE); + } - // test: if we are WYE variables and there is a phase missing, the positive sequence is modeled with currents if (isBus1Wye) { - - if (asymBus1.isPositiveSequenceAsCurrent()) { - // in this case we try to model the positive sequence as current balances - p1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.ONE, SequenceType.POSITIVE); - q1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.ONE, SequenceType.POSITIVE); - } else { - p1 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.ONE, SequenceType.POSITIVE); - q1 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.ONE, SequenceType.POSITIVE); - } - - // test if (nbPhases1 == 3) { ixn1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.ONE, SequenceType.NEGATIVE); iyn1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.ONE, SequenceType.NEGATIVE); @@ -223,22 +231,19 @@ protected void createImpedantBranch(LfBranch branch, LfBus bus1, LfBus bus2, Equ } } else { - p1 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.ONE, SequenceType.POSITIVE); - q1 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.ONE, SequenceType.POSITIVE); - ixn1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.ONE, SequenceType.NEGATIVE); iyn1 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.ONE, SequenceType.NEGATIVE); } - if (isBus2Wye) { + if (asymBus2.isPositiveSequenceAsCurrent()) { + p2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.TWO, SequenceType.POSITIVE); + q2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.TWO, SequenceType.POSITIVE); + } else { + p2 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.TWO, SequenceType.POSITIVE); + q2 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.TWO, SequenceType.POSITIVE); + } - if (asymBus2.isPositiveSequenceAsCurrent()) { - p2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.TWO, SequenceType.POSITIVE); - q2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.TWO, SequenceType.POSITIVE); - } else { - p2 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.TWO, SequenceType.POSITIVE); - q2 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.TWO, SequenceType.POSITIVE); - } + if (isBus2Wye) { if (nbPhases2 == 3) { ixn2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.TWO, SequenceType.NEGATIVE); @@ -249,9 +254,6 @@ protected void createImpedantBranch(LfBranch branch, LfBus bus1, LfBus bus2, Equ iyz2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.TWO, SequenceType.ZERO); } } else { - p2 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.TWO, SequenceType.POSITIVE); - q2 = new AsymmetricalClosedBranchCoupledPowerEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.TWO, SequenceType.POSITIVE); - ixn2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.REAL, Side.TWO, SequenceType.NEGATIVE); iyn2 = new AsymmetricalClosedBranchCoupledCurrentEquationTerm(branch, bus1, bus2, equationSystem.getVariableSet(), ComplexPart.IMAGINARY, Side.TWO, SequenceType.NEGATIVE); } diff --git a/src/main/java/com/powsybl/openloadflow/network/LfAsymLine.java b/src/main/java/com/powsybl/openloadflow/network/LfAsymLine.java index 210b431834..9c3abd6328 100644 --- a/src/main/java/com/powsybl/openloadflow/network/LfAsymLine.java +++ b/src/main/java/com/powsybl/openloadflow/network/LfAsymLine.java @@ -85,9 +85,9 @@ public LfAsymLine(ComplexMatrix yabc, boolean phaseOpenA, boolean phaseOpenB, bo this.hasPhaseC2 = hasPhaseC2; this.isSide1FortescueRepresentation = isSide1FortescueRepresentation; this.isSide2FortescueRepresentation = isSide2FortescueRepresentation; - admittanceMatrix = new LfAsymLineAdmittanceMatrix(this); this.side1VariableType = side1VariableType; this.side2VariableType = side2VariableType; + admittanceMatrix = new LfAsymLineAdmittanceMatrix(this); } public LfAsymLineAdmittanceMatrix getAdmittanceMatrix() { diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym4DeltaTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym4DeltaTest.java new file mode 100644 index 0000000000..a1e860d3a4 --- /dev/null +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym4DeltaTest.java @@ -0,0 +1,79 @@ +package com.powsybl.openloadflow.ac; + +import com.powsybl.iidm.network.Bus; +import com.powsybl.iidm.network.Network; +import com.powsybl.iidm.network.extensions.WindingConnectionType; +import com.powsybl.loadflow.LoadFlow; +import com.powsybl.loadflow.LoadFlowParameters; +import com.powsybl.loadflow.LoadFlowResult; +import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.openloadflow.OpenLoadFlowParameters; +import com.powsybl.openloadflow.OpenLoadFlowProvider; +import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.extensions.iidm.StepWindingConnectionType; +import org.apache.commons.math3.complex.Complex; +import org.junit.jupiter.api.Test; + +import static com.powsybl.openloadflow.util.LoadFlowAssert.assertAngleEquals; +import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class Asym4DeltaTest { + + private Network network; + private Bus bus1; + private Bus bus2; + private Bus bus3; + private Bus bus4; + + private LoadFlow.Runner loadFlowRunner; + private LoadFlowParameters parameters; + + @Test + void deltaY() { + + Complex zz = new Complex(0.1, 0.01); // 0.0001 , 0.001 + Complex zn = new Complex(0.1, 0.01); // 0.001 , 0.01 + Boolean isLoadBalanced = true; + WindingConnectionType w1 = WindingConnectionType.DELTA; + WindingConnectionType w2 = WindingConnectionType.Y_GROUNDED; + int numDisconnectedPhase = 0; + StepWindingConnectionType stepWindingConnectionType = StepWindingConnectionType.STEP_DOWN; + + network = Asym4nodesFeederTest.ieee4Feeder(zz, zn, isLoadBalanced, WindingConnectionType.Y_GROUNDED, w1, w2); + + bus1 = network.getBusBreakerView().getBus("B1"); + bus2 = network.getBusBreakerView().getBus("B2"); + bus3 = network.getBusBreakerView().getBus("B3"); + bus4 = network.getBusBreakerView().getBus("B4"); + + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) + .setDistributedSlack(false); + OpenLoadFlowParameters.create(parameters) + .setMaxNewtonRaphsonIterations(100) + .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) + .setAsymmetrical(true); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + + assertVoltageEquals(12.47, bus1); + assertAngleEquals(0., bus1); + assertVoltageEquals(12.433526294098483, bus2); + assertVoltageEquals(2.2804714045919776, bus3); + assertVoltageEquals(2.0355904463879693, bus4); + + // addition of an extension to have a 3 phase transformer and new load flow: + Asym4nodesFeederTest.addTfo3PhaseExtension(network, w2, stepWindingConnectionType, numDisconnectedPhase); + result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + + assertVoltageEquals(12.47, bus1); + assertAngleEquals(0., bus1); + assertVoltageEquals(12.401647497875299, bus2); + assertVoltageEquals(2.274193122764982, bus3); + assertVoltageEquals(2.0302309634844096, bus4); + } + +} diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym4nodesFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym4nodesFeederTest.java index 9f6d350649..61b612dff8 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym4nodesFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym4nodesFeederTest.java @@ -46,8 +46,8 @@ public class Asym4nodesFeederTest { @Test void ygYgUnbalancedTest() { - Complex zz = new Complex(0.1, 0.01); // 0.0001 , 0.001 - Complex zn = new Complex(0.1, 0.01); // 0.001 , 0.01 + Complex zz = new Complex(0.0001, 0.0001); // 0.0001 , 0.001 + Complex zn = new Complex(0.0001, 0.0001); // 0.001 , 0.01 Boolean isLoadBalanced = false; WindingConnectionType w1 = WindingConnectionType.Y_GROUNDED; WindingConnectionType w2 = WindingConnectionType.Y_GROUNDED; @@ -65,6 +65,7 @@ void ygYgUnbalancedTest() { parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); OpenLoadFlowParameters.create(parameters) + .setMaxNewtonRaphsonIterations(100) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setAsymmetrical(true); @@ -73,12 +74,12 @@ void ygYgUnbalancedTest() { assertVoltageEquals(7.199557856794634, bus1); assertAngleEquals(0., bus1); - assertVoltageEquals(7.133584938970962, bus2); - assertVoltageEquals(2.3420558121701402, bus3); - assertVoltageEquals(2.0966856983831206, bus4); + assertVoltageEquals(7.121540042954291, bus2); + assertVoltageEquals(2.2440043558129816, bus3); + assertVoltageEquals(1.9562695924418882, bus4); // addition of an extension to have a 3 phase transformer and new load flow: - addTfo3PhaseExtension(w2, stepWindingConnectionType, numDisconnectedPhase); + addTfo3PhaseExtension(network, w2, stepWindingConnectionType, numDisconnectedPhase); result = loadFlowRunner.run(network, parameters); assertTrue(result.isOk()); @@ -92,8 +93,8 @@ void ygYgUnbalancedTest() { @Test void ygYgTest() { - Complex zz = new Complex(0.1, 0.01); // 0.0001 , 0.001 - Complex zn = new Complex(0.1, 0.01); // 0.001 , 0.01 + Complex zz = new Complex(0.00001, 0.00001); // 0.0001 , 0.001 + Complex zn = new Complex(0.00001, 0.00001); // 0.001 , 0.01 Boolean isLoadBalanced = true; WindingConnectionType w1 = WindingConnectionType.Y_GROUNDED; WindingConnectionType w2 = WindingConnectionType.Y_GROUNDED; @@ -111,6 +112,7 @@ void ygYgTest() { parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); OpenLoadFlowParameters.create(parameters) + .setMaxNewtonRaphsonIterations(100) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setAsymmetrical(true); @@ -120,11 +122,11 @@ void ygYgTest() { assertVoltageEquals(7.199557856794634, bus1); assertAngleEquals(0., bus1); assertVoltageEquals(7.132278619390253, bus2); - assertVoltageEquals(2.344230653528591, bus3); - assertVoltageEquals(2.107863958213946, bus4); + assertVoltageEquals(2.2643149471277386, bus3); + assertVoltageEquals(2.017173369480019, bus4); // addition of an extension to have a 3 phase transformer and new load flow: - addTfo3PhaseExtension(w2, stepWindingConnectionType, numDisconnectedPhase); + addTfo3PhaseExtension(network, w2, stepWindingConnectionType, numDisconnectedPhase); result = loadFlowRunner.run(network, parameters); assertTrue(result.isOk()); @@ -174,12 +176,12 @@ void ygDeltaTest() { assertVoltageEquals(7.199557856794634, bus1); assertAngleEquals(0., bus1); - assertVoltageEquals(7.015678041873337, bus2); - assertVoltageEquals(3.842798277594563, bus3); - assertVoltageEquals(3.4440931482904062, bus4); + assertVoltageEquals(6.966398471893453, bus2); + assertVoltageEquals(3.222022038533233, bus3); + assertVoltageEquals(2.716189992104315, bus4); // addition of an extension to have a 3 phase transformer and new load flow: - addTfo3PhaseExtension(w2, stepWindingConnectionType, numDisconnectedPhase); + addTfo3PhaseExtension(network, w2, stepWindingConnectionType, numDisconnectedPhase); result = loadFlowRunner.run(network, parameters); assertTrue(result.isOk()); @@ -228,12 +230,12 @@ void deltaDeltaTest() { assertVoltageEquals(12.47, bus1); assertAngleEquals(0., bus1); - assertVoltageEquals(12.363327843118185, bus2); - assertVoltageEquals(3.919374745381408, bus3); - assertVoltageEquals(3.5306643903086035, bus4); + assertVoltageEquals(12.343319573062105, bus2); + assertVoltageEquals(3.3615589948468156, bus3); + assertVoltageEquals(2.885485615952693, bus4); // addition of an extension to have a 3 phase transformer and new load flow: - addTfo3PhaseExtension(w2, stepWindingConnectionType, numDisconnectedPhase); + addTfo3PhaseExtension(network, w2, stepWindingConnectionType, numDisconnectedPhase); result = loadFlowRunner.run(network, parameters); assertTrue(result.isOk()); @@ -282,12 +284,12 @@ void ygDeltaUnbalancedTest() { assertVoltageEquals(7.199557856794634, bus1); assertAngleEquals(0., bus1); - assertVoltageEquals(7.0078109349944375, bus2); - assertVoltageEquals(3.8315940839604075, bus3); - assertVoltageEquals(3.413967683262305, bus4); + assertVoltageEquals(6.937021164658664, bus2); + assertVoltageEquals(3.1166742441520894, bus3); + assertVoltageEquals(2.547669019028284, bus4); // addition of an extension to have a 3 phase transformer and new load flow: - addTfo3PhaseExtension(w2, stepWindingConnectionType, numDisconnectedPhase); + addTfo3PhaseExtension(network, w2, stepWindingConnectionType, numDisconnectedPhase); result = loadFlowRunner.run(network, parameters); assertTrue(result.isOk()); @@ -354,17 +356,15 @@ public static Network ieee4Feeder(Complex zz, Complex zn, boolean isLoadBalanced .setBus(bus1.getId()) .setMinP(-100.0) .setMaxP(200) - .setTargetP(0) + .setTargetP(2) .setTargetV(v1nom) .setVoltageRegulatorOn(true) .add(); gen1.newExtension(GeneratorFortescueAdder.class) .withRz(zz.getReal()) - //.withXz(0.001) .withXz(zz.getImaginary()) .withRn(zn.getReal()) - //.withXn(0.01) .withXn(zn.getImaginary()) .add(); @@ -388,6 +388,7 @@ public static Network ieee4Feeder(Complex zz, Complex zn, boolean isLoadBalanced bus2.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(side1VariableType) + .withPositiveSequenceAsCurrent(true) .add(); // Bus3 @@ -405,6 +406,7 @@ public static Network ieee4Feeder(Complex zz, Complex zn, boolean isLoadBalanced bus3.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(side2VariableType) + .withPositiveSequenceAsCurrent(true) .add(); // Bus4 @@ -426,6 +428,7 @@ public static Network ieee4Feeder(Complex zz, Complex zn, boolean isLoadBalanced bus4.setV(v3nom).setAngle(0.); bus4.newExtension(BusAsymmetricalAdder.class) + .withPositiveSequenceAsCurrent(true) .withBusVariableType(side2VariableType) .add(); @@ -562,9 +565,14 @@ public static Network ieee4Feeder(Complex zz, Complex zn, boolean isLoadBalanced .setB2(0.0) .add(); + // addition of asymmetrical extensions + ComplexMatrix yabc12 = ComplexMatrix.getMatrixScaled(ywyeabc, feetInMile / length1InFeet); + if (side1VariableType == BusVariableType.DELTA) { + yabc12 = ComplexMatrix.getMatrixScaled(yDeltaabc, feetInMile / length1InFeet); + } // addition of asymmetrical extensions line12.newExtension(LineAsymmetricalAdder.class) - .withYabc(ComplexMatrix.getMatrixScaled(ywyeabc, feetInMile / length1InFeet)) + .withYabc(yabc12) .add(); line12.newExtension(LineFortescueAdder.class) @@ -620,8 +628,8 @@ public static Network ieee4Feeder(Complex zz, Complex zn, boolean isLoadBalanced } double zBase = ratedU3 * ratedU3 / sBase; - double rT23 = zBase / 3. / 100; - double xT23 = 6. * zBase / 3. / 100; + double rT23 = zBase / 100; + double xT23 = 6. * zBase / 100; var t23 = substation23.newTwoWindingsTransformer() .setId("T2W_B2_B3") .setVoltageLevel1(vl2.getId()) @@ -652,7 +660,7 @@ public static Network ieee4Feeder(Complex zz, Complex zn, boolean isLoadBalanced return network; } - public void addTfo3PhaseExtension(WindingConnectionType w2, StepWindingConnectionType stepWindingConnectionType, int numDisconnectedPhase) { + public static void addTfo3PhaseExtension(Network network, WindingConnectionType w2, StepWindingConnectionType stepWindingConnectionType, int numDisconnectedPhase) { TwoWindingsTransformer t2w = network.getTwoWindingsTransformer("T2W_B2_B3"); // step up case, we use Vbase of transformer = Vnom From 07c30e5b01a78c4579c4c6f2586c2d94a0f512d0 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 010/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From f6e43cf0fa4cf424b859a7185a15139fe20b05ff Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 011/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From e8007d7468e22006cd86f9e275f48b7b0f6b0354 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 012/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +++++++------------ .../network/util/AsymLvFeederParser.java | 6 +++ .../util/AsymIeeeFeederParserTest.java | 6 ++- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From e8dedbe8e0cedd47b557ebe6a1c19e6f7b33fcd3 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 013/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From aba2e643f308e1e69619b4e33bb7d00bfea10aa6 Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 014/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 5b553829e6db1630f403a4c0a11a2ba916801931 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 015/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +-- .../network/util/AsymLvFeederParser.java | 6 + .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++----------- .../util/AsymIeeeFeederParserTest.java | 6 +- 4 files changed, 127 insertions(+), 188 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index 2c6edd1e9b..b960dba8a4 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,7 +18,9 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -88,14 +90,6 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -108,19 +102,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Power.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -133,19 +123,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Impedant.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -158,6 +144,10 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Current.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -271,6 +261,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load802.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -325,14 +318,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -345,6 +330,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load808.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -471,14 +460,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -491,6 +472,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load816.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -524,14 +509,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -544,6 +521,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load818.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -577,14 +558,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -597,6 +570,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load820.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -654,14 +631,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -674,6 +643,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load824.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -731,14 +704,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -751,6 +716,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load828.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -782,14 +751,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -802,6 +763,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load830.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -833,14 +798,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -853,6 +810,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load854.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -933,14 +894,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -953,6 +906,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load832.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible + .add(); + // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -1003,14 +960,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -1023,6 +972,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load890.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1054,14 +1007,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1074,6 +1019,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load858.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1131,14 +1080,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1151,6 +1092,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load834.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1181,14 +1126,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1201,6 +1138,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load842.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1232,14 +1172,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1252,6 +1184,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1269,6 +1205,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + distrload844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1300,14 +1240,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1320,6 +1252,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load846.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1362,6 +1298,10 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); + + load848.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1424,6 +1364,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1441,6 +1385,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + distriload860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1472,14 +1420,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1492,6 +1432,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load836.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1523,14 +1467,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1543,6 +1479,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load840.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1586,6 +1526,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load862.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From 15c41130d70ebbadc89139dbfd6467cc65126342 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 016/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From b354bb61c948b42959787c176d97898bb18351c4 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 017/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../extensions/iidm/BusAsymmetrical.java | 20 + .../network/impl/LfBranchImpl.java | 6 + .../network/util/AsymIeeeFeederParser.java | 643 +++++++++++++ .../network/util/AsymLvFeederParser.java | 352 +++++++ .../openloadflow/ac/Asym13BusFeederTest.java | 2 +- .../openloadflow/ac/Asym34BusFeederTest.java | 12 +- .../util/AsymIeeeFeederParserTest.java | 98 ++ src/test/resources/ieeeFeeder123/Bus.csv | 120 +++ .../ieeeFeeder123/DistributedLoad.csv | 1 + src/test/resources/ieeeFeeder123/Gen.csv | 2 + src/test/resources/ieeeFeeder123/Line.csv | 119 +++ .../resources/ieeeFeeder123/LineConfig.csv | 14 + .../resources/ieeeFeeder123/Regulator.csv | 5 + src/test/resources/ieeeFeeder123/SpotLoad.csv | 86 ++ src/test/resources/ieeeFeeder123/Tfo.csv | 1 + .../resources/ieeeFeeder123/TfoConfig.csv | 1 + src/test/resources/ieeeFeeder13/Bus.csv | 13 + .../ieeeFeeder13/DistributedLoad.csv | 2 + src/test/resources/ieeeFeeder13/Gen.csv | 2 + src/test/resources/ieeeFeeder13/Line.csv | 11 + .../resources/ieeeFeeder13/LineConfig.csv | 8 + src/test/resources/ieeeFeeder13/Regulator.csv | 2 + src/test/resources/ieeeFeeder13/SpotLoad.csv | 10 + src/test/resources/ieeeFeeder13/Tfo.csv | 2 + src/test/resources/ieeeFeeder13/TfoConfig.csv | 3 + src/test/resources/ieeeFeeder34/Bus.csv | 35 + .../ieeeFeeder34/DistributedLoad.csv | 19 + src/test/resources/ieeeFeeder34/Gen.csv | 2 + src/test/resources/ieeeFeeder34/Line.csv | 33 + .../resources/ieeeFeeder34/LineConfig.csv | 6 + src/test/resources/ieeeFeeder34/Regulator.csv | 3 + src/test/resources/ieeeFeeder34/SpotLoad.csv | 7 + src/test/resources/ieeeFeeder34/Tfo.csv | 2 + src/test/resources/ieeeFeeder34/TfoConfig.csv | 3 + src/test/resources/lvFeeder/Buscoords.csv | 908 ++++++++++++++++++ src/test/resources/lvFeeder/LineCodes.csv | 12 + src/test/resources/lvFeeder/Lines.csv | 907 +++++++++++++++++ src/test/resources/lvFeeder/LoadShapes.csv | 57 ++ src/test/resources/lvFeeder/Loads.csv | 58 ++ src/test/resources/lvFeeder/Source.csv | 6 + src/test/resources/lvFeeder/Transformer.csv | 3 + 41 files changed, 3589 insertions(+), 7 deletions(-) create mode 100644 src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java create mode 100644 src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java create mode 100644 src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java create mode 100644 src/test/resources/ieeeFeeder123/Bus.csv create mode 100644 src/test/resources/ieeeFeeder123/DistributedLoad.csv create mode 100644 src/test/resources/ieeeFeeder123/Gen.csv create mode 100644 src/test/resources/ieeeFeeder123/Line.csv create mode 100644 src/test/resources/ieeeFeeder123/LineConfig.csv create mode 100644 src/test/resources/ieeeFeeder123/Regulator.csv create mode 100644 src/test/resources/ieeeFeeder123/SpotLoad.csv create mode 100644 src/test/resources/ieeeFeeder123/Tfo.csv create mode 100644 src/test/resources/ieeeFeeder123/TfoConfig.csv create mode 100644 src/test/resources/ieeeFeeder13/Bus.csv create mode 100644 src/test/resources/ieeeFeeder13/DistributedLoad.csv create mode 100644 src/test/resources/ieeeFeeder13/Gen.csv create mode 100644 src/test/resources/ieeeFeeder13/Line.csv create mode 100644 src/test/resources/ieeeFeeder13/LineConfig.csv create mode 100644 src/test/resources/ieeeFeeder13/Regulator.csv create mode 100644 src/test/resources/ieeeFeeder13/SpotLoad.csv create mode 100644 src/test/resources/ieeeFeeder13/Tfo.csv create mode 100644 src/test/resources/ieeeFeeder13/TfoConfig.csv create mode 100644 src/test/resources/ieeeFeeder34/Bus.csv create mode 100644 src/test/resources/ieeeFeeder34/DistributedLoad.csv create mode 100644 src/test/resources/ieeeFeeder34/Gen.csv create mode 100644 src/test/resources/ieeeFeeder34/Line.csv create mode 100644 src/test/resources/ieeeFeeder34/LineConfig.csv create mode 100644 src/test/resources/ieeeFeeder34/Regulator.csv create mode 100644 src/test/resources/ieeeFeeder34/SpotLoad.csv create mode 100644 src/test/resources/ieeeFeeder34/Tfo.csv create mode 100644 src/test/resources/ieeeFeeder34/TfoConfig.csv create mode 100644 src/test/resources/lvFeeder/Buscoords.csv create mode 100644 src/test/resources/lvFeeder/LineCodes.csv create mode 100644 src/test/resources/lvFeeder/Lines.csv create mode 100644 src/test/resources/lvFeeder/LoadShapes.csv create mode 100644 src/test/resources/lvFeeder/Loads.csv create mode 100644 src/test/resources/lvFeeder/Source.csv create mode 100644 src/test/resources/lvFeeder/Transformer.csv diff --git a/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/BusAsymmetrical.java b/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/BusAsymmetrical.java index e300b1aaf5..8b15cc2f55 100644 --- a/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/BusAsymmetrical.java +++ b/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/BusAsymmetrical.java @@ -65,4 +65,24 @@ public boolean isFortescueRepresentation() { public boolean isPositiveSequenceAsCurrent() { return isPositiveSequenceAsCurrent; } + + public void setPositiveSequenceAsCurrent(boolean positiveSequenceAsCurrent) { + isPositiveSequenceAsCurrent = positiveSequenceAsCurrent; + } + + public void setFortescueRepresentation(boolean fortescueRepresentation) { + isFortescueRepresentation = fortescueRepresentation; + } + + public void setHasPhaseA(boolean hasPhaseA) { + this.hasPhaseA = hasPhaseA; + } + + public void setHasPhaseB(boolean hasPhaseB) { + this.hasPhaseB = hasPhaseB; + } + + public void setHasPhaseC(boolean hasPhaseC) { + this.hasPhaseC = hasPhaseC; + } } diff --git a/src/main/java/com/powsybl/openloadflow/network/impl/LfBranchImpl.java b/src/main/java/com/powsybl/openloadflow/network/impl/LfBranchImpl.java index 69671e2562..72d8826844 100644 --- a/src/main/java/com/powsybl/openloadflow/network/impl/LfBranchImpl.java +++ b/src/main/java/com/powsybl/openloadflow/network/impl/LfBranchImpl.java @@ -216,9 +216,15 @@ private static void createTransfoToAsym(TwoWindingsTransformer t2w, double zb, L if (asymBus1 != null) { side1VariableType = asymBus1.getAsymBusVariableType(); + if (!asymBus1.isFortescueRepresentation()) { + throw new PowsyblException("A three phase transformer must have its busses in Fortescue representation but bus 1 of '" + t2w.getId() + "' is in ABC representation"); + } } if (asymBus2 != null) { side2VariableType = asymBus2.getAsymBusVariableType(); + if (!asymBus2.isFortescueRepresentation()) { + throw new PowsyblException("A three phase transformer must have its busses in Fortescue representation but bus 2 of '" + t2w.getId() + "' is in ABC representation"); + } } AsymThreePhaseTransfo asym3phaseTfo = new AsymThreePhaseTransfo(leg1Type, leg2Type, stepLegConnectionType, diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java new file mode 100644 index 0000000000..4ca3d3aea2 --- /dev/null +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -0,0 +1,643 @@ +package com.powsybl.openloadflow.network.util; + +import com.powsybl.iidm.network.*; +import com.powsybl.iidm.network.extensions.*; +import com.powsybl.math.matrix.DenseMatrix; +import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; +import com.powsybl.openloadflow.util.ComplexMatrix; +import com.univocity.parsers.annotations.Parsed; +import com.univocity.parsers.common.processor.BeanListProcessor; +import com.univocity.parsers.csv.CsvParser; +import com.univocity.parsers.csv.CsvParserSettings; +import org.apache.commons.math3.complex.Complex; +import org.joda.time.DateTime; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.util.*; + +public final class AsymIeeeFeederParser { + + private AsymIeeeFeederParser() { + } + + private static List parseCsv(String resourceName, Class clazz) { + try (Reader inputReader = new InputStreamReader(Objects.requireNonNull(AsymIeeeFeederParser.class.getResourceAsStream(resourceName)), StandardCharsets.UTF_8)) { + BeanListProcessor rowProcessor = new BeanListProcessor<>(clazz); + CsvParserSettings settings = new CsvParserSettings(); + settings.setHeaderExtractionEnabled(true); + settings.setProcessor(rowProcessor); + CsvParser parser = new CsvParser(settings); + parser.parse(inputReader); + return rowProcessor.getBeans(); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + public static class LineData { + @Parsed(field = "NodeA") + String nodeA; + + @Parsed(field = "NodeB") + String nodeB; + + @Parsed(field = "Length") + double length; + + @Parsed(field = "Config") + String config; + } + + public static class TfoData { + @Parsed(field = "NodeA") + String nodeA; + + @Parsed(field = "NodeB") + String nodeB; + + @Parsed(field = "Config") + String config; + } + + public static class GenData { + @Parsed(field = "GenName") + String genName; + + @Parsed(field = "BusName") + String busName; + + @Parsed(field = "SetPoint") + double setPoint; + + } + + public static class BusData { + @Parsed(field = "BusName") + String busName; + + @Parsed(field = "UNom") + double uNom; + + } + + public static class LoadData { + @Parsed(field = "Node") + String busName; + + @Parsed(field = "Load") + String loadType; + + @Parsed(field = "Ph-1") + double ph1P; + + @Parsed(field = "Ph-1Q") + double ph1Q; + + @Parsed(field = "Ph-2") + double ph2P; + + @Parsed(field = "Ph-2Q") + double ph2Q; + + @Parsed(field = "Ph-3") + double ph3P; + + @Parsed(field = "Ph-3Q") + double ph3Q; + + } + + public static class DistriLoadData { + @Parsed(field = "NodeA") + String busNameA; + + @Parsed(field = "NodeB") + String busNameB; + + @Parsed(field = "Load") + String loadType; + + @Parsed(field = "Ph-1") + double ph1P; + + @Parsed(field = "Ph-1Q") + double ph1Q; + + @Parsed(field = "Ph-2") + double ph2P; + + @Parsed(field = "Ph-2Q") + double ph2Q; + + @Parsed(field = "Ph-3") + double ph3P; + + @Parsed(field = "Ph-3Q") + double ph3Q; + } + + public static class LineConfigData { + @Parsed(field = "Config") + String config; + + @Parsed(field = "PhaseA") + int phaseA; + + @Parsed(field = "PhaseB") + int phaseB; + + @Parsed(field = "PhaseC") + int phaseC; + + @Parsed + double r11; + + @Parsed + double x11; + + @Parsed + double r12; + + @Parsed + double x12; + + @Parsed + double r13; + + @Parsed + double x13; + + @Parsed + double r22; + + @Parsed + double x22; + + @Parsed + double r23; + + @Parsed + double x23; + + @Parsed + double r33; + + @Parsed + double x33; + + @Parsed + double b11; + + @Parsed + double b12; + + @Parsed + double b13; + + @Parsed + double b22; + + @Parsed + double b23; + + @Parsed + double b33; + } + + public static class TfoConfigData { + @Parsed(field = "Config") + String config; + + @Parsed(field = "SkVA") + double skva; + + @Parsed(field = "kV-high") + double kvHigh; + + @Parsed(field = "Winding-high") + String windingHigh; + + @Parsed(field = "kV-low") + double kvLow; + + @Parsed(field = "Winding-low") + String windingLow; + + @Parsed(field = "R") + double r; + + @Parsed(field = "X") + double x; + + } + + public static class RegulatorData { + @Parsed(field = "Line") + String line; + + @Parsed(field = "RhoA") + double rhoA; + + @Parsed(field = "RhoB") + double rhoB; + + @Parsed(field = "RhoC") + double rhoC; + + } + + private static String getBusId(String busName) { + return "Bus-" + busName; + } + + private static String getVoltageLevelId(String busName) { + return "VoltageLevel-" + busName; + } + + private static String getSubstationId(String busName) { + return "Substation-" + busName; + } + + private static void createBuses(Network network, Map firstBusTfo, String path) { + for (BusData busData : parseCsv(path + "Bus.csv", BusData.class)) { + + String substationId = getSubstationId(busData.busName); + if (firstBusTfo.containsKey(busData.busName)) { + substationId = getSubstationId(firstBusTfo.get(busData.busName)); + } + Substation s = network.getSubstation(substationId); + if (s == null) { + s = network.newSubstation() + .setId(substationId) + .add(); + } + VoltageLevel vl = s.newVoltageLevel() + .setId(getVoltageLevelId(busData.busName)) + .setTopologyKind(TopologyKind.BUS_BREAKER) + .setNominalV(busData.uNom) + .add(); + Bus bus = vl.getBusBreakerView().newBus() + .setId(getBusId(busData.busName)) + .add(); + + bus.setV(busData.uNom).setAngle(0.); + + // default settings for bus extensions, will be modified depending on the type of connected equipment : + bus.newExtension(BusAsymmetricalAdder.class) + .withBusVariableType(BusVariableType.WYE) + .withHasPhaseA(false) + .withHasPhaseB(false) + .withHasPhaseC(false) + .withPositiveSequenceAsCurrent(true) + .withFortescueRepresentation(true) + .add(); + } + } + + private static void createGenerators(Network network, String path) { + for (GenData gen : parseCsv(path + "Gen.csv", GenData.class)) { + VoltageLevel vl = network.getVoltageLevel(getVoltageLevelId(gen.busName)); + Generator generator = vl.newGenerator() + .setId(gen.genName) + .setBus(getBusId(gen.busName)) + .setMinP(-100.0) + .setMaxP(200) + .setTargetP(0.0) + .setTargetV(vl.getNominalV() * gen.setPoint) // TODO : TEST + .setVoltageRegulatorOn(true) + .add(); + + Complex zz = new Complex(0.0001, 0.0001); + Complex zn = new Complex(0.0001, 0.0001); + + generator.newExtension(GeneratorFortescueAdder.class) + .withRz(zz.getReal()) + .withXz(zz.getImaginary()) + .withRn(zn.getReal()) + .withXn(zn.getImaginary()) + .add(); + + // modification of bus extension due to generating unit + network.getBusBreakerView().getBus(getBusId(gen.busName)).getExtension(BusAsymmetrical.class).setPositiveSequenceAsCurrent(false); + + } + } + + private static List parseTfos(String path) { + + List listTfos = new ArrayList<>(); + for (TfoData tfo : parseCsv(path + "Tfo.csv", TfoData.class)) { + listTfos.add(tfo); + } + + return listTfos; + } + + private static Map getFirstBusTfo(List listTfos) { + // used to create a substation with the name of the first bus for a tfo + Map firstBusTfo = new HashMap<>(); + for (TfoData tfo : listTfos) { + firstBusTfo.put(tfo.nodeB, tfo.nodeA); + } + + return firstBusTfo; + } + + private static void createLoad(Network network, String loadName, String busName, String loadType, + double pa, double qa, double pb, double qb, double pc, double qc) { + VoltageLevel vl = network.getVoltageLevel(getVoltageLevelId(busName)); + Load load = vl.newLoad() + .setId(loadName) + .setBus(getBusId(busName)) + .setP0(0.) + .setQ0(0.) + .add(); + + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); + LoadConnectionType loadConnectionType; + LoadType loadTypeOut; + if (loadType.equals("Y-PQ")) { + loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; + } else if (loadType.equals("D-PQ")) { + loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; + } else if (loadType.equals("Y-Z")) { + loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + extensionBus.setFortescueRepresentation(false); + } else if (loadType.equals("D-Z")) { + loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + extensionBus.setFortescueRepresentation(false); + } else if (loadType.equals("Y-I")) { + loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_CURRENT; + extensionBus.setFortescueRepresentation(false); + } else if (loadType.equals("D-I")) { + loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_CURRENT; + extensionBus.setFortescueRepresentation(false); + } else { + throw new IllegalStateException("Unknown load type in csv at bus : " + busName); + } + + load.newExtension(LoadAsymmetricalAdder.class) + .withDeltaPa(pa / 1000.) + .withDeltaQa(qa / 1000.) + .withDeltaPb(pb / 1000.) + .withDeltaQb(qb / 1000.) + .withDeltaPc(pc / 1000.) + .withDeltaQc(qc / 1000.) + .withConnectionType(loadConnectionType) + .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + + } + + private static void createLoads(Network network, String path) { + + for (LoadData loadData : parseCsv(path + "SpotLoad.csv", LoadData.class)) { + + String loadName = "LOAD_" + loadData.busName + "-" + loadData.loadType; + + createLoad(network, loadName, loadData.busName, loadData.loadType, + loadData.ph1P, loadData.ph1Q, loadData.ph2P, loadData.ph2Q, loadData.ph3P, loadData.ph3Q); + } + } + + private static void createDistriLoads(Network network, String path) { + + for (DistriLoadData loadData : parseCsv(path + "DistributedLoad.csv", DistriLoadData.class)) { + String loadName = "LOAD_" + loadData.busNameA + "-" + loadData.busNameB + "-" + loadData.loadType; + + createLoad(network, loadName, loadData.busNameA, loadData.loadType, + loadData.ph1P, loadData.ph1Q, loadData.ph2P, loadData.ph2Q, loadData.ph3P, loadData.ph3Q); + } + } + + private static void createLines(Network network, String path) { + Map lineConfig = new HashMap<>(); + for (LineConfigData lineCode : parseCsv(path + "LineConfig.csv", LineConfigData.class)) { + lineConfig.put(lineCode.config, lineCode); + } + Map regulatorDataMap = new HashMap<>(); + for (RegulatorData regulatorData : parseCsv(path + "Regulator.csv", RegulatorData.class)) { + String lineName = "Line-" + regulatorData.line; + regulatorDataMap.put(lineName, regulatorData); + } + + for (LineData line : parseCsv(path + "Line.csv", LineData.class)) { + LineConfigData lineConfigData = lineConfig.get(line.config); + var l = network.newLine() + .setId("Line-" + line.nodeA + "-" + line.nodeB) + .setVoltageLevel1(getVoltageLevelId(line.nodeA)) + .setBus1(getBusId(line.nodeA)) + .setVoltageLevel2(getVoltageLevelId(line.nodeB)) + .setBus2(getBusId(line.nodeB)) + .setR(1.0 * line.length / 1000) + .setX(1.0 * line.length / 1000) + .add(); + + l.newExtension(LineFortescueAdder.class) + .withOpenPhaseA(false) + .withOpenPhaseB(false) + .withOpenPhaseC(false) + .withRz(1.0 * line.length / 1000) + .withXz(1.0 * line.length / 1000) + .add(); + + double micro = 0.000001; + double feetInMile = 5280; + double yCoef = 1. / 3.; + + // building of Yabc from given Y impedance matrix Zy + ComplexMatrix zy = new ComplexMatrix(3, 3); + zy.set(1, 1, new Complex(lineConfigData.r11, lineConfigData.x11)); + zy.set(1, 2, new Complex(lineConfigData.r12, lineConfigData.x12)); + zy.set(1, 3, new Complex(lineConfigData.r13, lineConfigData.x13)); + zy.set(2, 1, new Complex(lineConfigData.r12, lineConfigData.x12)); + zy.set(2, 2, new Complex(lineConfigData.r22, lineConfigData.x22)); + zy.set(2, 3, new Complex(lineConfigData.r23, lineConfigData.x23)); + zy.set(3, 1, new Complex(lineConfigData.r13, lineConfigData.x13)); + zy.set(3, 2, new Complex(lineConfigData.r23, lineConfigData.x23)); + zy.set(3, 3, new Complex(lineConfigData.r33, lineConfigData.x33)); + + ComplexMatrix b = new ComplexMatrix(3, 3); + + b.set(1, 1, new Complex(0, micro * lineConfigData.b11)); + b.set(1, 2, new Complex(0, micro * lineConfigData.b12)); + b.set(1, 3, new Complex(0, micro * lineConfigData.b13)); + b.set(2, 1, new Complex(0, micro * lineConfigData.b12)); + b.set(2, 2, new Complex(0, micro * lineConfigData.b22)); + b.set(2, 3, new Complex(0, micro * lineConfigData.b23)); + b.set(3, 1, new Complex(0, micro * lineConfigData.b13)); + b.set(3, 2, new Complex(0, micro * lineConfigData.b23)); + b.set(3, 3, new Complex(0, micro * lineConfigData.b33)); + + boolean hasPhaseA = lineConfigData.phaseA == 1; + boolean hasPhaseB = lineConfigData.phaseB == 1; + boolean hasPhaseC = lineConfigData.phaseC == 1; + + ComplexMatrix yabc = LineAsymmetrical.getAdmittanceMatrixFromImpedanceAndBmatrix(zy, b, + hasPhaseA, hasPhaseB, hasPhaseC, line.length / feetInMile); + if (regulatorDataMap.containsKey(l.getId())) { + // take into account effect of regulator + RegulatorData regulatorData = regulatorDataMap.get(l.getId()); + ComplexMatrix rho = new ComplexMatrix(6, 6); + rho.set(1, 1, new Complex(regulatorData.rhoA, 0.)); + rho.set(2, 2, new Complex(regulatorData.rhoB, 0.)); + rho.set(3, 3, new Complex(regulatorData.rhoC, 0.)); + rho.set(4, 4, new Complex(1., 0.)); + rho.set(5, 5, new Complex(1., 0.)); + rho.set(6, 6, new Complex(1., 0.)); + DenseMatrix yabcRho = rho.getRealCartesianMatrix().times(yabc.getRealCartesianMatrix().times(rho.getRealCartesianMatrix())); + yabc = ComplexMatrix.getComplexMatrixFromRealCartesian(yabcRho); + } + + l.newExtension(LineAsymmetricalAdder.class) + .withYabc(ComplexMatrix.getMatrixScaled(yabc, yCoef)) + .add(); + + // modification of bus extension depending on line connections: + var extensionBus1 = network.getBusBreakerView().getBus(getBusId(line.nodeA)).getExtension(BusAsymmetrical.class); + var extensionBus2 = network.getBusBreakerView().getBus(getBusId(line.nodeB)).getExtension(BusAsymmetrical.class); + + extensionBus1.setHasPhaseA(extensionBus1.isHasPhaseA() || hasPhaseA); + extensionBus1.setHasPhaseB(extensionBus1.isHasPhaseB() || hasPhaseB); + extensionBus1.setHasPhaseC(extensionBus1.isHasPhaseC() || hasPhaseC); + + extensionBus2.setHasPhaseA(extensionBus2.isHasPhaseA() || hasPhaseA); + extensionBus2.setHasPhaseB(extensionBus2.isHasPhaseB() || hasPhaseB); + extensionBus2.setHasPhaseC(extensionBus2.isHasPhaseC() || hasPhaseC); + + } + } + + private static void createTfos(Network network, String path) { + Map tfoConfigDataMap = new HashMap<>(); + for (TfoConfigData tfoConfig : parseCsv(path + "TfoConfig.csv", TfoConfigData.class)) { + tfoConfigDataMap.put(tfoConfig.config, tfoConfig); + } + for (TfoData tfoData : parseCsv(path + "Tfo.csv", TfoData.class)) { + TfoConfigData tfoConfigData = tfoConfigDataMap.get(tfoData.config); + double ratedUhigh = tfoConfigData.kvHigh; + double ratedUlow = tfoConfigData.kvLow; + double sBase = tfoConfigData.skva / 1000.; + double rTpc = tfoConfigData.r; + double xTpc = tfoConfigData.x; + double zBase = ratedUhigh * ratedUlow / sBase; + double rT = rTpc * zBase / 100.; + double xT = xTpc * zBase / 100.; + + var tfo = network.getSubstation(getSubstationId(tfoData.nodeA)).newTwoWindingsTransformer() + .setId("Tfo-" + tfoData.nodeA + "-" + tfoData.nodeB) + .setVoltageLevel1(network.getVoltageLevel(getVoltageLevelId(tfoData.nodeA)).getId()) + .setBus1(getBusId(tfoData.nodeA)) + .setConnectableBus1(getBusId(tfoData.nodeA)) + .setRatedU1(ratedUhigh) + .setVoltageLevel2(network.getVoltageLevel(getVoltageLevelId(tfoData.nodeB)).getId()) + .setBus2(getBusId(tfoData.nodeB)) + .setConnectableBus2(getBusId(tfoData.nodeB)) + .setRatedU2(ratedUlow) + .setR(rT) + .setX(xT) + .setG(0.0D) + .setB(0.0D) + .setRatedS(sBase) + .add(); + + WindingConnectionType windingConnectionType1; + if (tfoConfigData.windingHigh.equals("Gr.Y") || tfoConfigData.windingHigh.equals("Gr.W")) { + windingConnectionType1 = WindingConnectionType.Y_GROUNDED; + } else { + windingConnectionType1 = WindingConnectionType.DELTA; + } + + WindingConnectionType windingConnectionType2; + if (tfoConfigData.windingLow.equals("Gr.Y") || tfoConfigData.windingLow.equals("Gr.W")) { + windingConnectionType2 = WindingConnectionType.Y_GROUNDED; + } else { + windingConnectionType2 = WindingConnectionType.DELTA; + } + + tfo.newExtension(TwoWindingsTransformerFortescueAdder.class) + .withRz(rT) + .withXz(xT) + .withConnectionType1(windingConnectionType1) + .withConnectionType2(windingConnectionType2) + .withGroundingX1(0.0000) + .withGroundingX2(0.0000) + .withFreeFluxes(true) + .add(); + + Complex zPhase = new Complex(rTpc, xTpc).multiply(zBase / 3. / 100.); + Complex yPhase = new Complex(0., 0.); + + tfo.newExtension(Tfo3PhasesAdder.class) + .withIsOpenPhaseA1(false) + .withIsOpenPhaseB1(false) + .withIsOpenPhaseC1(false) + .withYa(buildSinglePhaseAdmittanceMatrix(zPhase, yPhase, yPhase)) + .withYb(buildSinglePhaseAdmittanceMatrix(zPhase, yPhase, yPhase)) + .withYc(buildSinglePhaseAdmittanceMatrix(zPhase, yPhase, yPhase)) + .add(); + + // modification of bus extension depending on line connections: + var extensionBus1 = network.getBusBreakerView().getBus(getBusId(tfoData.nodeA)).getExtension(BusAsymmetrical.class); + var extensionBus2 = network.getBusBreakerView().getBus(getBusId(tfoData.nodeB)).getExtension(BusAsymmetrical.class); + + extensionBus1.setHasPhaseA(true); + extensionBus1.setHasPhaseB(true); + extensionBus1.setHasPhaseC(true); + + extensionBus2.setHasPhaseA(true); + extensionBus2.setHasPhaseB(true); + extensionBus2.setHasPhaseC(true); + + extensionBus1.setFortescueRepresentation(true); + extensionBus2.setFortescueRepresentation(true); + } + } + + public static ComplexMatrix buildSinglePhaseAdmittanceMatrix(Complex z, Complex y1, Complex y2) { + ComplexMatrix cm = new ComplexMatrix(2, 2); + cm.set(1, 1, y1.add(z.reciprocal())); + cm.set(1, 2, z.reciprocal().multiply(-1.)); + cm.set(2, 1, z.reciprocal().multiply(-1.)); + cm.set(2, 2, y2.add(z.reciprocal())); + + return cm; + } + + public static Network create(String path) { + return create(NetworkFactory.findDefault(), path); + } + + public static Network create(NetworkFactory networkFactory, String path) { + Network network = networkFactory.createNetwork("EuropeanLvTestFeeder", "csv"); + network.setCaseDate(DateTime.parse("2023-04-11T23:59:00.000+01:00")); + + // for substation naming when there are tfos: + List listTfos = parseTfos(path); + Map firstBusTfo = getFirstBusTfo(listTfos); + + createBuses(network, firstBusTfo, path); + createLines(network, path); + createGenerators(network, path); + createLoads(network, path); + createDistriLoads(network, path); + createTfos(network, path); + + return network; + } + +} diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java new file mode 100644 index 0000000000..5b70c85e15 --- /dev/null +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -0,0 +1,352 @@ +package com.powsybl.openloadflow.network.util; + +import com.powsybl.commons.PowsyblException; +import com.powsybl.iidm.network.*; +import com.powsybl.iidm.network.extensions.*; +import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; +import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; +import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; +import com.univocity.parsers.annotations.Parsed; +import com.univocity.parsers.common.processor.BeanListProcessor; +import com.univocity.parsers.csv.CsvParser; +import com.univocity.parsers.csv.CsvParserSettings; +import org.apache.commons.math3.complex.Complex; +import org.joda.time.DateTime; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +public final class AsymLvFeederParser { + private AsymLvFeederParser() { + } + + private static List parseCsv(String resourceName, Class clazz) { + try (Reader inputReader = new InputStreamReader(Objects.requireNonNull(AsymLvFeederParser.class.getResourceAsStream(resourceName)), StandardCharsets.UTF_8)) { + BeanListProcessor rowProcessor = new BeanListProcessor<>(clazz); + CsvParserSettings settings = new CsvParserSettings(); + settings.setHeaderExtractionEnabled(true); + settings.setProcessor(rowProcessor); + CsvParser parser = new CsvParser(settings); + parser.parse(inputReader); + return rowProcessor.getBeans(); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + private static String getBusId(int busName) { + return "Bus-" + busName; + } + + private static String getVoltageLevelId(int busName) { + return "VoltageLevel-" + busName; + } + + private static String getSubstationId(int busName) { + return "Substation-" + busName; + } + + public static class BusCoord { + @Parsed(field = "Busname") + int busName; + + @Parsed + double x; + + @Parsed + double y; + } + + public static class Line { + @Parsed(field = "Name") + String name; + + @Parsed(field = "Bus1") + int bus1; + + @Parsed(field = "Bus2") + int bus2; + + @Parsed(field = "Phases") + String phases; + + @Parsed(field = "Length") + double length; + + @Parsed(field = "Units") + String units; + + @Parsed(field = "LineCode") + String code; + } + + public static class LineCode { + @Parsed(field = "Name") + String name; + + @Parsed + int nphases; + + @Parsed(field = "R1") + double r1; + + @Parsed(field = "X1") + double x1; + + @Parsed(field = "R0") + double r0; + + @Parsed(field = "X0") + double x0; + + @Parsed(field = "C1") + double c1; + + @Parsed(field = "C0") + double c0; + + @Parsed(field = "Units") + String units; + } + + public static class Load { + @Parsed(field = "Name") + String name; + + @Parsed + int numPhases; + + @Parsed(field = "Bus") + int bus; + + @Parsed + char phases; + + @Parsed + double kV; + + @Parsed(field = "Model") + int model; + + @Parsed(field = "Connection") + String connection; + + @Parsed + double kW; + + @Parsed(field = "PF") + double pf; + + @Parsed(field = "Yearly") + String yearly; + } + + public static class Transformer { + @Parsed(field = "Name") + String name; + + @Parsed + int phases; + + @Parsed + String bus1; + + @Parsed + int bus2; + + @Parsed(field = "kV_pri") + double kvPri; + + @Parsed(field = "kV_sec") + double kvSec; + + @Parsed(field = "MVA") + double mva; + + @Parsed(field = "Conn_pri") + String connPri; + + @Parsed(field = "Conn_sec") + String connSec; + + @Parsed(field = "%XHL") + double xhl; + + @Parsed(field = "% resistance") + double resistance; + } + + private static void createBuses(Network network, String path) { + for (BusCoord busCoord : parseCsv(path + "Buscoords.csv", BusCoord.class)) { + String substationId = getSubstationId(busCoord.busName); + Substation s = network.getSubstation(substationId); + if (s == null) { + s = network.newSubstation() + .setId(substationId) + .add(); + } + VoltageLevel vl = s.newVoltageLevel() + .setId(getVoltageLevelId(busCoord.busName)) + .setTopologyKind(TopologyKind.BUS_BREAKER) + .setNominalV(1) + .add(); + Bus bus = vl.getBusBreakerView().newBus() + .setId(getBusId(busCoord.busName)) + .add(); + + // default settings for bus extensions, will be modified depending on the type of connected equipment : + bus.newExtension(BusAsymmetricalAdder.class) + .withBusVariableType(BusVariableType.WYE) + .withHasPhaseA(true) + .withHasPhaseB(true) + .withHasPhaseC(true) + .withPositiveSequenceAsCurrent(true) + .withFortescueRepresentation(true) + .add(); + } + } + + private static void createLines(Network network, String path) { + Map lineCodes = new HashMap<>(); + for (LineCode lineCode : parseCsv(path + "LineCodes.csv", LineCode.class)) { + lineCodes.put(lineCode.name, lineCode); + } + double coeff = 1 / 1000.; + for (Line line : parseCsv(path + "Lines.csv", Line.class)) { + LineCode lineCode = lineCodes.get(line.code); + var l = network.newLine() + .setId("Line-" + line.bus1 + "-" + line.bus2) + .setVoltageLevel1(getVoltageLevelId(line.bus1)) + .setBus1(getBusId(line.bus1)) + .setVoltageLevel2(getVoltageLevelId(line.bus2)) + .setBus2(getBusId(line.bus2)) + .setR(lineCode.r1 * line.length * coeff) + .setX(lineCode.x1 * line.length * coeff) + .add(); + l.newExtension(LineFortescueAdder.class) + .withRz(lineCode.r0 * line.length * coeff) + .withXz(lineCode.x0 * line.length * coeff) + .add(); + } + } + + private static LoadConnectionType getConnectionType(Load load) { + if (load.connection.equals("wye")) { + return LoadConnectionType.Y; + } + throw new PowsyblException("Unknown load connection: " + load.connection); + } + + private static void createLoads(Network network, String path) { + for (Load load : parseCsv(path + "Loads.csv", Load.class)) { + var vl = network.getVoltageLevel(getVoltageLevelId(load.bus)); + double p0 = load.kW / 1000; + double q0 = p0 * load.pf; + var l = vl.newLoad() + .setId("Load-" + load.bus) + .setBus(getBusId(load.bus)) + .setP0(0.) + .setQ0(0.) + .add(); + double defaultLoad = 0.000; + double deltaPa = defaultLoad; + double deltaQa = defaultLoad; + double deltaPb = defaultLoad; + double deltaQb = defaultLoad; + double deltaPc = defaultLoad; + double deltaQc = defaultLoad; + switch (load.phases) { + case 'A': + deltaPa += p0; + deltaQa += q0; + break; + case 'B': + deltaPb += p0; + deltaQb += q0; + break; + case 'C': + deltaPc += p0; + deltaQc += q0; + break; + default: + throw new PowsyblException("Unknown phase: " + load.phases); + } + l.newExtension(LoadAsymmetricalAdder.class) + .withConnectionType(getConnectionType(load)) + .withDeltaPa(deltaPa) + .withDeltaQa(deltaQa) + .withDeltaPb(deltaPb) + .withDeltaQb(deltaQb) + .withDeltaPc(deltaPc) + .withDeltaQc(deltaQc) + .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + } + } + + private static void createSource(Network network) { + int busName = 1; + VoltageLevel vl = network.getVoltageLevel(getVoltageLevelId(busName)); + Generator generator = vl.newGenerator() + .setId("G150") + .setBus(getBusId(busName)) + .setMinP(-100.0) + .setMaxP(200) + .setTargetP(0) + .setTargetV(vl.getNominalV() * 1.05) + .setVoltageRegulatorOn(true) + .add(); + + Complex zz = new Complex(0.0001, 0.0001); // 0.0001 , 0.001 + Complex zn = new Complex(0.0001, 0.0001); // 0.001 , 0.01 + + generator.newExtension(GeneratorFortescueAdder.class) + .withRz(zz.getReal()) + .withXz(zz.getImaginary()) + .withRn(zn.getReal()) + .withXn(zn.getImaginary()) + .add(); + + // modification of bus extension due to generating unit + network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class).setPositiveSequenceAsCurrent(false); + } + + private static WindingConnectionType getConnectionType(String conn) { + switch (conn) { + case "Delta": + return WindingConnectionType.DELTA; + case "Wye": + return WindingConnectionType.Y; + default: + throw new PowsyblException("Connection type not supported: " + conn); + } + } + + public static Network create(String path) { + return create(NetworkFactory.findDefault(), path); + } + + public static Network create(NetworkFactory networkFactory, String path) { + Network network = networkFactory.createNetwork("EuropeanLvTestFeeder", "csv"); + network.setCaseDate(DateTime.parse("2023-04-11T23:59:00.000+01:00")); + + createBuses(network, path); + createSource(network); + createLines(network, path); + createLoads(network, path); + return network; + } + +} diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym13BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym13BusFeederTest.java index f076e6d356..196ce73bd6 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym13BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym13BusFeederTest.java @@ -309,7 +309,7 @@ void ieee13LoadWithConstantImpedanceDeltaTest() { assertVoltageEquals(4.290533459921324, bus632); assertVoltageEquals(4.2520625000874075, bus645); assertVoltageEquals(4.243258426216129, bus646); - assertVoltageEquals(4.154403168622116, bus652); + assertVoltageEquals(4.165204333227582, bus652); } @Test diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index c4ea034fef..2c6edd1e9b 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -923,7 +923,7 @@ public static Network ieee34LoadFeeder() { bus832.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(BusVariableType.WYE) .withPositiveSequenceAsCurrent(true) - .withFortescueRepresentation(false) + .withFortescueRepresentation(true) .add(); double p832 = 0.; @@ -934,12 +934,12 @@ public static Network ieee34LoadFeeder() { .setP0(p832) .setQ0(q832) .newZipModel() - .setC0p(0.) + .setC0p(1.) .setC1p(0.) - .setC2p(1.) - .setC0q(0.) + .setC2p(0.) + .setC0q(1.) .setC1q(0.) - .setC2q(1.) + .setC2q(0.) .add() .add(); @@ -969,7 +969,7 @@ public static Network ieee34LoadFeeder() { bus888.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(BusVariableType.WYE) .withPositiveSequenceAsCurrent(true) - .withFortescueRepresentation(false) + .withFortescueRepresentation(true) .add(); // Bus 890 diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java new file mode 100644 index 0000000000..d489c65980 --- /dev/null +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -0,0 +1,98 @@ +package com.powsybl.openloadflow.util; + +import com.powsybl.iidm.network.Network; +import com.powsybl.loadflow.LoadFlow; +import com.powsybl.loadflow.LoadFlowParameters; +import com.powsybl.loadflow.LoadFlowResult; +import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.openloadflow.OpenLoadFlowParameters; +import com.powsybl.openloadflow.OpenLoadFlowProvider; +import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; +import com.powsybl.openloadflow.network.util.AsymLvFeederParser; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class AsymIeeeFeederParserTest { + + private LoadFlow.Runner loadFlowRunner; + private LoadFlowParameters parameters; + + @BeforeEach + void setUp() { + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) + .setDistributedSlack(false); + + OpenLoadFlowParameters.create(parameters) + .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) + .setMaxNewtonRaphsonIterations(100) + .setMaxActivePowerMismatch(0.0001) + .setMaxReactivePowerMismatch(0.0001) + .setNewtonRaphsonConvEpsPerEq(0.0001) + .setMaxVoltageMismatch(0.0001) + .setMaxSusceptanceMismatch(0.0001) + .setMaxAngleMismatch(0.0001) + .setMaxRatioMismatch(0.0001) + .setAsymmetrical(true); + } + + @Test + void test13BussesTest() { + + Network network = AsymIeeeFeederParser.create("/ieeeFeeder13/"); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + assertVoltageEquals(4.276427533655057, network.getBusBreakerView().getBus("Bus-632")); + } + + @Test + void test34BussesTest() { + + Network network = AsymIeeeFeederParser.create("/ieeeFeeder34/"); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + assertVoltageEquals(26.145, network.getBusBreakerView().getBus("Bus-800")); + assertVoltageEquals(25.86703194305272, network.getBusBreakerView().getBus("Bus-832")); + } + + @Test + void test123BussesTest() { + + Network network = AsymIeeeFeederParser.create("/ieeeFeeder123/"); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + assertVoltageEquals(4.16, network.getBusBreakerView().getBus("Bus-150")); + assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); + } + + @Disabled + @Test + void testLvFeedersTest() { + + OpenLoadFlowParameters.create(parameters) + .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) + .setMaxNewtonRaphsonIterations(100) + .setMaxActivePowerMismatch(0.0000001) + .setMaxReactivePowerMismatch(0.0000001) + .setNewtonRaphsonConvEpsPerEq(0.0000001) + .setMaxVoltageMismatch(0.00001) + .setMaxSusceptanceMismatch(0.0001) + .setMaxAngleMismatch(0.0001) + .setMaxRatioMismatch(0.0001) + .setAsymmetrical(true); + + Network network = AsymLvFeederParser.create("/lvFeeder/"); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + } + +} diff --git a/src/test/resources/ieeeFeeder123/Bus.csv b/src/test/resources/ieeeFeeder123/Bus.csv new file mode 100644 index 0000000000..033b1a0ab3 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Bus.csv @@ -0,0 +1,120 @@ +BusName,UNom +150,4.16 +1,4.16 +2,4.16 +3,4.16 +4,4.16 +5,4.16 +6,4.16 +7,4.16 +8,4.16 +12,4.16 +9,4.16 +13,4.16 +14,4.16 +18,4.16 +11,4.16 +10,4.16 +15,4.16 +16,4.16 +17,4.16 +19,4.16 +21,4.16 +20,4.16 +22,4.16 +23,4.16 +24,4.16 +25,4.16 +26,4.16 +28,4.16 +27,4.16 +31,4.16 +33,4.16 +29,4.16 +30,4.16 +250,4.16 +32,4.16 +34,4.16 +35,4.16 +36,4.16 +40,4.16 +37,4.16 +38,4.16 +39,4.16 +41,4.16 +42,4.16 +43,4.16 +44,4.16 +45,4.16 +47,4.16 +46,4.16 +48,4.16 +49,4.16 +50,4.16 +51,4.16 +151,4.16 +52,4.16 +53,4.16 +54,4.16 +57,4.16 +55,4.16 +56,4.16 +58,4.16 +60,4.16 +59,4.16 +61,4.16 +62,4.16 +63,4.16 +64,4.16 +65,4.16 +66,4.16 +67,4.16 +68,4.16 +72,4.16 +69,4.16 +70,4.16 +71,4.16 +73,4.16 +76,4.16 +74,4.16 +75,4.16 +77,4.16 +78,4.16 +79,4.16 +80,4.16 +81,4.16 +82,4.16 +84,4.16 +83,4.16 +85,4.16 +86,4.16 +87,4.16 +88,4.16 +89,4.16 +90,4.16 +91,4.16 +92,4.16 +93,4.16 +94,4.16 +95,4.16 +96,4.16 +97,4.16 +98,4.16 +99,4.16 +100,4.16 +450,4.16 +101,4.16 +102,4.16 +105,4.16 +103,4.16 +104,4.16 +106,4.16 +108,4.16 +107,4.16 +109,4.16 +300,4.16 +110,4.16 +111,4.16 +112,4.16 +113,4.16 +114,4.16 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder123/DistributedLoad.csv b/src/test/resources/ieeeFeeder123/DistributedLoad.csv new file mode 100644 index 0000000000..65cf9c2d6e --- /dev/null +++ b/src/test/resources/ieeeFeeder123/DistributedLoad.csv @@ -0,0 +1 @@ +NodeA,NodeB,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q diff --git a/src/test/resources/ieeeFeeder123/Gen.csv b/src/test/resources/ieeeFeeder123/Gen.csv new file mode 100644 index 0000000000..5b4542d8fa --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Gen.csv @@ -0,0 +1,2 @@ +GenName,busName,SetPoint +G150,150,1.0 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder123/Line.csv b/src/test/resources/ieeeFeeder123/Line.csv new file mode 100644 index 0000000000..b2a8bf6652 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Line.csv @@ -0,0 +1,119 @@ +NodeA,NodeB,Length,Config +1,2,175,10 +1,3,250,11 +1,7,300,1 +3,4,200,11 +3,5,325,11 +5,6,250,11 +7,8,200,1 +8,12,225,10 +8,9,225,9 +8,13,300,1 +9,14,425,9 +13,34,150,11 +13,18,825,2 +14,11,250,9 +14,10,250,9 +15,16,375,11 +15,17,350,11 +18,19,250,9 +18,21,300,2 +19,20,325,9 +21,22,525,10 +21,23,250,2 +23,24,550,11 +23,25,275,2 +25,26,350,7 +25,28,200,2 +26,27,275,7 +26,31,225,11 +27,33,500,9 +28,29,300,2 +29,30,350,2 +30,250,200,2 +31,32,300,11 +34,15,100,11 +35,36,650,8 +35,40,250,1 +36,37,300,9 +36,38,250,10 +38,39,325,10 +40,41,325,11 +40,42,250,1 +42,43,500,10 +42,44,200,1 +44,45,200,9 +44,47,250,1 +45,46,300,9 +47,48,150,4 +47,49,250,4 +49,50,250,4 +50,51,250,4 +51,151,500,4 +52,53,200,1 +53,54,125,1 +54,55,275,1 +54,57,350,3 +55,56,275,1 +57,58,250,10 +57,60,750,3 +58,59,250,10 +60,61,550,5 +60,62,250,12 +62,63,175,12 +63,64,350,12 +64,65,425,12 +65,66,325,12 +67,68,200,9 +67,72,275,3 +67,97,250,3 +68,69,275,9 +69,70,325,9 +70,71,275,9 +72,73,275,11 +72,76,200,3 +73,74,350,11 +74,75,400,11 +76,77,400,6 +76,86,700,3 +77,78,100,6 +78,79,225,6 +78,80,475,6 +80,81,475,6 +81,82,250,6 +81,84,675,11 +82,83,250,6 +84,85,475,11 +86,87,450,6 +87,88,175,9 +87,89,275,6 +89,90,225,10 +89,91,225,6 +91,92,300,11 +91,93,225,6 +93,94,275,9 +93,95,300,6 +95,96,200,10 +97,98,275,3 +98,99,550,3 +99,100,300,3 +100,450,800,3 +101,102,225,11 +101,105,275,3 +102,103,325,11 +103,104,700,11 +105,106,225,10 +105,108,325,3 +106,107,575,10 +108,109,450,9 +108,300,1000,3 +109,110,300,9 +110,111,575,9 +110,112,125,9 +112,113,525,9 +113,114,325,9 +18,35,375,4 +150,1,400,1 +13,52,400,1 +60,67,350,6 +97,101,250,3 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder123/LineConfig.csv b/src/test/resources/ieeeFeeder123/LineConfig.csv new file mode 100644 index 0000000000..6345fc3ead --- /dev/null +++ b/src/test/resources/ieeeFeeder123/LineConfig.csv @@ -0,0 +1,14 @@ +Config,PhaseA,PhaseB,PhaseC,r11,x11,r12,x12,r13,x13,r22,x22,r23,x23,r33,x33,b11,b12,b13,b22,b23,b33 +1,1,1,1,0.4576,1.0780,0.1560,0.5017,0.1535,0.3849,0.4666,1.0482,0.1580,0.4236,0.4615,1.0651,5.6765,-1.8319,-0.6982,5.9809,-1.1645,5.3971 +2,1,1,1,0.4666,1.0482,0.1580,0.4236,0.1560,0.5017,0.4615,1.0651,0.1535,0.3849,0.4576,1.0780,5.9809,-1.1645,-1.8319,5.3971,-0.6982,5.6765 +3,1,1,1,0.4615,1.0651,0.1535,0.3849,0.1580,0.4236,0.4576,1.0780,0.1560,0.5017,0.4666,1.0482,5.3971,-0.6982,-1.1645,5.6765,-1.8319,5.9809 +4,1,1,1,0.4615,1.0651,0.1580,0.4236,0.1535,0.3849,0.4666,1.0482,0.1560,0.5017,0.4576,1.0780,5.3971,-1.1645,-0.6982,5.9809,-1.8319,5.6765 +5,1,1,1,0.4666,1.0482,0.1560,0.5017,0.1580,0.4236,0.4576,1.0780,0.1535,0.3849,0.4615,1.0651,5.9809,-1.8319,-1.1645,5.6765,-0.6982,5.3971 +6,1,1,1,0.4576,1.0780,0.1535,0.3849,0.1560,0.5017,0.4615,1.0651,0.1580,0.4236,0.4666,1.0482,5.6765,-0.6982,-1.8319,5.3971,-1.1645,5.9809 +7,1,0,1,0.4576,1.0780,0.0000,0.0000,0.1535,0.3849,0.0000,0.0000,0.0000,0.0000,0.4615,1.0651,5.1154,0.0000,-1.0549,0.0000,0.0000,5.1704 +8,1,1,0,0.4576,1.0780,0.1535,0.3849,0.0000,0.0000,0.4615,1.0651,0.0000,0.0000,0.0000,0.0000,5.1154,-1.0549,0.0000,5.1704,0.0000,0.0000 +9,1,0,0,1.3292,1.3475,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.5193,0.0000,0.0000,0.0000,0.0000,0.0000 +10,0,1,0,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.3292,1.3475,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.5193,0.0000,0.0000 +11,0,0,1,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.3292,1.3475,0.0000,0.0000,0.0000,0.0000,0.0000,4.5193 +12,1,1,1,1.5209,0.7521,0.5198,0.2775,0.4924,0.2157,1.5329,0.7162,0.5198,0.2775,1.5209,0.7521,67.2242,0.0000,0.0000,67.2242,0.0000,67.2242 + diff --git a/src/test/resources/ieeeFeeder123/Regulator.csv b/src/test/resources/ieeeFeeder123/Regulator.csv new file mode 100644 index 0000000000..b680c8f64f --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Regulator.csv @@ -0,0 +1,5 @@ +Line,RhoA,RhoB,RhoC +150-1,1.0437,1.0438,1.0438 +60-67,1.05,1.00624,1.03123 +25-26,1.0,1.0,0.9937 +9-14,0.9937,1.0,1.0 diff --git a/src/test/resources/ieeeFeeder123/SpotLoad.csv b/src/test/resources/ieeeFeeder123/SpotLoad.csv new file mode 100644 index 0000000000..d3327baa38 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/SpotLoad.csv @@ -0,0 +1,86 @@ +Node,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +1,Y-PQ,40,20,0,0,0,0 +2,Y-PQ,0,0,20,10,0,0 +4,Y-PQ,0,0,0,0,40,20 +5,Y-I,0,0,0,0,20,10 +6,Y-Z,0,0,0,0,40,20 +7,Y-PQ,20,10,0,0,0,0 +9,Y-PQ,40,20,0,0,0,0 +10,Y-I,20,10,0,0,0,0 +11,Y-Z,40,20,0,0,0,0 +12,Y-PQ,0,0,20,10,0,0 +16,Y-PQ,0,0,0,0,40,20 +17,Y-PQ,0,0,0,0,20,10 +19,Y-PQ,40,20,0,0,0,0 +20,Y-I,40,20,0,0,0,0 +22,Y-Z,0,0,40,20,0,0 +24,Y-PQ,0,0,0,0,40,20 +28,Y-I,40,20,0,0,0,0 +29,Y-Z,40,20,0,0,0,0 +30,Y-PQ,0,0,0,0,40,20 +31,Y-PQ,0,0,0,0,20,10 +32,Y-PQ,0,0,0,0,20,10 +33,Y-I,40,20,0,0,0,0 +34,Y-Z,0,0,0,0,40,20 +35,D-PQ,40,20,0,0,0,0 +37,Y-Z,40,20,0,0,0,0 +38,Y-I,0,0,20,10,0,0 +39,Y-PQ,0,0,20,10,0,0 +41,Y-PQ,0,0,0,0,20,10 +42,Y-PQ,20,10,0,0,0,0 +43,Y-Z,0,0,40,20,0,0 +45,Y-I,20,10,0,0,0,0 +46,Y-PQ,20,10,0,0,0,0 +47,Y-I,35,25,35,25,35,25 +48,Y-Z,70,50,70,50,70,50 +49,Y-PQ,35,25,70,50,35,20 +50,Y-PQ,0,0,0,0,40,20 +51,Y-PQ,20,10,0,0,0,0 +52,Y-PQ,40,20,0,0,0,0 +53,Y-PQ,40,20,0,0,0,0 +55,Y-Z,20,10,0,0,0,0 +56,Y-PQ,0,0,20,10,0,0 +58,Y-I,0,0,20,10,0,0 +59,Y-PQ,0,0,20,10,0,0 +60,Y-PQ,20,10,0,0,0,0 +62,Y-Z,0,0,0,0,40,20 +63,Y-PQ,40,20,0,0,0,0 +64,Y-I,0,0,75,35,0,0 +65,D-Z,35,25,35,25,70,50 +66,Y-PQ,0,0,0,0,75,35 +68,Y-PQ,20,10,0,0,0,0 +69,Y-PQ,40,20,0,0,0,0 +70,Y-PQ,20,10,0,0,0,0 +71,Y-PQ,40,20,0,0,0,0 +73,Y-PQ,0,0,0,0,40,20 +74,Y-Z,0,0,0,0,40,20 +75,Y-PQ,0,0,0,0,40,20 +76,D-I,105,80,70,50,70,50 +77,Y-PQ,0,0,40,20,0,0 +79,Y-Z,40,20,0,0,0,0 +80,Y-PQ,0,0,40,20,0,0 +82,Y-PQ,40,20,0,0,0,0 +83,Y-PQ,0,-200,0,-200,20,-190 +84,Y-PQ,0,0,0,0,20,10 +85,Y-PQ,0,0,0,0,40,20 +86,Y-PQ,0,0,20,10,0,0 +87,Y-PQ,0,0,40,20,0,0 +88,Y-PQ,40,-30,0,0,0,0 +90,Y-I,0,0,40,-30,0,0 +92,Y-PQ,0,0,0,0,40,-30 +94,Y-PQ,40,20,0,0,0,0 +95,Y-PQ,0,0,20,10,0,0 +96,Y-PQ,0,0,20,10,0,0 +98,Y-PQ,40,20,0,0,0,0 +99,Y-PQ,0,0,40,20,0,0 +100,Y-Z,0,0,0,0,40,20 +102,Y-PQ,0,0,0,0,20,10 +103,Y-PQ,0,0,0,0,40,20 +104,Y-PQ,0,0,0,0,40,20 +106,Y-PQ,0,0,40,20,0,0 +107,Y-PQ,0,0,40,20,0,0 +109,Y-PQ,40,20,0,0,0,0 +111,Y-PQ,20,10,0,0,0,0 +112,Y-I,20,10,0,0,0,0 +113,Y-Z,40,20,0,0,0,0 +114,Y-PQ,20,10,0,0,0,0 diff --git a/src/test/resources/ieeeFeeder123/Tfo.csv b/src/test/resources/ieeeFeeder123/Tfo.csv new file mode 100644 index 0000000000..7cc8d7f924 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Tfo.csv @@ -0,0 +1 @@ +NodeA,NodeB,Config \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder123/TfoConfig.csv b/src/test/resources/ieeeFeeder123/TfoConfig.csv new file mode 100644 index 0000000000..af208d5f88 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/TfoConfig.csv @@ -0,0 +1 @@ +Config,SkVA,kV-high,Winding-high,kV-low,Winding-low,R,X diff --git a/src/test/resources/ieeeFeeder13/Bus.csv b/src/test/resources/ieeeFeeder13/Bus.csv new file mode 100644 index 0000000000..048c44ba55 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Bus.csv @@ -0,0 +1,13 @@ +BusName,UNom +650,4.16 +632,4.16 +633,4.16 +634,0.48 +645,4.16 +646,4.16 +684,4.16 +611,4.16 +652,4.16 +680,4.16 +675,4.16 +671,4.16 diff --git a/src/test/resources/ieeeFeeder13/DistributedLoad.csv b/src/test/resources/ieeeFeeder13/DistributedLoad.csv new file mode 100644 index 0000000000..1462655e5d --- /dev/null +++ b/src/test/resources/ieeeFeeder13/DistributedLoad.csv @@ -0,0 +1,2 @@ +NodeA,NodeB,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +632,671,Y-PQ,17,10,66,38,117,68 diff --git a/src/test/resources/ieeeFeeder13/Gen.csv b/src/test/resources/ieeeFeeder13/Gen.csv new file mode 100644 index 0000000000..19dfc82448 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Gen.csv @@ -0,0 +1,2 @@ +GenName,busName,SetPoint +G650,650,1.0 diff --git a/src/test/resources/ieeeFeeder13/Line.csv b/src/test/resources/ieeeFeeder13/Line.csv new file mode 100644 index 0000000000..9e1ad5d5e3 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Line.csv @@ -0,0 +1,11 @@ +NodeA,NodeB,Length,Config +632,645,500,603 +632,633,500,602 +645,646,300,603 +650,632,2000,601 +684,652,800,607 +632,671,2000,601 +671,684,300,604 +671,680,1000,601 +684,611,300,605 +671,675,500,606 diff --git a/src/test/resources/ieeeFeeder13/LineConfig.csv b/src/test/resources/ieeeFeeder13/LineConfig.csv new file mode 100644 index 0000000000..e3cee9907f --- /dev/null +++ b/src/test/resources/ieeeFeeder13/LineConfig.csv @@ -0,0 +1,8 @@ +Config,PhaseA,PhaseB,PhaseC,r11,x11,r12,x12,r13,x13,r22,x22,r23,x23,r33,x33,b11,b12,b13,b22,b23,b33 +601,1,1,1,0.3465,1.0179,0.1560,0.5017,0.1580,0.4236,0.3375,1.0478,0.1535,0.3849,0.3414,1.0348,6.2998,-1.9958,-1.2595,5.9597,-0.7417,5.6386 +602,1,1,1,0.7526,1.1814,0.1580,0.4236,0.1560,0.5017,0.7475,1.1983,0.1535,0.3849,0.7436,1.2112,5.6990,-1.0817,-1.6905,5.1795,-0.6588,5.4246 +603,0,1,1,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.3294,1.3471,0.2066,0.4591,1.3238,1.3569,0.0000,0.0000,0.0000,4.7097,-0.8999,4.6658 +604,1,0,1,1.3238,1.3569,0.0000,0.0000,0.2066,0.4591,0.0000,0.0000,0.0000,0.0000,1.3294,1.3471,4.6658,0.0000,-0.8999,0.0000,0.0000,4.7097 +605,0,0,1,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.3292,1.3475,0.0000,0.0000,0.0000,0.0000,0.0000,4.5193 +606,1,1,1,0.7982,0.4463,0.3192,0.0328,0.2849,-0.0143,0.7891,0.4041,0.3192,0.0328,0.7982,0.4463,96.8897,0.0000,0.0000,96.8897,0.0000,96.8897 +607,1,0,0,1.3425,0.5124,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,88.9912,0.0000,0.0000,0.0000,0.0000,0.0000 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder13/Regulator.csv b/src/test/resources/ieeeFeeder13/Regulator.csv new file mode 100644 index 0000000000..8fa3bf4830 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Regulator.csv @@ -0,0 +1,2 @@ +Line,RhoA,RhoB,RhoC +650-632,1.0625,1.05,1.0687 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder13/SpotLoad.csv b/src/test/resources/ieeeFeeder13/SpotLoad.csv new file mode 100644 index 0000000000..7c49850bcd --- /dev/null +++ b/src/test/resources/ieeeFeeder13/SpotLoad.csv @@ -0,0 +1,10 @@ +Node,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +634,Y-PQ,160,110,120,90,120,90 +645,Y-PQ,0,0,170,125,0,0 +646,D-Z,0,0,230,132,0,0 +652,Y-Z,128,86,0,0,0,0 +671,D-PQ,385,220,385,220,555,371 +675,Y-PQ,485,190,68,60,290,212 +675,Y-Z,0,-200,0,-200,0,-200 +611,Y-I,0,0,0,0,170,80 +611,Y-Z,0,0,0,0,0,-100 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder13/Tfo.csv b/src/test/resources/ieeeFeeder13/Tfo.csv new file mode 100644 index 0000000000..50122c84ac --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Tfo.csv @@ -0,0 +1,2 @@ +NodeA,NodeB,Config +633,634,XFM-1 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder13/TfoConfig.csv b/src/test/resources/ieeeFeeder13/TfoConfig.csv new file mode 100644 index 0000000000..b9f8c2ff30 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/TfoConfig.csv @@ -0,0 +1,3 @@ +Config,SkVA,kV-high,Winding-high,kV-low,Winding-low,R,X +Substation,5000,115,D,4.16,Gr.Y,1,8 +XFM-1,500,4.16,Gr.W,0.48,Gr.W,1.1,2 diff --git a/src/test/resources/ieeeFeeder34/Bus.csv b/src/test/resources/ieeeFeeder34/Bus.csv new file mode 100644 index 0000000000..c41c848a80 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Bus.csv @@ -0,0 +1,35 @@ +BusName,UNom +800,24.9 +802,24.9 +806,24.9 +808,24.9 +810,24.9 +812,24.9 +814,24.9 +850,24.9 +816,24.9 +818,24.9 +820,24.9 +822,24.9 +824,24.9 +826,24.9 +828,24.9 +830,24.9 +832,24.9 +834,24.9 +836,24.9 +840,24.9 +842,24.9 +844,24.9 +846,24.9 +848,24.9 +852,24.9 +854,24.9 +856,24.9 +858,24.9 +864,24.9 +860,24.9 +862,24.9 +838,24.9 +888,4.16 +890,4.16 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/DistributedLoad.csv b/src/test/resources/ieeeFeeder34/DistributedLoad.csv new file mode 100644 index 0000000000..81aa998ff6 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/DistributedLoad.csv @@ -0,0 +1,19 @@ +NodeA,NodeB,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +802,806,Y-PQ,0,0,30,15,25,14 +808,810,Y-I,0,0,16,8,0,0 +818,820,Y-Z,34,17,0,0,0,0 +820,822,Y-PQ,135,70,0,0,0,0 +816,824,D-I,0,0,5,2,0,0 +824,826,Y-I,0,0,40,20,4,2 +828,830,Y-PQ,7,3,0,0,0,0 +854,856,Y-PQ,0,0,4,2,0,0 +832,858,D-PQ,7,3,2,1,6,3 +858,864,Y-PQ,2,1,0,0,0,0 +858,834,D-PQ,4,2,15,8,13,7 +834,860,D-Z,16,8,20,10,110,55 +860,836,D-PQ,30,15,10,6,42,22 +836,840,D-I,18,9,22,11,0,0 +862,838,Y-PQ,0,0,28,14,0,0 +842,844,Y-PQ,9,5,0,0,0,0 +844,846,Y-PQ,0,0,25,12,20,11 +846,848,Y-PQ,0,0,23,11,0,0 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/Gen.csv b/src/test/resources/ieeeFeeder34/Gen.csv new file mode 100644 index 0000000000..5e5fce36a7 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Gen.csv @@ -0,0 +1,2 @@ +GenName,busName,SetPoint +G800,800,1.05 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/Line.csv b/src/test/resources/ieeeFeeder34/Line.csv new file mode 100644 index 0000000000..46d005d707 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Line.csv @@ -0,0 +1,33 @@ +NodeA,NodeB,Length,Config +800,802,2580,300 +802,806,1730,300 +806,808,32230,300 +808,810,5804,303 +808,812,37500,300 +812,814,29730,300 +814,850,10,301 +816,818,1710,302 +816,824,10210,301 +818,820,48150,302 +820,822,13740,302 +824,826,3030,303 +824,828,840,301 +828,830,20440,301 +830,854,520,301 +832,858,4900,301 +834,860,2020,301 +834,842,280,301 +836,840,860,301 +836,862,280,301 +842,844,1350,301 +844,846,3640,301 +846,848,530,301 +850,816,310,301 +852,832,10,301 +854,856,23330,303 +854,852,36830,301 +858,864,1620,302 +858,834,5830,301 +860,836,2680,301 +862,838,4860,304 +888,890,10560,300 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/LineConfig.csv b/src/test/resources/ieeeFeeder34/LineConfig.csv new file mode 100644 index 0000000000..50858fe88d --- /dev/null +++ b/src/test/resources/ieeeFeeder34/LineConfig.csv @@ -0,0 +1,6 @@ +Config,PhaseA,PhaseB,PhaseC,r11,x11,r12,x12,r13,x13,r22,x22,r23,x23,r33,x33,b11,b12,b13,b22,b23,b33 +300,1,1,1,1.3368,1.3343,0.2101,0.5779,0.2130,0.5015,1.3238,1.3569,0.2066,0.4591,1.3294,1.3471,5.3350,-1.5313,-0.9943,5.0979,-0.6212,4.8880 +301,1,1,1,1.9300,1.4115,0.2327,0.6442,0.2359,0.5691,1.9157,1.4281,0.2288,0.5238,1.9219,1.4209,5.1207,-1.4364,-0.9402,4.9055,-0.5951,4.7154 +302,1,0,0,2.7995,1.4855,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.2251,0.0000,0.0000,0.0000,0.0000,0.0000 +303,0,1,0,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,2.7995,1.4855,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.2251,0.0000,0.0000 +304,0,1,0,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.9217,1.4212,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.3637,0.0000,0.0000 diff --git a/src/test/resources/ieeeFeeder34/Regulator.csv b/src/test/resources/ieeeFeeder34/Regulator.csv new file mode 100644 index 0000000000..f1b24d136b --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Regulator.csv @@ -0,0 +1,3 @@ +Line,RhoA,RhoB,RhoC +814-850,1.075,1.03117,1.03133 +852-832,1.0812,1.0687,1.075 diff --git a/src/test/resources/ieeeFeeder34/SpotLoad.csv b/src/test/resources/ieeeFeeder34/SpotLoad.csv new file mode 100644 index 0000000000..84f9f6f194 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/SpotLoad.csv @@ -0,0 +1,7 @@ +Node,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +860,Y-PQ,20,16,20,16,20,16 +840,Y-I,9,7,9,7,9,7 +844,Y-Z,135,5,135,5,135,5 +848,D-PQ,20,-134,20,-134,20,-134 +890,D-I,150,75,150,75,150,75 +830,D-Z,10,5,10,5,25,10 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/Tfo.csv b/src/test/resources/ieeeFeeder34/Tfo.csv new file mode 100644 index 0000000000..b531a06915 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Tfo.csv @@ -0,0 +1,2 @@ +NodeA,NodeB,Config +832,888,XFM-1 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/TfoConfig.csv b/src/test/resources/ieeeFeeder34/TfoConfig.csv new file mode 100644 index 0000000000..63035a3040 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/TfoConfig.csv @@ -0,0 +1,3 @@ +Config,SkVA,kV-high,Winding-high,kV-low,Winding-low,R,X +Substation,2500,69,D,24.9,Gr.W,1,8 +XFM-1,500,24.9,Gr.W,4.16,Gr.W,1.9,4.08 \ No newline at end of file diff --git a/src/test/resources/lvFeeder/Buscoords.csv b/src/test/resources/lvFeeder/Buscoords.csv new file mode 100644 index 0000000000..623890f156 --- /dev/null +++ b/src/test/resources/lvFeeder/Buscoords.csv @@ -0,0 +1,908 @@ +#Bus Coordinates,, +Busname, x, y +1,390872.663,392887.379 +2,390871.596,392887.638 +3,390871.481,392887.643 +4,390871.379,392887.608 +5,390871.305,392887.55 +6,390871.234,392887.42 +7,390868.779,392877.637 +8,390868.753,392877.186 +9,390868.753,392876.81 +10,390868.804,392876.484 +11,390868.904,392876.259 +12,390869.079,392876.108 +13,390869.18,392876.008 +14,390869.5,392875.857 +15,390872.292,392875.208 +16,390872.314,392875.302 +17,390875.678,392874.422 +18,390872.316,392875.346 +19,390875.907,392874.353 +20,390872.312,392875.392 +21,390876.142,392874.223 +22,390872.303,392875.433 +23,390876.44,392873.903 +24,390872.288,392875.482 +25,390877.003,392873.341 +26,390872.263,392875.532 +27,390880.364,392878.196 +28,390884.19,392866.433 +29,390872.239,392875.581 +30,390881.306,392879.522 +31,390879.232,392879.305 +32,390886.111,392864.602 +33,390872.17,392875.71 +34,390885,392880 +35,390879.208,392879.353 +36,390890.1695,392868.642 +37,390891.919,392859.065 +38,390872.092,392875.822 +39,390879.183,392879.426 +40,390890.444,392868.351 +41,390891.41,392869.955 +42,390895.963,392855.237 +43,390891.775,392858.903 +44,390872.073,392875.85 +45,390879.159,392879.522 +46,390890.571,392868.223 +47,390893,392874 +48,390899.026,392852.352 +49,390891.742,392858.804 +50,390872.038,392875.883 +51,390879.159,392879.763 +52,390890.754,392868.168 +53,390899.475,392851.944 +54,390899.491,392852.791 +55,390891.759,392858.689 +56,390871.964,392875.93 +57,390879.232,392879.956 +58,390890.936,392868.168 +59,390901.469,392850.053 +60,390899.548,392852.823 +61,390891.775,392858.59 +62,390871.892,392875.96 +63,390879.907,392880.679 +64,390891.045,392868.168 +65,390901.87,392849.664 +66,390907.23,392855.97 +67,390899.618,392852.847 +68,390891.825,392858.508 +69,390871.812,392875.983 +70,390881,392884 +71,390891.246,392868.241 +72,390906.932,392845.428 +73,390907,392860 +74,390907,392860 +75,390899.793,392852.887 +76,390891.972,392858.324 +77,390871.436,392876.083 +78,390892.048,392868.97 +79,390908.613,392843.857 +80,390899.889,392852.926 +81,390892.512,392857.808 +82,390870.935,392876.183 +83,390896,392870 +84,390909.025,392843.57 +85,390899.982,392852.987 +86,390893.558,392856.82 +87,390870.634,392876.259 +88,390909.878,392843.014 +89,390900.06,392853.057 +90,390893.775,392856.555 +91,390870.525,392876.285 +92,390910.741,392842.593 +93,390893.803,392856.496 +94,390870.492,392876.296 +95,390911.23,392842.324 +96,390893.8,392856.41 +97,390870.458,392876.31 +98,390911.556,392842.152 +99,390893.781,392856.378 +100,390870.383,392876.359 +101,390911.997,392841.898 +102,390890.706,392852.332 +103,390870.157,392876.534 +104,390912.282,392841.942 +105,390912.282,392841.72 +106,390890.64,392852.121 +107,390912.63,392841.967 +108,390912.43,392841.6 +109,390890.511,392851.689 +110,390913.032,392842.011 +111,390917.463,392836.015 +112,390883.277,392842.144 +113,390913.637,392842.13 +114,390918.004,392835.491 +115,390876.523,392833.895 +116,390914.4,392842.345 +117,390918.765,392836.293 +118,390915.488,392832.839 +119,390875.778,392833.236 +120,390914.924,392842.567 +121,390918.949,392836.229 +122,390919.135,392836.684 +123,390910.895,392828.11 +124,390875.199,392832.8 +125,390915.64,392842.933 +126,390919.115,392836.199 +127,390920.876,392838.518 +128,390908.834,392825.979 +129,390874.662,392832.48 +130,390916.403,392843.351 +131,390919.234,392836.205 +132,390923.576,392835.814 +133,390925.817,392843.725 +134,390908.271,392825.3 +135,390872.865,392831.803 +136,390917.072,392843.826 +137,390919.412,392836.253 +138,390923.799,392835.572 +139,390929.524,392847.569 +140,390907.615,392824.551 +141,390871.466,392831.607 +142,390918.076,392844.727 +143,390919.608,392836.348 +144,390923.973,392835.3 +145,390932.015,392850.135 +146,390907.053,392823.802 +147,390871.226,392831.623 +148,390922.542,392849.331 +149,390919.762,392836.466 +150,390924.07,392835.058 +151,390934.503,392852.697 +152,390935.584,392846.448 +153,390906.491,392822.865 +154,390871.173,392831.687 +155,390923.521,392850.328 +156,390919.905,392836.632 +157,390924.128,392834.671 +158,390941.046,392859.545 +159,390935.817,392846.24 +160,390906.35,392822.584 +161,390871.128,392831.801 +162,390915.061,392858.471 +163,390927.222,392854.1 +164,390920.012,392836.805 +165,390924.169,392834.201 +166,390943.336,392861.907 +167,390935.995,392846.017 +168,390905.502,392821.012 +169,390871.1,392832.049 +170,390913.478,392860.025 +171,390931.986,392859.25 +172,390920.077,392836.965 +173,390924.246,392833.853 +174,390946.01,392864.771 +175,390946.317,392858.942 +176,390936.05,392845.912 +177,390905.189,392820.053 +178,390910,392863 +179,390932.788,392860.118 +180,390930.205,392860.892 +181,390920.101,392837.143 +182,390924.411,392833.475 +183,390946.422,392865.19 +184,390946.618,392858.602 +185,390936.119,392845.666 +186,390905.022,392819.323 +187,390935.932,392863.545 +188,390923.046,392867.911 +189,390920.095,392837.297 +190,390924.644,392833.165 +191,390948.046,392866.84 +192,390946.652,392865.034 +193,390946.84,392858.223 +194,390936.242,392845.027 +195,390904.938,392818.655 +196,390941.568,392869.643 +197,390921.647,392869.283 +198,390923.824,392868.734 +199,390920.042,392837.481 +200,390924.934,392832.865 +201,390948.693,392867.51 +202,390946.807,392864.979 +203,390946.971,392857.897 +204,390936.288,392844.648 +205,390905.001,392817.821 +206,390939.128,392871.786 +207,390943.019,392871.212 +208,390917,392871 +209,390923.916,392868.865 +210,390919.804,392837.861 +211,390925.39,392832.419 +212,390946.962,392864.97 +213,390947.023,392857.622 +214,390936.388,392844.4 +215,390905.251,392816.298 +216,390931.512,392879.201 +217,390945.597,392874.081 +218,390923.961,392868.986 +219,390919.412,392838.407 +220,390926.643,392831.209 +221,390947.126,392865.015 +222,390947.089,392857.034 +223,390936.61,392843.936 +224,390905.69,392815.026 +225,390927,392880 +226,390946.519,392875.104 +227,390923.967,392869.089 +228,390926.75,392831.106 +229,390947.326,392865.134 +230,390947.18,392856.577 +231,390936.749,392843.721 +232,390906.065,392814.191 +233,390937.556,392882.924 +234,390947.273,392875.942 +235,390923.916,392869.238 +236,390926.805,392831.065 +237,390947.49,392865.261 +238,390947.287,392856.272 +239,390936.874,392843.589 +240,390906.399,392813.691 +241,390936.301,392884.111 +242,390923.807,392869.387 +243,390926.875,392831.043 +244,390947.59,392865.397 +245,390947.457,392855.998 +246,390938.352,392842.126 +247,390907.213,392812.685 +248,390931,392884 +249,390931,392884 +250,390923.606,392869.587 +251,390926.945,392831.047 +252,390947.626,392865.525 +253,390947.784,392855.658 +254,390938.796,392841.703 +255,390910.805,392815.497 +256,390907.752,392812.019 +257,390922.855,392870.303 +258,390927.019,392831.072 +259,390947.635,392865.698 +260,390949.052,392854.417 +261,390938.914,392841.633 +262,390911.309,392815.876 +263,390909.871,392809.604 +264,390921,392875 +265,390927.156,392831.157 +266,390947.599,392865.889 +267,390949.358,392854.138 +268,390936.706,392838.972 +269,390939.032,392841.62 +270,390911.514,392816.081 +271,390913.165,392812.297 +272,390910.583,392808.793 +273,390927.282,392831.268 +274,390947.508,392866.043 +275,390949.516,392854.033 +276,390935,392836 +277,390939.171,392841.613 +278,390911.683,392816.381 +279,390913.42,392812.472 +280,390913.173,392805.861 +281,390927.695,392831.755 +282,390947.071,392866.462 +283,390949.636,392853.999 +284,390939.296,392841.627 +285,390911.851,392816.885 +286,390913.648,392812.586 +287,390914.334,392804.546 +288,390912.467,392805.282 +289,390931,392831 +290,390946.507,392867.044 +291,390949.096,392853.309 +292,390949.744,392853.995 +293,390939.414,392841.675 +294,390912.001,392817.334 +295,390913.996,392812.686 +296,390914.839,392803.916 +297,390909.292,392803.146 +298,390948.848,392852.992 +299,390949.819,392854.01 +300,390939.539,392841.731 +301,390912.188,392817.651 +302,390915.584,392813.037 +303,390918.269,392799.909 +304,390908.726,392802.519 +305,390948.3925,392852.4855 +306,390949.898,392854.051 +307,390940.115,392842.278 +308,390912.454,392818.024 +309,390915.882,392813.133 +310,390918.529,392799.613 +311,390908.548,392802.302 +312,390947.472,392851.557 +313,390950.032,392854.156 +314,390943,392844 +315,390912.783,392818.365 +316,390916.093,392813.229 +317,390919.05,392800 +318,390923.291,392794.191 +319,390908.47,392802.178 +320,390946,392848 +321,390950.481,392854.63 +322,390913.191,392818.747 +323,390916.33,392813.352 +324,390921.636,392802.118 +325,390925.511,392791.533 +326,390908.408,392802.069 +327,390952,392853 +328,390913.426,392818.962 +329,390916.549,392813.501 +330,390922.556,392802.836 +331,390932.594,392797.299 +332,390929.7419,392786.3729 +333,390908.354,392801.937 +334,390914.512,392819.906 +335,390918.357,392814.966 +336,390924.531,392804.433 +337,390935,392800 +338,390934.963,392790.74 +339,390930.511,392785.435 +340,390908.323,392801.829 +341,390914.975,392820.221 +342,390923,392816 +343,390926.15,392805.742 +344,390923.88,392805.165 +345,390937.605,392792.915 +346,390931.168,392784.63 +347,390908.308,392801.736 +348,390915.149,392820.308 +349,390929,392807 +350,390923.819,392805.287 +351,390937.856,392793.111 +352,390931.703,392784.132 +353,390908.308,392801.651 +354,390915.29,392820.348 +355,390923.758,392805.422 +356,390937.949,392793.204 +357,390932.46,392783.603 +358,390908.315,392801.581 +359,390915.397,392820.355 +360,390923.744,392805.551 +361,390938.005,392793.278 +362,390932.953,392783.3 +363,390908.339,392801.503 +364,390915.451,392820.348 +365,390923.772,392805.686 +366,390938.024,392793.371 +367,390933.748,392782.903 +368,390908.385,392801.426 +369,390915.511,392820.295 +370,390923.86,392805.862 +371,390938.024,392793.483 +372,390934.599,392782.657 +373,390908.689,392801.043 +374,390915.592,392820.188 +375,390924.022,392806.038 +376,390938.005,392793.623 +377,390935.584,392782.524 +378,390910.98,392798.157 +379,390907.282,392801.155 +380,390915.907,392819.679 +381,390925.152,392806.998 +382,390937.968,392793.744 +383,390936.303,392782.505 +384,390913.208,392795.42 +385,390898.776,392802.817 +386,390906.36,392802.282 +387,390918,392819 +388,390926,392812 +389,390937.912,392793.827 +390,390937.155,392782.6 +391,390913.3067,392795.2978 +392,390895.655,392803.358 +393,390901.454,392808.389 +394,390937.791,392793.949 +395,390938.366,392782.884 +396,390910.051,392792.872 +397,390915.116,392793.058 +398,390895.344,392803.443 +399,390901.096,392808.831 +400,390937.344,392794.349 +401,390939.237,392783.187 +402,390909.746,392792.659 +403,390916.015,392791.999 +404,390895.119,392803.443 +405,390900.933,392809.018 +406,390937,392798 +407,390940.013,392783.622 +408,390909.563,392792.553 +409,390918.607,392788.706 +410,390915.753,392791.725 +411,390894.893,392803.386 +412,390900.791,392809.106 +413,390940.732,392784.113 +414,390909.433,392792.492 +415,390922.398,392784.096 +416,390915.69,392791.654 +417,390894.074,392802.85 +418,390900.539,392809.227 +419,390941.549,392784.768 +420,390909.212,392792.415 +421,390923.197,392783.136 +422,390915.654,392791.598 +423,390893.905,392802.681 +424,390897.659,392810.609 +425,390942.91,392785.874 +426,390942.91,392785.874 +427,390908.473,392792.172 +428,390923.398,392782.888 +429,390915.626,392791.52 +430,390893.792,392802.483 +431,390896.587,392810.976 +432,390947.433,392789.686 +433,390947.433,392789.686 +434,390907.642,392791.928 +435,390923.491,392782.749 +436,390915.619,392791.449 +437,390893.764,392802.258 +438,390896.22,392811.089 +439,390953.846,392795.059 +440,390953.846,392795.059 +441,390907.177,392791.783 +442,390923.553,392782.625 +443,390915.619,392791.371 +444,390893.82,392802.004 +445,390895.542,392811.117 +446,390958.463,392798.896 +447,390958.463,392798.896 +448,390906.751,392791.616 +449,390923.584,392782.517 +450,390915.633,392791.293 +451,390894.441,392801.355 +452,390894.949,392811.145 +453,390959.827,392800.103 +454,390959.827,392800.103 +455,390906.364,392791.414 +456,390923.6,392782.346 +457,390915.654,392791.243 +458,390894,392797 +459,390894.3,392810.976 +460,390963.865,392803.674 +461,390963.865,392803.674 +462,390957.305,392802.791 +463,390905.762,392791.025 +464,390923.584,392782.192 +465,390915.683,392791.215 +466,390893.764,392810.637 +467,390968.351,392807.642 +468,390968.351,392807.642 +469,390964.469,392803.03 +470,390956.915,392803.162 +471,390905.366,392790.721 +472,390923.538,392782.052 +473,390915.718,392791.18 +474,390891.2225,392808.691 +475,390970.015,392809.073 +476,390970.015,392809.073 +477,390956.693,392803.354 +478,390905.122,392790.469 +479,390923.476,392781.898 +480,390915.775,392791.151 +481,390891.138,392808.521 +482,390973.535,392812.101 +483,390973.535,392812.101 +484,390963.033,392816.614 +485,390956.52,392803.452 +486,390905.015,392790.34 +487,390923.352,392781.774 +488,390915.881,392791.116 +489,390891.11,392808.352 +490,390978.625,392816.388 +491,390978.625,392816.388 +492,390962.663,392817.058 +493,390965.49,392819.862 +494,390956.242,392803.57 +495,390904.962,392790.248 +496,390923.073,392781.511 +497,390916.016,392791.08 +498,390891.166,392808.126 +499,390981.879,392818.818 +500,390981.879,392818.818 +501,390962.507,392817.246 +502,390964,392822 +503,390955.804,392803.705 +504,390904.939,392790.18 +505,390916.237,392776.136 +506,390916.108,392791.052 +507,390891.336,392807.872 +508,390982.421,392819.26 +509,390982.421,392819.26 +510,390962.384,392817.32 +511,390955.501,392803.823 +512,390904.924,392790.081 +513,390912.695,392780.428 +514,390915.185,392775.311 +515,390916.186,392791.017 +516,390983.883,392820.451 +517,390983.883,392820.451 +518,390979.167,392822.695 +519,390962.253,392817.337 +520,390955.316,392803.946 +521,390904.932,392790.005 +522,390908,392779 +523,390914.619,392774.864 +524,390916.242,392790.981 +525,390985.003,392821.271 +526,390985.003,392821.271 +527,390977.209,392824.691 +528,390962.138,392817.312 +529,390955.18,392804.057 +530,390905.076,392789.479 +531,390914.548,392774.783 +532,390916.278,392790.932 +533,390986.567,392822.332 +534,390986.567,392822.332 +535,390975.743,392826.352 +536,390962.023,392817.271 +537,390954.784,392804.457 +538,390903.887,392790.99 +539,390904,392784 +540,390914.494,392774.721 +541,390916.292,392790.868 +542,390987.709,392823.028 +543,390987.709,392823.028 +544,390975.138,392827.039 +545,390961.735,392817.041 +546,390951.688,392807.795 +547,390902.523,392792.617 +548,390914.467,392774.649 +549,390916.278,392790.783 +550,390991,392824.805 +551,390991,392824.805 +552,390974.926,392827.234 +553,390977.781,392829.754 +554,390961.464,392816.787 +555,390951.538,392807.965 +556,390897,392791 +557,390914.449,392774.569 +558,390916.242,392790.733 +559,390993.403,392826.054 +560,390993.403,392826.054 +561,390974.831,392827.281 +562,390976,392832 +563,390958,392817 +564,390951.458,392808.125 +565,390914.458,392774.497 +566,390916.157,392790.648 +567,390993.936,392826.331 +568,390993.936,392826.331 +569,390991.104,392829.14 +570,390974.676,392827.311 +571,390951.428,392808.325 +572,390914.476,392774.425 +573,390994.064,392826.393 +574,390994.064,392826.393 +575,390990.836,392829.546 +576,390974.581,392827.311 +577,390951.428,392808.505 +578,390914.701,392774.115 +579,390997.536,392828.07 +580,390997.536,392828.07 +581,390993.888,392826.66 +582,390990.662,392829.86 +583,390974.467,392827.299 +584,390951.458,392808.71 +585,390910.991,392771.178 +586,390915.202,392773.458 +587,390999.985,392829.212 +588,390999.985,392829.212 +589,390993.812,392826.748 +590,390990.534,392830.185 +591,390974.378,392827.252 +592,390951.553,392808.9 +593,390910.777,392771.009 +594,390917.646,392770.357 +595,391004.98,392831.301 +596,391000.5776,392829.4599 +597,390993.745,392826.807 +598,390989.572,392833.322 +599,390973.854,392826.853 +600,390951.713,392809.099 +601,390910.657,392770.943 +602,390910.518,392764.593 +603,390920.545,392766.731 +604,391009.465,392833.089 +605,391009.465,392833.089 +606,391000.5776,392829.4599 +607,390996.172,392840.26 +608,390996.172,392840.26 +609,390993.64,392826.841 +610,390989.096,392834.773 +611,390969,392827 +612,390951.838,392809.199 +613,390910.547,392770.91 +614,390909,392760 +615,390923.419,392763.338 +616,391008.023,392836.745 +617,391012.375,392834.183 +618,391012.375,392834.183 +619,390996,392843 +620,390993.577,392826.832 +621,390988.794,392835.423 +622,390952.418,392809.569 +623,390910.454,392770.899 +624,390922.171,392762.286 +625,390924.232,392762.387 +626,391006.125,392841.751 +627,390993.509,392826.794 +628,390988.562,392835.841 +629,390954,392812 +630,390910.307,392770.899 +631,390921.888,392762.003 +632,390924.414,392762.164 +633,391005.565,392843.218 +634,390993.467,392826.744 +635,390988.132,392836.432 +636,390909.959,392770.941 +637,390921.726,392761.781 +638,390924.515,392762.063 +639,391002,392847 +640,390993.45,392826.677 +641,390987.226,392837.535 +642,390909.718,392770.968 +643,390921.524,392761.458 +644,390924.636,392761.963 +645,390993.459,392826.609 +646,390986.947,392837.814 +647,390909.412,392771.006 +648,390921.12,392760.65 +649,390924.798,392761.882 +650,390993.492,392826.521 +651,390986.866,392837.895 +652,390909.225,392771.017 +653,390920.797,392760.044 +654,390924.98,392761.862 +655,390993.551,392826.412 +656,390986.773,392837.93 +657,390987.307,392838.185 +658,390909.056,392771.023 +659,390920.534,392759.64 +660,390925.182,392761.882 +661,390993.787,392826.134 +662,390986.68,392837.93 +663,390987.923,392838.51 +664,390908.771,392771.012 +665,390920.231,392759.236 +666,390925.444,392762.018 +667,390993.989,392825.97 +668,390986.587,392837.907 +669,390990.478,392839.868 +670,390908.492,392770.984 +671,390919.948,392758.933 +672,390925.74,392761.64 +673,390926.091,392762.508 +674,390994.166,392825.873 +675,390986.018,392837.512 +676,390990,392841 +677,390908.361,392770.963 +678,390919.443,392758.468 +679,390925.919,392761.414 +680,390929.951,392765.901 +681,390994.528,392825.697 +682,390981,392837 +683,390908.218,392770.935 +684,390917.785,392756.994 +685,390926.062,392761.188 +686,390932.739,392768.301 +687,390908.087,392770.886 +688,390913,392755 +689,390926.169,392760.95 +690,390938.131,392762.197 +691,390940.702,392775.184 +692,390907.934,392770.815 +693,390926.216,392760.76 +694,390937.548,392761.707 +695,390939.539,392760.604 +696,390947.039,392768.131 +697,390942.352,392776.625 +698,390907.699,392770.684 +699,390926.24,392760.45 +700,390937.379,392761.539 +701,390943,392758 +702,390949,392763 +703,390944.148,392778.217 +704,390907.124,392770.224 +705,390926.204,392759.927 +706,390937.285,392761.418 +707,390948.941,392782.353 +708,390944.182,392778.111 +709,390906.396,392769.568 +710,390925.585,392756.048 +711,390937.231,392761.343 +712,390954.592,392787.288 +713,390951.513,392779.362 +714,390944.201,392778.008 +715,390906.33,392769.502 +716,390925.095,392752.863 +717,390937.197,392761.256 +718,390960.503,392792.29 +719,390951.779,392779.034 +720,390944.201,392777.911 +721,390906.287,392769.442 +722,390924.96,392751.851 +723,390937.177,392761.175 +724,390962.999,392794.377 +725,390966.597,392785.202 +726,390951.873,392778.903 +727,390944.188,392777.802 +728,390906.259,392769.376 +729,390924.892,392750.924 +730,390937.177,392761.081 +731,390966.383,392797.222 +732,390967.383,392784.225 +733,390951.956,392778.754 +734,390944.156,392777.718 +735,390906.248,392769.3 +736,390924.876,392750.418 +737,390937.191,392761.007 +738,390970.344,392800.554 +739,390967.79,392783.707 +740,390952.012,392778.624 +741,390944.072,392777.609 +742,390906.248,392769.229 +743,390924.892,392750.014 +744,390937.231,392760.926 +745,390973.519,392803.236 +746,390965.176,392781.034 +747,390967.869,392783.614 +748,390952.068,392778.466 +749,390943.95,392777.499 +750,390906.259,392769.163 +751,390924.96,392749.676 +752,390937.285,392760.845 +753,390974.708,392804.22 +754,390977.441,392798.798 +755,390965,392778 +756,390967.938,392783.559 +757,390952.106,392778.307 +758,390943.847,392777.429 +759,390906.303,392769.081 +760,390925.078,392749.289 +761,390937.393,392760.704 +762,390976.271,392805.664 +763,390980.72,392795.089 +764,390968.007,392783.531 +765,390952.134,392778.084 +766,390943.737,392777.377 +767,390906.369,392768.988 +768,390925.23,392748.952 +769,390938.215,392759.66 +770,390980.319,392808.983 +771,390978.194,392792.523 +772,390980.83,392795.019 +773,390968.132,392783.517 +774,390952.161,392777.776 +775,390943.66,392777.358 +776,390906.708,392768.567 +777,390925.5,392748.446 +778,390940,392756 +779,390983.29,392812.012 +780,390978,392789 +781,390980.951,392794.989 +782,390968.299,392783.573 +783,390952.189,392777.45 +784,390943.563,392777.358 +785,390906,392764 +786,390926.112,392747.463 +787,390985.762,392814.221 +788,390981.082,392794.959 +789,390968.41,392783.642 +790,390952.227,392777.236 +791,390943.473,392777.377 +792,390926.444,392747.366 +793,390924.179,392748.181 +794,390988.243,392815.901 +795,390981.202,392794.959 +796,390968.576,392783.781 +797,390952.283,392777.022 +798,390943.39,392777.416 +799,390926.734,392747.283 +800,390921.1,392749.367 +801,390988.444,392815.944 +802,390990.626,392817.377 +803,390981.333,392794.979 +804,390969.687,392784.793 +805,390952.311,392776.92 +806,390943.306,392777.506 +807,390926.982,392747.256 +808,390918.462,392750.361 +809,390988.65,392815.95 +810,390993.25,392818.98 +811,390993.25,392818.98 +812,390981.413,392795.009 +813,390973,392785 +814,390952.366,392776.761 +815,390943.035,392777.828 +816,390927.176,392747.256 +817,390917,392751 +818,390988.854,392815.918 +819,390995.557,392820.131 +820,390995.557,392820.131 +821,390981.524,392795.079 +822,390952.441,392776.622 +823,390942.694,392778.175 +824,390927.369,392747.297 +825,390989.048,392815.851 +826,390997.983,392821.471 +827,390997.983,392821.471 +828,390982.359,392795.763 +829,390952.581,392776.445 +830,390942.333,392778.516 +831,390927.535,392747.339 +832,390989.227,392815.749 +833,390999.996,392822.532 +834,390999.996,392822.532 +835,390986,392795 +836,390954.1,392774.61 +837,390927.645,392747.394 +838,390989.385,392815.617 +839,391002.28,392823.399 +840,391002.28,392823.399 +841,390954.732,392773.897 +842,390927.77,392747.463 +843,390989.516,392815.458 +844,391004.255,392819.014 +845,391005.615,392824.81 +846,391005.615,392824.81 +847,390955.053,392773.535 +848,390927.935,392747.601 +849,390989.5735,392815.3755 +850,391004.582,392818.391 +851,391009.67,392826.423 +852,391009.67,392826.423 +853,390955.134,392773.465 +854,390928.184,392747.849 +855,390990.602,392813.363 +856,391005.27,392816.532 +857,391016.001,392829.07 +858,391016.001,392829.07 +859,390955.204,392773.418 +860,390931,392748 +861,390935,392751 +862,390991.411,392812.136 +863,391006.257,392814.424 +864,391018.607,392830.063 +865,391018.607,392830.063 +866,390955.285,392773.378 +867,390991.997,392810.992 +868,391006.471,392814.211 +869,391020.304,392830.435 +870,391020.304,392830.435 +871,390955.355,392773.36 +872,390992.556,392809.765 +873,391006.765,392813.971 +874,391005.777,392813.73 +875,391021.504,392830.435 +876,391021.504,392830.435 +877,390955.425,392773.355 +878,390993.762,392807.804 +879,391007.112,392813.917 +880,391004.149,392812.61 +881,391022.496,392830.239 +882,391022.496,392830.239 +883,390955.495,392773.355 +884,390994.075,392807.334 +885,391007.646,392813.917 +886,391005,392808 +887,390955.564,392773.36 +888,390994.421,392806.816 +889,390992.316,392804.712 +890,391008.286,392814.131 +891,390956.756,392773.691 +892,390994.97,392805.953 +893,390990.811,392802.497 +894,391010.609,392815.358 +895,390952.377,392769.85 +896,390960,392774 +897,390995.113,392805.81 +898,390991,392798 +899,391014,392812 +900,390952,392766 +901,390995.257,392805.718 +902,390995.401,392805.718 +903,390995.584,392805.758 +904,390995.885,392805.914 +905,390996.355,392806.267 +906,391001,392805 diff --git a/src/test/resources/lvFeeder/LineCodes.csv b/src/test/resources/lvFeeder/LineCodes.csv new file mode 100644 index 0000000000..f603a0cd0f --- /dev/null +++ b/src/test/resources/lvFeeder/LineCodes.csv @@ -0,0 +1,12 @@ +# Line Codes defined by matrix values,,,,,,,, +Name,nphases,R1,X1,R0,X0,C1,C0,Units +2c_.007,3,3.97,0.099,3.97,0.099,0,0,km +2c_.0225,3,1.257,0.085,1.257,0.085,0,0,km +2c_16,3,1.15,0.088,1.2,0.088,0,0,km +35_SAC_XSC,3,0.868,0.092,0.76,0.092,0,0,km +4c_.06,3,0.469,0.075,1.581,0.091,0,0,km +4c_.1,3,0.274,0.073,0.959,0.079,0,0,km +4c_.35,3,0.089,0.0675,0.319,0.076,0,0,km +4c_185,3,0.166,0.068,0.58,0.078,0,0,km +4c_70,3,0.446,0.071,1.505,0.083,0,0,km +4c_95_SAC_XC,3,0.322,0.074,0.804,0.093,0,0,km diff --git a/src/test/resources/lvFeeder/Lines.csv b/src/test/resources/lvFeeder/Lines.csv new file mode 100644 index 0000000000..fa35170156 --- /dev/null +++ b/src/test/resources/lvFeeder/Lines.csv @@ -0,0 +1,907 @@ +# Line definitions ,,,,,, +Name,Bus1,Bus2,Phases,Length,Units,LineCode +LINE1,1,2,ABC,1.098,m,4c_70 +LINE2,2,3,ABC,0.11511,m,4c_70 +LINE3,3,4,ABC,0.10784,m,4c_70 +LINE4,4,5,ABC,0.094021,m,4c_70 +LINE5,5,6,ABC,0.14812,m,4c_70 +LINE6,6,7,ABC,10.0863,m,4c_70 +LINE7,7,8,ABC,0.45175,m,4c_70 +LINE8,8,9,ABC,0.376,m,4c_70 +LINE9,9,10,ABC,0.32997,m,4c_70 +LINE10,10,11,ABC,0.24622,m,4c_70 +LINE11,11,12,ABC,0.23114,m,4c_70 +LINE12,12,13,ABC,0.14213,m,4c_70 +LINE13,13,14,ABC,0.35384,m,4c_70 +LINE14,14,15,ABC,2.8664,m,4c_70 +LINE15,15,16,ABC,0.09654,m,2c_.007 +LINE16,15,17,ABC,3.476,m,4c_70 +LINE17,16,18,ABC,0.044045,m,2c_.007 +LINE18,17,19,ABC,0.23917,m,4c_70 +LINE19,18,20,ABC,0.046174,m,2c_.007 +LINE20,19,21,ABC,0.26856,m,4c_70 +LINE21,20,22,ABC,0.041976,m,2c_.007 +LINE22,21,23,ABC,0.43727,m,4c_70 +LINE23,22,24,ABC,0.051245,m,2c_.007 +LINE24,23,25,ABC,0.7955,m,4c_70 +LINE25,24,26,ABC,0.055902,m,2c_.007 +LINE26,25,27,ABC,5.9049,m,2c_16 +LINE27,25,28,ABC,9.9686,m,4c_70 +LINE28,26,29,ABC,0.054562,m,2c_.007 +LINE29,27,30,ABC,1.6265,m,2c_16 +LINE30,27,31,ABC,1.5847,m,2c_16 +LINE31,28,32,ABC,2.6538,m,4c_70 +LINE32,29,33,ABC,0.14629,m,2c_.007 +LINE33,30,34,ABC,3.7248,m,2c_16 +LINE34,31,35,ABC,0.053666,m,2c_16 +LINE35,32,36,ABC,5.7265,m,2c_16 +LINE36,32,37,ABC,8.0244,m,4c_70 +LINE37,33,38,ABC,0.13648,m,2c_.007 +LINE38,35,39,ABC,0.077162,m,2c_16 +LINE39,36,40,ABC,0.40004,m,2c_16 +LINE40,36,41,ABC,1.8063,m,2c_16 +LINE41,37,42,ABC,5.5684,m,4c_70 +LINE42,37,43,ABC,0.21675,m,4c_185 +LINE43,38,44,ABC,0.033838,m,2c_.007 +LINE44,39,45,ABC,0.098955,m,2c_16 +LINE45,40,46,ABC,0.18031,m,2c_16 +LINE46,41,47,ABC,4.3463,m,2c_16 +LINE47,42,48,ABC,4.2078,m,4c_70 +LINE48,43,49,ABC,0.10436,m,4c_185 +LINE49,44,50,ABC,0.048104,m,2c_.007 +LINE50,45,51,ABC,0.241,m,2c_16 +LINE51,46,52,ABC,0.19109,m,2c_16 +LINE52,48,53,ABC,0.60668,m,4c_70 +LINE53,48,54,ABC,0.63949,m,4c_70 +LINE54,49,55,ABC,0.11625,m,4c_185 +LINE55,50,56,ABC,0.087664,m,2c_.007 +LINE56,51,57,ABC,0.20634,m,2c_16 +LINE57,52,58,ABC,0.182,m,2c_16 +LINE58,53,59,ABC,2.7481,m,4c_70 +LINE59,54,60,ABC,0.065368,m,4c_70 +LINE60,55,61,ABC,0.10028,m,4c_185 +LINE61,56,62,ABC,0.078,m,2c_.007 +LINE62,57,63,ABC,0.98912,m,2c_16 +LINE63,58,64,ABC,0.109,m,2c_16 +LINE64,59,65,ABC,0.55868,m,4c_70 +LINE65,59,66,ABC,8.2583,m,2c_16 +LINE66,60,67,ABC,0.074,m,4c_70 +LINE67,61,68,ABC,0.096042,m,4c_185 +LINE68,62,69,ABC,0.083241,m,2c_.007 +LINE69,63,70,ABC,3.4962,m,2c_16 +LINE70,64,71,ABC,0.21385,m,2c_16 +LINE71,65,72,ABC,6.6006,m,4c_70 +LINE72,66,73,ABC,4.0366,m,2c_16 +LINE73,66,74,ABC,4.0366,m,2c_16 +LINE74,67,75,ABC,0.17951,m,4c_70 +LINE75,68,76,ABC,0.23551,m,4c_185 +LINE76,69,77,ABC,0.38907,m,2c_.007 +LINE77,71,78,ABC,1.0838,m,2c_16 +LINE78,72,79,ABC,2.3008,m,4c_70 +LINE79,75,80,ABC,0.10362,m,4c_70 +LINE80,76,81,ABC,0.7469,m,4c_185 +LINE81,77,82,ABC,0.51088,m,2c_.007 +LINE82,78,83,ABC,4.084,m,2c_16 +LINE83,79,84,ABC,0.50211,m,4c_70 +LINE84,80,85,ABC,0.11122,m,4c_70 +LINE85,81,86,ABC,1.4388,m,4c_185 +LINE86,82,87,ABC,0.31045,m,2c_.007 +LINE87,84,88,ABC,1.0182,m,4c_70 +LINE88,85,89,ABC,0.1048,m,4c_70 +LINE89,86,90,ABC,0.34251,m,4c_185 +LINE90,87,91,ABC,0.11206,m,2c_.007 +LINE91,88,92,ABC,0.96021,m,4c_70 +LINE92,90,93,ABC,0.065307,m,4c_185 +LINE93,91,94,ABC,0.034785,m,2c_.007 +LINE94,92,95,ABC,0.55811,m,4c_70 +LINE95,93,96,ABC,0.086052,m,4c_185 +LINE96,94,97,ABC,0.03677,m,2c_.007 +LINE97,95,98,ABC,0.36859,m,4c_70 +LINE98,96,99,ABC,0.037216,m,4c_185 +LINE99,97,100,ABC,0.089588,m,2c_.007 +LINE100,98,101,ABC,0.50892,m,4c_70 +LINE101,99,102,ABC,5.0819,m,4c_185 +LINE102,100,103,ABC,0.28583,m,2c_.007 +LINE103,101,104,ABC,0.28838,m,4c_.35 +LINE104,101,105,ABC,0.33602,m,4c_70 +LINE105,102,106,ABC,0.22108,m,4c_185 +LINE106,104,107,ABC,0.3489,m,4c_.35 +LINE107,105,108,ABC,0.19054,m,4c_70 +LINE108,106,109,ABC,0.45085,m,4c_185 +LINE109,107,110,ABC,0.4044,m,4c_.35 +LINE110,108,111,ABC,7.5182,m,4c_70 +LINE111,109,112,ABC,11.9766,m,4c_185 +LINE112,110,113,ABC,0.61659,m,4c_.35 +LINE113,111,114,ABC,0.75316,m,4c_70 +LINE114,112,115,ABC,10.6613,m,4c_185 +LINE115,113,116,ABC,0.79271,m,4c_.35 +LINE116,114,117,ABC,1.1056,m,4c_.35 +LINE117,114,118,ABC,3.6556,m,4c_.1 +LINE118,115,119,ABC,0.99464,m,4c_185 +LINE119,116,120,ABC,0.56909,m,4c_.35 +LINE120,117,121,ABC,0.19481,m,2c_.007 +LINE121,117,122,ABC,0.53831,m,4c_.35 +LINE122,118,123,ABC,6.5924,m,4c_.1 +LINE123,119,124,ABC,0.7248,m,4c_185 +LINE124,120,125,ABC,0.80412,m,4c_.35 +LINE125,121,126,ABC,0.16869,m,2c_.007 +LINE126,122,127,ABC,2.5288,m,4c_.35 +LINE127,123,128,ABC,2.9646,m,4c_.1 +LINE128,124,129,ABC,0.62512,m,4c_185 +LINE129,125,130,ABC,0.87,m,4c_.35 +LINE130,126,131,ABC,0.11915,m,2c_.007 +LINE131,127,132,ABC,3.8212,m,2c_16 +LINE132,127,133,ABC,7.1782,m,4c_.35 +LINE133,128,134,ABC,0.88205,m,4c_.1 +LINE134,129,135,ABC,1.9203,m,4c_185 +LINE135,130,136,ABC,0.82048,m,4c_.35 +LINE136,131,137,ABC,0.18436,m,2c_.007 +LINE137,132,138,ABC,0.32908,m,2c_16 +LINE138,133,139,ABC,5.3402,m,4c_.35 +LINE139,134,140,ABC,0.99566,m,4c_.1 +LINE140,135,141,ABC,1.4127,m,4c_185 +LINE141,136,142,ABC,1.349,m,4c_.35 +LINE142,137,143,ABC,0.21781,m,2c_.007 +LINE143,138,144,ABC,0.32289,m,2c_16 +LINE144,139,145,ABC,3.5762,m,4c_.35 +LINE145,140,146,ABC,0.9364,m,4c_.1 +LINE146,141,147,ABC,0.24053,m,4c_185 +LINE147,142,148,ABC,6.4142,m,4c_.35 +LINE148,143,149,ABC,0.19401,m,2c_.007 +LINE149,144,150,ABC,0.26072,m,2c_16 +LINE150,145,151,ABC,3.5713,m,4c_.35 +LINE151,145,152,ABC,5.1314,m,2c_16 +LINE152,146,153,ABC,1.0926,m,4c_.1 +LINE153,147,154,ABC,0.083096,m,4c_185 +LINE154,148,155,ABC,1.3973,m,4c_.35 +LINE155,149,156,ABC,0.2191,m,2c_.007 +LINE156,150,157,ABC,0.39132,m,2c_16 +LINE157,151,158,ABC,9.4713,m,4c_.35 +LINE158,152,159,ABC,0.31233,m,2c_16 +LINE159,153,160,ABC,0.31439,m,4c_.1 +LINE160,154,161,ABC,0.12256,m,4c_185 +LINE161,155,162,ABC,11.7422,m,2c_16 +LINE162,155,163,ABC,5.2844,m,4c_.35 +LINE163,156,164,ABC,0.20342,m,2c_.007 +LINE164,157,165,ABC,0.47178,m,2c_16 +LINE165,158,166,ABC,3.2899,m,4c_.35 +LINE166,159,167,ABC,0.28533,m,2c_16 +LINE167,160,168,ABC,1.7861,m,4c_.1 +LINE168,161,169,ABC,0.24958,m,4c_185 +LINE169,162,170,ABC,2.2183,m,2c_16 +LINE170,163,171,ABC,7.0156,m,4c_.35 +LINE171,164,172,ABC,0.1727,m,2c_.007 +LINE172,165,173,ABC,0.35642,m,2c_16 +LINE173,166,174,ABC,3.9183,m,4c_.35 +LINE174,166,175,ABC,4.2045,m,2c_16 +LINE175,167,176,ABC,0.11853,m,2c_16 +LINE176,168,177,ABC,1.0088,m,4c_.1 +LINE177,170,178,ABC,4.5768,m,2c_16 +LINE178,171,179,ABC,1.1818,m,4c_.35 +LINE179,171,180,ABC,2.4224,m,2c_16 +LINE180,172,181,ABC,0.17961,m,2c_.007 +LINE181,173,182,ABC,0.41244,m,2c_16 +LINE182,174,183,ABC,0.58763,m,4c_.35 +LINE183,175,184,ABC,0.45409,m,2c_16 +LINE184,176,185,ABC,0.25549,m,2c_16 +LINE185,177,186,ABC,0.74886,m,4c_.1 +LINE186,179,187,ABC,4.6507,m,4c_.35 +LINE187,180,188,ABC,10.0258,m,2c_16 +LINE188,181,189,ABC,0.15412,m,2c_.007 +LINE189,182,190,ABC,0.3878,m,2c_16 +LINE190,183,191,ABC,2.3151,m,4c_.35 +LINE191,183,192,ABC,0.27791,m,4c_.35 +LINE192,184,193,ABC,0.43923,m,2c_16 +LINE193,185,194,ABC,0.65073,m,2c_16 +LINE194,186,195,ABC,0.67326,m,4c_.1 +LINE195,187,196,ABC,8.3036,m,4c_.35 +LINE196,188,197,ABC,1.9595,m,2c_16 +LINE197,188,198,ABC,1.1325,m,2c_16 +LINE198,189,199,ABC,0.19148,m,2c_.007 +LINE199,190,200,ABC,0.41725,m,2c_16 +LINE200,191,201,ABC,0.9314,m,4c_.35 +LINE201,192,202,ABC,0.16447,m,4c_.35 +LINE202,193,203,ABC,0.35134,m,2c_16 +LINE203,194,204,ABC,0.38178,m,2c_16 +LINE204,195,205,ABC,0.83638,m,4c_.1 +LINE205,196,206,ABC,3.2475,m,2c_16 +LINE206,196,207,ABC,2.1371,m,4c_.35 +LINE207,197,208,ABC,4.9541,m,2c_16 +LINE208,198,209,ABC,0.16008,m,2c_16 +LINE209,199,210,ABC,0.44838,m,2c_.007 +LINE210,200,211,ABC,0.63785,m,2c_16 +LINE211,202,212,ABC,0.15526,m,4c_.35 +LINE212,203,213,ABC,0.27987,m,2c_16 +LINE213,204,214,ABC,0.2674,m,2c_16 +LINE214,205,215,ABC,1.5434,m,4c_.1 +LINE215,206,216,ABC,10.6295,m,2c_16 +LINE216,207,217,ABC,3.8571,m,4c_.35 +LINE217,209,218,ABC,0.1291,m,2c_16 +LINE218,210,219,ABC,0.67215,m,2c_.007 +LINE219,211,220,ABC,1.7419,m,2c_16 +LINE220,212,221,ABC,0.17006,m,4c_.35 +LINE221,213,222,ABC,0.59169,m,2c_16 +LINE222,214,223,ABC,0.51437,m,2c_16 +LINE223,215,224,ABC,1.3456,m,4c_.1 +LINE224,216,225,ABC,4.5822,m,2c_16 +LINE225,217,226,ABC,1.3772,m,4c_.35 +LINE226,218,227,ABC,0.10317,m,2c_16 +LINE227,220,228,ABC,0.14852,m,2c_16 +LINE228,221,229,ABC,0.23273,m,4c_.35 +LINE229,222,230,ABC,0.46597,m,2c_16 +LINE230,223,231,ABC,0.25602,m,2c_16 +LINE231,224,232,ABC,0.91534,m,4c_.1 +LINE232,226,233,ABC,11.8949,m,2c_16 +LINE233,226,234,ABC,1.1273,m,4c_.35 +LINE234,227,235,ABC,0.15749,m,2c_16 +LINE235,228,236,ABC,0.0686,m,2c_16 +LINE236,229,237,ABC,0.20742,m,4c_.35 +LINE237,230,238,ABC,0.32322,m,2c_16 +LINE238,231,239,ABC,0.18179,m,2c_16 +LINE239,232,240,ABC,0.6013,m,4c_.1 +LINE240,233,241,ABC,1.7274,m,2c_16 +LINE241,235,242,ABC,0.18461,m,2c_16 +LINE242,236,243,ABC,0.073376,m,2c_16 +LINE243,237,244,ABC,0.16881,m,4c_.35 +LINE244,238,245,ABC,0.32245,m,2c_16 +LINE245,239,246,ABC,2.0796,m,2c_16 +LINE246,240,247,ABC,1.2941,m,4c_.1 +LINE247,241,248,ABC,5.3022,m,2c_16 +LINE248,241,249,ABC,5.3022,m,2c_16 +LINE249,242,250,ABC,0.28355,m,2c_16 +LINE250,243,251,ABC,0.070114,m,2c_16 +LINE251,244,252,ABC,0.13297,m,4c_.35 +LINE252,245,253,ABC,0.47173,m,2c_16 +LINE253,246,254,ABC,0.61324,m,2c_16 +LINE254,247,255,ABC,4.5618,m,2c_16 +LINE255,247,256,ABC,0.85678,m,4c_.1 +LINE256,250,257,ABC,1.0376,m,2c_16 +LINE257,251,258,ABC,0.07811,m,2c_16 +LINE258,252,259,ABC,0.17323,m,4c_.35 +LINE259,253,260,ABC,1.7742,m,2c_16 +LINE260,254,261,ABC,0.1372,m,2c_16 +LINE261,255,262,ABC,0.6306,m,2c_16 +LINE262,256,263,ABC,3.2128,m,4c_.1 +LINE263,257,264,ABC,5.05,m,2c_16 +LINE264,258,265,ABC,0.16123,m,2c_16 +LINE265,259,266,ABC,0.19436,m,4c_.35 +LINE266,260,267,ABC,0.4141,m,2c_16 +LINE267,261,268,ABC,3.4578,m,2c_16 +LINE268,261,269,ABC,0.11871,m,2c_16 +LINE269,262,270,ABC,0.28991,m,2c_16 +LINE270,263,271,ABC,4.2547,m,2c_16 +LINE271,263,272,ABC,1.0792,m,4c_.1 +LINE272,265,273,ABC,0.16792,m,2c_16 +LINE273,266,274,ABC,0.17888,m,4c_.35 +LINE274,267,275,ABC,0.18971,m,2c_16 +LINE275,268,276,ABC,3.4268,m,2c_16 +LINE276,269,277,ABC,0.13918,m,2c_16 +LINE277,270,278,ABC,0.34433,m,2c_16 +LINE278,271,279,ABC,0.30927,m,2c_16 +LINE279,272,280,ABC,3.9121,m,4c_.1 +LINE280,273,281,ABC,0.63854,m,2c_16 +LINE281,274,282,ABC,0.60542,m,4c_.35 +LINE282,275,283,ABC,0.12472,m,2c_16 +LINE283,277,284,ABC,0.12578,m,2c_16 +LINE284,278,285,ABC,0.53126,m,2c_16 +LINE285,279,286,ABC,0.25491,m,2c_16 +LINE286,280,287,ABC,1.7542,m,4c_.06 +LINE287,280,288,ABC,0.91306,m,4c_.1 +LINE288,281,289,ABC,3.3901,m,2c_16 +LINE289,282,290,ABC,0.81044,m,4c_.35 +LINE290,283,291,ABC,0.87618,m,2c_16 +LINE291,283,292,ABC,0.10807,m,2c_16 +LINE292,284,293,ABC,0.12739,m,2c_16 +LINE293,285,294,ABC,0.47339,m,2c_16 +LINE294,286,295,ABC,0.36208,m,2c_16 +LINE295,287,296,ABC,0.80742,m,4c_.06 +LINE296,288,297,ABC,3.8266,m,4c_.1 +LINE297,291,298,ABC,0.40248,m,2c_16 +LINE298,292,299,ABC,0.076485,m,2c_16 +LINE299,293,300,ABC,0.13697,m,2c_16 +LINE300,294,301,ABC,0.36805,m,2c_16 +LINE301,295,302,ABC,1.6263,m,2c_16 +LINE302,296,303,ABC,5.2746,m,4c_.06 +LINE303,297,304,ABC,0.84468,m,4c_.1 +LINE304,298,305,ABC,0.68119,m,2c_16 +LINE305,299,306,ABC,0.089006,m,2c_16 +LINE306,300,307,ABC,0.79435,m,2c_16 +LINE307,301,308,ABC,0.45813,m,2c_16 +LINE308,302,309,ABC,0.31308,m,2c_16 +LINE309,303,310,ABC,0.39397,m,4c_.06 +LINE310,304,311,ABC,0.28067,m,4c_.1 +LINE311,305,312,ABC,1.3075,m,2c_16 +LINE312,306,313,ABC,0.17024,m,2c_16 +LINE313,307,314,ABC,3.3598,m,2c_16 +LINE314,308,315,ABC,0.47384,m,2c_16 +LINE315,309,316,ABC,0.23181,m,2c_16 +LINE316,310,317,ABC,0.64903,m,2c_16 +LINE317,310,318,ABC,7.2163,m,4c_.06 +LINE318,311,319,ABC,0.14649,m,4c_.1 +LINE319,312,320,ABC,3.8495,m,2c_16 +LINE320,313,321,ABC,0.6529,m,2c_16 +LINE321,315,322,ABC,0.55892,m,2c_16 +LINE322,316,323,ABC,0.26702,m,2c_16 +LINE323,317,324,ABC,3.3427,m,2c_16 +LINE324,318,325,ABC,3.4631,m,4c_.06 +LINE325,319,326,ABC,0.1254,m,4c_.1 +LINE326,321,327,ABC,2.2281,m,2c_16 +LINE327,322,328,ABC,0.31851,m,2c_16 +LINE328,323,329,ABC,0.26488,m,2c_16 +LINE329,324,330,ABC,1.167,m,2c_16 +LINE330,325,331,ABC,9.1332,m,2c_16 +LINE331,325,332,ABC,6.6729,m,4c_.06 +LINE332,326,333,ABC,0.14262,m,4c_.1 +LINE333,328,334,ABC,1.4389,m,2c_16 +LINE334,329,335,ABC,2.327,m,2c_16 +LINE335,330,336,ABC,2.5399,m,2c_16 +LINE336,331,337,ABC,3.6172,m,2c_16 +LINE337,332,338,ABC,6.8067,m,2c_16 +LINE338,332,339,ABC,1.2129,m,4c_.06 +LINE339,333,340,ABC,0.11236,m,4c_.1 +LINE340,334,341,ABC,0.55999,m,2c_16 +LINE341,335,342,ABC,4.7567,m,2c_16 +LINE342,336,343,ABC,2.082,m,2c_16 +LINE343,336,344,ABC,0.9796,m,2c_16 +LINE344,338,345,ABC,3.4221,m,2c_16 +LINE345,339,346,ABC,1.0391,m,4c_.06 +LINE346,340,347,ABC,0.094202,m,4c_.1 +LINE347,341,348,ABC,0.19454,m,2c_16 +LINE348,343,349,ABC,3.1153,m,2c_16 +LINE349,344,350,ABC,0.1364,m,2c_16 +LINE350,345,351,ABC,0.31846,m,2c_16 +LINE351,346,352,ABC,0.73091,m,4c_.06 +LINE352,347,353,ABC,0.085,m,4c_.1 +LINE353,348,354,ABC,0.14656,m,2c_16 +LINE354,350,355,ABC,0.14814,m,2c_16 +LINE355,351,356,ABC,0.13152,m,2c_16 +LINE356,352,357,ABC,0.92352,m,4c_.06 +LINE357,353,358,ABC,0.070349,m,4c_.1 +LINE358,354,359,ABC,0.10723,m,2c_16 +LINE359,355,360,ABC,0.12976,m,2c_16 +LINE360,356,361,ABC,0.092801,m,2c_16 +LINE361,357,362,ABC,0.57867,m,4c_.06 +LINE362,358,363,ABC,0.081609,m,4c_.1 +LINE363,359,364,ABC,0.054452,m,2c_16 +LINE364,360,365,ABC,0.13787,m,2c_16 +LINE365,361,366,ABC,0.094921,m,2c_16 +LINE366,362,367,ABC,0.88861,m,4c_.06 +LINE367,363,368,ABC,0.089694,m,4c_.1 +LINE368,364,369,ABC,0.080056,m,2c_16 +LINE369,365,370,ABC,0.19677,m,2c_16 +LINE370,366,371,ABC,0.112,m,2c_16 +LINE371,367,372,ABC,0.88584,m,4c_.06 +LINE372,368,373,ABC,0.48898,m,4c_.1 +LINE373,369,374,ABC,0.1342,m,2c_16 +LINE374,370,375,ABC,0.23921,m,2c_16 +LINE375,371,376,ABC,0.14128,m,2c_16 +LINE376,372,377,ABC,0.99394,m,4c_.06 +LINE377,373,378,ABC,3.6848,m,4c_.1 +LINE378,373,379,ABC,1.4115,m,2c_16 +LINE379,374,380,ABC,0.59859,m,2c_16 +LINE380,375,381,ABC,1.4827,m,2c_16 +LINE381,376,382,ABC,0.12653,m,2c_16 +LINE382,377,383,ABC,0.71925,m,4c_.06 +LINE383,378,384,ABC,3.5292,m,4c_.1 +LINE384,379,385,ABC,8.6668,m,2c_16 +LINE385,379,386,ABC,1.4561,m,2c_16 +LINE386,380,387,ABC,2.2004,m,2c_16 +LINE387,381,388,ABC,5.0734,m,2c_16 +LINE388,382,389,ABC,0.10012,m,2c_16 +LINE389,383,390,ABC,0.85728,m,4c_.06 +LINE390,384,391,ABC,0.15711,m,4c_.1 +LINE391,385,392,ABC,3.1675,m,2c_16 +LINE392,386,393,ABC,7.8335,m,2c_16 +LINE393,389,394,ABC,0.17183,m,2c_16 +LINE394,390,395,ABC,1.2439,m,4c_.06 +LINE395,391,396,ABC,4.0601,m,2c_16 +LINE396,391,397,ABC,2.8793,m,4c_.1 +LINE397,392,398,ABC,0.32241,m,2c_16 +LINE398,393,399,ABC,0.5688,m,2c_16 +LINE399,394,400,ABC,0.59984,m,2c_16 +LINE400,395,401,ABC,0.9222,m,4c_.06 +LINE401,396,402,ABC,0.37201,m,2c_16 +LINE402,397,403,ABC,1.3891,m,4c_.1 +LINE403,398,404,ABC,0.225,m,2c_16 +LINE404,399,405,ABC,0.24807,m,2c_16 +LINE405,400,406,ABC,3.6672,m,2c_16 +LINE406,401,407,ABC,0.88961,m,4c_.06 +LINE407,402,408,ABC,0.21148,m,2c_16 +LINE408,403,409,ABC,4.1907,m,4c_.1 +LINE409,403,410,ABC,0.3791,m,4c_.1 +LINE410,404,411,ABC,0.23308,m,2c_16 +LINE411,405,412,ABC,0.16706,m,2c_16 +LINE412,407,413,ABC,0.87066,m,4c_.06 +LINE413,408,414,ABC,0.1436,m,2c_16 +LINE414,409,415,ABC,5.9686,m,4c_.1 +LINE415,410,416,ABC,0.094921,m,4c_.1 +LINE416,411,417,ABC,0.9788,m,2c_16 +LINE417,412,418,ABC,0.27954,m,2c_16 +LINE418,413,419,ABC,1.0471,m,4c_.06 +LINE419,414,420,ABC,0.23403,m,2c_16 +LINE420,415,421,ABC,1.249,m,4c_.1 +LINE421,416,422,ABC,0.066573,m,4c_.1 +LINE422,417,423,ABC,0.239,m,2c_16 +LINE423,418,424,ABC,3.1944,m,2c_16 +LINE424,419,425,ABC,1.7537,m,4c_.06 +LINE425,419,426,ABC,1.7537,m,4c_.06 +LINE426,420,427,ABC,0.77793,m,2c_16 +LINE427,421,428,ABC,0.31923,m,4c_.1 +LINE428,422,429,ABC,0.082873,m,4c_.1 +LINE429,423,430,ABC,0.22798,m,2c_16 +LINE430,424,431,ABC,1.1331,m,2c_16 +LINE431,425,432,ABC,5.9151,m,4c_.06 +LINE432,425,433,ABC,5.9151,m,4c_.06 +LINE433,427,434,ABC,0.86608,m,2c_16 +LINE434,428,435,ABC,0.16724,m,4c_.1 +LINE435,429,436,ABC,0.071344,m,4c_.1 +LINE436,430,437,ABC,0.22674,m,2c_16 +LINE437,431,438,ABC,0.384,m,2c_16 +LINE438,432,439,ABC,8.3663,m,4c_.06 +LINE439,432,440,ABC,8.3663,m,4c_.06 +LINE440,434,441,ABC,0.48708,m,2c_16 +LINE441,435,442,ABC,0.13864,m,4c_.1 +LINE442,436,443,ABC,0.078,m,4c_.1 +LINE443,437,444,ABC,0.2601,m,2c_16 +LINE444,438,445,ABC,0.67858,m,2c_16 +LINE445,439,446,ABC,6.0033,m,4c_.06 +LINE446,439,447,ABC,6.0033,m,4c_.06 +LINE447,441,448,ABC,0.45756,m,2c_16 +LINE448,442,449,ABC,0.11236,m,4c_.1 +LINE449,443,450,ABC,0.079246,m,4c_.1 +LINE450,444,451,ABC,0.89824,m,2c_16 +LINE451,445,452,ABC,0.59366,m,2c_16 +LINE452,446,453,ABC,1.8214,m,4c_.06 +LINE453,446,454,ABC,1.8214,m,4c_.06 +LINE454,448,455,ABC,0.43655,m,2c_16 +LINE455,449,456,ABC,0.17175,m,4c_.1 +LINE456,450,457,ABC,0.054231,m,4c_.1 +LINE457,451,458,ABC,4.3773,m,2c_16 +LINE458,452,459,ABC,0.67064,m,2c_16 +LINE459,453,460,ABC,5.3905,m,4c_.06 +LINE460,453,461,ABC,5.3905,m,4c_.06 +LINE461,453,462,ABC,3.6859,m,2c_16 +LINE462,455,463,ABC,0.71675,m,2c_16 +LINE463,456,464,ABC,0.15483,m,4c_.1 +LINE464,457,465,ABC,0.040311,m,4c_.1 +LINE465,459,466,ABC,0.63421,m,2c_16 +LINE466,460,467,ABC,5.9891,m,4c_.06 +LINE467,460,468,ABC,5.9891,m,4c_.06 +LINE468,460,469,ABC,0.88292,m,4c_.06 +LINE469,462,470,ABC,0.53828,m,2c_16 +LINE470,463,471,ABC,0.49923,m,2c_16 +LINE471,464,472,ABC,0.14736,m,4c_.1 +LINE472,465,473,ABC,0.049497,m,4c_.1 +LINE473,466,474,ABC,3.201,m,2c_16 +LINE474,467,475,ABC,2.1947,m,4c_.06 +LINE475,467,476,ABC,2.1947,m,4c_.06 +LINE476,470,477,ABC,0.29351,m,2c_16 +LINE477,471,478,ABC,0.35077,m,2c_16 +LINE478,472,479,ABC,0.16601,m,4c_.1 +LINE479,473,480,ABC,0.063953,m,4c_.1 +LINE480,474,481,ABC,0.18984,m,2c_16 +LINE481,475,482,ABC,4.6432,m,4c_.06 +LINE482,475,483,ABC,4.6432,m,4c_.06 +LINE483,475,484,ABC,10.2769,m,2c_16 +LINE484,477,485,ABC,0.19883,m,2c_16 +LINE485,478,486,ABC,0.1676,m,2c_16 +LINE486,479,487,ABC,0.17536,m,4c_.1 +LINE487,480,488,ABC,0.11163,m,4c_.1 +LINE488,481,489,ABC,0.1713,m,2c_16 +LINE489,482,490,ABC,6.6548,m,4c_.06 +LINE490,482,491,ABC,6.6548,m,4c_.06 +LINE491,484,492,ABC,0.57796,m,2c_16 +LINE492,484,493,ABC,4.0726,m,2c_16 +LINE493,485,494,ABC,0.30201,m,2c_16 +LINE494,486,495,ABC,0.10617,m,2c_16 +LINE495,487,496,ABC,0.38342,m,4c_.1 +LINE496,488,497,ABC,0.13972,m,4c_.1 +LINE497,489,498,ABC,0.23283,m,2c_16 +LINE498,490,499,ABC,4.0612,m,4c_.06 +LINE499,490,500,ABC,4.0612,m,4c_.06 +LINE500,492,501,ABC,0.24429,m,2c_16 +LINE501,493,502,ABC,2.606,m,2c_16 +LINE502,494,503,ABC,0.45833,m,2c_16 +LINE503,495,504,ABC,0.071784,m,2c_16 +LINE504,496,505,ABC,8.6961,m,4c_.1 +LINE505,497,506,ABC,0.096167,m,4c_.1 +LINE506,498,507,ABC,0.30564,m,2c_16 +LINE507,499,508,ABC,0.69938,m,4c_.06 +LINE508,499,509,ABC,0.69938,m,4c_.06 +LINE509,501,510,ABC,0.14354,m,2c_16 +LINE510,503,511,ABC,0.32517,m,2c_16 +LINE511,504,512,ABC,0.10013,m,2c_16 +LINE512,505,513,ABC,5.5648,m,2c_16 +LINE513,505,514,ABC,1.3369,m,4c_.1 +LINE514,506,515,ABC,0.085492,m,4c_.1 +LINE515,508,516,ABC,1.8857,m,4c_.06 +LINE516,508,517,ABC,1.8857,m,4c_.06 +LINE517,508,518,ABC,4.7316,m,2c_16 +LINE518,510,519,ABC,0.1321,m,2c_16 +LINE519,511,520,ABC,0.22216,m,2c_16 +LINE520,512,521,ABC,0.07642,m,2c_16 +LINE521,513,522,ABC,4.9074,m,2c_16 +LINE522,514,523,ABC,0.72122,m,4c_.1 +LINE523,515,524,ABC,0.066573,m,4c_.1 +LINE524,516,525,ABC,1.3881,m,4c_.06 +LINE525,516,526,ABC,1.3881,m,4c_.06 +LINE526,518,527,ABC,2.796,m,2c_16 +LINE527,519,528,ABC,0.11769,m,2c_16 +LINE528,520,529,ABC,0.17555,m,2c_16 +LINE529,521,530,ABC,0.54535,m,2c_16 +LINE530,523,531,ABC,0.10771,m,4c_.1 +LINE531,524,532,ABC,0.060803,m,4c_.1 +LINE532,525,533,ABC,1.8899,m,4c_.06 +LINE533,525,534,ABC,1.8899,m,4c_.06 +LINE534,527,535,ABC,2.2154,m,2c_16 +LINE535,528,536,ABC,0.12209,m,2c_16 +LINE536,529,537,ABC,0.56286,m,2c_16 +LINE537,530,538,ABC,1.9227,m,2c_16 +LINE538,530,539,ABC,5.5837,m,2c_16 +LINE539,531,540,ABC,0.082219,m,4c_.1 +LINE540,532,541,ABC,0.065513,m,4c_.1 +LINE541,533,542,ABC,1.3374,m,4c_.06 +LINE542,533,543,ABC,1.3374,m,4c_.06 +LINE543,535,544,ABC,0.91542,m,2c_16 +LINE544,536,545,ABC,0.36857,m,2c_16 +LINE545,537,546,ABC,4.5527,m,2c_16 +LINE546,538,547,ABC,2.1231,m,2c_16 +LINE547,540,548,ABC,0.076896,m,4c_.1 +LINE548,541,549,ABC,0.086145,m,4c_.1 +LINE549,542,550,ABC,3.7401,m,4c_.06 +LINE550,542,551,ABC,3.7401,m,4c_.06 +LINE551,544,552,ABC,0.28804,m,2c_16 +LINE552,544,553,ABC,3.789,m,2c_16 +LINE553,545,554,ABC,0.37143,m,2c_16 +LINE554,546,555,ABC,0.22672,m,2c_16 +LINE555,547,556,ABC,5.7548,m,2c_16 +LINE556,548,557,ABC,0.082,m,4c_.1 +LINE557,549,558,ABC,0.061612,m,4c_.1 +LINE558,550,559,ABC,2.7082,m,4c_.06 +LINE559,550,560,ABC,2.7082,m,4c_.06 +LINE560,552,561,ABC,0.10599,m,2c_16 +LINE561,553,562,ABC,2.8664,m,2c_16 +LINE562,554,563,ABC,3.4705,m,2c_16 +LINE563,555,564,ABC,0.17889,m,2c_16 +LINE564,557,565,ABC,0.07256,m,4c_.1 +LINE565,558,566,ABC,0.12021,m,4c_.1 +LINE566,559,567,ABC,0.60068,m,4c_.06 +LINE567,559,568,ABC,0.60068,m,4c_.06 +LINE568,559,569,ABC,3.8482,m,2c_16 +LINE569,561,570,ABC,0.15788,m,2c_16 +LINE570,564,571,ABC,0.20224,m,2c_16 +LINE571,565,572,ABC,0.074216,m,4c_.1 +LINE572,567,573,ABC,0.14223,m,4c_.06 +LINE573,567,574,ABC,0.14223,m,4c_.06 +LINE574,569,575,ABC,0.48648,m,2c_16 +LINE575,570,576,ABC,0.095,m,2c_16 +LINE576,571,577,ABC,0.18,m,2c_16 +LINE577,572,578,ABC,0.38305,m,4c_.1 +LINE578,573,579,ABC,3.8558,m,4c_.06 +LINE579,573,580,ABC,3.8558,m,4c_.06 +LINE580,573,581,ABC,0.31979,m,4c_.06 +LINE581,575,582,ABC,0.35899,m,2c_16 +LINE582,576,583,ABC,0.11463,m,2c_16 +LINE583,577,584,ABC,0.20718,m,2c_16 +LINE584,578,585,ABC,4.7318,m,2c_16 +LINE585,578,586,ABC,0.82623,m,4c_.1 +LINE586,579,587,ABC,2.7022,m,4c_.06 +LINE587,579,588,ABC,2.7022,m,4c_.06 +LINE588,581,589,ABC,0.11628,m,4c_.06 +LINE589,582,590,ABC,0.3493,m,2c_16 +LINE590,583,591,ABC,0.10065,m,2c_16 +LINE591,584,592,ABC,0.21243,m,2c_16 +LINE592,585,593,ABC,0.27268,m,2c_16 +LINE593,586,594,ABC,3.9483,m,4c_.1 +LINE594,587,595,ABC,5.4142,m,4c_.06 +LINE595,587,596,ABC,0.64238,m,4c_.06 +LINE596,589,597,ABC,0.089275,m,4c_.06 +LINE597,590,598,ABC,3.2812,m,2c_16 +LINE598,591,599,ABC,0.65862,m,2c_16 +LINE599,592,600,ABC,0.25534,m,2c_16 +LINE600,593,601,ABC,0.13695,m,2c_16 +LINE601,594,602,ABC,9.1669,m,2c_16 +LINE602,594,603,ABC,4.6424,m,4c_.1 +LINE603,595,604,ABC,4.8283,m,4c_.06 +LINE604,595,605,ABC,4.8283,m,4c_.06 +LINE605,595,606,ABC,4.7719,m,4c_.06 +LINE606,596,607,ABC,11.6642,m,2c_16 +LINE607,596,608,ABC,11.6642,m,2c_16 +LINE608,597,609,ABC,0.11037,m,4c_.06 +LINE609,598,610,ABC,1.5271,m,2c_16 +LINE610,599,611,ABC,4.8562,m,2c_16 +LINE611,600,612,ABC,0.16008,m,2c_16 +LINE612,601,613,ABC,0.11484,m,2c_16 +LINE613,602,614,ABC,4.8374,m,2c_16 +LINE614,603,615,ABC,4.4466,m,4c_.1 +LINE615,604,616,ABC,3.9301,m,2c_.0225 +LINE616,604,617,ABC,3.1088,m,4c_.06 +LINE617,604,618,ABC,3.1088,m,4c_.06 +LINE618,607,619,ABC,2.7454,m,2c_16 +LINE619,609,620,ABC,0.06364,m,4c_.06 +LINE620,610,621,ABC,0.71673,m,2c_16 +LINE621,612,622,ABC,0.68797,m,2c_16 +LINE622,613,623,ABC,0.093648,m,2c_16 +LINE623,615,624,ABC,1.6322,m,2c_16 +LINE624,615,625,ABC,1.2511,m,4c_.1 +LINE625,616,626,ABC,5.3537,m,2c_.0225 +LINE626,620,627,ABC,0.077897,m,4c_.06 +LINE627,621,628,ABC,0.47807,m,2c_16 +LINE628,622,629,ABC,2.9004,m,2c_16 +LINE629,623,630,ABC,0.147,m,2c_16 +LINE630,624,631,ABC,0.40022,m,2c_16 +LINE631,625,632,ABC,0.28784,m,4c_.1 +LINE632,626,633,ABC,1.5703,m,2c_.0225 +LINE633,627,634,ABC,0.065299,m,4c_.06 +LINE634,628,635,ABC,0.73088,m,2c_16 +LINE635,630,636,ABC,0.35053,m,2c_16 +LINE636,631,637,ABC,0.27482,m,2c_16 +LINE637,632,638,ABC,0.14284,m,4c_.1 +LINE638,633,639,ABC,5.1974,m,2c_.0225 +LINE639,634,640,ABC,0.069123,m,4c_.06 +LINE640,635,641,ABC,1.4274,m,2c_16 +LINE641,636,642,ABC,0.24251,m,2c_16 +LINE642,637,643,ABC,0.38096,m,2c_16 +LINE643,638,644,ABC,0.15697,m,4c_.1 +LINE644,640,645,ABC,0.068593,m,4c_.06 +LINE645,641,646,ABC,0.39457,m,2c_16 +LINE646,642,647,ABC,0.30835,m,2c_16 +LINE647,643,648,ABC,0.90337,m,2c_16 +LINE648,644,649,ABC,0.18112,m,4c_.1 +LINE649,645,650,ABC,0.093984,m,4c_.06 +LINE650,646,651,ABC,0.11455,m,2c_16 +LINE651,647,652,ABC,0.18732,m,2c_16 +LINE652,648,653,ABC,0.68671,m,2c_16 +LINE653,649,654,ABC,0.1831,m,4c_.1 +LINE654,650,655,ABC,0.12394,m,4c_.06 +LINE655,651,656,ABC,0.099368,m,2c_16 +LINE656,651,657,ABC,0.52781,m,2c_16 +LINE657,652,658,ABC,0.16911,m,2c_16 +LINE658,653,659,ABC,0.48206,m,2c_16 +LINE659,654,660,ABC,0.20299,m,4c_.1 +LINE660,655,661,ABC,0.36466,m,4c_.06 +LINE661,656,662,ABC,0.093,m,2c_16 +LINE662,657,663,ABC,0.69648,m,2c_16 +LINE663,658,664,ABC,0.28521,m,2c_16 +LINE664,659,665,ABC,0.505,m,2c_16 +LINE665,660,666,ABC,0.29519,m,4c_.1 +LINE666,661,667,ABC,0.26019,m,4c_.06 +LINE667,662,668,ABC,0.095802,m,2c_16 +LINE668,663,669,ABC,2.8935,m,2c_16 +LINE669,664,670,ABC,0.2804,m,2c_16 +LINE670,665,671,ABC,0.41461,m,2c_16 +LINE671,666,672,ABC,0.4801,m,2c_16 +LINE672,666,673,ABC,0.81161,m,4c_.1 +LINE673,667,674,ABC,0.20184,m,4c_.06 +LINE674,668,675,ABC,0.69267,m,2c_16 +LINE675,669,676,ABC,1.2288,m,2c_16 +LINE676,670,677,ABC,0.13267,m,2c_16 +LINE677,671,678,ABC,0.68648,m,2c_16 +LINE678,672,679,ABC,0.2883,m,2c_16 +LINE679,673,680,ABC,5.1393,m,4c_.1 +LINE680,674,681,ABC,0.40252,m,4c_.06 +LINE681,675,682,ABC,5.0441,m,2c_16 +LINE682,677,683,ABC,0.14572,m,2c_16 +LINE683,678,684,ABC,2.2185,m,2c_16 +LINE684,679,685,ABC,0.26744,m,2c_16 +LINE685,680,686,ABC,3.6787,m,4c_.1 +LINE686,683,687,ABC,0.13986,m,2c_16 +LINE687,684,688,ABC,5.1838,m,2c_16 +LINE688,685,689,ABC,0.26095,m,2c_16 +LINE689,686,690,ABC,8.1445,m,2c_16 +LINE690,686,691,ABC,10.5254,m,4c_.1 +LINE691,687,692,ABC,0.16867,m,2c_16 +LINE692,689,693,ABC,0.19573,m,2c_16 +LINE693,690,694,ABC,0.76157,m,2c_16 +LINE694,690,695,ABC,2.1261,m,2c_16 +LINE695,691,696,ABC,9.4817,m,2c_16 +LINE696,691,697,ABC,2.1907,m,4c_.1 +LINE697,692,698,ABC,0.26905,m,2c_16 +LINE698,693,699,ABC,0.31093,m,2c_16 +LINE699,694,700,ABC,0.2383,m,2c_16 +LINE700,695,701,ABC,4.3312,m,2c_16 +LINE701,696,702,ABC,5.493,m,2c_16 +LINE702,697,703,ABC,2.4,m,4c_.06 +LINE703,698,704,ABC,0.73636,m,2c_16 +LINE704,699,705,ABC,0.52424,m,2c_16 +LINE705,700,706,ABC,0.15322,m,2c_16 +LINE706,703,707,ABC,6.3308,m,4c_.06 +LINE707,703,708,ABC,0.11132,m,4c_.06 +LINE708,704,709,ABC,0.97996,m,2c_16 +LINE709,705,710,ABC,3.9281,m,2c_16 +LINE710,706,711,ABC,0.092418,m,2c_16 +LINE711,707,712,ABC,7.5025,m,4c_.06 +LINE712,707,713,ABC,3.9448,m,2c_16 +LINE713,708,714,ABC,0.10474,m,4c_.06 +LINE714,709,715,ABC,0.093338,m,2c_16 +LINE715,710,716,ABC,3.2225,m,2c_16 +LINE716,711,717,ABC,0.093408,m,2c_16 +LINE717,712,718,ABC,7.7434,m,4c_.06 +LINE718,713,719,ABC,0.4223,m,2c_16 +LINE719,714,720,ABC,0.097,m,4c_.06 +LINE720,715,721,ABC,0.073817,m,2c_16 +LINE721,716,722,ABC,1.021,m,2c_16 +LINE722,717,723,ABC,0.083433,m,2c_16 +LINE723,718,724,ABC,3.2535,m,4c_.06 +LINE724,718,725,ABC,9.3475,m,2c_16 +LINE725,719,726,ABC,0.16124,m,2c_16 +LINE726,720,727,ABC,0.10977,m,4c_.06 +LINE727,721,728,ABC,0.071694,m,2c_16 +LINE728,722,729,ABC,0.92949,m,2c_16 +LINE729,723,730,ABC,0.094,m,2c_16 +LINE730,724,731,ABC,4.421,m,4c_.06 +LINE731,725,732,ABC,1.2539,m,2c_16 +LINE732,726,733,ABC,0.17056,m,2c_16 +LINE733,727,734,ABC,0.089889,m,4c_.06 +LINE734,728,735,ABC,0.076792,m,2c_16 +LINE735,729,736,ABC,0.50625,m,2c_16 +LINE736,730,737,ABC,0.075313,m,2c_16 +LINE737,731,738,ABC,5.1761,m,4c_.06 +LINE738,732,739,ABC,0.65877,m,2c_16 +LINE739,733,740,ABC,0.14155,m,2c_16 +LINE740,734,741,ABC,0.13761,m,4c_.06 +LINE741,735,742,ABC,0.071,m,2c_16 +LINE742,736,743,ABC,0.40432,m,2c_16 +LINE743,737,744,ABC,0.090338,m,2c_16 +LINE744,738,745,ABC,4.1562,m,4c_.06 +LINE745,739,746,ABC,3.7387,m,2c_16 +LINE746,739,747,ABC,0.12202,m,2c_16 +LINE747,740,748,ABC,0.16763,m,2c_16 +LINE748,741,749,ABC,0.16427,m,4c_.06 +LINE749,742,750,ABC,0.06691,m,2c_16 +LINE750,743,751,ABC,0.34477,m,2c_16 +LINE751,744,752,ABC,0.09735,m,2c_16 +LINE752,745,753,ABC,1.5434,m,4c_.06 +LINE753,745,754,ABC,5.9227,m,2c_16 +LINE754,746,755,ABC,3.0391,m,2c_16 +LINE755,747,756,ABC,0.088238,m,2c_16 +LINE756,748,757,ABC,0.16348,m,2c_16 +LINE757,749,758,ABC,0.12454,m,4c_.06 +LINE758,750,759,ABC,0.093059,m,2c_16 +LINE759,751,760,ABC,0.40459,m,2c_16 +LINE760,752,761,ABC,0.17761,m,2c_16 +LINE761,753,762,ABC,2.1279,m,4c_.06 +LINE762,754,763,ABC,4.9506,m,2c_16 +LINE763,756,764,ABC,0.074465,m,2c_16 +LINE764,757,765,ABC,0.22475,m,2c_16 +LINE765,758,766,ABC,0.12167,m,4c_.06 +LINE766,759,767,ABC,0.11404,m,2c_16 +LINE767,760,768,ABC,0.36969,m,2c_16 +LINE768,761,769,ABC,1.3288,m,2c_16 +LINE769,762,770,ABC,5.2347,m,4c_.06 +LINE770,763,771,ABC,3.6007,m,2c_16 +LINE771,763,772,ABC,0.13038,m,2c_16 +LINE772,764,773,ABC,0.12578,m,2c_16 +LINE773,765,774,ABC,0.30918,m,2c_16 +LINE774,766,775,ABC,0.07931,m,4c_.06 +LINE775,767,776,ABC,0.54052,m,2c_16 +LINE776,768,777,ABC,0.57353,m,2c_16 +LINE777,769,778,ABC,4.0721,m,2c_16 +LINE778,770,779,ABC,4.2428,m,4c_.06 +LINE779,771,780,ABC,3.5283,m,2c_16 +LINE780,772,781,ABC,0.12466,m,2c_16 +LINE781,773,782,ABC,0.17614,m,2c_16 +LINE782,774,783,ABC,0.3272,m,2c_16 +LINE783,775,784,ABC,0.097,m,4c_.06 +LINE784,776,785,ABC,4.6216,m,2c_16 +LINE785,777,786,ABC,1.1579,m,2c_16 +LINE786,779,787,ABC,3.3152,m,4c_.06 +LINE787,781,788,ABC,0.13439,m,2c_16 +LINE788,782,789,ABC,0.1307,m,2c_16 +LINE789,783,790,ABC,0.21735,m,2c_16 +LINE790,784,791,ABC,0.091984,m,4c_.06 +LINE791,786,792,ABC,0.34588,m,2c_16 +LINE792,786,793,ABC,2.062,m,2c_16 +LINE793,787,794,ABC,2.9963,m,4c_.06 +LINE794,788,795,ABC,0.12,m,2c_16 +LINE795,789,796,ABC,0.21651,m,2c_16 +LINE796,790,797,ABC,0.22121,m,2c_16 +LINE797,791,798,ABC,0.091706,m,4c_.06 +LINE798,792,799,ABC,0.30164,m,2c_16 +LINE799,793,800,ABC,3.2995,m,2c_16 +LINE800,794,801,ABC,0.20555,m,2c_16 +LINE801,794,802,ABC,2.8031,m,4c_95_SAC_XC +LINE802,795,803,ABC,0.13252,m,2c_16 +LINE803,796,804,ABC,1.5028,m,2c_16 +LINE804,797,805,ABC,0.10577,m,2c_16 +LINE805,798,806,ABC,0.12311,m,4c_.06 +LINE806,799,807,ABC,0.24947,m,2c_16 +LINE807,800,808,ABC,2.8191,m,2c_16 +LINE808,801,809,ABC,0.20609,m,2c_16 +LINE809,802,810,ABC,3.0749,m,4c_.06 +LINE810,802,811,ABC,3.0749,m,4c_.06 +LINE811,803,812,ABC,0.08544,m,2c_16 +LINE812,804,813,ABC,3.3195,m,2c_16 +LINE813,805,814,ABC,0.16824,m,2c_16 +LINE814,806,815,ABC,0.42086,m,4c_.06 +LINE815,807,816,ABC,0.194,m,2c_16 +LINE816,808,817,ABC,1.5955,m,2c_16 +LINE817,809,818,ABC,0.20649,m,2c_16 +LINE818,810,819,ABC,2.5782,m,4c_.06 +LINE819,810,820,ABC,2.5782,m,4c_.06 +LINE820,812,821,ABC,0.13123,m,2c_16 +LINE821,814,822,ABC,0.15794,m,2c_16 +LINE822,815,823,ABC,0.48651,m,4c_.06 +LINE823,816,824,ABC,0.19731,m,2c_16 +LINE824,818,825,ABC,0.20524,m,2c_16 +LINE825,819,826,ABC,2.7715,m,4c_.06 +LINE826,819,827,ABC,2.7715,m,4c_.06 +LINE827,821,828,ABC,1.0794,m,2c_16 +LINE828,822,829,ABC,0.22567,m,2c_16 +LINE829,823,830,ABC,0.49659,m,4c_.06 +LINE830,824,831,ABC,0.17123,m,2c_16 +LINE831,825,832,ABC,0.20602,m,2c_16 +LINE832,826,833,ABC,2.2755,m,4c_.06 +LINE833,826,834,ABC,2.2755,m,4c_.06 +LINE834,828,835,ABC,3.7201,m,2c_16 +LINE835,829,836,ABC,2.3821,m,2c_16 +LINE836,831,837,ABC,0.12298,m,2c_16 +LINE837,832,838,ABC,0.20588,m,2c_16 +LINE838,833,839,ABC,2.443,m,4c_.06 +LINE839,833,840,ABC,2.443,m,4c_.06 +LINE840,836,841,ABC,0.95278,m,2c_16 +LINE841,837,842,ABC,0.14278,m,2c_16 +LINE842,838,843,ABC,0.20601,m,2c_16 +LINE843,839,844,ABC,4.8092,m,2c_.0225 +LINE844,839,845,ABC,3.6212,m,4c_.06 +LINE845,839,846,ABC,3.6212,m,4c_.06 +LINE846,841,847,ABC,0.48382,m,2c_16 +LINE847,842,848,ABC,0.2151,m,2c_16 +LINE848,843,849,ABC,0.10056,m,2c_16 +LINE849,844,850,ABC,0.7036,m,2c_.0225 +LINE850,845,851,ABC,4.364,m,4c_.06 +LINE851,845,852,ABC,4.364,m,4c_.06 +LINE852,847,853,ABC,0.10706,m,2c_16 +LINE853,848,854,ABC,0.35143,m,2c_16 +LINE854,849,855,ABC,2.2601,m,2c_16 +LINE855,850,856,ABC,1.9822,m,2c_.0225 +LINE856,851,857,ABC,6.8621,m,4c_.06 +LINE857,851,858,ABC,6.8621,m,4c_.06 +LINE858,853,859,ABC,0.084315,m,2c_16 +LINE859,854,860,ABC,2.82,m,2c_16 +LINE860,854,861,ABC,7.5091,m,2c_16 +LINE861,855,862,ABC,1.4697,m,2c_16 +LINE862,856,863,ABC,2.3276,m,2c_.0225 +LINE863,857,864,ABC,2.7888,m,4c_.06 +LINE864,857,865,ABC,2.7888,m,4c_.06 +LINE865,859,866,ABC,0.090338,m,2c_16 +LINE866,862,867,ABC,1.2854,m,2c_16 +LINE867,863,868,ABC,0.30194,m,2c_.0225 +LINE868,864,869,ABC,1.7373,m,4c_.06 +LINE869,864,870,ABC,1.7373,m,4c_.06 +LINE870,866,871,ABC,0.072277,m,2c_16 +LINE871,867,872,ABC,1.3483,m,2c_16 +LINE872,868,873,ABC,0.37952,m,2c_.0225 +LINE873,868,874,ABC,0.84439,m,2c_.0225 +LINE874,869,875,ABC,1.2,m,4c_.06 +LINE875,869,876,ABC,1.2,m,4c_.06 +LINE876,871,877,ABC,0.070178,m,2c_16 +LINE877,872,878,ABC,2.3022,m,2c_16 +LINE878,873,879,ABC,0.35118,m,2c_.0225 +LINE879,874,880,ABC,1.9761,m,2c_.0225 +LINE880,875,881,ABC,1.0112,m,4c_.06 +LINE881,875,882,ABC,1.0112,m,4c_.06 +LINE882,877,883,ABC,0.07,m,2c_16 +LINE883,878,884,ABC,0.56468,m,2c_16 +LINE884,879,885,ABC,0.534,m,2c_.0225 +LINE885,880,886,ABC,4.6879,m,2c_.0225 +LINE886,883,887,ABC,0.069181,m,2c_16 +LINE887,884,888,ABC,0.62293,m,2c_16 +LINE888,884,889,ABC,3.1574,m,35_SAC_XSC +LINE889,885,890,ABC,0.67483,m,2c_.0225 +LINE890,887,891,ABC,1.2371,m,2c_16 +LINE891,888,892,ABC,1.0228,m,2c_16 +LINE892,889,893,ABC,2.6779,m,35_SAC_XSC +LINE893,890,894,ABC,2.6271,m,2c_.0225 +LINE894,891,895,ABC,5.8249,m,2c_16 +LINE895,891,896,ABC,3.2587,m,2c_16 +LINE896,892,897,ABC,0.20223,m,2c_16 +LINE897,893,898,ABC,4.501,m,35_SAC_XSC +LINE898,894,899,ABC,4.7723,m,2c_.0225 +LINE899,895,900,ABC,3.8684,m,2c_16 +LINE900,897,901,ABC,0.17088,m,2c_16 +LINE901,901,902,ABC,0.144,m,2c_16 +LINE902,902,903,ABC,0.18732,m,2c_16 +LINE903,903,904,ABC,0.33902,m,2c_16 +LINE904,904,905,ABC,0.5878,m,2c_16 +LINE905,905,906,ABC,4.8147,m,2c_16 diff --git a/src/test/resources/lvFeeder/LoadShapes.csv b/src/test/resources/lvFeeder/LoadShapes.csv new file mode 100644 index 0000000000..a0841dec34 --- /dev/null +++ b/src/test/resources/lvFeeder/LoadShapes.csv @@ -0,0 +1,57 @@ +# Load Shapes,,,, +Name,npts,minterval,File,useactual +Shape_1,1440,1,Load_profile_1.csv,TRUE +Shape_2,1440,1,Load_profile_2.csv,TRUE +Shape_3,1440,1,Load_profile_3.csv,TRUE +Shape_4,1440,1,Load_profile_4.csv,TRUE +Shape_5,1440,1,Load_profile_5.csv,TRUE +Shape_6,1440,1,Load_profile_6.csv,TRUE +Shape_7,1440,1,Load_profile_7.csv,TRUE +Shape_8,1440,1,Load_profile_8.csv,TRUE +Shape_9,1440,1,Load_profile_9.csv,TRUE +Shape_10,1440,1,Load_profile_10.csv,TRUE +Shape_11,1440,1,Load_profile_11.csv,TRUE +Shape_12,1440,1,Load_profile_12.csv,TRUE +Shape_13,1440,1,Load_profile_13.csv,TRUE +Shape_14,1440,1,Load_profile_14.csv,TRUE +Shape_15,1440,1,Load_profile_15.csv,TRUE +Shape_16,1440,1,Load_profile_16.csv,TRUE +Shape_17,1440,1,Load_profile_17.csv,TRUE +Shape_18,1440,1,Load_profile_18.csv,TRUE +Shape_19,1440,1,Load_profile_19.csv,TRUE +Shape_20,1440,1,Load_profile_20.csv,TRUE +Shape_21,1440,1,Load_profile_21.csv,TRUE +Shape_22,1440,1,Load_profile_22.csv,TRUE +Shape_23,1440,1,Load_profile_23.csv,TRUE +Shape_24,1440,1,Load_profile_24.csv,TRUE +Shape_25,1440,1,Load_profile_25.csv,TRUE +Shape_26,1440,1,Load_profile_26.csv,TRUE +Shape_27,1440,1,Load_profile_27.csv,TRUE +Shape_28,1440,1,Load_profile_28.csv,TRUE +Shape_29,1440,1,Load_profile_29.csv,TRUE +Shape_30,1440,1,Load_profile_30.csv,TRUE +Shape_31,1440,1,Load_profile_31.csv,TRUE +Shape_32,1440,1,Load_profile_32.csv,TRUE +Shape_33,1440,1,Load_profile_33.csv,TRUE +Shape_34,1440,1,Load_profile_34.csv,TRUE +Shape_35,1440,1,Load_profile_35.csv,TRUE +Shape_36,1440,1,Load_profile_36.csv,TRUE +Shape_37,1440,1,Load_profile_37.csv,TRUE +Shape_38,1440,1,Load_profile_38.csv,TRUE +Shape_39,1440,1,Load_profile_39.csv,TRUE +Shape_40,1440,1,Load_profile_40.csv,TRUE +Shape_41,1440,1,Load_profile_41.csv,TRUE +Shape_42,1440,1,Load_profile_42.csv,TRUE +Shape_43,1440,1,Load_profile_43.csv,TRUE +Shape_44,1440,1,Load_profile_44.csv,TRUE +Shape_45,1440,1,Load_profile_45.csv,TRUE +Shape_46,1440,1,Load_profile_46.csv,TRUE +Shape_47,1440,1,Load_profile_47.csv,TRUE +Shape_48,1440,1,Load_profile_48.csv,TRUE +Shape_49,1440,1,Load_profile_49.csv,TRUE +Shape_50,1440,1,Load_profile_50.csv,TRUE +Shape_51,1440,1,Load_profile_51.csv,TRUE +Shape_52,1440,1,Load_profile_52.csv,TRUE +Shape_53,1440,1,Load_profile_53.csv,TRUE +Shape_54,1440,1,Load_profile_54.csv,TRUE +Shape_55,1440,1,Load_profile_55.csv,TRUE diff --git a/src/test/resources/lvFeeder/Loads.csv b/src/test/resources/lvFeeder/Loads.csv new file mode 100644 index 0000000000..256565141f --- /dev/null +++ b/src/test/resources/lvFeeder/Loads.csv @@ -0,0 +1,58 @@ +# Loads ,,,,,,,,, +# Model 1 is constant PQ,,,,,,,,, +Name,numPhases,Bus,phases,kV,Model,Connection,kW,PF,Yearly +LOAD1,1,34,A,0.23,1,wye,1,0.95,Shape_1 +LOAD2,1,47,B,0.23,1,wye,1,0.95,Shape_2 +LOAD3,1,70,A,0.23,1,wye,1,0.95,Shape_3 +LOAD4,1,73,A,0.23,1,wye,1,0.95,Shape_4 +LOAD5,1,74,A,0.23,1,wye,1,0.95,Shape_5 +LOAD6,1,83,B,0.23,1,wye,1,0.95,Shape_6 +LOAD7,1,178,B,0.23,1,wye,1,0.95,Shape_7 +LOAD8,1,208,C,0.23,1,wye,1,0.95,Shape_8 +LOAD9,1,225,A,0.23,1,wye,1,0.95,Shape_9 +LOAD10,1,248,B,0.23,1,wye,1,0.95,Shape_10 +LOAD11,1,249,B,0.23,1,wye,1,0.95,Shape_11 +LOAD12,1,264,C,0.23,1,wye,1,0.95,Shape_12 +LOAD13,1,276,B,0.23,1,wye,1,0.95,Shape_13 +LOAD14,1,289,A,0.23,1,wye,1,0.95,Shape_14 +LOAD15,1,314,B,0.23,1,wye,1,0.95,Shape_15 +LOAD16,1,320,C,0.23,1,wye,1,0.95,Shape_16 +LOAD17,1,327,C,0.23,1,wye,1,0.95,Shape_17 +LOAD18,1,337,C,0.23,1,wye,1,0.95,Shape_18 +LOAD19,1,342,C,0.23,1,wye,1,0.95,Shape_19 +LOAD20,1,349,A,0.23,1,wye,1,0.95,Shape_20 +LOAD21,1,387,A,0.23,1,wye,1,0.95,Shape_21 +LOAD22,1,388,A,0.23,1,wye,1,0.95,Shape_22 +LOAD23,1,406,B,0.23,1,wye,1,0.95,Shape_23 +LOAD24,1,458,C,0.23,1,wye,1,0.95,Shape_24 +LOAD25,1,502,A,0.23,1,wye,1,0.95,Shape_25 +LOAD26,1,522,B,0.23,1,wye,1,0.95,Shape_26 +LOAD27,1,539,C,0.23,1,wye,1,0.95,Shape_27 +LOAD28,1,556,C,0.23,1,wye,1,0.95,Shape_28 +LOAD29,1,562,A,0.23,1,wye,1,0.95,Shape_29 +LOAD30,1,563,A,0.23,1,wye,1,0.95,Shape_30 +LOAD31,1,611,A,0.23,1,wye,1,0.95,Shape_31 +LOAD32,1,614,C,0.23,1,wye,1,0.95,Shape_32 +LOAD33,1,619,C,0.23,1,wye,1,0.95,Shape_33 +LOAD34,1,629,A,0.23,1,wye,1,0.95,Shape_34 +LOAD35,1,639,B,0.23,1,wye,1,0.95,Shape_35 +LOAD36,1,676,B,0.23,1,wye,1,0.95,Shape_36 +LOAD37,1,682,B,0.23,1,wye,1,0.95,Shape_37 +LOAD38,1,688,B,0.23,1,wye,1,0.95,Shape_38 +LOAD39,1,701,C,0.23,1,wye,1,0.95,Shape_39 +LOAD40,1,702,B,0.23,1,wye,1,0.95,Shape_40 +LOAD41,1,755,B,0.23,1,wye,1,0.95,Shape_41 +LOAD42,1,778,C,0.23,1,wye,1,0.95,Shape_42 +LOAD43,1,780,C,0.23,1,wye,1,0.95,Shape_43 +LOAD44,1,785,B,0.23,1,wye,1,0.95,Shape_44 +LOAD45,1,813,B,0.23,1,wye,1,0.95,Shape_45 +LOAD46,1,817,A,0.23,1,wye,1,0.95,Shape_46 +LOAD47,1,835,C,0.23,1,wye,1,0.95,Shape_47 +LOAD48,1,860,A,0.23,1,wye,1,0.95,Shape_48 +LOAD49,1,861,A,0.23,1,wye,1,0.95,Shape_49 +LOAD50,1,886,B,0.23,1,wye,1,0.95,Shape_50 +LOAD51,1,896,A,0.23,1,wye,1,0.95,Shape_51 +LOAD52,1,898,A,0.23,1,wye,1,0.95,Shape_52 +LOAD53,1,899,B,0.23,1,wye,1,0.95,Shape_53 +LOAD54,1,900,A,0.23,1,wye,1,0.95,Shape_54 +LOAD55,1,906,A,0.23,1,wye,1,0.95,Shape_55 diff --git a/src/test/resources/lvFeeder/Source.csv b/src/test/resources/lvFeeder/Source.csv new file mode 100644 index 0000000000..ca83982600 --- /dev/null +++ b/src/test/resources/lvFeeder/Source.csv @@ -0,0 +1,6 @@ +# Source impedance +[Source] +Voltage=11 kV +pu=1.05 +ISC3=3000 A +ISC1=5 A diff --git a/src/test/resources/lvFeeder/Transformer.csv b/src/test/resources/lvFeeder/Transformer.csv new file mode 100644 index 0000000000..2e34814d1a --- /dev/null +++ b/src/test/resources/lvFeeder/Transformer.csv @@ -0,0 +1,3 @@ +# Substation transformer connected Delta/grounded-wye,,,,,,,,,, +Name, phases, bus1, bus2, kV_pri, kV_sec, MVA, Conn_pri, Conn_sec, %XHL,% resistance +TR1,3,SourceBus,1,11,0.416,0.8, Delta, Wye,4,0.4 From e8df69d03d74d8848020a1fc18deb18cce4de567 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 018/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 9d51c1273c7e5a1aee884850b5b7ce6214dab694 Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 019/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 652a4a68cf13efd0b2df912292a67b83c8a2b2cd Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 020/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +++++++------------ .../network/util/AsymLvFeederParser.java | 6 +++ .../util/AsymIeeeFeederParserTest.java | 6 ++- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From 2d2e2478a77627d7dfdc789dc9a3a57b00d1d1ce Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 021/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 39f7209fc43d388d103cb7c1fe2c47fea615adfe Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 022/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 962c0ca0f77e2524b9839a6800f882cb6eba8fe8 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 023/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +-- .../network/util/AsymLvFeederParser.java | 6 + .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++----------- .../util/AsymIeeeFeederParserTest.java | 6 +- 4 files changed, 127 insertions(+), 188 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index 2c6edd1e9b..b960dba8a4 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,7 +18,9 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -88,14 +90,6 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -108,19 +102,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Power.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -133,19 +123,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Impedant.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -158,6 +144,10 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Current.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -271,6 +261,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load802.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -325,14 +318,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -345,6 +330,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load808.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -471,14 +460,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -491,6 +472,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load816.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -524,14 +509,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -544,6 +521,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load818.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -577,14 +558,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -597,6 +570,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load820.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -654,14 +631,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -674,6 +643,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load824.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -731,14 +704,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -751,6 +716,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load828.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -782,14 +751,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -802,6 +763,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load830.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -833,14 +798,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -853,6 +810,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load854.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -933,14 +894,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -953,6 +906,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load832.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible + .add(); + // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -1003,14 +960,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -1023,6 +972,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load890.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1054,14 +1007,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1074,6 +1019,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load858.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1131,14 +1080,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1151,6 +1092,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load834.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1181,14 +1126,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1201,6 +1138,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load842.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1232,14 +1172,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1252,6 +1184,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1269,6 +1205,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + distrload844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1300,14 +1240,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1320,6 +1252,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load846.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1362,6 +1298,10 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); + + load848.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1424,6 +1364,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1441,6 +1385,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + distriload860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1472,14 +1420,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1492,6 +1432,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load836.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1523,14 +1467,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1543,6 +1479,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load840.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1586,6 +1526,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load862.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From df45c4fa174be704284a242b4f6f0dfe8fc26094 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 024/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 6a1d489b503593eea747404fa07f00227d46b4f9 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 025/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From 816a5acabaabdda9c5f5adf1664fbb3d03ac8b8e Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 026/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 9561a582f3815ce4c8134ca7f78b0716e245dd9f Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 027/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From b108cf0e520a1f7276a576853db7fe2a1d02fe16 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 028/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +++++++------------ .../network/util/AsymLvFeederParser.java | 6 +++ .../util/AsymIeeeFeederParserTest.java | 6 ++- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From e4654311496a3b79e23c3fdb1099e33e8d8842da Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 029/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 120835e9b697e18c7ea31ea85f2ac87838327782 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 030/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++++++------- 1 file changed, 160 insertions(+), 104 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index b960dba8a4..2c6edd1e9b 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,9 +18,7 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -90,6 +88,14 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -102,15 +108,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Power.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -123,15 +133,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Impedant.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -144,10 +158,6 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Current.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -261,9 +271,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load802.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -318,6 +325,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -330,10 +345,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load808.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -460,6 +471,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -472,10 +491,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load816.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -509,6 +524,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -521,10 +544,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load818.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -558,6 +577,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -570,10 +597,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load820.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -631,6 +654,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -643,10 +674,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load824.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -704,6 +731,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -716,10 +751,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load828.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -751,6 +782,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -763,10 +802,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load830.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -798,6 +833,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -810,10 +853,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load854.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -894,6 +933,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -906,10 +953,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load832.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible - .add(); - // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -960,6 +1003,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -972,10 +1023,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load890.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1007,6 +1054,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1019,10 +1074,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load858.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1080,6 +1131,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1092,10 +1151,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load834.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1126,6 +1181,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1138,9 +1201,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load842.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1172,6 +1232,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1184,10 +1252,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1205,10 +1269,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - distrload844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1240,6 +1300,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1252,10 +1320,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load846.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1298,10 +1362,6 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); - - load848.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1364,10 +1424,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1385,10 +1441,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - distriload860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1420,6 +1472,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1432,10 +1492,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load836.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1467,6 +1523,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1479,10 +1543,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load840.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1526,10 +1586,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load862.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") From 6236196f6f30ade7353f28b792a7f1435b692e03 Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 031/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 7bc8799b644249db0761ec2124ef077e49fe2196 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 032/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +++++++------------ .../network/util/AsymLvFeederParser.java | 6 +++ .../util/AsymIeeeFeederParserTest.java | 6 ++- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From a1c18d32abff8bf955cdb5f59e8a232b65080771 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 033/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From e53411f435cd2cb2e1af10bd865e16be40f2d72a Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 034/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 480670e464c7cbda40421f50f7a016a338910c7a Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 035/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +-- .../network/util/AsymLvFeederParser.java | 6 + .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++----------- .../util/AsymIeeeFeederParserTest.java | 6 +- 4 files changed, 127 insertions(+), 188 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index 2c6edd1e9b..b960dba8a4 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,7 +18,9 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -88,14 +90,6 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -108,19 +102,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Power.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -133,19 +123,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Impedant.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -158,6 +144,10 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Current.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -271,6 +261,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load802.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -325,14 +318,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -345,6 +330,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load808.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -471,14 +460,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -491,6 +472,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load816.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -524,14 +509,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -544,6 +521,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load818.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -577,14 +558,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -597,6 +570,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load820.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -654,14 +631,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -674,6 +643,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load824.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -731,14 +704,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -751,6 +716,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load828.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -782,14 +751,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -802,6 +763,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load830.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -833,14 +798,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -853,6 +810,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load854.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -933,14 +894,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -953,6 +906,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load832.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible + .add(); + // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -1003,14 +960,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -1023,6 +972,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load890.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1054,14 +1007,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1074,6 +1019,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load858.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1131,14 +1080,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1151,6 +1092,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load834.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1181,14 +1126,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1201,6 +1138,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load842.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1232,14 +1172,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1252,6 +1184,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1269,6 +1205,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + distrload844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1300,14 +1240,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1320,6 +1252,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load846.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1362,6 +1298,10 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); + + load848.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1424,6 +1364,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1441,6 +1385,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + distriload860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1472,14 +1420,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1492,6 +1432,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load836.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1523,14 +1467,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1543,6 +1479,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load840.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1586,6 +1526,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load862.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From 49f0009a7e5962b9f5cb408790451af7ecbe5230 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 036/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 1779a26546f835b6fe33bbeded2e61328442d032 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 037/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++++++------- .../util/AsymIeeeFeederParserTest.java | 6 +- 2 files changed, 164 insertions(+), 106 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index b960dba8a4..2c6edd1e9b 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,9 +18,7 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -90,6 +88,14 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -102,15 +108,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Power.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -123,15 +133,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Impedant.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -144,10 +158,6 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Current.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -261,9 +271,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load802.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -318,6 +325,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -330,10 +345,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load808.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -460,6 +471,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -472,10 +491,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load816.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -509,6 +524,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -521,10 +544,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load818.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -558,6 +577,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -570,10 +597,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load820.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -631,6 +654,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -643,10 +674,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load824.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -704,6 +731,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -716,10 +751,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load828.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -751,6 +782,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -763,10 +802,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load830.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -798,6 +833,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -810,10 +853,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load854.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -894,6 +933,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -906,10 +953,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load832.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible - .add(); - // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -960,6 +1003,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -972,10 +1023,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load890.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1007,6 +1054,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1019,10 +1074,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load858.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1080,6 +1131,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1092,10 +1151,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load834.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1126,6 +1181,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1138,9 +1201,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load842.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1172,6 +1232,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1184,10 +1252,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1205,10 +1269,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - distrload844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1240,6 +1300,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1252,10 +1320,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load846.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1298,10 +1362,6 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); - - load848.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1364,10 +1424,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1385,10 +1441,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - distriload860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1420,6 +1472,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1432,10 +1492,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load836.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1467,6 +1523,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1479,10 +1543,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load840.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1526,10 +1586,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load862.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From f0528204535bc90c94542373bbe80b3f44b71f5b Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 038/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 2ceb12ff193af44e35e9d9d6b659b5fa8904e7ff Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 039/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 97877837836023e7a8791dac8f11b857537984d0 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 040/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +++++++------------ .../network/util/AsymLvFeederParser.java | 6 +++ .../util/AsymIeeeFeederParserTest.java | 6 ++- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From fd665659462ca7ff2a6c64d310f54ea419000d30 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 041/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 2a9a597c60792c59016a8eba0b30951cdc7d03dd Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 042/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From e551d4692c4bc90fc077606d7cbf58d53f250837 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 043/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +-- .../network/util/AsymLvFeederParser.java | 6 + .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++----------- .../util/AsymIeeeFeederParserTest.java | 6 +- 4 files changed, 127 insertions(+), 188 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index 2c6edd1e9b..b960dba8a4 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,7 +18,9 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -88,14 +90,6 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -108,19 +102,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Power.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -133,19 +123,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Impedant.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -158,6 +144,10 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Current.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -271,6 +261,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load802.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -325,14 +318,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -345,6 +330,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load808.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -471,14 +460,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -491,6 +472,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load816.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -524,14 +509,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -544,6 +521,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load818.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -577,14 +558,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -597,6 +570,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load820.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -654,14 +631,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -674,6 +643,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load824.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -731,14 +704,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -751,6 +716,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load828.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -782,14 +751,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -802,6 +763,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load830.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -833,14 +798,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -853,6 +810,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load854.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -933,14 +894,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -953,6 +906,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load832.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible + .add(); + // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -1003,14 +960,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -1023,6 +972,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load890.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1054,14 +1007,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1074,6 +1019,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load858.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1131,14 +1080,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1151,6 +1092,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load834.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1181,14 +1126,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1201,6 +1138,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load842.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1232,14 +1172,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1252,6 +1184,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1269,6 +1205,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + distrload844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1300,14 +1240,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1320,6 +1252,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load846.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1362,6 +1298,10 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); + + load848.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1424,6 +1364,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1441,6 +1385,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + distriload860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1472,14 +1420,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1492,6 +1432,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load836.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1523,14 +1467,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1543,6 +1479,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load840.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1586,6 +1526,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load862.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From 4890700c6113b4ca5c227c8fa77d98115880eb97 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 044/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 2ba205b70a044930e1ad8aede235b5f0d7f79352 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 045/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From b4a1d511dbd62d348b9df0694eb16e11ac608614 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 046/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 905ced83cc694f6e1095db38aa09db0dbe4a4c36 Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 047/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From ab5448d9daa485d1fad37bc1481bce5163fe1118 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 048/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +++++++------------ .../network/util/AsymLvFeederParser.java | 6 +++ .../util/AsymIeeeFeederParserTest.java | 6 ++- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From 53a8ce8f5084193e6603371df02c1d826e13acd0 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 049/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 7f7a168ddac806f5db60a513d6febfe3ee1004e3 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 050/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++++++------- 1 file changed, 160 insertions(+), 104 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index b960dba8a4..2c6edd1e9b 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,9 +18,7 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -90,6 +88,14 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -102,15 +108,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Power.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -123,15 +133,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Impedant.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -144,10 +158,6 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Current.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -261,9 +271,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load802.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -318,6 +325,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -330,10 +345,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load808.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -460,6 +471,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -472,10 +491,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load816.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -509,6 +524,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -521,10 +544,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load818.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -558,6 +577,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -570,10 +597,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load820.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -631,6 +654,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -643,10 +674,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load824.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -704,6 +731,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -716,10 +751,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load828.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -751,6 +782,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -763,10 +802,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load830.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -798,6 +833,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -810,10 +853,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load854.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -894,6 +933,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -906,10 +953,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load832.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible - .add(); - // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -960,6 +1003,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -972,10 +1023,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load890.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1007,6 +1054,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1019,10 +1074,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load858.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1080,6 +1131,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1092,10 +1151,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load834.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1126,6 +1181,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1138,9 +1201,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load842.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1172,6 +1232,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1184,10 +1252,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1205,10 +1269,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - distrload844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1240,6 +1300,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1252,10 +1320,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load846.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1298,10 +1362,6 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); - - load848.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1364,10 +1424,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1385,10 +1441,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - distriload860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1420,6 +1472,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1432,10 +1492,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load836.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1467,6 +1523,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1479,10 +1543,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load840.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1526,10 +1586,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load862.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") From 941a908ddae96e708d7b6ee2c5b7d6be4af85433 Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 051/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 0ccae9a200a8dc76aa414da6eb785de29baf2200 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 052/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +-- .../network/util/AsymLvFeederParser.java | 6 + .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++----------- .../util/AsymIeeeFeederParserTest.java | 6 +- 4 files changed, 127 insertions(+), 188 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index 2c6edd1e9b..b960dba8a4 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,7 +18,9 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -88,14 +90,6 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -108,19 +102,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Power.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -133,19 +123,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Impedant.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -158,6 +144,10 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Current.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -271,6 +261,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load802.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -325,14 +318,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -345,6 +330,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load808.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -471,14 +460,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -491,6 +472,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load816.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -524,14 +509,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -544,6 +521,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load818.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -577,14 +558,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -597,6 +570,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load820.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -654,14 +631,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -674,6 +643,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load824.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -731,14 +704,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -751,6 +716,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load828.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -782,14 +751,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -802,6 +763,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load830.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -833,14 +798,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -853,6 +810,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load854.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -933,14 +894,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -953,6 +906,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load832.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible + .add(); + // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -1003,14 +960,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -1023,6 +972,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load890.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1054,14 +1007,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1074,6 +1019,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load858.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1131,14 +1080,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1151,6 +1092,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load834.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1181,14 +1126,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1201,6 +1138,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load842.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1232,14 +1172,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1252,6 +1184,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1269,6 +1205,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + distrload844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1300,14 +1240,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1320,6 +1252,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load846.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1362,6 +1298,10 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); + + load848.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1424,6 +1364,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1441,6 +1385,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + distriload860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1472,14 +1420,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1492,6 +1432,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load836.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1523,14 +1467,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1543,6 +1479,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load840.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1586,6 +1526,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load862.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From 11e83127f45a72bdd981d9c53cc8bed87513aa7d Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 053/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 78c618f7ebd7e2ac1cd9f09fdd045430194e53f3 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 054/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From e6a94f1f3ac7b9e933edb7ab72e3e055822b3836 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 055/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From bec068444bea87a1f5f55e298b002204cd8a0643 Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 056/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 81d6a8c978842c451897f239a32f6acd9567c489 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 057/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +++++++------------ .../network/util/AsymLvFeederParser.java | 6 +++ .../util/AsymIeeeFeederParserTest.java | 6 ++- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From e72720e115fc93dabd06be7530d03ab28aef9182 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 058/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 70ce15a056c17f24c7c8ebbc6f8eb6698df4fb99 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 059/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++++++------- 1 file changed, 160 insertions(+), 104 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index b960dba8a4..2c6edd1e9b 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,9 +18,7 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -90,6 +88,14 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -102,15 +108,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Power.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -123,15 +133,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Impedant.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -144,10 +158,6 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Current.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -261,9 +271,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load802.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -318,6 +325,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -330,10 +345,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load808.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -460,6 +471,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -472,10 +491,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load816.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -509,6 +524,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -521,10 +544,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load818.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -558,6 +577,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -570,10 +597,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load820.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -631,6 +654,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -643,10 +674,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load824.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -704,6 +731,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -716,10 +751,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load828.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -751,6 +782,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -763,10 +802,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load830.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -798,6 +833,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -810,10 +853,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load854.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -894,6 +933,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -906,10 +953,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load832.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible - .add(); - // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -960,6 +1003,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -972,10 +1023,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load890.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1007,6 +1054,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1019,10 +1074,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load858.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1080,6 +1131,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1092,10 +1151,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load834.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1126,6 +1181,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1138,9 +1201,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load842.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1172,6 +1232,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1184,10 +1252,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1205,10 +1269,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - distrload844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1240,6 +1300,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1252,10 +1320,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load846.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1298,10 +1362,6 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); - - load848.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1364,10 +1424,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1385,10 +1441,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - distriload860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1420,6 +1472,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1432,10 +1492,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load836.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1467,6 +1523,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1479,10 +1543,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load840.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1526,10 +1586,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load862.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") From e1e9df485c7607e045f321e5eb31e9454dc81f9c Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 060/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 67a81a850dbe88af8a88a17f9d662ac50bb85e15 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 061/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +++++++------------ .../network/util/AsymLvFeederParser.java | 6 +++ .../util/AsymIeeeFeederParserTest.java | 6 ++- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From 48db4ee9a422ae5e94d3999dbe02a3c1c607b165 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 062/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 537ee5852c0f7491682d783bd438d68b2b142ac6 Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 063/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 22c95140aea7c42ff7f90a8a11ecd9270aa798c3 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 064/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +-- .../network/util/AsymLvFeederParser.java | 6 + .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++----------- .../util/AsymIeeeFeederParserTest.java | 6 +- 4 files changed, 127 insertions(+), 188 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index 2c6edd1e9b..b960dba8a4 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,7 +18,9 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -88,14 +90,6 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -108,19 +102,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Power.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -133,19 +123,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Impedant.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -158,6 +144,10 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Current.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -271,6 +261,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load802.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -325,14 +318,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -345,6 +330,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load808.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -471,14 +460,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -491,6 +472,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load816.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -524,14 +509,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -544,6 +521,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load818.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -577,14 +558,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -597,6 +570,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load820.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -654,14 +631,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -674,6 +643,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load824.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -731,14 +704,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -751,6 +716,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load828.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -782,14 +751,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -802,6 +763,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load830.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -833,14 +798,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -853,6 +810,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load854.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -933,14 +894,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -953,6 +906,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load832.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible + .add(); + // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -1003,14 +960,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -1023,6 +972,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load890.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1054,14 +1007,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1074,6 +1019,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load858.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1131,14 +1080,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1151,6 +1092,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load834.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1181,14 +1126,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1201,6 +1138,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load842.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1232,14 +1172,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1252,6 +1184,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1269,6 +1205,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + distrload844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1300,14 +1240,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1320,6 +1252,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load846.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1362,6 +1298,10 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); + + load848.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1424,6 +1364,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1441,6 +1385,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + distriload860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1472,14 +1420,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1492,6 +1432,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load836.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1523,14 +1467,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1543,6 +1479,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load840.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1586,6 +1526,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load862.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From a6f85035fbcec18f4d9630c299350fff52953a92 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 065/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 1835d70e8a7138fff0fac0d17c7cf390c6b18509 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 066/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++++++------- 1 file changed, 160 insertions(+), 104 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index b960dba8a4..2c6edd1e9b 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,9 +18,7 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -90,6 +88,14 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -102,15 +108,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Power.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -123,15 +133,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Impedant.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -144,10 +158,6 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Current.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -261,9 +271,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load802.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -318,6 +325,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -330,10 +345,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load808.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -460,6 +471,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -472,10 +491,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load816.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -509,6 +524,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -521,10 +544,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load818.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -558,6 +577,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -570,10 +597,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load820.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -631,6 +654,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -643,10 +674,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load824.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -704,6 +731,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -716,10 +751,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load828.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -751,6 +782,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -763,10 +802,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load830.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -798,6 +833,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -810,10 +853,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load854.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -894,6 +933,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -906,10 +953,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load832.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible - .add(); - // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -960,6 +1003,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -972,10 +1023,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load890.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1007,6 +1054,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1019,10 +1074,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load858.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1080,6 +1131,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1092,10 +1151,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load834.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1126,6 +1181,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1138,9 +1201,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load842.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1172,6 +1232,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1184,10 +1252,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1205,10 +1269,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - distrload844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1240,6 +1300,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1252,10 +1320,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load846.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1298,10 +1362,6 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); - - load848.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1364,10 +1424,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1385,10 +1441,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - distriload860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1420,6 +1472,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1432,10 +1492,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load836.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1467,6 +1523,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1479,10 +1543,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load840.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1526,10 +1586,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load862.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") From c4c433f7ee393e2081949eba6277587d8d07a4ac Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 067/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 58040aa22baa2289879d27999f1e7ef9ed9e9748 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 068/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +++++++------------ .../network/util/AsymLvFeederParser.java | 6 +++ .../util/AsymIeeeFeederParserTest.java | 6 ++- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From 4806f87af4f1466934c3a02c89de8d30dd790bfb Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 069/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 51cf8b9bd9addf8456d0ba4c830dd608d28a5966 Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 070/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 95f8157fff4876c937b90d425ac0bbce172e3263 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 071/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +-- .../network/util/AsymLvFeederParser.java | 6 + .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++----------- .../util/AsymIeeeFeederParserTest.java | 6 +- 4 files changed, 127 insertions(+), 188 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index 2c6edd1e9b..b960dba8a4 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,7 +18,9 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -88,14 +90,6 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -108,19 +102,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Power.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -133,19 +123,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Impedant.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -158,6 +144,10 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Current.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -271,6 +261,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load802.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -325,14 +318,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -345,6 +330,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load808.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -471,14 +460,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -491,6 +472,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load816.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -524,14 +509,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -544,6 +521,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load818.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -577,14 +558,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -597,6 +570,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load820.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -654,14 +631,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -674,6 +643,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load824.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -731,14 +704,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -751,6 +716,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load828.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -782,14 +751,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -802,6 +763,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load830.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -833,14 +798,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -853,6 +810,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load854.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -933,14 +894,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -953,6 +906,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load832.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible + .add(); + // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -1003,14 +960,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -1023,6 +972,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load890.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1054,14 +1007,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1074,6 +1019,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load858.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1131,14 +1080,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1151,6 +1092,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load834.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1181,14 +1126,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1201,6 +1138,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load842.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1232,14 +1172,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1252,6 +1184,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1269,6 +1205,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + distrload844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1300,14 +1240,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1320,6 +1252,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load846.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1362,6 +1298,10 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); + + load848.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1424,6 +1364,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1441,6 +1385,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + distriload860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1472,14 +1420,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1492,6 +1432,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load836.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1523,14 +1467,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1543,6 +1479,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load840.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1586,6 +1526,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load862.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From 825787232cf5795849436606b8ede38b366d2e15 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 072/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 060e81d65a597e1128ebebd9e2c923b6694ef47a Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 073/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../openloadflow/ac/Asym34BusFeederTest.java | 268 +++++++++++------- 1 file changed, 162 insertions(+), 106 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index b960dba8a4..c4ea034fef 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,9 +18,7 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -90,6 +88,14 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -102,15 +108,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Power.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -123,15 +133,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Impedant.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -144,10 +158,6 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Current.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -261,9 +271,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load802.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -318,6 +325,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -330,10 +345,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load808.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -460,6 +471,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -472,10 +491,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load816.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -509,6 +524,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -521,10 +544,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load818.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -558,6 +577,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -570,10 +597,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load820.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -631,6 +654,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -643,10 +674,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load824.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -704,6 +731,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -716,10 +751,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load828.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -751,6 +782,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -763,10 +802,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load830.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -798,6 +833,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -810,10 +853,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load854.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -884,7 +923,7 @@ public static Network ieee34LoadFeeder() { bus832.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(BusVariableType.WYE) .withPositiveSequenceAsCurrent(true) - .withFortescueRepresentation(true) + .withFortescueRepresentation(false) .add(); double p832 = 0.; @@ -894,6 +933,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -906,10 +953,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load832.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible - .add(); - // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -926,7 +969,7 @@ public static Network ieee34LoadFeeder() { bus888.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(BusVariableType.WYE) .withPositiveSequenceAsCurrent(true) - .withFortescueRepresentation(true) + .withFortescueRepresentation(false) .add(); // Bus 890 @@ -960,6 +1003,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -972,10 +1023,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load890.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1007,6 +1054,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1019,10 +1074,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load858.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1080,6 +1131,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1092,10 +1151,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load834.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1126,6 +1181,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1138,9 +1201,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load842.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1172,6 +1232,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1184,10 +1252,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1205,10 +1269,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - distrload844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1240,6 +1300,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1252,10 +1320,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load846.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1298,10 +1362,6 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); - - load848.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1364,10 +1424,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1385,10 +1441,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - distriload860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1420,6 +1472,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1432,10 +1492,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load836.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1467,6 +1523,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1479,10 +1543,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load840.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1526,10 +1586,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load862.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") From 71ff40a1823eae162107b609daed1f43829b51a3 Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 074/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From db9afc3f656cecb45d3e05ef8dd8fb0be5ac0e3c Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 075/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../powsybl/openloadflow/ac/Asym34BusFeederTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index c4ea034fef..2c6edd1e9b 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -923,7 +923,7 @@ public static Network ieee34LoadFeeder() { bus832.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(BusVariableType.WYE) .withPositiveSequenceAsCurrent(true) - .withFortescueRepresentation(false) + .withFortescueRepresentation(true) .add(); double p832 = 0.; @@ -934,12 +934,12 @@ public static Network ieee34LoadFeeder() { .setP0(p832) .setQ0(q832) .newZipModel() - .setC0p(0.) + .setC0p(1.) .setC1p(0.) - .setC2p(1.) - .setC0q(0.) + .setC2p(0.) + .setC0q(1.) .setC1q(0.) - .setC2q(1.) + .setC2q(0.) .add() .add(); @@ -969,7 +969,7 @@ public static Network ieee34LoadFeeder() { bus888.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(BusVariableType.WYE) .withPositiveSequenceAsCurrent(true) - .withFortescueRepresentation(false) + .withFortescueRepresentation(true) .add(); // Bus 890 From b02f9baae52a629c976686504363c9d166c281ff Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 076/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +++++++------------ .../network/util/AsymLvFeederParser.java | 6 +++ .../util/AsymIeeeFeederParserTest.java | 6 ++- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From 8aca7eb355780aee7fe2163b699eb2fcb1a90587 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 077/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From caac18df1de5c7e7b81dc215df851cb899cc30f3 Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 078/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From cf1076fd5e0397fc4f009368e95f835f9367e0a9 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 079/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +-- .../network/util/AsymLvFeederParser.java | 6 + .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++----------- .../util/AsymIeeeFeederParserTest.java | 6 +- 4 files changed, 127 insertions(+), 188 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index 2c6edd1e9b..b960dba8a4 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,7 +18,9 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -88,14 +90,6 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -108,19 +102,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Power.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -133,19 +123,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Impedant.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -158,6 +144,10 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Current.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -271,6 +261,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load802.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -325,14 +318,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -345,6 +330,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load808.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -471,14 +460,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -491,6 +472,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load816.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -524,14 +509,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -544,6 +521,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load818.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -577,14 +558,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -597,6 +570,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load820.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -654,14 +631,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -674,6 +643,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load824.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -731,14 +704,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -751,6 +716,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load828.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -782,14 +751,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -802,6 +763,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load830.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -833,14 +798,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -853,6 +810,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load854.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -933,14 +894,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -953,6 +906,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load832.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible + .add(); + // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -1003,14 +960,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -1023,6 +972,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load890.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1054,14 +1007,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1074,6 +1019,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load858.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1131,14 +1080,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1151,6 +1092,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load834.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1181,14 +1126,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1201,6 +1138,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load842.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1232,14 +1172,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1252,6 +1184,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1269,6 +1205,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + distrload844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1300,14 +1240,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1320,6 +1252,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load846.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1362,6 +1298,10 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); + + load848.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1424,6 +1364,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1441,6 +1385,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + distriload860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1472,14 +1420,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1492,6 +1432,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load836.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1523,14 +1467,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1543,6 +1479,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load840.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1586,6 +1526,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load862.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From 540981adbdb4317e067ce5631be07281bfa6fe26 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 080/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 129c1f5e11d4f1312baca04fe49f97f3c81ebb5b Mon Sep 17 00:00:00 2001 From: JB-H Date: Wed, 11 Oct 2023 17:58:37 +0200 Subject: [PATCH 081/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 37 ++- .../network/util/AsymLvFeederParser.java | 5 - .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++++++------- 3 files changed, 185 insertions(+), 121 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..7377a56f83 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,50 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1) + .setC0q(1) + .setC1p(0) + .setC1q(0) + .setC2p(0) + .setC2q(0) + .add() .add(); var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; + ZipLoadModel zipLoadModel = (ZipLoadModel) load.getModel().orElseThrow(); if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + zipLoadModel.setC0p(0); + zipLoadModel.setC0q(0); + zipLoadModel.setC2p(1); + zipLoadModel.setC2q(1); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + zipLoadModel.setC0p(0); + zipLoadModel.setC0q(0); + zipLoadModel.setC2p(1); + zipLoadModel.setC2q(1); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + zipLoadModel.setC0p(0); + zipLoadModel.setC0q(0); + zipLoadModel.setC1p(1); + zipLoadModel.setC1q(1); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + zipLoadModel.setC0p(0); + zipLoadModel.setC0q(0); + zipLoadModel.setC1p(1); + zipLoadModel.setC1q(1); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -397,10 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withConnectionType(loadConnectionType) .add(); - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..e796ecdd83 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -290,9 +288,6 @@ private static void createLoads(Network network, String path) { .withDeltaQc(deltaQc) .add(); - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index b960dba8a4..5ab400b34b 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,9 +18,7 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -90,6 +88,14 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -102,15 +108,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Power.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -123,15 +133,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Impedant.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -144,10 +158,6 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Current.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -261,9 +271,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load802.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -318,6 +325,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -330,10 +345,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load808.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -460,6 +471,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -472,10 +491,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load816.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -509,6 +524,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -521,10 +544,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load818.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -558,6 +577,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -570,10 +597,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load820.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -631,6 +654,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -643,10 +674,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load824.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -704,6 +731,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -716,10 +751,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load828.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -751,6 +782,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -763,10 +802,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load830.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -798,6 +833,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -810,10 +853,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load854.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -894,6 +933,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -906,10 +953,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load832.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible - .add(); - // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -960,6 +1003,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -972,10 +1023,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load890.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1007,6 +1054,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1019,10 +1074,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load858.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1080,6 +1131,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1092,10 +1151,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load834.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1126,6 +1181,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1138,9 +1201,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load842.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1172,6 +1232,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1184,10 +1252,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1205,10 +1269,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - distrload844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1240,6 +1300,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1252,10 +1320,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load846.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1298,10 +1362,6 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); - - load848.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1364,10 +1424,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1385,10 +1441,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - distriload860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1420,6 +1472,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1432,10 +1492,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load836.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1467,6 +1523,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1479,10 +1543,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load840.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1526,10 +1586,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load862.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") From f32e21eb5f2e1652688c5769f0b84535446da3ec Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 082/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../extensions/iidm/BusAsymmetrical.java | 20 + .../network/impl/LfBranchImpl.java | 6 + .../network/util/AsymIeeeFeederParser.java | 643 +++++++++++++ .../network/util/AsymLvFeederParser.java | 352 +++++++ .../openloadflow/ac/Asym13BusFeederTest.java | 2 +- .../openloadflow/ac/Asym34BusFeederTest.java | 12 +- .../util/AsymIeeeFeederParserTest.java | 98 ++ src/test/resources/ieeeFeeder123/Bus.csv | 120 +++ .../ieeeFeeder123/DistributedLoad.csv | 1 + src/test/resources/ieeeFeeder123/Gen.csv | 2 + src/test/resources/ieeeFeeder123/Line.csv | 119 +++ .../resources/ieeeFeeder123/LineConfig.csv | 14 + .../resources/ieeeFeeder123/Regulator.csv | 5 + src/test/resources/ieeeFeeder123/SpotLoad.csv | 86 ++ src/test/resources/ieeeFeeder123/Tfo.csv | 1 + .../resources/ieeeFeeder123/TfoConfig.csv | 1 + src/test/resources/ieeeFeeder13/Bus.csv | 13 + .../ieeeFeeder13/DistributedLoad.csv | 2 + src/test/resources/ieeeFeeder13/Gen.csv | 2 + src/test/resources/ieeeFeeder13/Line.csv | 11 + .../resources/ieeeFeeder13/LineConfig.csv | 8 + src/test/resources/ieeeFeeder13/Regulator.csv | 2 + src/test/resources/ieeeFeeder13/SpotLoad.csv | 10 + src/test/resources/ieeeFeeder13/Tfo.csv | 2 + src/test/resources/ieeeFeeder13/TfoConfig.csv | 3 + src/test/resources/ieeeFeeder34/Bus.csv | 35 + .../ieeeFeeder34/DistributedLoad.csv | 19 + src/test/resources/ieeeFeeder34/Gen.csv | 2 + src/test/resources/ieeeFeeder34/Line.csv | 33 + .../resources/ieeeFeeder34/LineConfig.csv | 6 + src/test/resources/ieeeFeeder34/Regulator.csv | 3 + src/test/resources/ieeeFeeder34/SpotLoad.csv | 7 + src/test/resources/ieeeFeeder34/Tfo.csv | 2 + src/test/resources/ieeeFeeder34/TfoConfig.csv | 3 + src/test/resources/lvFeeder/Buscoords.csv | 908 ++++++++++++++++++ src/test/resources/lvFeeder/LineCodes.csv | 12 + src/test/resources/lvFeeder/Lines.csv | 907 +++++++++++++++++ src/test/resources/lvFeeder/LoadShapes.csv | 57 ++ src/test/resources/lvFeeder/Loads.csv | 58 ++ src/test/resources/lvFeeder/Source.csv | 6 + src/test/resources/lvFeeder/Transformer.csv | 3 + 41 files changed, 3589 insertions(+), 7 deletions(-) create mode 100644 src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java create mode 100644 src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java create mode 100644 src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java create mode 100644 src/test/resources/ieeeFeeder123/Bus.csv create mode 100644 src/test/resources/ieeeFeeder123/DistributedLoad.csv create mode 100644 src/test/resources/ieeeFeeder123/Gen.csv create mode 100644 src/test/resources/ieeeFeeder123/Line.csv create mode 100644 src/test/resources/ieeeFeeder123/LineConfig.csv create mode 100644 src/test/resources/ieeeFeeder123/Regulator.csv create mode 100644 src/test/resources/ieeeFeeder123/SpotLoad.csv create mode 100644 src/test/resources/ieeeFeeder123/Tfo.csv create mode 100644 src/test/resources/ieeeFeeder123/TfoConfig.csv create mode 100644 src/test/resources/ieeeFeeder13/Bus.csv create mode 100644 src/test/resources/ieeeFeeder13/DistributedLoad.csv create mode 100644 src/test/resources/ieeeFeeder13/Gen.csv create mode 100644 src/test/resources/ieeeFeeder13/Line.csv create mode 100644 src/test/resources/ieeeFeeder13/LineConfig.csv create mode 100644 src/test/resources/ieeeFeeder13/Regulator.csv create mode 100644 src/test/resources/ieeeFeeder13/SpotLoad.csv create mode 100644 src/test/resources/ieeeFeeder13/Tfo.csv create mode 100644 src/test/resources/ieeeFeeder13/TfoConfig.csv create mode 100644 src/test/resources/ieeeFeeder34/Bus.csv create mode 100644 src/test/resources/ieeeFeeder34/DistributedLoad.csv create mode 100644 src/test/resources/ieeeFeeder34/Gen.csv create mode 100644 src/test/resources/ieeeFeeder34/Line.csv create mode 100644 src/test/resources/ieeeFeeder34/LineConfig.csv create mode 100644 src/test/resources/ieeeFeeder34/Regulator.csv create mode 100644 src/test/resources/ieeeFeeder34/SpotLoad.csv create mode 100644 src/test/resources/ieeeFeeder34/Tfo.csv create mode 100644 src/test/resources/ieeeFeeder34/TfoConfig.csv create mode 100644 src/test/resources/lvFeeder/Buscoords.csv create mode 100644 src/test/resources/lvFeeder/LineCodes.csv create mode 100644 src/test/resources/lvFeeder/Lines.csv create mode 100644 src/test/resources/lvFeeder/LoadShapes.csv create mode 100644 src/test/resources/lvFeeder/Loads.csv create mode 100644 src/test/resources/lvFeeder/Source.csv create mode 100644 src/test/resources/lvFeeder/Transformer.csv diff --git a/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/BusAsymmetrical.java b/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/BusAsymmetrical.java index e300b1aaf5..8b15cc2f55 100644 --- a/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/BusAsymmetrical.java +++ b/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/BusAsymmetrical.java @@ -65,4 +65,24 @@ public boolean isFortescueRepresentation() { public boolean isPositiveSequenceAsCurrent() { return isPositiveSequenceAsCurrent; } + + public void setPositiveSequenceAsCurrent(boolean positiveSequenceAsCurrent) { + isPositiveSequenceAsCurrent = positiveSequenceAsCurrent; + } + + public void setFortescueRepresentation(boolean fortescueRepresentation) { + isFortescueRepresentation = fortescueRepresentation; + } + + public void setHasPhaseA(boolean hasPhaseA) { + this.hasPhaseA = hasPhaseA; + } + + public void setHasPhaseB(boolean hasPhaseB) { + this.hasPhaseB = hasPhaseB; + } + + public void setHasPhaseC(boolean hasPhaseC) { + this.hasPhaseC = hasPhaseC; + } } diff --git a/src/main/java/com/powsybl/openloadflow/network/impl/LfBranchImpl.java b/src/main/java/com/powsybl/openloadflow/network/impl/LfBranchImpl.java index 69671e2562..72d8826844 100644 --- a/src/main/java/com/powsybl/openloadflow/network/impl/LfBranchImpl.java +++ b/src/main/java/com/powsybl/openloadflow/network/impl/LfBranchImpl.java @@ -216,9 +216,15 @@ private static void createTransfoToAsym(TwoWindingsTransformer t2w, double zb, L if (asymBus1 != null) { side1VariableType = asymBus1.getAsymBusVariableType(); + if (!asymBus1.isFortescueRepresentation()) { + throw new PowsyblException("A three phase transformer must have its busses in Fortescue representation but bus 1 of '" + t2w.getId() + "' is in ABC representation"); + } } if (asymBus2 != null) { side2VariableType = asymBus2.getAsymBusVariableType(); + if (!asymBus2.isFortescueRepresentation()) { + throw new PowsyblException("A three phase transformer must have its busses in Fortescue representation but bus 2 of '" + t2w.getId() + "' is in ABC representation"); + } } AsymThreePhaseTransfo asym3phaseTfo = new AsymThreePhaseTransfo(leg1Type, leg2Type, stepLegConnectionType, diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java new file mode 100644 index 0000000000..4ca3d3aea2 --- /dev/null +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -0,0 +1,643 @@ +package com.powsybl.openloadflow.network.util; + +import com.powsybl.iidm.network.*; +import com.powsybl.iidm.network.extensions.*; +import com.powsybl.math.matrix.DenseMatrix; +import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; +import com.powsybl.openloadflow.util.ComplexMatrix; +import com.univocity.parsers.annotations.Parsed; +import com.univocity.parsers.common.processor.BeanListProcessor; +import com.univocity.parsers.csv.CsvParser; +import com.univocity.parsers.csv.CsvParserSettings; +import org.apache.commons.math3.complex.Complex; +import org.joda.time.DateTime; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.util.*; + +public final class AsymIeeeFeederParser { + + private AsymIeeeFeederParser() { + } + + private static List parseCsv(String resourceName, Class clazz) { + try (Reader inputReader = new InputStreamReader(Objects.requireNonNull(AsymIeeeFeederParser.class.getResourceAsStream(resourceName)), StandardCharsets.UTF_8)) { + BeanListProcessor rowProcessor = new BeanListProcessor<>(clazz); + CsvParserSettings settings = new CsvParserSettings(); + settings.setHeaderExtractionEnabled(true); + settings.setProcessor(rowProcessor); + CsvParser parser = new CsvParser(settings); + parser.parse(inputReader); + return rowProcessor.getBeans(); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + public static class LineData { + @Parsed(field = "NodeA") + String nodeA; + + @Parsed(field = "NodeB") + String nodeB; + + @Parsed(field = "Length") + double length; + + @Parsed(field = "Config") + String config; + } + + public static class TfoData { + @Parsed(field = "NodeA") + String nodeA; + + @Parsed(field = "NodeB") + String nodeB; + + @Parsed(field = "Config") + String config; + } + + public static class GenData { + @Parsed(field = "GenName") + String genName; + + @Parsed(field = "BusName") + String busName; + + @Parsed(field = "SetPoint") + double setPoint; + + } + + public static class BusData { + @Parsed(field = "BusName") + String busName; + + @Parsed(field = "UNom") + double uNom; + + } + + public static class LoadData { + @Parsed(field = "Node") + String busName; + + @Parsed(field = "Load") + String loadType; + + @Parsed(field = "Ph-1") + double ph1P; + + @Parsed(field = "Ph-1Q") + double ph1Q; + + @Parsed(field = "Ph-2") + double ph2P; + + @Parsed(field = "Ph-2Q") + double ph2Q; + + @Parsed(field = "Ph-3") + double ph3P; + + @Parsed(field = "Ph-3Q") + double ph3Q; + + } + + public static class DistriLoadData { + @Parsed(field = "NodeA") + String busNameA; + + @Parsed(field = "NodeB") + String busNameB; + + @Parsed(field = "Load") + String loadType; + + @Parsed(field = "Ph-1") + double ph1P; + + @Parsed(field = "Ph-1Q") + double ph1Q; + + @Parsed(field = "Ph-2") + double ph2P; + + @Parsed(field = "Ph-2Q") + double ph2Q; + + @Parsed(field = "Ph-3") + double ph3P; + + @Parsed(field = "Ph-3Q") + double ph3Q; + } + + public static class LineConfigData { + @Parsed(field = "Config") + String config; + + @Parsed(field = "PhaseA") + int phaseA; + + @Parsed(field = "PhaseB") + int phaseB; + + @Parsed(field = "PhaseC") + int phaseC; + + @Parsed + double r11; + + @Parsed + double x11; + + @Parsed + double r12; + + @Parsed + double x12; + + @Parsed + double r13; + + @Parsed + double x13; + + @Parsed + double r22; + + @Parsed + double x22; + + @Parsed + double r23; + + @Parsed + double x23; + + @Parsed + double r33; + + @Parsed + double x33; + + @Parsed + double b11; + + @Parsed + double b12; + + @Parsed + double b13; + + @Parsed + double b22; + + @Parsed + double b23; + + @Parsed + double b33; + } + + public static class TfoConfigData { + @Parsed(field = "Config") + String config; + + @Parsed(field = "SkVA") + double skva; + + @Parsed(field = "kV-high") + double kvHigh; + + @Parsed(field = "Winding-high") + String windingHigh; + + @Parsed(field = "kV-low") + double kvLow; + + @Parsed(field = "Winding-low") + String windingLow; + + @Parsed(field = "R") + double r; + + @Parsed(field = "X") + double x; + + } + + public static class RegulatorData { + @Parsed(field = "Line") + String line; + + @Parsed(field = "RhoA") + double rhoA; + + @Parsed(field = "RhoB") + double rhoB; + + @Parsed(field = "RhoC") + double rhoC; + + } + + private static String getBusId(String busName) { + return "Bus-" + busName; + } + + private static String getVoltageLevelId(String busName) { + return "VoltageLevel-" + busName; + } + + private static String getSubstationId(String busName) { + return "Substation-" + busName; + } + + private static void createBuses(Network network, Map firstBusTfo, String path) { + for (BusData busData : parseCsv(path + "Bus.csv", BusData.class)) { + + String substationId = getSubstationId(busData.busName); + if (firstBusTfo.containsKey(busData.busName)) { + substationId = getSubstationId(firstBusTfo.get(busData.busName)); + } + Substation s = network.getSubstation(substationId); + if (s == null) { + s = network.newSubstation() + .setId(substationId) + .add(); + } + VoltageLevel vl = s.newVoltageLevel() + .setId(getVoltageLevelId(busData.busName)) + .setTopologyKind(TopologyKind.BUS_BREAKER) + .setNominalV(busData.uNom) + .add(); + Bus bus = vl.getBusBreakerView().newBus() + .setId(getBusId(busData.busName)) + .add(); + + bus.setV(busData.uNom).setAngle(0.); + + // default settings for bus extensions, will be modified depending on the type of connected equipment : + bus.newExtension(BusAsymmetricalAdder.class) + .withBusVariableType(BusVariableType.WYE) + .withHasPhaseA(false) + .withHasPhaseB(false) + .withHasPhaseC(false) + .withPositiveSequenceAsCurrent(true) + .withFortescueRepresentation(true) + .add(); + } + } + + private static void createGenerators(Network network, String path) { + for (GenData gen : parseCsv(path + "Gen.csv", GenData.class)) { + VoltageLevel vl = network.getVoltageLevel(getVoltageLevelId(gen.busName)); + Generator generator = vl.newGenerator() + .setId(gen.genName) + .setBus(getBusId(gen.busName)) + .setMinP(-100.0) + .setMaxP(200) + .setTargetP(0.0) + .setTargetV(vl.getNominalV() * gen.setPoint) // TODO : TEST + .setVoltageRegulatorOn(true) + .add(); + + Complex zz = new Complex(0.0001, 0.0001); + Complex zn = new Complex(0.0001, 0.0001); + + generator.newExtension(GeneratorFortescueAdder.class) + .withRz(zz.getReal()) + .withXz(zz.getImaginary()) + .withRn(zn.getReal()) + .withXn(zn.getImaginary()) + .add(); + + // modification of bus extension due to generating unit + network.getBusBreakerView().getBus(getBusId(gen.busName)).getExtension(BusAsymmetrical.class).setPositiveSequenceAsCurrent(false); + + } + } + + private static List parseTfos(String path) { + + List listTfos = new ArrayList<>(); + for (TfoData tfo : parseCsv(path + "Tfo.csv", TfoData.class)) { + listTfos.add(tfo); + } + + return listTfos; + } + + private static Map getFirstBusTfo(List listTfos) { + // used to create a substation with the name of the first bus for a tfo + Map firstBusTfo = new HashMap<>(); + for (TfoData tfo : listTfos) { + firstBusTfo.put(tfo.nodeB, tfo.nodeA); + } + + return firstBusTfo; + } + + private static void createLoad(Network network, String loadName, String busName, String loadType, + double pa, double qa, double pb, double qb, double pc, double qc) { + VoltageLevel vl = network.getVoltageLevel(getVoltageLevelId(busName)); + Load load = vl.newLoad() + .setId(loadName) + .setBus(getBusId(busName)) + .setP0(0.) + .setQ0(0.) + .add(); + + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); + LoadConnectionType loadConnectionType; + LoadType loadTypeOut; + if (loadType.equals("Y-PQ")) { + loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; + } else if (loadType.equals("D-PQ")) { + loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; + } else if (loadType.equals("Y-Z")) { + loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + extensionBus.setFortescueRepresentation(false); + } else if (loadType.equals("D-Z")) { + loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + extensionBus.setFortescueRepresentation(false); + } else if (loadType.equals("Y-I")) { + loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_CURRENT; + extensionBus.setFortescueRepresentation(false); + } else if (loadType.equals("D-I")) { + loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_CURRENT; + extensionBus.setFortescueRepresentation(false); + } else { + throw new IllegalStateException("Unknown load type in csv at bus : " + busName); + } + + load.newExtension(LoadAsymmetricalAdder.class) + .withDeltaPa(pa / 1000.) + .withDeltaQa(qa / 1000.) + .withDeltaPb(pb / 1000.) + .withDeltaQb(qb / 1000.) + .withDeltaPc(pc / 1000.) + .withDeltaQc(qc / 1000.) + .withConnectionType(loadConnectionType) + .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + + } + + private static void createLoads(Network network, String path) { + + for (LoadData loadData : parseCsv(path + "SpotLoad.csv", LoadData.class)) { + + String loadName = "LOAD_" + loadData.busName + "-" + loadData.loadType; + + createLoad(network, loadName, loadData.busName, loadData.loadType, + loadData.ph1P, loadData.ph1Q, loadData.ph2P, loadData.ph2Q, loadData.ph3P, loadData.ph3Q); + } + } + + private static void createDistriLoads(Network network, String path) { + + for (DistriLoadData loadData : parseCsv(path + "DistributedLoad.csv", DistriLoadData.class)) { + String loadName = "LOAD_" + loadData.busNameA + "-" + loadData.busNameB + "-" + loadData.loadType; + + createLoad(network, loadName, loadData.busNameA, loadData.loadType, + loadData.ph1P, loadData.ph1Q, loadData.ph2P, loadData.ph2Q, loadData.ph3P, loadData.ph3Q); + } + } + + private static void createLines(Network network, String path) { + Map lineConfig = new HashMap<>(); + for (LineConfigData lineCode : parseCsv(path + "LineConfig.csv", LineConfigData.class)) { + lineConfig.put(lineCode.config, lineCode); + } + Map regulatorDataMap = new HashMap<>(); + for (RegulatorData regulatorData : parseCsv(path + "Regulator.csv", RegulatorData.class)) { + String lineName = "Line-" + regulatorData.line; + regulatorDataMap.put(lineName, regulatorData); + } + + for (LineData line : parseCsv(path + "Line.csv", LineData.class)) { + LineConfigData lineConfigData = lineConfig.get(line.config); + var l = network.newLine() + .setId("Line-" + line.nodeA + "-" + line.nodeB) + .setVoltageLevel1(getVoltageLevelId(line.nodeA)) + .setBus1(getBusId(line.nodeA)) + .setVoltageLevel2(getVoltageLevelId(line.nodeB)) + .setBus2(getBusId(line.nodeB)) + .setR(1.0 * line.length / 1000) + .setX(1.0 * line.length / 1000) + .add(); + + l.newExtension(LineFortescueAdder.class) + .withOpenPhaseA(false) + .withOpenPhaseB(false) + .withOpenPhaseC(false) + .withRz(1.0 * line.length / 1000) + .withXz(1.0 * line.length / 1000) + .add(); + + double micro = 0.000001; + double feetInMile = 5280; + double yCoef = 1. / 3.; + + // building of Yabc from given Y impedance matrix Zy + ComplexMatrix zy = new ComplexMatrix(3, 3); + zy.set(1, 1, new Complex(lineConfigData.r11, lineConfigData.x11)); + zy.set(1, 2, new Complex(lineConfigData.r12, lineConfigData.x12)); + zy.set(1, 3, new Complex(lineConfigData.r13, lineConfigData.x13)); + zy.set(2, 1, new Complex(lineConfigData.r12, lineConfigData.x12)); + zy.set(2, 2, new Complex(lineConfigData.r22, lineConfigData.x22)); + zy.set(2, 3, new Complex(lineConfigData.r23, lineConfigData.x23)); + zy.set(3, 1, new Complex(lineConfigData.r13, lineConfigData.x13)); + zy.set(3, 2, new Complex(lineConfigData.r23, lineConfigData.x23)); + zy.set(3, 3, new Complex(lineConfigData.r33, lineConfigData.x33)); + + ComplexMatrix b = new ComplexMatrix(3, 3); + + b.set(1, 1, new Complex(0, micro * lineConfigData.b11)); + b.set(1, 2, new Complex(0, micro * lineConfigData.b12)); + b.set(1, 3, new Complex(0, micro * lineConfigData.b13)); + b.set(2, 1, new Complex(0, micro * lineConfigData.b12)); + b.set(2, 2, new Complex(0, micro * lineConfigData.b22)); + b.set(2, 3, new Complex(0, micro * lineConfigData.b23)); + b.set(3, 1, new Complex(0, micro * lineConfigData.b13)); + b.set(3, 2, new Complex(0, micro * lineConfigData.b23)); + b.set(3, 3, new Complex(0, micro * lineConfigData.b33)); + + boolean hasPhaseA = lineConfigData.phaseA == 1; + boolean hasPhaseB = lineConfigData.phaseB == 1; + boolean hasPhaseC = lineConfigData.phaseC == 1; + + ComplexMatrix yabc = LineAsymmetrical.getAdmittanceMatrixFromImpedanceAndBmatrix(zy, b, + hasPhaseA, hasPhaseB, hasPhaseC, line.length / feetInMile); + if (regulatorDataMap.containsKey(l.getId())) { + // take into account effect of regulator + RegulatorData regulatorData = regulatorDataMap.get(l.getId()); + ComplexMatrix rho = new ComplexMatrix(6, 6); + rho.set(1, 1, new Complex(regulatorData.rhoA, 0.)); + rho.set(2, 2, new Complex(regulatorData.rhoB, 0.)); + rho.set(3, 3, new Complex(regulatorData.rhoC, 0.)); + rho.set(4, 4, new Complex(1., 0.)); + rho.set(5, 5, new Complex(1., 0.)); + rho.set(6, 6, new Complex(1., 0.)); + DenseMatrix yabcRho = rho.getRealCartesianMatrix().times(yabc.getRealCartesianMatrix().times(rho.getRealCartesianMatrix())); + yabc = ComplexMatrix.getComplexMatrixFromRealCartesian(yabcRho); + } + + l.newExtension(LineAsymmetricalAdder.class) + .withYabc(ComplexMatrix.getMatrixScaled(yabc, yCoef)) + .add(); + + // modification of bus extension depending on line connections: + var extensionBus1 = network.getBusBreakerView().getBus(getBusId(line.nodeA)).getExtension(BusAsymmetrical.class); + var extensionBus2 = network.getBusBreakerView().getBus(getBusId(line.nodeB)).getExtension(BusAsymmetrical.class); + + extensionBus1.setHasPhaseA(extensionBus1.isHasPhaseA() || hasPhaseA); + extensionBus1.setHasPhaseB(extensionBus1.isHasPhaseB() || hasPhaseB); + extensionBus1.setHasPhaseC(extensionBus1.isHasPhaseC() || hasPhaseC); + + extensionBus2.setHasPhaseA(extensionBus2.isHasPhaseA() || hasPhaseA); + extensionBus2.setHasPhaseB(extensionBus2.isHasPhaseB() || hasPhaseB); + extensionBus2.setHasPhaseC(extensionBus2.isHasPhaseC() || hasPhaseC); + + } + } + + private static void createTfos(Network network, String path) { + Map tfoConfigDataMap = new HashMap<>(); + for (TfoConfigData tfoConfig : parseCsv(path + "TfoConfig.csv", TfoConfigData.class)) { + tfoConfigDataMap.put(tfoConfig.config, tfoConfig); + } + for (TfoData tfoData : parseCsv(path + "Tfo.csv", TfoData.class)) { + TfoConfigData tfoConfigData = tfoConfigDataMap.get(tfoData.config); + double ratedUhigh = tfoConfigData.kvHigh; + double ratedUlow = tfoConfigData.kvLow; + double sBase = tfoConfigData.skva / 1000.; + double rTpc = tfoConfigData.r; + double xTpc = tfoConfigData.x; + double zBase = ratedUhigh * ratedUlow / sBase; + double rT = rTpc * zBase / 100.; + double xT = xTpc * zBase / 100.; + + var tfo = network.getSubstation(getSubstationId(tfoData.nodeA)).newTwoWindingsTransformer() + .setId("Tfo-" + tfoData.nodeA + "-" + tfoData.nodeB) + .setVoltageLevel1(network.getVoltageLevel(getVoltageLevelId(tfoData.nodeA)).getId()) + .setBus1(getBusId(tfoData.nodeA)) + .setConnectableBus1(getBusId(tfoData.nodeA)) + .setRatedU1(ratedUhigh) + .setVoltageLevel2(network.getVoltageLevel(getVoltageLevelId(tfoData.nodeB)).getId()) + .setBus2(getBusId(tfoData.nodeB)) + .setConnectableBus2(getBusId(tfoData.nodeB)) + .setRatedU2(ratedUlow) + .setR(rT) + .setX(xT) + .setG(0.0D) + .setB(0.0D) + .setRatedS(sBase) + .add(); + + WindingConnectionType windingConnectionType1; + if (tfoConfigData.windingHigh.equals("Gr.Y") || tfoConfigData.windingHigh.equals("Gr.W")) { + windingConnectionType1 = WindingConnectionType.Y_GROUNDED; + } else { + windingConnectionType1 = WindingConnectionType.DELTA; + } + + WindingConnectionType windingConnectionType2; + if (tfoConfigData.windingLow.equals("Gr.Y") || tfoConfigData.windingLow.equals("Gr.W")) { + windingConnectionType2 = WindingConnectionType.Y_GROUNDED; + } else { + windingConnectionType2 = WindingConnectionType.DELTA; + } + + tfo.newExtension(TwoWindingsTransformerFortescueAdder.class) + .withRz(rT) + .withXz(xT) + .withConnectionType1(windingConnectionType1) + .withConnectionType2(windingConnectionType2) + .withGroundingX1(0.0000) + .withGroundingX2(0.0000) + .withFreeFluxes(true) + .add(); + + Complex zPhase = new Complex(rTpc, xTpc).multiply(zBase / 3. / 100.); + Complex yPhase = new Complex(0., 0.); + + tfo.newExtension(Tfo3PhasesAdder.class) + .withIsOpenPhaseA1(false) + .withIsOpenPhaseB1(false) + .withIsOpenPhaseC1(false) + .withYa(buildSinglePhaseAdmittanceMatrix(zPhase, yPhase, yPhase)) + .withYb(buildSinglePhaseAdmittanceMatrix(zPhase, yPhase, yPhase)) + .withYc(buildSinglePhaseAdmittanceMatrix(zPhase, yPhase, yPhase)) + .add(); + + // modification of bus extension depending on line connections: + var extensionBus1 = network.getBusBreakerView().getBus(getBusId(tfoData.nodeA)).getExtension(BusAsymmetrical.class); + var extensionBus2 = network.getBusBreakerView().getBus(getBusId(tfoData.nodeB)).getExtension(BusAsymmetrical.class); + + extensionBus1.setHasPhaseA(true); + extensionBus1.setHasPhaseB(true); + extensionBus1.setHasPhaseC(true); + + extensionBus2.setHasPhaseA(true); + extensionBus2.setHasPhaseB(true); + extensionBus2.setHasPhaseC(true); + + extensionBus1.setFortescueRepresentation(true); + extensionBus2.setFortescueRepresentation(true); + } + } + + public static ComplexMatrix buildSinglePhaseAdmittanceMatrix(Complex z, Complex y1, Complex y2) { + ComplexMatrix cm = new ComplexMatrix(2, 2); + cm.set(1, 1, y1.add(z.reciprocal())); + cm.set(1, 2, z.reciprocal().multiply(-1.)); + cm.set(2, 1, z.reciprocal().multiply(-1.)); + cm.set(2, 2, y2.add(z.reciprocal())); + + return cm; + } + + public static Network create(String path) { + return create(NetworkFactory.findDefault(), path); + } + + public static Network create(NetworkFactory networkFactory, String path) { + Network network = networkFactory.createNetwork("EuropeanLvTestFeeder", "csv"); + network.setCaseDate(DateTime.parse("2023-04-11T23:59:00.000+01:00")); + + // for substation naming when there are tfos: + List listTfos = parseTfos(path); + Map firstBusTfo = getFirstBusTfo(listTfos); + + createBuses(network, firstBusTfo, path); + createLines(network, path); + createGenerators(network, path); + createLoads(network, path); + createDistriLoads(network, path); + createTfos(network, path); + + return network; + } + +} diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java new file mode 100644 index 0000000000..5b70c85e15 --- /dev/null +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -0,0 +1,352 @@ +package com.powsybl.openloadflow.network.util; + +import com.powsybl.commons.PowsyblException; +import com.powsybl.iidm.network.*; +import com.powsybl.iidm.network.extensions.*; +import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; +import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; +import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; +import com.univocity.parsers.annotations.Parsed; +import com.univocity.parsers.common.processor.BeanListProcessor; +import com.univocity.parsers.csv.CsvParser; +import com.univocity.parsers.csv.CsvParserSettings; +import org.apache.commons.math3.complex.Complex; +import org.joda.time.DateTime; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +public final class AsymLvFeederParser { + private AsymLvFeederParser() { + } + + private static List parseCsv(String resourceName, Class clazz) { + try (Reader inputReader = new InputStreamReader(Objects.requireNonNull(AsymLvFeederParser.class.getResourceAsStream(resourceName)), StandardCharsets.UTF_8)) { + BeanListProcessor rowProcessor = new BeanListProcessor<>(clazz); + CsvParserSettings settings = new CsvParserSettings(); + settings.setHeaderExtractionEnabled(true); + settings.setProcessor(rowProcessor); + CsvParser parser = new CsvParser(settings); + parser.parse(inputReader); + return rowProcessor.getBeans(); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + private static String getBusId(int busName) { + return "Bus-" + busName; + } + + private static String getVoltageLevelId(int busName) { + return "VoltageLevel-" + busName; + } + + private static String getSubstationId(int busName) { + return "Substation-" + busName; + } + + public static class BusCoord { + @Parsed(field = "Busname") + int busName; + + @Parsed + double x; + + @Parsed + double y; + } + + public static class Line { + @Parsed(field = "Name") + String name; + + @Parsed(field = "Bus1") + int bus1; + + @Parsed(field = "Bus2") + int bus2; + + @Parsed(field = "Phases") + String phases; + + @Parsed(field = "Length") + double length; + + @Parsed(field = "Units") + String units; + + @Parsed(field = "LineCode") + String code; + } + + public static class LineCode { + @Parsed(field = "Name") + String name; + + @Parsed + int nphases; + + @Parsed(field = "R1") + double r1; + + @Parsed(field = "X1") + double x1; + + @Parsed(field = "R0") + double r0; + + @Parsed(field = "X0") + double x0; + + @Parsed(field = "C1") + double c1; + + @Parsed(field = "C0") + double c0; + + @Parsed(field = "Units") + String units; + } + + public static class Load { + @Parsed(field = "Name") + String name; + + @Parsed + int numPhases; + + @Parsed(field = "Bus") + int bus; + + @Parsed + char phases; + + @Parsed + double kV; + + @Parsed(field = "Model") + int model; + + @Parsed(field = "Connection") + String connection; + + @Parsed + double kW; + + @Parsed(field = "PF") + double pf; + + @Parsed(field = "Yearly") + String yearly; + } + + public static class Transformer { + @Parsed(field = "Name") + String name; + + @Parsed + int phases; + + @Parsed + String bus1; + + @Parsed + int bus2; + + @Parsed(field = "kV_pri") + double kvPri; + + @Parsed(field = "kV_sec") + double kvSec; + + @Parsed(field = "MVA") + double mva; + + @Parsed(field = "Conn_pri") + String connPri; + + @Parsed(field = "Conn_sec") + String connSec; + + @Parsed(field = "%XHL") + double xhl; + + @Parsed(field = "% resistance") + double resistance; + } + + private static void createBuses(Network network, String path) { + for (BusCoord busCoord : parseCsv(path + "Buscoords.csv", BusCoord.class)) { + String substationId = getSubstationId(busCoord.busName); + Substation s = network.getSubstation(substationId); + if (s == null) { + s = network.newSubstation() + .setId(substationId) + .add(); + } + VoltageLevel vl = s.newVoltageLevel() + .setId(getVoltageLevelId(busCoord.busName)) + .setTopologyKind(TopologyKind.BUS_BREAKER) + .setNominalV(1) + .add(); + Bus bus = vl.getBusBreakerView().newBus() + .setId(getBusId(busCoord.busName)) + .add(); + + // default settings for bus extensions, will be modified depending on the type of connected equipment : + bus.newExtension(BusAsymmetricalAdder.class) + .withBusVariableType(BusVariableType.WYE) + .withHasPhaseA(true) + .withHasPhaseB(true) + .withHasPhaseC(true) + .withPositiveSequenceAsCurrent(true) + .withFortescueRepresentation(true) + .add(); + } + } + + private static void createLines(Network network, String path) { + Map lineCodes = new HashMap<>(); + for (LineCode lineCode : parseCsv(path + "LineCodes.csv", LineCode.class)) { + lineCodes.put(lineCode.name, lineCode); + } + double coeff = 1 / 1000.; + for (Line line : parseCsv(path + "Lines.csv", Line.class)) { + LineCode lineCode = lineCodes.get(line.code); + var l = network.newLine() + .setId("Line-" + line.bus1 + "-" + line.bus2) + .setVoltageLevel1(getVoltageLevelId(line.bus1)) + .setBus1(getBusId(line.bus1)) + .setVoltageLevel2(getVoltageLevelId(line.bus2)) + .setBus2(getBusId(line.bus2)) + .setR(lineCode.r1 * line.length * coeff) + .setX(lineCode.x1 * line.length * coeff) + .add(); + l.newExtension(LineFortescueAdder.class) + .withRz(lineCode.r0 * line.length * coeff) + .withXz(lineCode.x0 * line.length * coeff) + .add(); + } + } + + private static LoadConnectionType getConnectionType(Load load) { + if (load.connection.equals("wye")) { + return LoadConnectionType.Y; + } + throw new PowsyblException("Unknown load connection: " + load.connection); + } + + private static void createLoads(Network network, String path) { + for (Load load : parseCsv(path + "Loads.csv", Load.class)) { + var vl = network.getVoltageLevel(getVoltageLevelId(load.bus)); + double p0 = load.kW / 1000; + double q0 = p0 * load.pf; + var l = vl.newLoad() + .setId("Load-" + load.bus) + .setBus(getBusId(load.bus)) + .setP0(0.) + .setQ0(0.) + .add(); + double defaultLoad = 0.000; + double deltaPa = defaultLoad; + double deltaQa = defaultLoad; + double deltaPb = defaultLoad; + double deltaQb = defaultLoad; + double deltaPc = defaultLoad; + double deltaQc = defaultLoad; + switch (load.phases) { + case 'A': + deltaPa += p0; + deltaQa += q0; + break; + case 'B': + deltaPb += p0; + deltaQb += q0; + break; + case 'C': + deltaPc += p0; + deltaQc += q0; + break; + default: + throw new PowsyblException("Unknown phase: " + load.phases); + } + l.newExtension(LoadAsymmetricalAdder.class) + .withConnectionType(getConnectionType(load)) + .withDeltaPa(deltaPa) + .withDeltaQa(deltaQa) + .withDeltaPb(deltaPb) + .withDeltaQb(deltaQb) + .withDeltaPc(deltaPc) + .withDeltaQc(deltaQc) + .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + } + } + + private static void createSource(Network network) { + int busName = 1; + VoltageLevel vl = network.getVoltageLevel(getVoltageLevelId(busName)); + Generator generator = vl.newGenerator() + .setId("G150") + .setBus(getBusId(busName)) + .setMinP(-100.0) + .setMaxP(200) + .setTargetP(0) + .setTargetV(vl.getNominalV() * 1.05) + .setVoltageRegulatorOn(true) + .add(); + + Complex zz = new Complex(0.0001, 0.0001); // 0.0001 , 0.001 + Complex zn = new Complex(0.0001, 0.0001); // 0.001 , 0.01 + + generator.newExtension(GeneratorFortescueAdder.class) + .withRz(zz.getReal()) + .withXz(zz.getImaginary()) + .withRn(zn.getReal()) + .withXn(zn.getImaginary()) + .add(); + + // modification of bus extension due to generating unit + network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class).setPositiveSequenceAsCurrent(false); + } + + private static WindingConnectionType getConnectionType(String conn) { + switch (conn) { + case "Delta": + return WindingConnectionType.DELTA; + case "Wye": + return WindingConnectionType.Y; + default: + throw new PowsyblException("Connection type not supported: " + conn); + } + } + + public static Network create(String path) { + return create(NetworkFactory.findDefault(), path); + } + + public static Network create(NetworkFactory networkFactory, String path) { + Network network = networkFactory.createNetwork("EuropeanLvTestFeeder", "csv"); + network.setCaseDate(DateTime.parse("2023-04-11T23:59:00.000+01:00")); + + createBuses(network, path); + createSource(network); + createLines(network, path); + createLoads(network, path); + return network; + } + +} diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym13BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym13BusFeederTest.java index f076e6d356..196ce73bd6 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym13BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym13BusFeederTest.java @@ -309,7 +309,7 @@ void ieee13LoadWithConstantImpedanceDeltaTest() { assertVoltageEquals(4.290533459921324, bus632); assertVoltageEquals(4.2520625000874075, bus645); assertVoltageEquals(4.243258426216129, bus646); - assertVoltageEquals(4.154403168622116, bus652); + assertVoltageEquals(4.165204333227582, bus652); } @Test diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index c4ea034fef..2c6edd1e9b 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -923,7 +923,7 @@ public static Network ieee34LoadFeeder() { bus832.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(BusVariableType.WYE) .withPositiveSequenceAsCurrent(true) - .withFortescueRepresentation(false) + .withFortescueRepresentation(true) .add(); double p832 = 0.; @@ -934,12 +934,12 @@ public static Network ieee34LoadFeeder() { .setP0(p832) .setQ0(q832) .newZipModel() - .setC0p(0.) + .setC0p(1.) .setC1p(0.) - .setC2p(1.) - .setC0q(0.) + .setC2p(0.) + .setC0q(1.) .setC1q(0.) - .setC2q(1.) + .setC2q(0.) .add() .add(); @@ -969,7 +969,7 @@ public static Network ieee34LoadFeeder() { bus888.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(BusVariableType.WYE) .withPositiveSequenceAsCurrent(true) - .withFortescueRepresentation(false) + .withFortescueRepresentation(true) .add(); // Bus 890 diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java new file mode 100644 index 0000000000..d489c65980 --- /dev/null +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -0,0 +1,98 @@ +package com.powsybl.openloadflow.util; + +import com.powsybl.iidm.network.Network; +import com.powsybl.loadflow.LoadFlow; +import com.powsybl.loadflow.LoadFlowParameters; +import com.powsybl.loadflow.LoadFlowResult; +import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.openloadflow.OpenLoadFlowParameters; +import com.powsybl.openloadflow.OpenLoadFlowProvider; +import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; +import com.powsybl.openloadflow.network.util.AsymLvFeederParser; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class AsymIeeeFeederParserTest { + + private LoadFlow.Runner loadFlowRunner; + private LoadFlowParameters parameters; + + @BeforeEach + void setUp() { + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) + .setDistributedSlack(false); + + OpenLoadFlowParameters.create(parameters) + .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) + .setMaxNewtonRaphsonIterations(100) + .setMaxActivePowerMismatch(0.0001) + .setMaxReactivePowerMismatch(0.0001) + .setNewtonRaphsonConvEpsPerEq(0.0001) + .setMaxVoltageMismatch(0.0001) + .setMaxSusceptanceMismatch(0.0001) + .setMaxAngleMismatch(0.0001) + .setMaxRatioMismatch(0.0001) + .setAsymmetrical(true); + } + + @Test + void test13BussesTest() { + + Network network = AsymIeeeFeederParser.create("/ieeeFeeder13/"); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + assertVoltageEquals(4.276427533655057, network.getBusBreakerView().getBus("Bus-632")); + } + + @Test + void test34BussesTest() { + + Network network = AsymIeeeFeederParser.create("/ieeeFeeder34/"); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + assertVoltageEquals(26.145, network.getBusBreakerView().getBus("Bus-800")); + assertVoltageEquals(25.86703194305272, network.getBusBreakerView().getBus("Bus-832")); + } + + @Test + void test123BussesTest() { + + Network network = AsymIeeeFeederParser.create("/ieeeFeeder123/"); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + assertVoltageEquals(4.16, network.getBusBreakerView().getBus("Bus-150")); + assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); + } + + @Disabled + @Test + void testLvFeedersTest() { + + OpenLoadFlowParameters.create(parameters) + .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) + .setMaxNewtonRaphsonIterations(100) + .setMaxActivePowerMismatch(0.0000001) + .setMaxReactivePowerMismatch(0.0000001) + .setNewtonRaphsonConvEpsPerEq(0.0000001) + .setMaxVoltageMismatch(0.00001) + .setMaxSusceptanceMismatch(0.0001) + .setMaxAngleMismatch(0.0001) + .setMaxRatioMismatch(0.0001) + .setAsymmetrical(true); + + Network network = AsymLvFeederParser.create("/lvFeeder/"); + + LoadFlowResult result = loadFlowRunner.run(network, parameters); + assertTrue(result.isOk()); + } + +} diff --git a/src/test/resources/ieeeFeeder123/Bus.csv b/src/test/resources/ieeeFeeder123/Bus.csv new file mode 100644 index 0000000000..033b1a0ab3 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Bus.csv @@ -0,0 +1,120 @@ +BusName,UNom +150,4.16 +1,4.16 +2,4.16 +3,4.16 +4,4.16 +5,4.16 +6,4.16 +7,4.16 +8,4.16 +12,4.16 +9,4.16 +13,4.16 +14,4.16 +18,4.16 +11,4.16 +10,4.16 +15,4.16 +16,4.16 +17,4.16 +19,4.16 +21,4.16 +20,4.16 +22,4.16 +23,4.16 +24,4.16 +25,4.16 +26,4.16 +28,4.16 +27,4.16 +31,4.16 +33,4.16 +29,4.16 +30,4.16 +250,4.16 +32,4.16 +34,4.16 +35,4.16 +36,4.16 +40,4.16 +37,4.16 +38,4.16 +39,4.16 +41,4.16 +42,4.16 +43,4.16 +44,4.16 +45,4.16 +47,4.16 +46,4.16 +48,4.16 +49,4.16 +50,4.16 +51,4.16 +151,4.16 +52,4.16 +53,4.16 +54,4.16 +57,4.16 +55,4.16 +56,4.16 +58,4.16 +60,4.16 +59,4.16 +61,4.16 +62,4.16 +63,4.16 +64,4.16 +65,4.16 +66,4.16 +67,4.16 +68,4.16 +72,4.16 +69,4.16 +70,4.16 +71,4.16 +73,4.16 +76,4.16 +74,4.16 +75,4.16 +77,4.16 +78,4.16 +79,4.16 +80,4.16 +81,4.16 +82,4.16 +84,4.16 +83,4.16 +85,4.16 +86,4.16 +87,4.16 +88,4.16 +89,4.16 +90,4.16 +91,4.16 +92,4.16 +93,4.16 +94,4.16 +95,4.16 +96,4.16 +97,4.16 +98,4.16 +99,4.16 +100,4.16 +450,4.16 +101,4.16 +102,4.16 +105,4.16 +103,4.16 +104,4.16 +106,4.16 +108,4.16 +107,4.16 +109,4.16 +300,4.16 +110,4.16 +111,4.16 +112,4.16 +113,4.16 +114,4.16 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder123/DistributedLoad.csv b/src/test/resources/ieeeFeeder123/DistributedLoad.csv new file mode 100644 index 0000000000..65cf9c2d6e --- /dev/null +++ b/src/test/resources/ieeeFeeder123/DistributedLoad.csv @@ -0,0 +1 @@ +NodeA,NodeB,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q diff --git a/src/test/resources/ieeeFeeder123/Gen.csv b/src/test/resources/ieeeFeeder123/Gen.csv new file mode 100644 index 0000000000..5b4542d8fa --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Gen.csv @@ -0,0 +1,2 @@ +GenName,busName,SetPoint +G150,150,1.0 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder123/Line.csv b/src/test/resources/ieeeFeeder123/Line.csv new file mode 100644 index 0000000000..b2a8bf6652 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Line.csv @@ -0,0 +1,119 @@ +NodeA,NodeB,Length,Config +1,2,175,10 +1,3,250,11 +1,7,300,1 +3,4,200,11 +3,5,325,11 +5,6,250,11 +7,8,200,1 +8,12,225,10 +8,9,225,9 +8,13,300,1 +9,14,425,9 +13,34,150,11 +13,18,825,2 +14,11,250,9 +14,10,250,9 +15,16,375,11 +15,17,350,11 +18,19,250,9 +18,21,300,2 +19,20,325,9 +21,22,525,10 +21,23,250,2 +23,24,550,11 +23,25,275,2 +25,26,350,7 +25,28,200,2 +26,27,275,7 +26,31,225,11 +27,33,500,9 +28,29,300,2 +29,30,350,2 +30,250,200,2 +31,32,300,11 +34,15,100,11 +35,36,650,8 +35,40,250,1 +36,37,300,9 +36,38,250,10 +38,39,325,10 +40,41,325,11 +40,42,250,1 +42,43,500,10 +42,44,200,1 +44,45,200,9 +44,47,250,1 +45,46,300,9 +47,48,150,4 +47,49,250,4 +49,50,250,4 +50,51,250,4 +51,151,500,4 +52,53,200,1 +53,54,125,1 +54,55,275,1 +54,57,350,3 +55,56,275,1 +57,58,250,10 +57,60,750,3 +58,59,250,10 +60,61,550,5 +60,62,250,12 +62,63,175,12 +63,64,350,12 +64,65,425,12 +65,66,325,12 +67,68,200,9 +67,72,275,3 +67,97,250,3 +68,69,275,9 +69,70,325,9 +70,71,275,9 +72,73,275,11 +72,76,200,3 +73,74,350,11 +74,75,400,11 +76,77,400,6 +76,86,700,3 +77,78,100,6 +78,79,225,6 +78,80,475,6 +80,81,475,6 +81,82,250,6 +81,84,675,11 +82,83,250,6 +84,85,475,11 +86,87,450,6 +87,88,175,9 +87,89,275,6 +89,90,225,10 +89,91,225,6 +91,92,300,11 +91,93,225,6 +93,94,275,9 +93,95,300,6 +95,96,200,10 +97,98,275,3 +98,99,550,3 +99,100,300,3 +100,450,800,3 +101,102,225,11 +101,105,275,3 +102,103,325,11 +103,104,700,11 +105,106,225,10 +105,108,325,3 +106,107,575,10 +108,109,450,9 +108,300,1000,3 +109,110,300,9 +110,111,575,9 +110,112,125,9 +112,113,525,9 +113,114,325,9 +18,35,375,4 +150,1,400,1 +13,52,400,1 +60,67,350,6 +97,101,250,3 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder123/LineConfig.csv b/src/test/resources/ieeeFeeder123/LineConfig.csv new file mode 100644 index 0000000000..6345fc3ead --- /dev/null +++ b/src/test/resources/ieeeFeeder123/LineConfig.csv @@ -0,0 +1,14 @@ +Config,PhaseA,PhaseB,PhaseC,r11,x11,r12,x12,r13,x13,r22,x22,r23,x23,r33,x33,b11,b12,b13,b22,b23,b33 +1,1,1,1,0.4576,1.0780,0.1560,0.5017,0.1535,0.3849,0.4666,1.0482,0.1580,0.4236,0.4615,1.0651,5.6765,-1.8319,-0.6982,5.9809,-1.1645,5.3971 +2,1,1,1,0.4666,1.0482,0.1580,0.4236,0.1560,0.5017,0.4615,1.0651,0.1535,0.3849,0.4576,1.0780,5.9809,-1.1645,-1.8319,5.3971,-0.6982,5.6765 +3,1,1,1,0.4615,1.0651,0.1535,0.3849,0.1580,0.4236,0.4576,1.0780,0.1560,0.5017,0.4666,1.0482,5.3971,-0.6982,-1.1645,5.6765,-1.8319,5.9809 +4,1,1,1,0.4615,1.0651,0.1580,0.4236,0.1535,0.3849,0.4666,1.0482,0.1560,0.5017,0.4576,1.0780,5.3971,-1.1645,-0.6982,5.9809,-1.8319,5.6765 +5,1,1,1,0.4666,1.0482,0.1560,0.5017,0.1580,0.4236,0.4576,1.0780,0.1535,0.3849,0.4615,1.0651,5.9809,-1.8319,-1.1645,5.6765,-0.6982,5.3971 +6,1,1,1,0.4576,1.0780,0.1535,0.3849,0.1560,0.5017,0.4615,1.0651,0.1580,0.4236,0.4666,1.0482,5.6765,-0.6982,-1.8319,5.3971,-1.1645,5.9809 +7,1,0,1,0.4576,1.0780,0.0000,0.0000,0.1535,0.3849,0.0000,0.0000,0.0000,0.0000,0.4615,1.0651,5.1154,0.0000,-1.0549,0.0000,0.0000,5.1704 +8,1,1,0,0.4576,1.0780,0.1535,0.3849,0.0000,0.0000,0.4615,1.0651,0.0000,0.0000,0.0000,0.0000,5.1154,-1.0549,0.0000,5.1704,0.0000,0.0000 +9,1,0,0,1.3292,1.3475,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.5193,0.0000,0.0000,0.0000,0.0000,0.0000 +10,0,1,0,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.3292,1.3475,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.5193,0.0000,0.0000 +11,0,0,1,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.3292,1.3475,0.0000,0.0000,0.0000,0.0000,0.0000,4.5193 +12,1,1,1,1.5209,0.7521,0.5198,0.2775,0.4924,0.2157,1.5329,0.7162,0.5198,0.2775,1.5209,0.7521,67.2242,0.0000,0.0000,67.2242,0.0000,67.2242 + diff --git a/src/test/resources/ieeeFeeder123/Regulator.csv b/src/test/resources/ieeeFeeder123/Regulator.csv new file mode 100644 index 0000000000..b680c8f64f --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Regulator.csv @@ -0,0 +1,5 @@ +Line,RhoA,RhoB,RhoC +150-1,1.0437,1.0438,1.0438 +60-67,1.05,1.00624,1.03123 +25-26,1.0,1.0,0.9937 +9-14,0.9937,1.0,1.0 diff --git a/src/test/resources/ieeeFeeder123/SpotLoad.csv b/src/test/resources/ieeeFeeder123/SpotLoad.csv new file mode 100644 index 0000000000..d3327baa38 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/SpotLoad.csv @@ -0,0 +1,86 @@ +Node,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +1,Y-PQ,40,20,0,0,0,0 +2,Y-PQ,0,0,20,10,0,0 +4,Y-PQ,0,0,0,0,40,20 +5,Y-I,0,0,0,0,20,10 +6,Y-Z,0,0,0,0,40,20 +7,Y-PQ,20,10,0,0,0,0 +9,Y-PQ,40,20,0,0,0,0 +10,Y-I,20,10,0,0,0,0 +11,Y-Z,40,20,0,0,0,0 +12,Y-PQ,0,0,20,10,0,0 +16,Y-PQ,0,0,0,0,40,20 +17,Y-PQ,0,0,0,0,20,10 +19,Y-PQ,40,20,0,0,0,0 +20,Y-I,40,20,0,0,0,0 +22,Y-Z,0,0,40,20,0,0 +24,Y-PQ,0,0,0,0,40,20 +28,Y-I,40,20,0,0,0,0 +29,Y-Z,40,20,0,0,0,0 +30,Y-PQ,0,0,0,0,40,20 +31,Y-PQ,0,0,0,0,20,10 +32,Y-PQ,0,0,0,0,20,10 +33,Y-I,40,20,0,0,0,0 +34,Y-Z,0,0,0,0,40,20 +35,D-PQ,40,20,0,0,0,0 +37,Y-Z,40,20,0,0,0,0 +38,Y-I,0,0,20,10,0,0 +39,Y-PQ,0,0,20,10,0,0 +41,Y-PQ,0,0,0,0,20,10 +42,Y-PQ,20,10,0,0,0,0 +43,Y-Z,0,0,40,20,0,0 +45,Y-I,20,10,0,0,0,0 +46,Y-PQ,20,10,0,0,0,0 +47,Y-I,35,25,35,25,35,25 +48,Y-Z,70,50,70,50,70,50 +49,Y-PQ,35,25,70,50,35,20 +50,Y-PQ,0,0,0,0,40,20 +51,Y-PQ,20,10,0,0,0,0 +52,Y-PQ,40,20,0,0,0,0 +53,Y-PQ,40,20,0,0,0,0 +55,Y-Z,20,10,0,0,0,0 +56,Y-PQ,0,0,20,10,0,0 +58,Y-I,0,0,20,10,0,0 +59,Y-PQ,0,0,20,10,0,0 +60,Y-PQ,20,10,0,0,0,0 +62,Y-Z,0,0,0,0,40,20 +63,Y-PQ,40,20,0,0,0,0 +64,Y-I,0,0,75,35,0,0 +65,D-Z,35,25,35,25,70,50 +66,Y-PQ,0,0,0,0,75,35 +68,Y-PQ,20,10,0,0,0,0 +69,Y-PQ,40,20,0,0,0,0 +70,Y-PQ,20,10,0,0,0,0 +71,Y-PQ,40,20,0,0,0,0 +73,Y-PQ,0,0,0,0,40,20 +74,Y-Z,0,0,0,0,40,20 +75,Y-PQ,0,0,0,0,40,20 +76,D-I,105,80,70,50,70,50 +77,Y-PQ,0,0,40,20,0,0 +79,Y-Z,40,20,0,0,0,0 +80,Y-PQ,0,0,40,20,0,0 +82,Y-PQ,40,20,0,0,0,0 +83,Y-PQ,0,-200,0,-200,20,-190 +84,Y-PQ,0,0,0,0,20,10 +85,Y-PQ,0,0,0,0,40,20 +86,Y-PQ,0,0,20,10,0,0 +87,Y-PQ,0,0,40,20,0,0 +88,Y-PQ,40,-30,0,0,0,0 +90,Y-I,0,0,40,-30,0,0 +92,Y-PQ,0,0,0,0,40,-30 +94,Y-PQ,40,20,0,0,0,0 +95,Y-PQ,0,0,20,10,0,0 +96,Y-PQ,0,0,20,10,0,0 +98,Y-PQ,40,20,0,0,0,0 +99,Y-PQ,0,0,40,20,0,0 +100,Y-Z,0,0,0,0,40,20 +102,Y-PQ,0,0,0,0,20,10 +103,Y-PQ,0,0,0,0,40,20 +104,Y-PQ,0,0,0,0,40,20 +106,Y-PQ,0,0,40,20,0,0 +107,Y-PQ,0,0,40,20,0,0 +109,Y-PQ,40,20,0,0,0,0 +111,Y-PQ,20,10,0,0,0,0 +112,Y-I,20,10,0,0,0,0 +113,Y-Z,40,20,0,0,0,0 +114,Y-PQ,20,10,0,0,0,0 diff --git a/src/test/resources/ieeeFeeder123/Tfo.csv b/src/test/resources/ieeeFeeder123/Tfo.csv new file mode 100644 index 0000000000..7cc8d7f924 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/Tfo.csv @@ -0,0 +1 @@ +NodeA,NodeB,Config \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder123/TfoConfig.csv b/src/test/resources/ieeeFeeder123/TfoConfig.csv new file mode 100644 index 0000000000..af208d5f88 --- /dev/null +++ b/src/test/resources/ieeeFeeder123/TfoConfig.csv @@ -0,0 +1 @@ +Config,SkVA,kV-high,Winding-high,kV-low,Winding-low,R,X diff --git a/src/test/resources/ieeeFeeder13/Bus.csv b/src/test/resources/ieeeFeeder13/Bus.csv new file mode 100644 index 0000000000..048c44ba55 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Bus.csv @@ -0,0 +1,13 @@ +BusName,UNom +650,4.16 +632,4.16 +633,4.16 +634,0.48 +645,4.16 +646,4.16 +684,4.16 +611,4.16 +652,4.16 +680,4.16 +675,4.16 +671,4.16 diff --git a/src/test/resources/ieeeFeeder13/DistributedLoad.csv b/src/test/resources/ieeeFeeder13/DistributedLoad.csv new file mode 100644 index 0000000000..1462655e5d --- /dev/null +++ b/src/test/resources/ieeeFeeder13/DistributedLoad.csv @@ -0,0 +1,2 @@ +NodeA,NodeB,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +632,671,Y-PQ,17,10,66,38,117,68 diff --git a/src/test/resources/ieeeFeeder13/Gen.csv b/src/test/resources/ieeeFeeder13/Gen.csv new file mode 100644 index 0000000000..19dfc82448 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Gen.csv @@ -0,0 +1,2 @@ +GenName,busName,SetPoint +G650,650,1.0 diff --git a/src/test/resources/ieeeFeeder13/Line.csv b/src/test/resources/ieeeFeeder13/Line.csv new file mode 100644 index 0000000000..9e1ad5d5e3 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Line.csv @@ -0,0 +1,11 @@ +NodeA,NodeB,Length,Config +632,645,500,603 +632,633,500,602 +645,646,300,603 +650,632,2000,601 +684,652,800,607 +632,671,2000,601 +671,684,300,604 +671,680,1000,601 +684,611,300,605 +671,675,500,606 diff --git a/src/test/resources/ieeeFeeder13/LineConfig.csv b/src/test/resources/ieeeFeeder13/LineConfig.csv new file mode 100644 index 0000000000..e3cee9907f --- /dev/null +++ b/src/test/resources/ieeeFeeder13/LineConfig.csv @@ -0,0 +1,8 @@ +Config,PhaseA,PhaseB,PhaseC,r11,x11,r12,x12,r13,x13,r22,x22,r23,x23,r33,x33,b11,b12,b13,b22,b23,b33 +601,1,1,1,0.3465,1.0179,0.1560,0.5017,0.1580,0.4236,0.3375,1.0478,0.1535,0.3849,0.3414,1.0348,6.2998,-1.9958,-1.2595,5.9597,-0.7417,5.6386 +602,1,1,1,0.7526,1.1814,0.1580,0.4236,0.1560,0.5017,0.7475,1.1983,0.1535,0.3849,0.7436,1.2112,5.6990,-1.0817,-1.6905,5.1795,-0.6588,5.4246 +603,0,1,1,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.3294,1.3471,0.2066,0.4591,1.3238,1.3569,0.0000,0.0000,0.0000,4.7097,-0.8999,4.6658 +604,1,0,1,1.3238,1.3569,0.0000,0.0000,0.2066,0.4591,0.0000,0.0000,0.0000,0.0000,1.3294,1.3471,4.6658,0.0000,-0.8999,0.0000,0.0000,4.7097 +605,0,0,1,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.3292,1.3475,0.0000,0.0000,0.0000,0.0000,0.0000,4.5193 +606,1,1,1,0.7982,0.4463,0.3192,0.0328,0.2849,-0.0143,0.7891,0.4041,0.3192,0.0328,0.7982,0.4463,96.8897,0.0000,0.0000,96.8897,0.0000,96.8897 +607,1,0,0,1.3425,0.5124,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,88.9912,0.0000,0.0000,0.0000,0.0000,0.0000 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder13/Regulator.csv b/src/test/resources/ieeeFeeder13/Regulator.csv new file mode 100644 index 0000000000..8fa3bf4830 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Regulator.csv @@ -0,0 +1,2 @@ +Line,RhoA,RhoB,RhoC +650-632,1.0625,1.05,1.0687 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder13/SpotLoad.csv b/src/test/resources/ieeeFeeder13/SpotLoad.csv new file mode 100644 index 0000000000..7c49850bcd --- /dev/null +++ b/src/test/resources/ieeeFeeder13/SpotLoad.csv @@ -0,0 +1,10 @@ +Node,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +634,Y-PQ,160,110,120,90,120,90 +645,Y-PQ,0,0,170,125,0,0 +646,D-Z,0,0,230,132,0,0 +652,Y-Z,128,86,0,0,0,0 +671,D-PQ,385,220,385,220,555,371 +675,Y-PQ,485,190,68,60,290,212 +675,Y-Z,0,-200,0,-200,0,-200 +611,Y-I,0,0,0,0,170,80 +611,Y-Z,0,0,0,0,0,-100 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder13/Tfo.csv b/src/test/resources/ieeeFeeder13/Tfo.csv new file mode 100644 index 0000000000..50122c84ac --- /dev/null +++ b/src/test/resources/ieeeFeeder13/Tfo.csv @@ -0,0 +1,2 @@ +NodeA,NodeB,Config +633,634,XFM-1 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder13/TfoConfig.csv b/src/test/resources/ieeeFeeder13/TfoConfig.csv new file mode 100644 index 0000000000..b9f8c2ff30 --- /dev/null +++ b/src/test/resources/ieeeFeeder13/TfoConfig.csv @@ -0,0 +1,3 @@ +Config,SkVA,kV-high,Winding-high,kV-low,Winding-low,R,X +Substation,5000,115,D,4.16,Gr.Y,1,8 +XFM-1,500,4.16,Gr.W,0.48,Gr.W,1.1,2 diff --git a/src/test/resources/ieeeFeeder34/Bus.csv b/src/test/resources/ieeeFeeder34/Bus.csv new file mode 100644 index 0000000000..c41c848a80 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Bus.csv @@ -0,0 +1,35 @@ +BusName,UNom +800,24.9 +802,24.9 +806,24.9 +808,24.9 +810,24.9 +812,24.9 +814,24.9 +850,24.9 +816,24.9 +818,24.9 +820,24.9 +822,24.9 +824,24.9 +826,24.9 +828,24.9 +830,24.9 +832,24.9 +834,24.9 +836,24.9 +840,24.9 +842,24.9 +844,24.9 +846,24.9 +848,24.9 +852,24.9 +854,24.9 +856,24.9 +858,24.9 +864,24.9 +860,24.9 +862,24.9 +838,24.9 +888,4.16 +890,4.16 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/DistributedLoad.csv b/src/test/resources/ieeeFeeder34/DistributedLoad.csv new file mode 100644 index 0000000000..81aa998ff6 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/DistributedLoad.csv @@ -0,0 +1,19 @@ +NodeA,NodeB,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +802,806,Y-PQ,0,0,30,15,25,14 +808,810,Y-I,0,0,16,8,0,0 +818,820,Y-Z,34,17,0,0,0,0 +820,822,Y-PQ,135,70,0,0,0,0 +816,824,D-I,0,0,5,2,0,0 +824,826,Y-I,0,0,40,20,4,2 +828,830,Y-PQ,7,3,0,0,0,0 +854,856,Y-PQ,0,0,4,2,0,0 +832,858,D-PQ,7,3,2,1,6,3 +858,864,Y-PQ,2,1,0,0,0,0 +858,834,D-PQ,4,2,15,8,13,7 +834,860,D-Z,16,8,20,10,110,55 +860,836,D-PQ,30,15,10,6,42,22 +836,840,D-I,18,9,22,11,0,0 +862,838,Y-PQ,0,0,28,14,0,0 +842,844,Y-PQ,9,5,0,0,0,0 +844,846,Y-PQ,0,0,25,12,20,11 +846,848,Y-PQ,0,0,23,11,0,0 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/Gen.csv b/src/test/resources/ieeeFeeder34/Gen.csv new file mode 100644 index 0000000000..5e5fce36a7 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Gen.csv @@ -0,0 +1,2 @@ +GenName,busName,SetPoint +G800,800,1.05 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/Line.csv b/src/test/resources/ieeeFeeder34/Line.csv new file mode 100644 index 0000000000..46d005d707 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Line.csv @@ -0,0 +1,33 @@ +NodeA,NodeB,Length,Config +800,802,2580,300 +802,806,1730,300 +806,808,32230,300 +808,810,5804,303 +808,812,37500,300 +812,814,29730,300 +814,850,10,301 +816,818,1710,302 +816,824,10210,301 +818,820,48150,302 +820,822,13740,302 +824,826,3030,303 +824,828,840,301 +828,830,20440,301 +830,854,520,301 +832,858,4900,301 +834,860,2020,301 +834,842,280,301 +836,840,860,301 +836,862,280,301 +842,844,1350,301 +844,846,3640,301 +846,848,530,301 +850,816,310,301 +852,832,10,301 +854,856,23330,303 +854,852,36830,301 +858,864,1620,302 +858,834,5830,301 +860,836,2680,301 +862,838,4860,304 +888,890,10560,300 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/LineConfig.csv b/src/test/resources/ieeeFeeder34/LineConfig.csv new file mode 100644 index 0000000000..50858fe88d --- /dev/null +++ b/src/test/resources/ieeeFeeder34/LineConfig.csv @@ -0,0 +1,6 @@ +Config,PhaseA,PhaseB,PhaseC,r11,x11,r12,x12,r13,x13,r22,x22,r23,x23,r33,x33,b11,b12,b13,b22,b23,b33 +300,1,1,1,1.3368,1.3343,0.2101,0.5779,0.2130,0.5015,1.3238,1.3569,0.2066,0.4591,1.3294,1.3471,5.3350,-1.5313,-0.9943,5.0979,-0.6212,4.8880 +301,1,1,1,1.9300,1.4115,0.2327,0.6442,0.2359,0.5691,1.9157,1.4281,0.2288,0.5238,1.9219,1.4209,5.1207,-1.4364,-0.9402,4.9055,-0.5951,4.7154 +302,1,0,0,2.7995,1.4855,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.2251,0.0000,0.0000,0.0000,0.0000,0.0000 +303,0,1,0,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,2.7995,1.4855,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.2251,0.0000,0.0000 +304,0,1,0,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.9217,1.4212,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.3637,0.0000,0.0000 diff --git a/src/test/resources/ieeeFeeder34/Regulator.csv b/src/test/resources/ieeeFeeder34/Regulator.csv new file mode 100644 index 0000000000..f1b24d136b --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Regulator.csv @@ -0,0 +1,3 @@ +Line,RhoA,RhoB,RhoC +814-850,1.075,1.03117,1.03133 +852-832,1.0812,1.0687,1.075 diff --git a/src/test/resources/ieeeFeeder34/SpotLoad.csv b/src/test/resources/ieeeFeeder34/SpotLoad.csv new file mode 100644 index 0000000000..84f9f6f194 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/SpotLoad.csv @@ -0,0 +1,7 @@ +Node,Load,Ph-1,Ph-1Q,Ph-2,Ph-2Q,Ph-3,Ph-3Q +860,Y-PQ,20,16,20,16,20,16 +840,Y-I,9,7,9,7,9,7 +844,Y-Z,135,5,135,5,135,5 +848,D-PQ,20,-134,20,-134,20,-134 +890,D-I,150,75,150,75,150,75 +830,D-Z,10,5,10,5,25,10 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/Tfo.csv b/src/test/resources/ieeeFeeder34/Tfo.csv new file mode 100644 index 0000000000..b531a06915 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/Tfo.csv @@ -0,0 +1,2 @@ +NodeA,NodeB,Config +832,888,XFM-1 \ No newline at end of file diff --git a/src/test/resources/ieeeFeeder34/TfoConfig.csv b/src/test/resources/ieeeFeeder34/TfoConfig.csv new file mode 100644 index 0000000000..63035a3040 --- /dev/null +++ b/src/test/resources/ieeeFeeder34/TfoConfig.csv @@ -0,0 +1,3 @@ +Config,SkVA,kV-high,Winding-high,kV-low,Winding-low,R,X +Substation,2500,69,D,24.9,Gr.W,1,8 +XFM-1,500,24.9,Gr.W,4.16,Gr.W,1.9,4.08 \ No newline at end of file diff --git a/src/test/resources/lvFeeder/Buscoords.csv b/src/test/resources/lvFeeder/Buscoords.csv new file mode 100644 index 0000000000..623890f156 --- /dev/null +++ b/src/test/resources/lvFeeder/Buscoords.csv @@ -0,0 +1,908 @@ +#Bus Coordinates,, +Busname, x, y +1,390872.663,392887.379 +2,390871.596,392887.638 +3,390871.481,392887.643 +4,390871.379,392887.608 +5,390871.305,392887.55 +6,390871.234,392887.42 +7,390868.779,392877.637 +8,390868.753,392877.186 +9,390868.753,392876.81 +10,390868.804,392876.484 +11,390868.904,392876.259 +12,390869.079,392876.108 +13,390869.18,392876.008 +14,390869.5,392875.857 +15,390872.292,392875.208 +16,390872.314,392875.302 +17,390875.678,392874.422 +18,390872.316,392875.346 +19,390875.907,392874.353 +20,390872.312,392875.392 +21,390876.142,392874.223 +22,390872.303,392875.433 +23,390876.44,392873.903 +24,390872.288,392875.482 +25,390877.003,392873.341 +26,390872.263,392875.532 +27,390880.364,392878.196 +28,390884.19,392866.433 +29,390872.239,392875.581 +30,390881.306,392879.522 +31,390879.232,392879.305 +32,390886.111,392864.602 +33,390872.17,392875.71 +34,390885,392880 +35,390879.208,392879.353 +36,390890.1695,392868.642 +37,390891.919,392859.065 +38,390872.092,392875.822 +39,390879.183,392879.426 +40,390890.444,392868.351 +41,390891.41,392869.955 +42,390895.963,392855.237 +43,390891.775,392858.903 +44,390872.073,392875.85 +45,390879.159,392879.522 +46,390890.571,392868.223 +47,390893,392874 +48,390899.026,392852.352 +49,390891.742,392858.804 +50,390872.038,392875.883 +51,390879.159,392879.763 +52,390890.754,392868.168 +53,390899.475,392851.944 +54,390899.491,392852.791 +55,390891.759,392858.689 +56,390871.964,392875.93 +57,390879.232,392879.956 +58,390890.936,392868.168 +59,390901.469,392850.053 +60,390899.548,392852.823 +61,390891.775,392858.59 +62,390871.892,392875.96 +63,390879.907,392880.679 +64,390891.045,392868.168 +65,390901.87,392849.664 +66,390907.23,392855.97 +67,390899.618,392852.847 +68,390891.825,392858.508 +69,390871.812,392875.983 +70,390881,392884 +71,390891.246,392868.241 +72,390906.932,392845.428 +73,390907,392860 +74,390907,392860 +75,390899.793,392852.887 +76,390891.972,392858.324 +77,390871.436,392876.083 +78,390892.048,392868.97 +79,390908.613,392843.857 +80,390899.889,392852.926 +81,390892.512,392857.808 +82,390870.935,392876.183 +83,390896,392870 +84,390909.025,392843.57 +85,390899.982,392852.987 +86,390893.558,392856.82 +87,390870.634,392876.259 +88,390909.878,392843.014 +89,390900.06,392853.057 +90,390893.775,392856.555 +91,390870.525,392876.285 +92,390910.741,392842.593 +93,390893.803,392856.496 +94,390870.492,392876.296 +95,390911.23,392842.324 +96,390893.8,392856.41 +97,390870.458,392876.31 +98,390911.556,392842.152 +99,390893.781,392856.378 +100,390870.383,392876.359 +101,390911.997,392841.898 +102,390890.706,392852.332 +103,390870.157,392876.534 +104,390912.282,392841.942 +105,390912.282,392841.72 +106,390890.64,392852.121 +107,390912.63,392841.967 +108,390912.43,392841.6 +109,390890.511,392851.689 +110,390913.032,392842.011 +111,390917.463,392836.015 +112,390883.277,392842.144 +113,390913.637,392842.13 +114,390918.004,392835.491 +115,390876.523,392833.895 +116,390914.4,392842.345 +117,390918.765,392836.293 +118,390915.488,392832.839 +119,390875.778,392833.236 +120,390914.924,392842.567 +121,390918.949,392836.229 +122,390919.135,392836.684 +123,390910.895,392828.11 +124,390875.199,392832.8 +125,390915.64,392842.933 +126,390919.115,392836.199 +127,390920.876,392838.518 +128,390908.834,392825.979 +129,390874.662,392832.48 +130,390916.403,392843.351 +131,390919.234,392836.205 +132,390923.576,392835.814 +133,390925.817,392843.725 +134,390908.271,392825.3 +135,390872.865,392831.803 +136,390917.072,392843.826 +137,390919.412,392836.253 +138,390923.799,392835.572 +139,390929.524,392847.569 +140,390907.615,392824.551 +141,390871.466,392831.607 +142,390918.076,392844.727 +143,390919.608,392836.348 +144,390923.973,392835.3 +145,390932.015,392850.135 +146,390907.053,392823.802 +147,390871.226,392831.623 +148,390922.542,392849.331 +149,390919.762,392836.466 +150,390924.07,392835.058 +151,390934.503,392852.697 +152,390935.584,392846.448 +153,390906.491,392822.865 +154,390871.173,392831.687 +155,390923.521,392850.328 +156,390919.905,392836.632 +157,390924.128,392834.671 +158,390941.046,392859.545 +159,390935.817,392846.24 +160,390906.35,392822.584 +161,390871.128,392831.801 +162,390915.061,392858.471 +163,390927.222,392854.1 +164,390920.012,392836.805 +165,390924.169,392834.201 +166,390943.336,392861.907 +167,390935.995,392846.017 +168,390905.502,392821.012 +169,390871.1,392832.049 +170,390913.478,392860.025 +171,390931.986,392859.25 +172,390920.077,392836.965 +173,390924.246,392833.853 +174,390946.01,392864.771 +175,390946.317,392858.942 +176,390936.05,392845.912 +177,390905.189,392820.053 +178,390910,392863 +179,390932.788,392860.118 +180,390930.205,392860.892 +181,390920.101,392837.143 +182,390924.411,392833.475 +183,390946.422,392865.19 +184,390946.618,392858.602 +185,390936.119,392845.666 +186,390905.022,392819.323 +187,390935.932,392863.545 +188,390923.046,392867.911 +189,390920.095,392837.297 +190,390924.644,392833.165 +191,390948.046,392866.84 +192,390946.652,392865.034 +193,390946.84,392858.223 +194,390936.242,392845.027 +195,390904.938,392818.655 +196,390941.568,392869.643 +197,390921.647,392869.283 +198,390923.824,392868.734 +199,390920.042,392837.481 +200,390924.934,392832.865 +201,390948.693,392867.51 +202,390946.807,392864.979 +203,390946.971,392857.897 +204,390936.288,392844.648 +205,390905.001,392817.821 +206,390939.128,392871.786 +207,390943.019,392871.212 +208,390917,392871 +209,390923.916,392868.865 +210,390919.804,392837.861 +211,390925.39,392832.419 +212,390946.962,392864.97 +213,390947.023,392857.622 +214,390936.388,392844.4 +215,390905.251,392816.298 +216,390931.512,392879.201 +217,390945.597,392874.081 +218,390923.961,392868.986 +219,390919.412,392838.407 +220,390926.643,392831.209 +221,390947.126,392865.015 +222,390947.089,392857.034 +223,390936.61,392843.936 +224,390905.69,392815.026 +225,390927,392880 +226,390946.519,392875.104 +227,390923.967,392869.089 +228,390926.75,392831.106 +229,390947.326,392865.134 +230,390947.18,392856.577 +231,390936.749,392843.721 +232,390906.065,392814.191 +233,390937.556,392882.924 +234,390947.273,392875.942 +235,390923.916,392869.238 +236,390926.805,392831.065 +237,390947.49,392865.261 +238,390947.287,392856.272 +239,390936.874,392843.589 +240,390906.399,392813.691 +241,390936.301,392884.111 +242,390923.807,392869.387 +243,390926.875,392831.043 +244,390947.59,392865.397 +245,390947.457,392855.998 +246,390938.352,392842.126 +247,390907.213,392812.685 +248,390931,392884 +249,390931,392884 +250,390923.606,392869.587 +251,390926.945,392831.047 +252,390947.626,392865.525 +253,390947.784,392855.658 +254,390938.796,392841.703 +255,390910.805,392815.497 +256,390907.752,392812.019 +257,390922.855,392870.303 +258,390927.019,392831.072 +259,390947.635,392865.698 +260,390949.052,392854.417 +261,390938.914,392841.633 +262,390911.309,392815.876 +263,390909.871,392809.604 +264,390921,392875 +265,390927.156,392831.157 +266,390947.599,392865.889 +267,390949.358,392854.138 +268,390936.706,392838.972 +269,390939.032,392841.62 +270,390911.514,392816.081 +271,390913.165,392812.297 +272,390910.583,392808.793 +273,390927.282,392831.268 +274,390947.508,392866.043 +275,390949.516,392854.033 +276,390935,392836 +277,390939.171,392841.613 +278,390911.683,392816.381 +279,390913.42,392812.472 +280,390913.173,392805.861 +281,390927.695,392831.755 +282,390947.071,392866.462 +283,390949.636,392853.999 +284,390939.296,392841.627 +285,390911.851,392816.885 +286,390913.648,392812.586 +287,390914.334,392804.546 +288,390912.467,392805.282 +289,390931,392831 +290,390946.507,392867.044 +291,390949.096,392853.309 +292,390949.744,392853.995 +293,390939.414,392841.675 +294,390912.001,392817.334 +295,390913.996,392812.686 +296,390914.839,392803.916 +297,390909.292,392803.146 +298,390948.848,392852.992 +299,390949.819,392854.01 +300,390939.539,392841.731 +301,390912.188,392817.651 +302,390915.584,392813.037 +303,390918.269,392799.909 +304,390908.726,392802.519 +305,390948.3925,392852.4855 +306,390949.898,392854.051 +307,390940.115,392842.278 +308,390912.454,392818.024 +309,390915.882,392813.133 +310,390918.529,392799.613 +311,390908.548,392802.302 +312,390947.472,392851.557 +313,390950.032,392854.156 +314,390943,392844 +315,390912.783,392818.365 +316,390916.093,392813.229 +317,390919.05,392800 +318,390923.291,392794.191 +319,390908.47,392802.178 +320,390946,392848 +321,390950.481,392854.63 +322,390913.191,392818.747 +323,390916.33,392813.352 +324,390921.636,392802.118 +325,390925.511,392791.533 +326,390908.408,392802.069 +327,390952,392853 +328,390913.426,392818.962 +329,390916.549,392813.501 +330,390922.556,392802.836 +331,390932.594,392797.299 +332,390929.7419,392786.3729 +333,390908.354,392801.937 +334,390914.512,392819.906 +335,390918.357,392814.966 +336,390924.531,392804.433 +337,390935,392800 +338,390934.963,392790.74 +339,390930.511,392785.435 +340,390908.323,392801.829 +341,390914.975,392820.221 +342,390923,392816 +343,390926.15,392805.742 +344,390923.88,392805.165 +345,390937.605,392792.915 +346,390931.168,392784.63 +347,390908.308,392801.736 +348,390915.149,392820.308 +349,390929,392807 +350,390923.819,392805.287 +351,390937.856,392793.111 +352,390931.703,392784.132 +353,390908.308,392801.651 +354,390915.29,392820.348 +355,390923.758,392805.422 +356,390937.949,392793.204 +357,390932.46,392783.603 +358,390908.315,392801.581 +359,390915.397,392820.355 +360,390923.744,392805.551 +361,390938.005,392793.278 +362,390932.953,392783.3 +363,390908.339,392801.503 +364,390915.451,392820.348 +365,390923.772,392805.686 +366,390938.024,392793.371 +367,390933.748,392782.903 +368,390908.385,392801.426 +369,390915.511,392820.295 +370,390923.86,392805.862 +371,390938.024,392793.483 +372,390934.599,392782.657 +373,390908.689,392801.043 +374,390915.592,392820.188 +375,390924.022,392806.038 +376,390938.005,392793.623 +377,390935.584,392782.524 +378,390910.98,392798.157 +379,390907.282,392801.155 +380,390915.907,392819.679 +381,390925.152,392806.998 +382,390937.968,392793.744 +383,390936.303,392782.505 +384,390913.208,392795.42 +385,390898.776,392802.817 +386,390906.36,392802.282 +387,390918,392819 +388,390926,392812 +389,390937.912,392793.827 +390,390937.155,392782.6 +391,390913.3067,392795.2978 +392,390895.655,392803.358 +393,390901.454,392808.389 +394,390937.791,392793.949 +395,390938.366,392782.884 +396,390910.051,392792.872 +397,390915.116,392793.058 +398,390895.344,392803.443 +399,390901.096,392808.831 +400,390937.344,392794.349 +401,390939.237,392783.187 +402,390909.746,392792.659 +403,390916.015,392791.999 +404,390895.119,392803.443 +405,390900.933,392809.018 +406,390937,392798 +407,390940.013,392783.622 +408,390909.563,392792.553 +409,390918.607,392788.706 +410,390915.753,392791.725 +411,390894.893,392803.386 +412,390900.791,392809.106 +413,390940.732,392784.113 +414,390909.433,392792.492 +415,390922.398,392784.096 +416,390915.69,392791.654 +417,390894.074,392802.85 +418,390900.539,392809.227 +419,390941.549,392784.768 +420,390909.212,392792.415 +421,390923.197,392783.136 +422,390915.654,392791.598 +423,390893.905,392802.681 +424,390897.659,392810.609 +425,390942.91,392785.874 +426,390942.91,392785.874 +427,390908.473,392792.172 +428,390923.398,392782.888 +429,390915.626,392791.52 +430,390893.792,392802.483 +431,390896.587,392810.976 +432,390947.433,392789.686 +433,390947.433,392789.686 +434,390907.642,392791.928 +435,390923.491,392782.749 +436,390915.619,392791.449 +437,390893.764,392802.258 +438,390896.22,392811.089 +439,390953.846,392795.059 +440,390953.846,392795.059 +441,390907.177,392791.783 +442,390923.553,392782.625 +443,390915.619,392791.371 +444,390893.82,392802.004 +445,390895.542,392811.117 +446,390958.463,392798.896 +447,390958.463,392798.896 +448,390906.751,392791.616 +449,390923.584,392782.517 +450,390915.633,392791.293 +451,390894.441,392801.355 +452,390894.949,392811.145 +453,390959.827,392800.103 +454,390959.827,392800.103 +455,390906.364,392791.414 +456,390923.6,392782.346 +457,390915.654,392791.243 +458,390894,392797 +459,390894.3,392810.976 +460,390963.865,392803.674 +461,390963.865,392803.674 +462,390957.305,392802.791 +463,390905.762,392791.025 +464,390923.584,392782.192 +465,390915.683,392791.215 +466,390893.764,392810.637 +467,390968.351,392807.642 +468,390968.351,392807.642 +469,390964.469,392803.03 +470,390956.915,392803.162 +471,390905.366,392790.721 +472,390923.538,392782.052 +473,390915.718,392791.18 +474,390891.2225,392808.691 +475,390970.015,392809.073 +476,390970.015,392809.073 +477,390956.693,392803.354 +478,390905.122,392790.469 +479,390923.476,392781.898 +480,390915.775,392791.151 +481,390891.138,392808.521 +482,390973.535,392812.101 +483,390973.535,392812.101 +484,390963.033,392816.614 +485,390956.52,392803.452 +486,390905.015,392790.34 +487,390923.352,392781.774 +488,390915.881,392791.116 +489,390891.11,392808.352 +490,390978.625,392816.388 +491,390978.625,392816.388 +492,390962.663,392817.058 +493,390965.49,392819.862 +494,390956.242,392803.57 +495,390904.962,392790.248 +496,390923.073,392781.511 +497,390916.016,392791.08 +498,390891.166,392808.126 +499,390981.879,392818.818 +500,390981.879,392818.818 +501,390962.507,392817.246 +502,390964,392822 +503,390955.804,392803.705 +504,390904.939,392790.18 +505,390916.237,392776.136 +506,390916.108,392791.052 +507,390891.336,392807.872 +508,390982.421,392819.26 +509,390982.421,392819.26 +510,390962.384,392817.32 +511,390955.501,392803.823 +512,390904.924,392790.081 +513,390912.695,392780.428 +514,390915.185,392775.311 +515,390916.186,392791.017 +516,390983.883,392820.451 +517,390983.883,392820.451 +518,390979.167,392822.695 +519,390962.253,392817.337 +520,390955.316,392803.946 +521,390904.932,392790.005 +522,390908,392779 +523,390914.619,392774.864 +524,390916.242,392790.981 +525,390985.003,392821.271 +526,390985.003,392821.271 +527,390977.209,392824.691 +528,390962.138,392817.312 +529,390955.18,392804.057 +530,390905.076,392789.479 +531,390914.548,392774.783 +532,390916.278,392790.932 +533,390986.567,392822.332 +534,390986.567,392822.332 +535,390975.743,392826.352 +536,390962.023,392817.271 +537,390954.784,392804.457 +538,390903.887,392790.99 +539,390904,392784 +540,390914.494,392774.721 +541,390916.292,392790.868 +542,390987.709,392823.028 +543,390987.709,392823.028 +544,390975.138,392827.039 +545,390961.735,392817.041 +546,390951.688,392807.795 +547,390902.523,392792.617 +548,390914.467,392774.649 +549,390916.278,392790.783 +550,390991,392824.805 +551,390991,392824.805 +552,390974.926,392827.234 +553,390977.781,392829.754 +554,390961.464,392816.787 +555,390951.538,392807.965 +556,390897,392791 +557,390914.449,392774.569 +558,390916.242,392790.733 +559,390993.403,392826.054 +560,390993.403,392826.054 +561,390974.831,392827.281 +562,390976,392832 +563,390958,392817 +564,390951.458,392808.125 +565,390914.458,392774.497 +566,390916.157,392790.648 +567,390993.936,392826.331 +568,390993.936,392826.331 +569,390991.104,392829.14 +570,390974.676,392827.311 +571,390951.428,392808.325 +572,390914.476,392774.425 +573,390994.064,392826.393 +574,390994.064,392826.393 +575,390990.836,392829.546 +576,390974.581,392827.311 +577,390951.428,392808.505 +578,390914.701,392774.115 +579,390997.536,392828.07 +580,390997.536,392828.07 +581,390993.888,392826.66 +582,390990.662,392829.86 +583,390974.467,392827.299 +584,390951.458,392808.71 +585,390910.991,392771.178 +586,390915.202,392773.458 +587,390999.985,392829.212 +588,390999.985,392829.212 +589,390993.812,392826.748 +590,390990.534,392830.185 +591,390974.378,392827.252 +592,390951.553,392808.9 +593,390910.777,392771.009 +594,390917.646,392770.357 +595,391004.98,392831.301 +596,391000.5776,392829.4599 +597,390993.745,392826.807 +598,390989.572,392833.322 +599,390973.854,392826.853 +600,390951.713,392809.099 +601,390910.657,392770.943 +602,390910.518,392764.593 +603,390920.545,392766.731 +604,391009.465,392833.089 +605,391009.465,392833.089 +606,391000.5776,392829.4599 +607,390996.172,392840.26 +608,390996.172,392840.26 +609,390993.64,392826.841 +610,390989.096,392834.773 +611,390969,392827 +612,390951.838,392809.199 +613,390910.547,392770.91 +614,390909,392760 +615,390923.419,392763.338 +616,391008.023,392836.745 +617,391012.375,392834.183 +618,391012.375,392834.183 +619,390996,392843 +620,390993.577,392826.832 +621,390988.794,392835.423 +622,390952.418,392809.569 +623,390910.454,392770.899 +624,390922.171,392762.286 +625,390924.232,392762.387 +626,391006.125,392841.751 +627,390993.509,392826.794 +628,390988.562,392835.841 +629,390954,392812 +630,390910.307,392770.899 +631,390921.888,392762.003 +632,390924.414,392762.164 +633,391005.565,392843.218 +634,390993.467,392826.744 +635,390988.132,392836.432 +636,390909.959,392770.941 +637,390921.726,392761.781 +638,390924.515,392762.063 +639,391002,392847 +640,390993.45,392826.677 +641,390987.226,392837.535 +642,390909.718,392770.968 +643,390921.524,392761.458 +644,390924.636,392761.963 +645,390993.459,392826.609 +646,390986.947,392837.814 +647,390909.412,392771.006 +648,390921.12,392760.65 +649,390924.798,392761.882 +650,390993.492,392826.521 +651,390986.866,392837.895 +652,390909.225,392771.017 +653,390920.797,392760.044 +654,390924.98,392761.862 +655,390993.551,392826.412 +656,390986.773,392837.93 +657,390987.307,392838.185 +658,390909.056,392771.023 +659,390920.534,392759.64 +660,390925.182,392761.882 +661,390993.787,392826.134 +662,390986.68,392837.93 +663,390987.923,392838.51 +664,390908.771,392771.012 +665,390920.231,392759.236 +666,390925.444,392762.018 +667,390993.989,392825.97 +668,390986.587,392837.907 +669,390990.478,392839.868 +670,390908.492,392770.984 +671,390919.948,392758.933 +672,390925.74,392761.64 +673,390926.091,392762.508 +674,390994.166,392825.873 +675,390986.018,392837.512 +676,390990,392841 +677,390908.361,392770.963 +678,390919.443,392758.468 +679,390925.919,392761.414 +680,390929.951,392765.901 +681,390994.528,392825.697 +682,390981,392837 +683,390908.218,392770.935 +684,390917.785,392756.994 +685,390926.062,392761.188 +686,390932.739,392768.301 +687,390908.087,392770.886 +688,390913,392755 +689,390926.169,392760.95 +690,390938.131,392762.197 +691,390940.702,392775.184 +692,390907.934,392770.815 +693,390926.216,392760.76 +694,390937.548,392761.707 +695,390939.539,392760.604 +696,390947.039,392768.131 +697,390942.352,392776.625 +698,390907.699,392770.684 +699,390926.24,392760.45 +700,390937.379,392761.539 +701,390943,392758 +702,390949,392763 +703,390944.148,392778.217 +704,390907.124,392770.224 +705,390926.204,392759.927 +706,390937.285,392761.418 +707,390948.941,392782.353 +708,390944.182,392778.111 +709,390906.396,392769.568 +710,390925.585,392756.048 +711,390937.231,392761.343 +712,390954.592,392787.288 +713,390951.513,392779.362 +714,390944.201,392778.008 +715,390906.33,392769.502 +716,390925.095,392752.863 +717,390937.197,392761.256 +718,390960.503,392792.29 +719,390951.779,392779.034 +720,390944.201,392777.911 +721,390906.287,392769.442 +722,390924.96,392751.851 +723,390937.177,392761.175 +724,390962.999,392794.377 +725,390966.597,392785.202 +726,390951.873,392778.903 +727,390944.188,392777.802 +728,390906.259,392769.376 +729,390924.892,392750.924 +730,390937.177,392761.081 +731,390966.383,392797.222 +732,390967.383,392784.225 +733,390951.956,392778.754 +734,390944.156,392777.718 +735,390906.248,392769.3 +736,390924.876,392750.418 +737,390937.191,392761.007 +738,390970.344,392800.554 +739,390967.79,392783.707 +740,390952.012,392778.624 +741,390944.072,392777.609 +742,390906.248,392769.229 +743,390924.892,392750.014 +744,390937.231,392760.926 +745,390973.519,392803.236 +746,390965.176,392781.034 +747,390967.869,392783.614 +748,390952.068,392778.466 +749,390943.95,392777.499 +750,390906.259,392769.163 +751,390924.96,392749.676 +752,390937.285,392760.845 +753,390974.708,392804.22 +754,390977.441,392798.798 +755,390965,392778 +756,390967.938,392783.559 +757,390952.106,392778.307 +758,390943.847,392777.429 +759,390906.303,392769.081 +760,390925.078,392749.289 +761,390937.393,392760.704 +762,390976.271,392805.664 +763,390980.72,392795.089 +764,390968.007,392783.531 +765,390952.134,392778.084 +766,390943.737,392777.377 +767,390906.369,392768.988 +768,390925.23,392748.952 +769,390938.215,392759.66 +770,390980.319,392808.983 +771,390978.194,392792.523 +772,390980.83,392795.019 +773,390968.132,392783.517 +774,390952.161,392777.776 +775,390943.66,392777.358 +776,390906.708,392768.567 +777,390925.5,392748.446 +778,390940,392756 +779,390983.29,392812.012 +780,390978,392789 +781,390980.951,392794.989 +782,390968.299,392783.573 +783,390952.189,392777.45 +784,390943.563,392777.358 +785,390906,392764 +786,390926.112,392747.463 +787,390985.762,392814.221 +788,390981.082,392794.959 +789,390968.41,392783.642 +790,390952.227,392777.236 +791,390943.473,392777.377 +792,390926.444,392747.366 +793,390924.179,392748.181 +794,390988.243,392815.901 +795,390981.202,392794.959 +796,390968.576,392783.781 +797,390952.283,392777.022 +798,390943.39,392777.416 +799,390926.734,392747.283 +800,390921.1,392749.367 +801,390988.444,392815.944 +802,390990.626,392817.377 +803,390981.333,392794.979 +804,390969.687,392784.793 +805,390952.311,392776.92 +806,390943.306,392777.506 +807,390926.982,392747.256 +808,390918.462,392750.361 +809,390988.65,392815.95 +810,390993.25,392818.98 +811,390993.25,392818.98 +812,390981.413,392795.009 +813,390973,392785 +814,390952.366,392776.761 +815,390943.035,392777.828 +816,390927.176,392747.256 +817,390917,392751 +818,390988.854,392815.918 +819,390995.557,392820.131 +820,390995.557,392820.131 +821,390981.524,392795.079 +822,390952.441,392776.622 +823,390942.694,392778.175 +824,390927.369,392747.297 +825,390989.048,392815.851 +826,390997.983,392821.471 +827,390997.983,392821.471 +828,390982.359,392795.763 +829,390952.581,392776.445 +830,390942.333,392778.516 +831,390927.535,392747.339 +832,390989.227,392815.749 +833,390999.996,392822.532 +834,390999.996,392822.532 +835,390986,392795 +836,390954.1,392774.61 +837,390927.645,392747.394 +838,390989.385,392815.617 +839,391002.28,392823.399 +840,391002.28,392823.399 +841,390954.732,392773.897 +842,390927.77,392747.463 +843,390989.516,392815.458 +844,391004.255,392819.014 +845,391005.615,392824.81 +846,391005.615,392824.81 +847,390955.053,392773.535 +848,390927.935,392747.601 +849,390989.5735,392815.3755 +850,391004.582,392818.391 +851,391009.67,392826.423 +852,391009.67,392826.423 +853,390955.134,392773.465 +854,390928.184,392747.849 +855,390990.602,392813.363 +856,391005.27,392816.532 +857,391016.001,392829.07 +858,391016.001,392829.07 +859,390955.204,392773.418 +860,390931,392748 +861,390935,392751 +862,390991.411,392812.136 +863,391006.257,392814.424 +864,391018.607,392830.063 +865,391018.607,392830.063 +866,390955.285,392773.378 +867,390991.997,392810.992 +868,391006.471,392814.211 +869,391020.304,392830.435 +870,391020.304,392830.435 +871,390955.355,392773.36 +872,390992.556,392809.765 +873,391006.765,392813.971 +874,391005.777,392813.73 +875,391021.504,392830.435 +876,391021.504,392830.435 +877,390955.425,392773.355 +878,390993.762,392807.804 +879,391007.112,392813.917 +880,391004.149,392812.61 +881,391022.496,392830.239 +882,391022.496,392830.239 +883,390955.495,392773.355 +884,390994.075,392807.334 +885,391007.646,392813.917 +886,391005,392808 +887,390955.564,392773.36 +888,390994.421,392806.816 +889,390992.316,392804.712 +890,391008.286,392814.131 +891,390956.756,392773.691 +892,390994.97,392805.953 +893,390990.811,392802.497 +894,391010.609,392815.358 +895,390952.377,392769.85 +896,390960,392774 +897,390995.113,392805.81 +898,390991,392798 +899,391014,392812 +900,390952,392766 +901,390995.257,392805.718 +902,390995.401,392805.718 +903,390995.584,392805.758 +904,390995.885,392805.914 +905,390996.355,392806.267 +906,391001,392805 diff --git a/src/test/resources/lvFeeder/LineCodes.csv b/src/test/resources/lvFeeder/LineCodes.csv new file mode 100644 index 0000000000..f603a0cd0f --- /dev/null +++ b/src/test/resources/lvFeeder/LineCodes.csv @@ -0,0 +1,12 @@ +# Line Codes defined by matrix values,,,,,,,, +Name,nphases,R1,X1,R0,X0,C1,C0,Units +2c_.007,3,3.97,0.099,3.97,0.099,0,0,km +2c_.0225,3,1.257,0.085,1.257,0.085,0,0,km +2c_16,3,1.15,0.088,1.2,0.088,0,0,km +35_SAC_XSC,3,0.868,0.092,0.76,0.092,0,0,km +4c_.06,3,0.469,0.075,1.581,0.091,0,0,km +4c_.1,3,0.274,0.073,0.959,0.079,0,0,km +4c_.35,3,0.089,0.0675,0.319,0.076,0,0,km +4c_185,3,0.166,0.068,0.58,0.078,0,0,km +4c_70,3,0.446,0.071,1.505,0.083,0,0,km +4c_95_SAC_XC,3,0.322,0.074,0.804,0.093,0,0,km diff --git a/src/test/resources/lvFeeder/Lines.csv b/src/test/resources/lvFeeder/Lines.csv new file mode 100644 index 0000000000..fa35170156 --- /dev/null +++ b/src/test/resources/lvFeeder/Lines.csv @@ -0,0 +1,907 @@ +# Line definitions ,,,,,, +Name,Bus1,Bus2,Phases,Length,Units,LineCode +LINE1,1,2,ABC,1.098,m,4c_70 +LINE2,2,3,ABC,0.11511,m,4c_70 +LINE3,3,4,ABC,0.10784,m,4c_70 +LINE4,4,5,ABC,0.094021,m,4c_70 +LINE5,5,6,ABC,0.14812,m,4c_70 +LINE6,6,7,ABC,10.0863,m,4c_70 +LINE7,7,8,ABC,0.45175,m,4c_70 +LINE8,8,9,ABC,0.376,m,4c_70 +LINE9,9,10,ABC,0.32997,m,4c_70 +LINE10,10,11,ABC,0.24622,m,4c_70 +LINE11,11,12,ABC,0.23114,m,4c_70 +LINE12,12,13,ABC,0.14213,m,4c_70 +LINE13,13,14,ABC,0.35384,m,4c_70 +LINE14,14,15,ABC,2.8664,m,4c_70 +LINE15,15,16,ABC,0.09654,m,2c_.007 +LINE16,15,17,ABC,3.476,m,4c_70 +LINE17,16,18,ABC,0.044045,m,2c_.007 +LINE18,17,19,ABC,0.23917,m,4c_70 +LINE19,18,20,ABC,0.046174,m,2c_.007 +LINE20,19,21,ABC,0.26856,m,4c_70 +LINE21,20,22,ABC,0.041976,m,2c_.007 +LINE22,21,23,ABC,0.43727,m,4c_70 +LINE23,22,24,ABC,0.051245,m,2c_.007 +LINE24,23,25,ABC,0.7955,m,4c_70 +LINE25,24,26,ABC,0.055902,m,2c_.007 +LINE26,25,27,ABC,5.9049,m,2c_16 +LINE27,25,28,ABC,9.9686,m,4c_70 +LINE28,26,29,ABC,0.054562,m,2c_.007 +LINE29,27,30,ABC,1.6265,m,2c_16 +LINE30,27,31,ABC,1.5847,m,2c_16 +LINE31,28,32,ABC,2.6538,m,4c_70 +LINE32,29,33,ABC,0.14629,m,2c_.007 +LINE33,30,34,ABC,3.7248,m,2c_16 +LINE34,31,35,ABC,0.053666,m,2c_16 +LINE35,32,36,ABC,5.7265,m,2c_16 +LINE36,32,37,ABC,8.0244,m,4c_70 +LINE37,33,38,ABC,0.13648,m,2c_.007 +LINE38,35,39,ABC,0.077162,m,2c_16 +LINE39,36,40,ABC,0.40004,m,2c_16 +LINE40,36,41,ABC,1.8063,m,2c_16 +LINE41,37,42,ABC,5.5684,m,4c_70 +LINE42,37,43,ABC,0.21675,m,4c_185 +LINE43,38,44,ABC,0.033838,m,2c_.007 +LINE44,39,45,ABC,0.098955,m,2c_16 +LINE45,40,46,ABC,0.18031,m,2c_16 +LINE46,41,47,ABC,4.3463,m,2c_16 +LINE47,42,48,ABC,4.2078,m,4c_70 +LINE48,43,49,ABC,0.10436,m,4c_185 +LINE49,44,50,ABC,0.048104,m,2c_.007 +LINE50,45,51,ABC,0.241,m,2c_16 +LINE51,46,52,ABC,0.19109,m,2c_16 +LINE52,48,53,ABC,0.60668,m,4c_70 +LINE53,48,54,ABC,0.63949,m,4c_70 +LINE54,49,55,ABC,0.11625,m,4c_185 +LINE55,50,56,ABC,0.087664,m,2c_.007 +LINE56,51,57,ABC,0.20634,m,2c_16 +LINE57,52,58,ABC,0.182,m,2c_16 +LINE58,53,59,ABC,2.7481,m,4c_70 +LINE59,54,60,ABC,0.065368,m,4c_70 +LINE60,55,61,ABC,0.10028,m,4c_185 +LINE61,56,62,ABC,0.078,m,2c_.007 +LINE62,57,63,ABC,0.98912,m,2c_16 +LINE63,58,64,ABC,0.109,m,2c_16 +LINE64,59,65,ABC,0.55868,m,4c_70 +LINE65,59,66,ABC,8.2583,m,2c_16 +LINE66,60,67,ABC,0.074,m,4c_70 +LINE67,61,68,ABC,0.096042,m,4c_185 +LINE68,62,69,ABC,0.083241,m,2c_.007 +LINE69,63,70,ABC,3.4962,m,2c_16 +LINE70,64,71,ABC,0.21385,m,2c_16 +LINE71,65,72,ABC,6.6006,m,4c_70 +LINE72,66,73,ABC,4.0366,m,2c_16 +LINE73,66,74,ABC,4.0366,m,2c_16 +LINE74,67,75,ABC,0.17951,m,4c_70 +LINE75,68,76,ABC,0.23551,m,4c_185 +LINE76,69,77,ABC,0.38907,m,2c_.007 +LINE77,71,78,ABC,1.0838,m,2c_16 +LINE78,72,79,ABC,2.3008,m,4c_70 +LINE79,75,80,ABC,0.10362,m,4c_70 +LINE80,76,81,ABC,0.7469,m,4c_185 +LINE81,77,82,ABC,0.51088,m,2c_.007 +LINE82,78,83,ABC,4.084,m,2c_16 +LINE83,79,84,ABC,0.50211,m,4c_70 +LINE84,80,85,ABC,0.11122,m,4c_70 +LINE85,81,86,ABC,1.4388,m,4c_185 +LINE86,82,87,ABC,0.31045,m,2c_.007 +LINE87,84,88,ABC,1.0182,m,4c_70 +LINE88,85,89,ABC,0.1048,m,4c_70 +LINE89,86,90,ABC,0.34251,m,4c_185 +LINE90,87,91,ABC,0.11206,m,2c_.007 +LINE91,88,92,ABC,0.96021,m,4c_70 +LINE92,90,93,ABC,0.065307,m,4c_185 +LINE93,91,94,ABC,0.034785,m,2c_.007 +LINE94,92,95,ABC,0.55811,m,4c_70 +LINE95,93,96,ABC,0.086052,m,4c_185 +LINE96,94,97,ABC,0.03677,m,2c_.007 +LINE97,95,98,ABC,0.36859,m,4c_70 +LINE98,96,99,ABC,0.037216,m,4c_185 +LINE99,97,100,ABC,0.089588,m,2c_.007 +LINE100,98,101,ABC,0.50892,m,4c_70 +LINE101,99,102,ABC,5.0819,m,4c_185 +LINE102,100,103,ABC,0.28583,m,2c_.007 +LINE103,101,104,ABC,0.28838,m,4c_.35 +LINE104,101,105,ABC,0.33602,m,4c_70 +LINE105,102,106,ABC,0.22108,m,4c_185 +LINE106,104,107,ABC,0.3489,m,4c_.35 +LINE107,105,108,ABC,0.19054,m,4c_70 +LINE108,106,109,ABC,0.45085,m,4c_185 +LINE109,107,110,ABC,0.4044,m,4c_.35 +LINE110,108,111,ABC,7.5182,m,4c_70 +LINE111,109,112,ABC,11.9766,m,4c_185 +LINE112,110,113,ABC,0.61659,m,4c_.35 +LINE113,111,114,ABC,0.75316,m,4c_70 +LINE114,112,115,ABC,10.6613,m,4c_185 +LINE115,113,116,ABC,0.79271,m,4c_.35 +LINE116,114,117,ABC,1.1056,m,4c_.35 +LINE117,114,118,ABC,3.6556,m,4c_.1 +LINE118,115,119,ABC,0.99464,m,4c_185 +LINE119,116,120,ABC,0.56909,m,4c_.35 +LINE120,117,121,ABC,0.19481,m,2c_.007 +LINE121,117,122,ABC,0.53831,m,4c_.35 +LINE122,118,123,ABC,6.5924,m,4c_.1 +LINE123,119,124,ABC,0.7248,m,4c_185 +LINE124,120,125,ABC,0.80412,m,4c_.35 +LINE125,121,126,ABC,0.16869,m,2c_.007 +LINE126,122,127,ABC,2.5288,m,4c_.35 +LINE127,123,128,ABC,2.9646,m,4c_.1 +LINE128,124,129,ABC,0.62512,m,4c_185 +LINE129,125,130,ABC,0.87,m,4c_.35 +LINE130,126,131,ABC,0.11915,m,2c_.007 +LINE131,127,132,ABC,3.8212,m,2c_16 +LINE132,127,133,ABC,7.1782,m,4c_.35 +LINE133,128,134,ABC,0.88205,m,4c_.1 +LINE134,129,135,ABC,1.9203,m,4c_185 +LINE135,130,136,ABC,0.82048,m,4c_.35 +LINE136,131,137,ABC,0.18436,m,2c_.007 +LINE137,132,138,ABC,0.32908,m,2c_16 +LINE138,133,139,ABC,5.3402,m,4c_.35 +LINE139,134,140,ABC,0.99566,m,4c_.1 +LINE140,135,141,ABC,1.4127,m,4c_185 +LINE141,136,142,ABC,1.349,m,4c_.35 +LINE142,137,143,ABC,0.21781,m,2c_.007 +LINE143,138,144,ABC,0.32289,m,2c_16 +LINE144,139,145,ABC,3.5762,m,4c_.35 +LINE145,140,146,ABC,0.9364,m,4c_.1 +LINE146,141,147,ABC,0.24053,m,4c_185 +LINE147,142,148,ABC,6.4142,m,4c_.35 +LINE148,143,149,ABC,0.19401,m,2c_.007 +LINE149,144,150,ABC,0.26072,m,2c_16 +LINE150,145,151,ABC,3.5713,m,4c_.35 +LINE151,145,152,ABC,5.1314,m,2c_16 +LINE152,146,153,ABC,1.0926,m,4c_.1 +LINE153,147,154,ABC,0.083096,m,4c_185 +LINE154,148,155,ABC,1.3973,m,4c_.35 +LINE155,149,156,ABC,0.2191,m,2c_.007 +LINE156,150,157,ABC,0.39132,m,2c_16 +LINE157,151,158,ABC,9.4713,m,4c_.35 +LINE158,152,159,ABC,0.31233,m,2c_16 +LINE159,153,160,ABC,0.31439,m,4c_.1 +LINE160,154,161,ABC,0.12256,m,4c_185 +LINE161,155,162,ABC,11.7422,m,2c_16 +LINE162,155,163,ABC,5.2844,m,4c_.35 +LINE163,156,164,ABC,0.20342,m,2c_.007 +LINE164,157,165,ABC,0.47178,m,2c_16 +LINE165,158,166,ABC,3.2899,m,4c_.35 +LINE166,159,167,ABC,0.28533,m,2c_16 +LINE167,160,168,ABC,1.7861,m,4c_.1 +LINE168,161,169,ABC,0.24958,m,4c_185 +LINE169,162,170,ABC,2.2183,m,2c_16 +LINE170,163,171,ABC,7.0156,m,4c_.35 +LINE171,164,172,ABC,0.1727,m,2c_.007 +LINE172,165,173,ABC,0.35642,m,2c_16 +LINE173,166,174,ABC,3.9183,m,4c_.35 +LINE174,166,175,ABC,4.2045,m,2c_16 +LINE175,167,176,ABC,0.11853,m,2c_16 +LINE176,168,177,ABC,1.0088,m,4c_.1 +LINE177,170,178,ABC,4.5768,m,2c_16 +LINE178,171,179,ABC,1.1818,m,4c_.35 +LINE179,171,180,ABC,2.4224,m,2c_16 +LINE180,172,181,ABC,0.17961,m,2c_.007 +LINE181,173,182,ABC,0.41244,m,2c_16 +LINE182,174,183,ABC,0.58763,m,4c_.35 +LINE183,175,184,ABC,0.45409,m,2c_16 +LINE184,176,185,ABC,0.25549,m,2c_16 +LINE185,177,186,ABC,0.74886,m,4c_.1 +LINE186,179,187,ABC,4.6507,m,4c_.35 +LINE187,180,188,ABC,10.0258,m,2c_16 +LINE188,181,189,ABC,0.15412,m,2c_.007 +LINE189,182,190,ABC,0.3878,m,2c_16 +LINE190,183,191,ABC,2.3151,m,4c_.35 +LINE191,183,192,ABC,0.27791,m,4c_.35 +LINE192,184,193,ABC,0.43923,m,2c_16 +LINE193,185,194,ABC,0.65073,m,2c_16 +LINE194,186,195,ABC,0.67326,m,4c_.1 +LINE195,187,196,ABC,8.3036,m,4c_.35 +LINE196,188,197,ABC,1.9595,m,2c_16 +LINE197,188,198,ABC,1.1325,m,2c_16 +LINE198,189,199,ABC,0.19148,m,2c_.007 +LINE199,190,200,ABC,0.41725,m,2c_16 +LINE200,191,201,ABC,0.9314,m,4c_.35 +LINE201,192,202,ABC,0.16447,m,4c_.35 +LINE202,193,203,ABC,0.35134,m,2c_16 +LINE203,194,204,ABC,0.38178,m,2c_16 +LINE204,195,205,ABC,0.83638,m,4c_.1 +LINE205,196,206,ABC,3.2475,m,2c_16 +LINE206,196,207,ABC,2.1371,m,4c_.35 +LINE207,197,208,ABC,4.9541,m,2c_16 +LINE208,198,209,ABC,0.16008,m,2c_16 +LINE209,199,210,ABC,0.44838,m,2c_.007 +LINE210,200,211,ABC,0.63785,m,2c_16 +LINE211,202,212,ABC,0.15526,m,4c_.35 +LINE212,203,213,ABC,0.27987,m,2c_16 +LINE213,204,214,ABC,0.2674,m,2c_16 +LINE214,205,215,ABC,1.5434,m,4c_.1 +LINE215,206,216,ABC,10.6295,m,2c_16 +LINE216,207,217,ABC,3.8571,m,4c_.35 +LINE217,209,218,ABC,0.1291,m,2c_16 +LINE218,210,219,ABC,0.67215,m,2c_.007 +LINE219,211,220,ABC,1.7419,m,2c_16 +LINE220,212,221,ABC,0.17006,m,4c_.35 +LINE221,213,222,ABC,0.59169,m,2c_16 +LINE222,214,223,ABC,0.51437,m,2c_16 +LINE223,215,224,ABC,1.3456,m,4c_.1 +LINE224,216,225,ABC,4.5822,m,2c_16 +LINE225,217,226,ABC,1.3772,m,4c_.35 +LINE226,218,227,ABC,0.10317,m,2c_16 +LINE227,220,228,ABC,0.14852,m,2c_16 +LINE228,221,229,ABC,0.23273,m,4c_.35 +LINE229,222,230,ABC,0.46597,m,2c_16 +LINE230,223,231,ABC,0.25602,m,2c_16 +LINE231,224,232,ABC,0.91534,m,4c_.1 +LINE232,226,233,ABC,11.8949,m,2c_16 +LINE233,226,234,ABC,1.1273,m,4c_.35 +LINE234,227,235,ABC,0.15749,m,2c_16 +LINE235,228,236,ABC,0.0686,m,2c_16 +LINE236,229,237,ABC,0.20742,m,4c_.35 +LINE237,230,238,ABC,0.32322,m,2c_16 +LINE238,231,239,ABC,0.18179,m,2c_16 +LINE239,232,240,ABC,0.6013,m,4c_.1 +LINE240,233,241,ABC,1.7274,m,2c_16 +LINE241,235,242,ABC,0.18461,m,2c_16 +LINE242,236,243,ABC,0.073376,m,2c_16 +LINE243,237,244,ABC,0.16881,m,4c_.35 +LINE244,238,245,ABC,0.32245,m,2c_16 +LINE245,239,246,ABC,2.0796,m,2c_16 +LINE246,240,247,ABC,1.2941,m,4c_.1 +LINE247,241,248,ABC,5.3022,m,2c_16 +LINE248,241,249,ABC,5.3022,m,2c_16 +LINE249,242,250,ABC,0.28355,m,2c_16 +LINE250,243,251,ABC,0.070114,m,2c_16 +LINE251,244,252,ABC,0.13297,m,4c_.35 +LINE252,245,253,ABC,0.47173,m,2c_16 +LINE253,246,254,ABC,0.61324,m,2c_16 +LINE254,247,255,ABC,4.5618,m,2c_16 +LINE255,247,256,ABC,0.85678,m,4c_.1 +LINE256,250,257,ABC,1.0376,m,2c_16 +LINE257,251,258,ABC,0.07811,m,2c_16 +LINE258,252,259,ABC,0.17323,m,4c_.35 +LINE259,253,260,ABC,1.7742,m,2c_16 +LINE260,254,261,ABC,0.1372,m,2c_16 +LINE261,255,262,ABC,0.6306,m,2c_16 +LINE262,256,263,ABC,3.2128,m,4c_.1 +LINE263,257,264,ABC,5.05,m,2c_16 +LINE264,258,265,ABC,0.16123,m,2c_16 +LINE265,259,266,ABC,0.19436,m,4c_.35 +LINE266,260,267,ABC,0.4141,m,2c_16 +LINE267,261,268,ABC,3.4578,m,2c_16 +LINE268,261,269,ABC,0.11871,m,2c_16 +LINE269,262,270,ABC,0.28991,m,2c_16 +LINE270,263,271,ABC,4.2547,m,2c_16 +LINE271,263,272,ABC,1.0792,m,4c_.1 +LINE272,265,273,ABC,0.16792,m,2c_16 +LINE273,266,274,ABC,0.17888,m,4c_.35 +LINE274,267,275,ABC,0.18971,m,2c_16 +LINE275,268,276,ABC,3.4268,m,2c_16 +LINE276,269,277,ABC,0.13918,m,2c_16 +LINE277,270,278,ABC,0.34433,m,2c_16 +LINE278,271,279,ABC,0.30927,m,2c_16 +LINE279,272,280,ABC,3.9121,m,4c_.1 +LINE280,273,281,ABC,0.63854,m,2c_16 +LINE281,274,282,ABC,0.60542,m,4c_.35 +LINE282,275,283,ABC,0.12472,m,2c_16 +LINE283,277,284,ABC,0.12578,m,2c_16 +LINE284,278,285,ABC,0.53126,m,2c_16 +LINE285,279,286,ABC,0.25491,m,2c_16 +LINE286,280,287,ABC,1.7542,m,4c_.06 +LINE287,280,288,ABC,0.91306,m,4c_.1 +LINE288,281,289,ABC,3.3901,m,2c_16 +LINE289,282,290,ABC,0.81044,m,4c_.35 +LINE290,283,291,ABC,0.87618,m,2c_16 +LINE291,283,292,ABC,0.10807,m,2c_16 +LINE292,284,293,ABC,0.12739,m,2c_16 +LINE293,285,294,ABC,0.47339,m,2c_16 +LINE294,286,295,ABC,0.36208,m,2c_16 +LINE295,287,296,ABC,0.80742,m,4c_.06 +LINE296,288,297,ABC,3.8266,m,4c_.1 +LINE297,291,298,ABC,0.40248,m,2c_16 +LINE298,292,299,ABC,0.076485,m,2c_16 +LINE299,293,300,ABC,0.13697,m,2c_16 +LINE300,294,301,ABC,0.36805,m,2c_16 +LINE301,295,302,ABC,1.6263,m,2c_16 +LINE302,296,303,ABC,5.2746,m,4c_.06 +LINE303,297,304,ABC,0.84468,m,4c_.1 +LINE304,298,305,ABC,0.68119,m,2c_16 +LINE305,299,306,ABC,0.089006,m,2c_16 +LINE306,300,307,ABC,0.79435,m,2c_16 +LINE307,301,308,ABC,0.45813,m,2c_16 +LINE308,302,309,ABC,0.31308,m,2c_16 +LINE309,303,310,ABC,0.39397,m,4c_.06 +LINE310,304,311,ABC,0.28067,m,4c_.1 +LINE311,305,312,ABC,1.3075,m,2c_16 +LINE312,306,313,ABC,0.17024,m,2c_16 +LINE313,307,314,ABC,3.3598,m,2c_16 +LINE314,308,315,ABC,0.47384,m,2c_16 +LINE315,309,316,ABC,0.23181,m,2c_16 +LINE316,310,317,ABC,0.64903,m,2c_16 +LINE317,310,318,ABC,7.2163,m,4c_.06 +LINE318,311,319,ABC,0.14649,m,4c_.1 +LINE319,312,320,ABC,3.8495,m,2c_16 +LINE320,313,321,ABC,0.6529,m,2c_16 +LINE321,315,322,ABC,0.55892,m,2c_16 +LINE322,316,323,ABC,0.26702,m,2c_16 +LINE323,317,324,ABC,3.3427,m,2c_16 +LINE324,318,325,ABC,3.4631,m,4c_.06 +LINE325,319,326,ABC,0.1254,m,4c_.1 +LINE326,321,327,ABC,2.2281,m,2c_16 +LINE327,322,328,ABC,0.31851,m,2c_16 +LINE328,323,329,ABC,0.26488,m,2c_16 +LINE329,324,330,ABC,1.167,m,2c_16 +LINE330,325,331,ABC,9.1332,m,2c_16 +LINE331,325,332,ABC,6.6729,m,4c_.06 +LINE332,326,333,ABC,0.14262,m,4c_.1 +LINE333,328,334,ABC,1.4389,m,2c_16 +LINE334,329,335,ABC,2.327,m,2c_16 +LINE335,330,336,ABC,2.5399,m,2c_16 +LINE336,331,337,ABC,3.6172,m,2c_16 +LINE337,332,338,ABC,6.8067,m,2c_16 +LINE338,332,339,ABC,1.2129,m,4c_.06 +LINE339,333,340,ABC,0.11236,m,4c_.1 +LINE340,334,341,ABC,0.55999,m,2c_16 +LINE341,335,342,ABC,4.7567,m,2c_16 +LINE342,336,343,ABC,2.082,m,2c_16 +LINE343,336,344,ABC,0.9796,m,2c_16 +LINE344,338,345,ABC,3.4221,m,2c_16 +LINE345,339,346,ABC,1.0391,m,4c_.06 +LINE346,340,347,ABC,0.094202,m,4c_.1 +LINE347,341,348,ABC,0.19454,m,2c_16 +LINE348,343,349,ABC,3.1153,m,2c_16 +LINE349,344,350,ABC,0.1364,m,2c_16 +LINE350,345,351,ABC,0.31846,m,2c_16 +LINE351,346,352,ABC,0.73091,m,4c_.06 +LINE352,347,353,ABC,0.085,m,4c_.1 +LINE353,348,354,ABC,0.14656,m,2c_16 +LINE354,350,355,ABC,0.14814,m,2c_16 +LINE355,351,356,ABC,0.13152,m,2c_16 +LINE356,352,357,ABC,0.92352,m,4c_.06 +LINE357,353,358,ABC,0.070349,m,4c_.1 +LINE358,354,359,ABC,0.10723,m,2c_16 +LINE359,355,360,ABC,0.12976,m,2c_16 +LINE360,356,361,ABC,0.092801,m,2c_16 +LINE361,357,362,ABC,0.57867,m,4c_.06 +LINE362,358,363,ABC,0.081609,m,4c_.1 +LINE363,359,364,ABC,0.054452,m,2c_16 +LINE364,360,365,ABC,0.13787,m,2c_16 +LINE365,361,366,ABC,0.094921,m,2c_16 +LINE366,362,367,ABC,0.88861,m,4c_.06 +LINE367,363,368,ABC,0.089694,m,4c_.1 +LINE368,364,369,ABC,0.080056,m,2c_16 +LINE369,365,370,ABC,0.19677,m,2c_16 +LINE370,366,371,ABC,0.112,m,2c_16 +LINE371,367,372,ABC,0.88584,m,4c_.06 +LINE372,368,373,ABC,0.48898,m,4c_.1 +LINE373,369,374,ABC,0.1342,m,2c_16 +LINE374,370,375,ABC,0.23921,m,2c_16 +LINE375,371,376,ABC,0.14128,m,2c_16 +LINE376,372,377,ABC,0.99394,m,4c_.06 +LINE377,373,378,ABC,3.6848,m,4c_.1 +LINE378,373,379,ABC,1.4115,m,2c_16 +LINE379,374,380,ABC,0.59859,m,2c_16 +LINE380,375,381,ABC,1.4827,m,2c_16 +LINE381,376,382,ABC,0.12653,m,2c_16 +LINE382,377,383,ABC,0.71925,m,4c_.06 +LINE383,378,384,ABC,3.5292,m,4c_.1 +LINE384,379,385,ABC,8.6668,m,2c_16 +LINE385,379,386,ABC,1.4561,m,2c_16 +LINE386,380,387,ABC,2.2004,m,2c_16 +LINE387,381,388,ABC,5.0734,m,2c_16 +LINE388,382,389,ABC,0.10012,m,2c_16 +LINE389,383,390,ABC,0.85728,m,4c_.06 +LINE390,384,391,ABC,0.15711,m,4c_.1 +LINE391,385,392,ABC,3.1675,m,2c_16 +LINE392,386,393,ABC,7.8335,m,2c_16 +LINE393,389,394,ABC,0.17183,m,2c_16 +LINE394,390,395,ABC,1.2439,m,4c_.06 +LINE395,391,396,ABC,4.0601,m,2c_16 +LINE396,391,397,ABC,2.8793,m,4c_.1 +LINE397,392,398,ABC,0.32241,m,2c_16 +LINE398,393,399,ABC,0.5688,m,2c_16 +LINE399,394,400,ABC,0.59984,m,2c_16 +LINE400,395,401,ABC,0.9222,m,4c_.06 +LINE401,396,402,ABC,0.37201,m,2c_16 +LINE402,397,403,ABC,1.3891,m,4c_.1 +LINE403,398,404,ABC,0.225,m,2c_16 +LINE404,399,405,ABC,0.24807,m,2c_16 +LINE405,400,406,ABC,3.6672,m,2c_16 +LINE406,401,407,ABC,0.88961,m,4c_.06 +LINE407,402,408,ABC,0.21148,m,2c_16 +LINE408,403,409,ABC,4.1907,m,4c_.1 +LINE409,403,410,ABC,0.3791,m,4c_.1 +LINE410,404,411,ABC,0.23308,m,2c_16 +LINE411,405,412,ABC,0.16706,m,2c_16 +LINE412,407,413,ABC,0.87066,m,4c_.06 +LINE413,408,414,ABC,0.1436,m,2c_16 +LINE414,409,415,ABC,5.9686,m,4c_.1 +LINE415,410,416,ABC,0.094921,m,4c_.1 +LINE416,411,417,ABC,0.9788,m,2c_16 +LINE417,412,418,ABC,0.27954,m,2c_16 +LINE418,413,419,ABC,1.0471,m,4c_.06 +LINE419,414,420,ABC,0.23403,m,2c_16 +LINE420,415,421,ABC,1.249,m,4c_.1 +LINE421,416,422,ABC,0.066573,m,4c_.1 +LINE422,417,423,ABC,0.239,m,2c_16 +LINE423,418,424,ABC,3.1944,m,2c_16 +LINE424,419,425,ABC,1.7537,m,4c_.06 +LINE425,419,426,ABC,1.7537,m,4c_.06 +LINE426,420,427,ABC,0.77793,m,2c_16 +LINE427,421,428,ABC,0.31923,m,4c_.1 +LINE428,422,429,ABC,0.082873,m,4c_.1 +LINE429,423,430,ABC,0.22798,m,2c_16 +LINE430,424,431,ABC,1.1331,m,2c_16 +LINE431,425,432,ABC,5.9151,m,4c_.06 +LINE432,425,433,ABC,5.9151,m,4c_.06 +LINE433,427,434,ABC,0.86608,m,2c_16 +LINE434,428,435,ABC,0.16724,m,4c_.1 +LINE435,429,436,ABC,0.071344,m,4c_.1 +LINE436,430,437,ABC,0.22674,m,2c_16 +LINE437,431,438,ABC,0.384,m,2c_16 +LINE438,432,439,ABC,8.3663,m,4c_.06 +LINE439,432,440,ABC,8.3663,m,4c_.06 +LINE440,434,441,ABC,0.48708,m,2c_16 +LINE441,435,442,ABC,0.13864,m,4c_.1 +LINE442,436,443,ABC,0.078,m,4c_.1 +LINE443,437,444,ABC,0.2601,m,2c_16 +LINE444,438,445,ABC,0.67858,m,2c_16 +LINE445,439,446,ABC,6.0033,m,4c_.06 +LINE446,439,447,ABC,6.0033,m,4c_.06 +LINE447,441,448,ABC,0.45756,m,2c_16 +LINE448,442,449,ABC,0.11236,m,4c_.1 +LINE449,443,450,ABC,0.079246,m,4c_.1 +LINE450,444,451,ABC,0.89824,m,2c_16 +LINE451,445,452,ABC,0.59366,m,2c_16 +LINE452,446,453,ABC,1.8214,m,4c_.06 +LINE453,446,454,ABC,1.8214,m,4c_.06 +LINE454,448,455,ABC,0.43655,m,2c_16 +LINE455,449,456,ABC,0.17175,m,4c_.1 +LINE456,450,457,ABC,0.054231,m,4c_.1 +LINE457,451,458,ABC,4.3773,m,2c_16 +LINE458,452,459,ABC,0.67064,m,2c_16 +LINE459,453,460,ABC,5.3905,m,4c_.06 +LINE460,453,461,ABC,5.3905,m,4c_.06 +LINE461,453,462,ABC,3.6859,m,2c_16 +LINE462,455,463,ABC,0.71675,m,2c_16 +LINE463,456,464,ABC,0.15483,m,4c_.1 +LINE464,457,465,ABC,0.040311,m,4c_.1 +LINE465,459,466,ABC,0.63421,m,2c_16 +LINE466,460,467,ABC,5.9891,m,4c_.06 +LINE467,460,468,ABC,5.9891,m,4c_.06 +LINE468,460,469,ABC,0.88292,m,4c_.06 +LINE469,462,470,ABC,0.53828,m,2c_16 +LINE470,463,471,ABC,0.49923,m,2c_16 +LINE471,464,472,ABC,0.14736,m,4c_.1 +LINE472,465,473,ABC,0.049497,m,4c_.1 +LINE473,466,474,ABC,3.201,m,2c_16 +LINE474,467,475,ABC,2.1947,m,4c_.06 +LINE475,467,476,ABC,2.1947,m,4c_.06 +LINE476,470,477,ABC,0.29351,m,2c_16 +LINE477,471,478,ABC,0.35077,m,2c_16 +LINE478,472,479,ABC,0.16601,m,4c_.1 +LINE479,473,480,ABC,0.063953,m,4c_.1 +LINE480,474,481,ABC,0.18984,m,2c_16 +LINE481,475,482,ABC,4.6432,m,4c_.06 +LINE482,475,483,ABC,4.6432,m,4c_.06 +LINE483,475,484,ABC,10.2769,m,2c_16 +LINE484,477,485,ABC,0.19883,m,2c_16 +LINE485,478,486,ABC,0.1676,m,2c_16 +LINE486,479,487,ABC,0.17536,m,4c_.1 +LINE487,480,488,ABC,0.11163,m,4c_.1 +LINE488,481,489,ABC,0.1713,m,2c_16 +LINE489,482,490,ABC,6.6548,m,4c_.06 +LINE490,482,491,ABC,6.6548,m,4c_.06 +LINE491,484,492,ABC,0.57796,m,2c_16 +LINE492,484,493,ABC,4.0726,m,2c_16 +LINE493,485,494,ABC,0.30201,m,2c_16 +LINE494,486,495,ABC,0.10617,m,2c_16 +LINE495,487,496,ABC,0.38342,m,4c_.1 +LINE496,488,497,ABC,0.13972,m,4c_.1 +LINE497,489,498,ABC,0.23283,m,2c_16 +LINE498,490,499,ABC,4.0612,m,4c_.06 +LINE499,490,500,ABC,4.0612,m,4c_.06 +LINE500,492,501,ABC,0.24429,m,2c_16 +LINE501,493,502,ABC,2.606,m,2c_16 +LINE502,494,503,ABC,0.45833,m,2c_16 +LINE503,495,504,ABC,0.071784,m,2c_16 +LINE504,496,505,ABC,8.6961,m,4c_.1 +LINE505,497,506,ABC,0.096167,m,4c_.1 +LINE506,498,507,ABC,0.30564,m,2c_16 +LINE507,499,508,ABC,0.69938,m,4c_.06 +LINE508,499,509,ABC,0.69938,m,4c_.06 +LINE509,501,510,ABC,0.14354,m,2c_16 +LINE510,503,511,ABC,0.32517,m,2c_16 +LINE511,504,512,ABC,0.10013,m,2c_16 +LINE512,505,513,ABC,5.5648,m,2c_16 +LINE513,505,514,ABC,1.3369,m,4c_.1 +LINE514,506,515,ABC,0.085492,m,4c_.1 +LINE515,508,516,ABC,1.8857,m,4c_.06 +LINE516,508,517,ABC,1.8857,m,4c_.06 +LINE517,508,518,ABC,4.7316,m,2c_16 +LINE518,510,519,ABC,0.1321,m,2c_16 +LINE519,511,520,ABC,0.22216,m,2c_16 +LINE520,512,521,ABC,0.07642,m,2c_16 +LINE521,513,522,ABC,4.9074,m,2c_16 +LINE522,514,523,ABC,0.72122,m,4c_.1 +LINE523,515,524,ABC,0.066573,m,4c_.1 +LINE524,516,525,ABC,1.3881,m,4c_.06 +LINE525,516,526,ABC,1.3881,m,4c_.06 +LINE526,518,527,ABC,2.796,m,2c_16 +LINE527,519,528,ABC,0.11769,m,2c_16 +LINE528,520,529,ABC,0.17555,m,2c_16 +LINE529,521,530,ABC,0.54535,m,2c_16 +LINE530,523,531,ABC,0.10771,m,4c_.1 +LINE531,524,532,ABC,0.060803,m,4c_.1 +LINE532,525,533,ABC,1.8899,m,4c_.06 +LINE533,525,534,ABC,1.8899,m,4c_.06 +LINE534,527,535,ABC,2.2154,m,2c_16 +LINE535,528,536,ABC,0.12209,m,2c_16 +LINE536,529,537,ABC,0.56286,m,2c_16 +LINE537,530,538,ABC,1.9227,m,2c_16 +LINE538,530,539,ABC,5.5837,m,2c_16 +LINE539,531,540,ABC,0.082219,m,4c_.1 +LINE540,532,541,ABC,0.065513,m,4c_.1 +LINE541,533,542,ABC,1.3374,m,4c_.06 +LINE542,533,543,ABC,1.3374,m,4c_.06 +LINE543,535,544,ABC,0.91542,m,2c_16 +LINE544,536,545,ABC,0.36857,m,2c_16 +LINE545,537,546,ABC,4.5527,m,2c_16 +LINE546,538,547,ABC,2.1231,m,2c_16 +LINE547,540,548,ABC,0.076896,m,4c_.1 +LINE548,541,549,ABC,0.086145,m,4c_.1 +LINE549,542,550,ABC,3.7401,m,4c_.06 +LINE550,542,551,ABC,3.7401,m,4c_.06 +LINE551,544,552,ABC,0.28804,m,2c_16 +LINE552,544,553,ABC,3.789,m,2c_16 +LINE553,545,554,ABC,0.37143,m,2c_16 +LINE554,546,555,ABC,0.22672,m,2c_16 +LINE555,547,556,ABC,5.7548,m,2c_16 +LINE556,548,557,ABC,0.082,m,4c_.1 +LINE557,549,558,ABC,0.061612,m,4c_.1 +LINE558,550,559,ABC,2.7082,m,4c_.06 +LINE559,550,560,ABC,2.7082,m,4c_.06 +LINE560,552,561,ABC,0.10599,m,2c_16 +LINE561,553,562,ABC,2.8664,m,2c_16 +LINE562,554,563,ABC,3.4705,m,2c_16 +LINE563,555,564,ABC,0.17889,m,2c_16 +LINE564,557,565,ABC,0.07256,m,4c_.1 +LINE565,558,566,ABC,0.12021,m,4c_.1 +LINE566,559,567,ABC,0.60068,m,4c_.06 +LINE567,559,568,ABC,0.60068,m,4c_.06 +LINE568,559,569,ABC,3.8482,m,2c_16 +LINE569,561,570,ABC,0.15788,m,2c_16 +LINE570,564,571,ABC,0.20224,m,2c_16 +LINE571,565,572,ABC,0.074216,m,4c_.1 +LINE572,567,573,ABC,0.14223,m,4c_.06 +LINE573,567,574,ABC,0.14223,m,4c_.06 +LINE574,569,575,ABC,0.48648,m,2c_16 +LINE575,570,576,ABC,0.095,m,2c_16 +LINE576,571,577,ABC,0.18,m,2c_16 +LINE577,572,578,ABC,0.38305,m,4c_.1 +LINE578,573,579,ABC,3.8558,m,4c_.06 +LINE579,573,580,ABC,3.8558,m,4c_.06 +LINE580,573,581,ABC,0.31979,m,4c_.06 +LINE581,575,582,ABC,0.35899,m,2c_16 +LINE582,576,583,ABC,0.11463,m,2c_16 +LINE583,577,584,ABC,0.20718,m,2c_16 +LINE584,578,585,ABC,4.7318,m,2c_16 +LINE585,578,586,ABC,0.82623,m,4c_.1 +LINE586,579,587,ABC,2.7022,m,4c_.06 +LINE587,579,588,ABC,2.7022,m,4c_.06 +LINE588,581,589,ABC,0.11628,m,4c_.06 +LINE589,582,590,ABC,0.3493,m,2c_16 +LINE590,583,591,ABC,0.10065,m,2c_16 +LINE591,584,592,ABC,0.21243,m,2c_16 +LINE592,585,593,ABC,0.27268,m,2c_16 +LINE593,586,594,ABC,3.9483,m,4c_.1 +LINE594,587,595,ABC,5.4142,m,4c_.06 +LINE595,587,596,ABC,0.64238,m,4c_.06 +LINE596,589,597,ABC,0.089275,m,4c_.06 +LINE597,590,598,ABC,3.2812,m,2c_16 +LINE598,591,599,ABC,0.65862,m,2c_16 +LINE599,592,600,ABC,0.25534,m,2c_16 +LINE600,593,601,ABC,0.13695,m,2c_16 +LINE601,594,602,ABC,9.1669,m,2c_16 +LINE602,594,603,ABC,4.6424,m,4c_.1 +LINE603,595,604,ABC,4.8283,m,4c_.06 +LINE604,595,605,ABC,4.8283,m,4c_.06 +LINE605,595,606,ABC,4.7719,m,4c_.06 +LINE606,596,607,ABC,11.6642,m,2c_16 +LINE607,596,608,ABC,11.6642,m,2c_16 +LINE608,597,609,ABC,0.11037,m,4c_.06 +LINE609,598,610,ABC,1.5271,m,2c_16 +LINE610,599,611,ABC,4.8562,m,2c_16 +LINE611,600,612,ABC,0.16008,m,2c_16 +LINE612,601,613,ABC,0.11484,m,2c_16 +LINE613,602,614,ABC,4.8374,m,2c_16 +LINE614,603,615,ABC,4.4466,m,4c_.1 +LINE615,604,616,ABC,3.9301,m,2c_.0225 +LINE616,604,617,ABC,3.1088,m,4c_.06 +LINE617,604,618,ABC,3.1088,m,4c_.06 +LINE618,607,619,ABC,2.7454,m,2c_16 +LINE619,609,620,ABC,0.06364,m,4c_.06 +LINE620,610,621,ABC,0.71673,m,2c_16 +LINE621,612,622,ABC,0.68797,m,2c_16 +LINE622,613,623,ABC,0.093648,m,2c_16 +LINE623,615,624,ABC,1.6322,m,2c_16 +LINE624,615,625,ABC,1.2511,m,4c_.1 +LINE625,616,626,ABC,5.3537,m,2c_.0225 +LINE626,620,627,ABC,0.077897,m,4c_.06 +LINE627,621,628,ABC,0.47807,m,2c_16 +LINE628,622,629,ABC,2.9004,m,2c_16 +LINE629,623,630,ABC,0.147,m,2c_16 +LINE630,624,631,ABC,0.40022,m,2c_16 +LINE631,625,632,ABC,0.28784,m,4c_.1 +LINE632,626,633,ABC,1.5703,m,2c_.0225 +LINE633,627,634,ABC,0.065299,m,4c_.06 +LINE634,628,635,ABC,0.73088,m,2c_16 +LINE635,630,636,ABC,0.35053,m,2c_16 +LINE636,631,637,ABC,0.27482,m,2c_16 +LINE637,632,638,ABC,0.14284,m,4c_.1 +LINE638,633,639,ABC,5.1974,m,2c_.0225 +LINE639,634,640,ABC,0.069123,m,4c_.06 +LINE640,635,641,ABC,1.4274,m,2c_16 +LINE641,636,642,ABC,0.24251,m,2c_16 +LINE642,637,643,ABC,0.38096,m,2c_16 +LINE643,638,644,ABC,0.15697,m,4c_.1 +LINE644,640,645,ABC,0.068593,m,4c_.06 +LINE645,641,646,ABC,0.39457,m,2c_16 +LINE646,642,647,ABC,0.30835,m,2c_16 +LINE647,643,648,ABC,0.90337,m,2c_16 +LINE648,644,649,ABC,0.18112,m,4c_.1 +LINE649,645,650,ABC,0.093984,m,4c_.06 +LINE650,646,651,ABC,0.11455,m,2c_16 +LINE651,647,652,ABC,0.18732,m,2c_16 +LINE652,648,653,ABC,0.68671,m,2c_16 +LINE653,649,654,ABC,0.1831,m,4c_.1 +LINE654,650,655,ABC,0.12394,m,4c_.06 +LINE655,651,656,ABC,0.099368,m,2c_16 +LINE656,651,657,ABC,0.52781,m,2c_16 +LINE657,652,658,ABC,0.16911,m,2c_16 +LINE658,653,659,ABC,0.48206,m,2c_16 +LINE659,654,660,ABC,0.20299,m,4c_.1 +LINE660,655,661,ABC,0.36466,m,4c_.06 +LINE661,656,662,ABC,0.093,m,2c_16 +LINE662,657,663,ABC,0.69648,m,2c_16 +LINE663,658,664,ABC,0.28521,m,2c_16 +LINE664,659,665,ABC,0.505,m,2c_16 +LINE665,660,666,ABC,0.29519,m,4c_.1 +LINE666,661,667,ABC,0.26019,m,4c_.06 +LINE667,662,668,ABC,0.095802,m,2c_16 +LINE668,663,669,ABC,2.8935,m,2c_16 +LINE669,664,670,ABC,0.2804,m,2c_16 +LINE670,665,671,ABC,0.41461,m,2c_16 +LINE671,666,672,ABC,0.4801,m,2c_16 +LINE672,666,673,ABC,0.81161,m,4c_.1 +LINE673,667,674,ABC,0.20184,m,4c_.06 +LINE674,668,675,ABC,0.69267,m,2c_16 +LINE675,669,676,ABC,1.2288,m,2c_16 +LINE676,670,677,ABC,0.13267,m,2c_16 +LINE677,671,678,ABC,0.68648,m,2c_16 +LINE678,672,679,ABC,0.2883,m,2c_16 +LINE679,673,680,ABC,5.1393,m,4c_.1 +LINE680,674,681,ABC,0.40252,m,4c_.06 +LINE681,675,682,ABC,5.0441,m,2c_16 +LINE682,677,683,ABC,0.14572,m,2c_16 +LINE683,678,684,ABC,2.2185,m,2c_16 +LINE684,679,685,ABC,0.26744,m,2c_16 +LINE685,680,686,ABC,3.6787,m,4c_.1 +LINE686,683,687,ABC,0.13986,m,2c_16 +LINE687,684,688,ABC,5.1838,m,2c_16 +LINE688,685,689,ABC,0.26095,m,2c_16 +LINE689,686,690,ABC,8.1445,m,2c_16 +LINE690,686,691,ABC,10.5254,m,4c_.1 +LINE691,687,692,ABC,0.16867,m,2c_16 +LINE692,689,693,ABC,0.19573,m,2c_16 +LINE693,690,694,ABC,0.76157,m,2c_16 +LINE694,690,695,ABC,2.1261,m,2c_16 +LINE695,691,696,ABC,9.4817,m,2c_16 +LINE696,691,697,ABC,2.1907,m,4c_.1 +LINE697,692,698,ABC,0.26905,m,2c_16 +LINE698,693,699,ABC,0.31093,m,2c_16 +LINE699,694,700,ABC,0.2383,m,2c_16 +LINE700,695,701,ABC,4.3312,m,2c_16 +LINE701,696,702,ABC,5.493,m,2c_16 +LINE702,697,703,ABC,2.4,m,4c_.06 +LINE703,698,704,ABC,0.73636,m,2c_16 +LINE704,699,705,ABC,0.52424,m,2c_16 +LINE705,700,706,ABC,0.15322,m,2c_16 +LINE706,703,707,ABC,6.3308,m,4c_.06 +LINE707,703,708,ABC,0.11132,m,4c_.06 +LINE708,704,709,ABC,0.97996,m,2c_16 +LINE709,705,710,ABC,3.9281,m,2c_16 +LINE710,706,711,ABC,0.092418,m,2c_16 +LINE711,707,712,ABC,7.5025,m,4c_.06 +LINE712,707,713,ABC,3.9448,m,2c_16 +LINE713,708,714,ABC,0.10474,m,4c_.06 +LINE714,709,715,ABC,0.093338,m,2c_16 +LINE715,710,716,ABC,3.2225,m,2c_16 +LINE716,711,717,ABC,0.093408,m,2c_16 +LINE717,712,718,ABC,7.7434,m,4c_.06 +LINE718,713,719,ABC,0.4223,m,2c_16 +LINE719,714,720,ABC,0.097,m,4c_.06 +LINE720,715,721,ABC,0.073817,m,2c_16 +LINE721,716,722,ABC,1.021,m,2c_16 +LINE722,717,723,ABC,0.083433,m,2c_16 +LINE723,718,724,ABC,3.2535,m,4c_.06 +LINE724,718,725,ABC,9.3475,m,2c_16 +LINE725,719,726,ABC,0.16124,m,2c_16 +LINE726,720,727,ABC,0.10977,m,4c_.06 +LINE727,721,728,ABC,0.071694,m,2c_16 +LINE728,722,729,ABC,0.92949,m,2c_16 +LINE729,723,730,ABC,0.094,m,2c_16 +LINE730,724,731,ABC,4.421,m,4c_.06 +LINE731,725,732,ABC,1.2539,m,2c_16 +LINE732,726,733,ABC,0.17056,m,2c_16 +LINE733,727,734,ABC,0.089889,m,4c_.06 +LINE734,728,735,ABC,0.076792,m,2c_16 +LINE735,729,736,ABC,0.50625,m,2c_16 +LINE736,730,737,ABC,0.075313,m,2c_16 +LINE737,731,738,ABC,5.1761,m,4c_.06 +LINE738,732,739,ABC,0.65877,m,2c_16 +LINE739,733,740,ABC,0.14155,m,2c_16 +LINE740,734,741,ABC,0.13761,m,4c_.06 +LINE741,735,742,ABC,0.071,m,2c_16 +LINE742,736,743,ABC,0.40432,m,2c_16 +LINE743,737,744,ABC,0.090338,m,2c_16 +LINE744,738,745,ABC,4.1562,m,4c_.06 +LINE745,739,746,ABC,3.7387,m,2c_16 +LINE746,739,747,ABC,0.12202,m,2c_16 +LINE747,740,748,ABC,0.16763,m,2c_16 +LINE748,741,749,ABC,0.16427,m,4c_.06 +LINE749,742,750,ABC,0.06691,m,2c_16 +LINE750,743,751,ABC,0.34477,m,2c_16 +LINE751,744,752,ABC,0.09735,m,2c_16 +LINE752,745,753,ABC,1.5434,m,4c_.06 +LINE753,745,754,ABC,5.9227,m,2c_16 +LINE754,746,755,ABC,3.0391,m,2c_16 +LINE755,747,756,ABC,0.088238,m,2c_16 +LINE756,748,757,ABC,0.16348,m,2c_16 +LINE757,749,758,ABC,0.12454,m,4c_.06 +LINE758,750,759,ABC,0.093059,m,2c_16 +LINE759,751,760,ABC,0.40459,m,2c_16 +LINE760,752,761,ABC,0.17761,m,2c_16 +LINE761,753,762,ABC,2.1279,m,4c_.06 +LINE762,754,763,ABC,4.9506,m,2c_16 +LINE763,756,764,ABC,0.074465,m,2c_16 +LINE764,757,765,ABC,0.22475,m,2c_16 +LINE765,758,766,ABC,0.12167,m,4c_.06 +LINE766,759,767,ABC,0.11404,m,2c_16 +LINE767,760,768,ABC,0.36969,m,2c_16 +LINE768,761,769,ABC,1.3288,m,2c_16 +LINE769,762,770,ABC,5.2347,m,4c_.06 +LINE770,763,771,ABC,3.6007,m,2c_16 +LINE771,763,772,ABC,0.13038,m,2c_16 +LINE772,764,773,ABC,0.12578,m,2c_16 +LINE773,765,774,ABC,0.30918,m,2c_16 +LINE774,766,775,ABC,0.07931,m,4c_.06 +LINE775,767,776,ABC,0.54052,m,2c_16 +LINE776,768,777,ABC,0.57353,m,2c_16 +LINE777,769,778,ABC,4.0721,m,2c_16 +LINE778,770,779,ABC,4.2428,m,4c_.06 +LINE779,771,780,ABC,3.5283,m,2c_16 +LINE780,772,781,ABC,0.12466,m,2c_16 +LINE781,773,782,ABC,0.17614,m,2c_16 +LINE782,774,783,ABC,0.3272,m,2c_16 +LINE783,775,784,ABC,0.097,m,4c_.06 +LINE784,776,785,ABC,4.6216,m,2c_16 +LINE785,777,786,ABC,1.1579,m,2c_16 +LINE786,779,787,ABC,3.3152,m,4c_.06 +LINE787,781,788,ABC,0.13439,m,2c_16 +LINE788,782,789,ABC,0.1307,m,2c_16 +LINE789,783,790,ABC,0.21735,m,2c_16 +LINE790,784,791,ABC,0.091984,m,4c_.06 +LINE791,786,792,ABC,0.34588,m,2c_16 +LINE792,786,793,ABC,2.062,m,2c_16 +LINE793,787,794,ABC,2.9963,m,4c_.06 +LINE794,788,795,ABC,0.12,m,2c_16 +LINE795,789,796,ABC,0.21651,m,2c_16 +LINE796,790,797,ABC,0.22121,m,2c_16 +LINE797,791,798,ABC,0.091706,m,4c_.06 +LINE798,792,799,ABC,0.30164,m,2c_16 +LINE799,793,800,ABC,3.2995,m,2c_16 +LINE800,794,801,ABC,0.20555,m,2c_16 +LINE801,794,802,ABC,2.8031,m,4c_95_SAC_XC +LINE802,795,803,ABC,0.13252,m,2c_16 +LINE803,796,804,ABC,1.5028,m,2c_16 +LINE804,797,805,ABC,0.10577,m,2c_16 +LINE805,798,806,ABC,0.12311,m,4c_.06 +LINE806,799,807,ABC,0.24947,m,2c_16 +LINE807,800,808,ABC,2.8191,m,2c_16 +LINE808,801,809,ABC,0.20609,m,2c_16 +LINE809,802,810,ABC,3.0749,m,4c_.06 +LINE810,802,811,ABC,3.0749,m,4c_.06 +LINE811,803,812,ABC,0.08544,m,2c_16 +LINE812,804,813,ABC,3.3195,m,2c_16 +LINE813,805,814,ABC,0.16824,m,2c_16 +LINE814,806,815,ABC,0.42086,m,4c_.06 +LINE815,807,816,ABC,0.194,m,2c_16 +LINE816,808,817,ABC,1.5955,m,2c_16 +LINE817,809,818,ABC,0.20649,m,2c_16 +LINE818,810,819,ABC,2.5782,m,4c_.06 +LINE819,810,820,ABC,2.5782,m,4c_.06 +LINE820,812,821,ABC,0.13123,m,2c_16 +LINE821,814,822,ABC,0.15794,m,2c_16 +LINE822,815,823,ABC,0.48651,m,4c_.06 +LINE823,816,824,ABC,0.19731,m,2c_16 +LINE824,818,825,ABC,0.20524,m,2c_16 +LINE825,819,826,ABC,2.7715,m,4c_.06 +LINE826,819,827,ABC,2.7715,m,4c_.06 +LINE827,821,828,ABC,1.0794,m,2c_16 +LINE828,822,829,ABC,0.22567,m,2c_16 +LINE829,823,830,ABC,0.49659,m,4c_.06 +LINE830,824,831,ABC,0.17123,m,2c_16 +LINE831,825,832,ABC,0.20602,m,2c_16 +LINE832,826,833,ABC,2.2755,m,4c_.06 +LINE833,826,834,ABC,2.2755,m,4c_.06 +LINE834,828,835,ABC,3.7201,m,2c_16 +LINE835,829,836,ABC,2.3821,m,2c_16 +LINE836,831,837,ABC,0.12298,m,2c_16 +LINE837,832,838,ABC,0.20588,m,2c_16 +LINE838,833,839,ABC,2.443,m,4c_.06 +LINE839,833,840,ABC,2.443,m,4c_.06 +LINE840,836,841,ABC,0.95278,m,2c_16 +LINE841,837,842,ABC,0.14278,m,2c_16 +LINE842,838,843,ABC,0.20601,m,2c_16 +LINE843,839,844,ABC,4.8092,m,2c_.0225 +LINE844,839,845,ABC,3.6212,m,4c_.06 +LINE845,839,846,ABC,3.6212,m,4c_.06 +LINE846,841,847,ABC,0.48382,m,2c_16 +LINE847,842,848,ABC,0.2151,m,2c_16 +LINE848,843,849,ABC,0.10056,m,2c_16 +LINE849,844,850,ABC,0.7036,m,2c_.0225 +LINE850,845,851,ABC,4.364,m,4c_.06 +LINE851,845,852,ABC,4.364,m,4c_.06 +LINE852,847,853,ABC,0.10706,m,2c_16 +LINE853,848,854,ABC,0.35143,m,2c_16 +LINE854,849,855,ABC,2.2601,m,2c_16 +LINE855,850,856,ABC,1.9822,m,2c_.0225 +LINE856,851,857,ABC,6.8621,m,4c_.06 +LINE857,851,858,ABC,6.8621,m,4c_.06 +LINE858,853,859,ABC,0.084315,m,2c_16 +LINE859,854,860,ABC,2.82,m,2c_16 +LINE860,854,861,ABC,7.5091,m,2c_16 +LINE861,855,862,ABC,1.4697,m,2c_16 +LINE862,856,863,ABC,2.3276,m,2c_.0225 +LINE863,857,864,ABC,2.7888,m,4c_.06 +LINE864,857,865,ABC,2.7888,m,4c_.06 +LINE865,859,866,ABC,0.090338,m,2c_16 +LINE866,862,867,ABC,1.2854,m,2c_16 +LINE867,863,868,ABC,0.30194,m,2c_.0225 +LINE868,864,869,ABC,1.7373,m,4c_.06 +LINE869,864,870,ABC,1.7373,m,4c_.06 +LINE870,866,871,ABC,0.072277,m,2c_16 +LINE871,867,872,ABC,1.3483,m,2c_16 +LINE872,868,873,ABC,0.37952,m,2c_.0225 +LINE873,868,874,ABC,0.84439,m,2c_.0225 +LINE874,869,875,ABC,1.2,m,4c_.06 +LINE875,869,876,ABC,1.2,m,4c_.06 +LINE876,871,877,ABC,0.070178,m,2c_16 +LINE877,872,878,ABC,2.3022,m,2c_16 +LINE878,873,879,ABC,0.35118,m,2c_.0225 +LINE879,874,880,ABC,1.9761,m,2c_.0225 +LINE880,875,881,ABC,1.0112,m,4c_.06 +LINE881,875,882,ABC,1.0112,m,4c_.06 +LINE882,877,883,ABC,0.07,m,2c_16 +LINE883,878,884,ABC,0.56468,m,2c_16 +LINE884,879,885,ABC,0.534,m,2c_.0225 +LINE885,880,886,ABC,4.6879,m,2c_.0225 +LINE886,883,887,ABC,0.069181,m,2c_16 +LINE887,884,888,ABC,0.62293,m,2c_16 +LINE888,884,889,ABC,3.1574,m,35_SAC_XSC +LINE889,885,890,ABC,0.67483,m,2c_.0225 +LINE890,887,891,ABC,1.2371,m,2c_16 +LINE891,888,892,ABC,1.0228,m,2c_16 +LINE892,889,893,ABC,2.6779,m,35_SAC_XSC +LINE893,890,894,ABC,2.6271,m,2c_.0225 +LINE894,891,895,ABC,5.8249,m,2c_16 +LINE895,891,896,ABC,3.2587,m,2c_16 +LINE896,892,897,ABC,0.20223,m,2c_16 +LINE897,893,898,ABC,4.501,m,35_SAC_XSC +LINE898,894,899,ABC,4.7723,m,2c_.0225 +LINE899,895,900,ABC,3.8684,m,2c_16 +LINE900,897,901,ABC,0.17088,m,2c_16 +LINE901,901,902,ABC,0.144,m,2c_16 +LINE902,902,903,ABC,0.18732,m,2c_16 +LINE903,903,904,ABC,0.33902,m,2c_16 +LINE904,904,905,ABC,0.5878,m,2c_16 +LINE905,905,906,ABC,4.8147,m,2c_16 diff --git a/src/test/resources/lvFeeder/LoadShapes.csv b/src/test/resources/lvFeeder/LoadShapes.csv new file mode 100644 index 0000000000..a0841dec34 --- /dev/null +++ b/src/test/resources/lvFeeder/LoadShapes.csv @@ -0,0 +1,57 @@ +# Load Shapes,,,, +Name,npts,minterval,File,useactual +Shape_1,1440,1,Load_profile_1.csv,TRUE +Shape_2,1440,1,Load_profile_2.csv,TRUE +Shape_3,1440,1,Load_profile_3.csv,TRUE +Shape_4,1440,1,Load_profile_4.csv,TRUE +Shape_5,1440,1,Load_profile_5.csv,TRUE +Shape_6,1440,1,Load_profile_6.csv,TRUE +Shape_7,1440,1,Load_profile_7.csv,TRUE +Shape_8,1440,1,Load_profile_8.csv,TRUE +Shape_9,1440,1,Load_profile_9.csv,TRUE +Shape_10,1440,1,Load_profile_10.csv,TRUE +Shape_11,1440,1,Load_profile_11.csv,TRUE +Shape_12,1440,1,Load_profile_12.csv,TRUE +Shape_13,1440,1,Load_profile_13.csv,TRUE +Shape_14,1440,1,Load_profile_14.csv,TRUE +Shape_15,1440,1,Load_profile_15.csv,TRUE +Shape_16,1440,1,Load_profile_16.csv,TRUE +Shape_17,1440,1,Load_profile_17.csv,TRUE +Shape_18,1440,1,Load_profile_18.csv,TRUE +Shape_19,1440,1,Load_profile_19.csv,TRUE +Shape_20,1440,1,Load_profile_20.csv,TRUE +Shape_21,1440,1,Load_profile_21.csv,TRUE +Shape_22,1440,1,Load_profile_22.csv,TRUE +Shape_23,1440,1,Load_profile_23.csv,TRUE +Shape_24,1440,1,Load_profile_24.csv,TRUE +Shape_25,1440,1,Load_profile_25.csv,TRUE +Shape_26,1440,1,Load_profile_26.csv,TRUE +Shape_27,1440,1,Load_profile_27.csv,TRUE +Shape_28,1440,1,Load_profile_28.csv,TRUE +Shape_29,1440,1,Load_profile_29.csv,TRUE +Shape_30,1440,1,Load_profile_30.csv,TRUE +Shape_31,1440,1,Load_profile_31.csv,TRUE +Shape_32,1440,1,Load_profile_32.csv,TRUE +Shape_33,1440,1,Load_profile_33.csv,TRUE +Shape_34,1440,1,Load_profile_34.csv,TRUE +Shape_35,1440,1,Load_profile_35.csv,TRUE +Shape_36,1440,1,Load_profile_36.csv,TRUE +Shape_37,1440,1,Load_profile_37.csv,TRUE +Shape_38,1440,1,Load_profile_38.csv,TRUE +Shape_39,1440,1,Load_profile_39.csv,TRUE +Shape_40,1440,1,Load_profile_40.csv,TRUE +Shape_41,1440,1,Load_profile_41.csv,TRUE +Shape_42,1440,1,Load_profile_42.csv,TRUE +Shape_43,1440,1,Load_profile_43.csv,TRUE +Shape_44,1440,1,Load_profile_44.csv,TRUE +Shape_45,1440,1,Load_profile_45.csv,TRUE +Shape_46,1440,1,Load_profile_46.csv,TRUE +Shape_47,1440,1,Load_profile_47.csv,TRUE +Shape_48,1440,1,Load_profile_48.csv,TRUE +Shape_49,1440,1,Load_profile_49.csv,TRUE +Shape_50,1440,1,Load_profile_50.csv,TRUE +Shape_51,1440,1,Load_profile_51.csv,TRUE +Shape_52,1440,1,Load_profile_52.csv,TRUE +Shape_53,1440,1,Load_profile_53.csv,TRUE +Shape_54,1440,1,Load_profile_54.csv,TRUE +Shape_55,1440,1,Load_profile_55.csv,TRUE diff --git a/src/test/resources/lvFeeder/Loads.csv b/src/test/resources/lvFeeder/Loads.csv new file mode 100644 index 0000000000..256565141f --- /dev/null +++ b/src/test/resources/lvFeeder/Loads.csv @@ -0,0 +1,58 @@ +# Loads ,,,,,,,,, +# Model 1 is constant PQ,,,,,,,,, +Name,numPhases,Bus,phases,kV,Model,Connection,kW,PF,Yearly +LOAD1,1,34,A,0.23,1,wye,1,0.95,Shape_1 +LOAD2,1,47,B,0.23,1,wye,1,0.95,Shape_2 +LOAD3,1,70,A,0.23,1,wye,1,0.95,Shape_3 +LOAD4,1,73,A,0.23,1,wye,1,0.95,Shape_4 +LOAD5,1,74,A,0.23,1,wye,1,0.95,Shape_5 +LOAD6,1,83,B,0.23,1,wye,1,0.95,Shape_6 +LOAD7,1,178,B,0.23,1,wye,1,0.95,Shape_7 +LOAD8,1,208,C,0.23,1,wye,1,0.95,Shape_8 +LOAD9,1,225,A,0.23,1,wye,1,0.95,Shape_9 +LOAD10,1,248,B,0.23,1,wye,1,0.95,Shape_10 +LOAD11,1,249,B,0.23,1,wye,1,0.95,Shape_11 +LOAD12,1,264,C,0.23,1,wye,1,0.95,Shape_12 +LOAD13,1,276,B,0.23,1,wye,1,0.95,Shape_13 +LOAD14,1,289,A,0.23,1,wye,1,0.95,Shape_14 +LOAD15,1,314,B,0.23,1,wye,1,0.95,Shape_15 +LOAD16,1,320,C,0.23,1,wye,1,0.95,Shape_16 +LOAD17,1,327,C,0.23,1,wye,1,0.95,Shape_17 +LOAD18,1,337,C,0.23,1,wye,1,0.95,Shape_18 +LOAD19,1,342,C,0.23,1,wye,1,0.95,Shape_19 +LOAD20,1,349,A,0.23,1,wye,1,0.95,Shape_20 +LOAD21,1,387,A,0.23,1,wye,1,0.95,Shape_21 +LOAD22,1,388,A,0.23,1,wye,1,0.95,Shape_22 +LOAD23,1,406,B,0.23,1,wye,1,0.95,Shape_23 +LOAD24,1,458,C,0.23,1,wye,1,0.95,Shape_24 +LOAD25,1,502,A,0.23,1,wye,1,0.95,Shape_25 +LOAD26,1,522,B,0.23,1,wye,1,0.95,Shape_26 +LOAD27,1,539,C,0.23,1,wye,1,0.95,Shape_27 +LOAD28,1,556,C,0.23,1,wye,1,0.95,Shape_28 +LOAD29,1,562,A,0.23,1,wye,1,0.95,Shape_29 +LOAD30,1,563,A,0.23,1,wye,1,0.95,Shape_30 +LOAD31,1,611,A,0.23,1,wye,1,0.95,Shape_31 +LOAD32,1,614,C,0.23,1,wye,1,0.95,Shape_32 +LOAD33,1,619,C,0.23,1,wye,1,0.95,Shape_33 +LOAD34,1,629,A,0.23,1,wye,1,0.95,Shape_34 +LOAD35,1,639,B,0.23,1,wye,1,0.95,Shape_35 +LOAD36,1,676,B,0.23,1,wye,1,0.95,Shape_36 +LOAD37,1,682,B,0.23,1,wye,1,0.95,Shape_37 +LOAD38,1,688,B,0.23,1,wye,1,0.95,Shape_38 +LOAD39,1,701,C,0.23,1,wye,1,0.95,Shape_39 +LOAD40,1,702,B,0.23,1,wye,1,0.95,Shape_40 +LOAD41,1,755,B,0.23,1,wye,1,0.95,Shape_41 +LOAD42,1,778,C,0.23,1,wye,1,0.95,Shape_42 +LOAD43,1,780,C,0.23,1,wye,1,0.95,Shape_43 +LOAD44,1,785,B,0.23,1,wye,1,0.95,Shape_44 +LOAD45,1,813,B,0.23,1,wye,1,0.95,Shape_45 +LOAD46,1,817,A,0.23,1,wye,1,0.95,Shape_46 +LOAD47,1,835,C,0.23,1,wye,1,0.95,Shape_47 +LOAD48,1,860,A,0.23,1,wye,1,0.95,Shape_48 +LOAD49,1,861,A,0.23,1,wye,1,0.95,Shape_49 +LOAD50,1,886,B,0.23,1,wye,1,0.95,Shape_50 +LOAD51,1,896,A,0.23,1,wye,1,0.95,Shape_51 +LOAD52,1,898,A,0.23,1,wye,1,0.95,Shape_52 +LOAD53,1,899,B,0.23,1,wye,1,0.95,Shape_53 +LOAD54,1,900,A,0.23,1,wye,1,0.95,Shape_54 +LOAD55,1,906,A,0.23,1,wye,1,0.95,Shape_55 diff --git a/src/test/resources/lvFeeder/Source.csv b/src/test/resources/lvFeeder/Source.csv new file mode 100644 index 0000000000..ca83982600 --- /dev/null +++ b/src/test/resources/lvFeeder/Source.csv @@ -0,0 +1,6 @@ +# Source impedance +[Source] +Voltage=11 kV +pu=1.05 +ISC3=3000 A +ISC1=5 A diff --git a/src/test/resources/lvFeeder/Transformer.csv b/src/test/resources/lvFeeder/Transformer.csv new file mode 100644 index 0000000000..2e34814d1a --- /dev/null +++ b/src/test/resources/lvFeeder/Transformer.csv @@ -0,0 +1,3 @@ +# Substation transformer connected Delta/grounded-wye,,,,,,,,,, +Name, phases, bus1, bus2, kV_pri, kV_sec, MVA, Conn_pri, Conn_sec, %XHL,% resistance +TR1,3,SourceBus,1,11,0.416,0.8, Delta, Wye,4,0.4 From b61849cb5375d976fbf5a8c1dccbd0eda107e956 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 083/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From a0f6b086065fd60b39414e04dde2a692fa3cb9b4 Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 084/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 6f97c31c3db2d7784b7675bca9fbeb5580476fc5 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 085/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +++++++------------ .../network/util/AsymLvFeederParser.java | 6 +++ .../util/AsymIeeeFeederParserTest.java | 6 ++- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From e584e1235604ef1355f45340c98634ca21990bdc Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 086/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From d6ff17eb81546cf65f6d4664583a6bba71ad7111 Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 087/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 87938713a0340b78c4967573b5a7cd02cabeacb9 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 088/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +-- .../network/util/AsymLvFeederParser.java | 6 + .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++----------- .../util/AsymIeeeFeederParserTest.java | 6 +- 4 files changed, 127 insertions(+), 188 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index 2c6edd1e9b..b960dba8a4 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,7 +18,9 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -88,14 +90,6 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -108,19 +102,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Power.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -133,19 +123,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Impedant.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -158,6 +144,10 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Current.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -271,6 +261,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load802.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -325,14 +318,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -345,6 +330,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load808.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -471,14 +460,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -491,6 +472,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load816.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -524,14 +509,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -544,6 +521,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load818.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -577,14 +558,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -597,6 +570,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load820.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -654,14 +631,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -674,6 +643,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load824.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -731,14 +704,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -751,6 +716,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load828.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -782,14 +751,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -802,6 +763,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load830.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -833,14 +798,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -853,6 +810,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load854.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -933,14 +894,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -953,6 +906,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load832.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible + .add(); + // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -1003,14 +960,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -1023,6 +972,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load890.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1054,14 +1007,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1074,6 +1019,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load858.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1131,14 +1080,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1151,6 +1092,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load834.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1181,14 +1126,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1201,6 +1138,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load842.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1232,14 +1172,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1252,6 +1184,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1269,6 +1205,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + distrload844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1300,14 +1240,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1320,6 +1252,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load846.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1362,6 +1298,10 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); + + load848.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1424,6 +1364,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1441,6 +1385,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + distriload860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1472,14 +1420,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1492,6 +1432,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load836.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1523,14 +1467,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1543,6 +1479,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load840.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1586,6 +1526,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load862.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From a3854e2ee262d7b0ada5d73a93264acd144a5c90 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 089/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 0ba9eb35c00be204f5660b494af584a8e627312f Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 090/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From e9e16ca49d9032a744220cd76129fadc4f0e345d Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 091/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From dc9b30dfe15340220b0689e1ef63dc70a5ca64be Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 092/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 53971566d4560be3d483965f473caaaed46ad870 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 093/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +++++++------------ .../network/util/AsymLvFeederParser.java | 6 +++ .../util/AsymIeeeFeederParserTest.java | 6 ++- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From 4b8e241ea3a0536fc4985ab9bf7eff93ed3a34f7 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 094/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 7cc656db84dacf89304eacd438baa4ed4cb23944 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 095/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++++++------- 1 file changed, 160 insertions(+), 104 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index b960dba8a4..2c6edd1e9b 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,9 +18,7 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -90,6 +88,14 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -102,15 +108,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Power.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -123,15 +133,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Impedant.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -144,10 +158,6 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Current.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -261,9 +271,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load802.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -318,6 +325,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -330,10 +345,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load808.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -460,6 +471,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -472,10 +491,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load816.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -509,6 +524,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -521,10 +544,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load818.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -558,6 +577,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -570,10 +597,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load820.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -631,6 +654,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -643,10 +674,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load824.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -704,6 +731,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -716,10 +751,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load828.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -751,6 +782,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -763,10 +802,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load830.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -798,6 +833,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -810,10 +853,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load854.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -894,6 +933,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -906,10 +953,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load832.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible - .add(); - // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -960,6 +1003,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -972,10 +1023,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load890.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1007,6 +1054,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1019,10 +1074,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load858.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1080,6 +1131,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1092,10 +1151,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load834.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1126,6 +1181,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1138,9 +1201,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load842.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1172,6 +1232,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1184,10 +1252,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1205,10 +1269,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - distrload844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1240,6 +1300,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1252,10 +1320,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load846.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1298,10 +1362,6 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); - - load848.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1364,10 +1424,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1385,10 +1441,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - distriload860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1420,6 +1472,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1432,10 +1492,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load836.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1467,6 +1523,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1479,10 +1543,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load840.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1526,10 +1586,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load862.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") From abaaa0b265a343719d5aeadc4be37b16dcdb32dd Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 096/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 9bde829760c72c67410790cffd1a19cc9b931ad5 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 097/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +++++++------------ .../network/util/AsymLvFeederParser.java | 6 +++ .../util/AsymIeeeFeederParserTest.java | 6 ++- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From 5a4fba1d79a686061620cbb28a9a673126bbc715 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 098/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From cecb69cd7f33b04e59c0b0c8be9fd3e64fd03ce3 Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 099/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From c22e1b3e400f9417b795d6ffc2a710d924a28589 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 100/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +-- .../network/util/AsymLvFeederParser.java | 6 + .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++----------- .../util/AsymIeeeFeederParserTest.java | 6 +- 4 files changed, 127 insertions(+), 188 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index 2c6edd1e9b..b960dba8a4 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,7 +18,9 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -88,14 +90,6 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -108,19 +102,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Power.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -133,19 +123,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Impedant.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -158,6 +144,10 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Current.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -271,6 +261,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load802.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -325,14 +318,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -345,6 +330,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load808.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -471,14 +460,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -491,6 +472,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load816.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -524,14 +509,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -544,6 +521,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load818.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -577,14 +558,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -597,6 +570,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load820.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -654,14 +631,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -674,6 +643,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load824.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -731,14 +704,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -751,6 +716,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load828.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -782,14 +751,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -802,6 +763,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load830.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -833,14 +798,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -853,6 +810,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load854.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -933,14 +894,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -953,6 +906,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load832.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible + .add(); + // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -1003,14 +960,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -1023,6 +972,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load890.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1054,14 +1007,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1074,6 +1019,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load858.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1131,14 +1080,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1151,6 +1092,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load834.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1181,14 +1126,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1201,6 +1138,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load842.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1232,14 +1172,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1252,6 +1184,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1269,6 +1205,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + distrload844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1300,14 +1240,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1320,6 +1252,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load846.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1362,6 +1298,10 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); + + load848.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1424,6 +1364,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1441,6 +1385,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + distriload860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1472,14 +1420,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1492,6 +1432,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load836.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1523,14 +1467,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1543,6 +1479,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load840.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1586,6 +1526,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load862.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From 48f564a3ff712a6ed56137ba3f820fc7c13b938e Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 101/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 3b0453420cb172363351b42669988fdd95d26253 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 102/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++++++------- .../util/AsymIeeeFeederParserTest.java | 6 +- 2 files changed, 164 insertions(+), 106 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index b960dba8a4..2c6edd1e9b 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,9 +18,7 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -90,6 +88,14 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -102,15 +108,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Power.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -123,15 +133,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Impedant.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -144,10 +158,6 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Current.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -261,9 +271,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load802.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -318,6 +325,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -330,10 +345,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load808.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -460,6 +471,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -472,10 +491,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load816.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -509,6 +524,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -521,10 +544,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load818.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -558,6 +577,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -570,10 +597,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load820.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -631,6 +654,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -643,10 +674,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load824.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -704,6 +731,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -716,10 +751,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load828.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -751,6 +782,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -763,10 +802,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load830.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -798,6 +833,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -810,10 +853,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load854.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -894,6 +933,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -906,10 +953,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load832.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible - .add(); - // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -960,6 +1003,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -972,10 +1023,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load890.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1007,6 +1054,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1019,10 +1074,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load858.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1080,6 +1131,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1092,10 +1151,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load834.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1126,6 +1181,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1138,9 +1201,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load842.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1172,6 +1232,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1184,10 +1252,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1205,10 +1269,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - distrload844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1240,6 +1300,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1252,10 +1320,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load846.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1298,10 +1362,6 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); - - load848.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1364,10 +1424,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1385,10 +1441,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - distriload860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1420,6 +1472,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1432,10 +1492,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load836.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1467,6 +1523,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1479,10 +1543,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load840.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1526,10 +1586,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load862.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From e6199558980072efff08e4d7932f5b79ba1802bc Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 103/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From af069ff9f3d0b2ceb18e747292fb1e818b91381a Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 104/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 33a079cecc0c308fc7f6298d388bc4fc8201683b Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 105/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +++++++------------ .../network/util/AsymLvFeederParser.java | 6 +++ .../util/AsymIeeeFeederParserTest.java | 6 ++- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From 8597ecf1d30c850f881bf3d9c0861bb55e8fe837 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 106/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 99d8fb6687d49152ca7d2850a9ff8edffa649541 Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 107/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 0ddf3e242eae49702a29cf27e91ff991becb16f8 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 108/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +-- .../network/util/AsymLvFeederParser.java | 6 + .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++----------- .../util/AsymIeeeFeederParserTest.java | 6 +- 4 files changed, 127 insertions(+), 188 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index 2c6edd1e9b..b960dba8a4 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,7 +18,9 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -88,14 +90,6 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -108,19 +102,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Power.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -133,19 +123,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Impedant.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -158,6 +144,10 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Current.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -271,6 +261,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load802.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -325,14 +318,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -345,6 +330,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load808.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -471,14 +460,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -491,6 +472,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load816.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -524,14 +509,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -544,6 +521,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load818.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -577,14 +558,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -597,6 +570,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load820.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -654,14 +631,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -674,6 +643,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load824.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -731,14 +704,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -751,6 +716,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load828.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -782,14 +751,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -802,6 +763,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load830.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -833,14 +798,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -853,6 +810,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load854.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -933,14 +894,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -953,6 +906,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load832.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible + .add(); + // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -1003,14 +960,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -1023,6 +972,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load890.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1054,14 +1007,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1074,6 +1019,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load858.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1131,14 +1080,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1151,6 +1092,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load834.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1181,14 +1126,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1201,6 +1138,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load842.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1232,14 +1172,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1252,6 +1184,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1269,6 +1205,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + distrload844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1300,14 +1240,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1320,6 +1252,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load846.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1362,6 +1298,10 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); + + load848.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1424,6 +1364,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1441,6 +1385,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + distriload860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1472,14 +1420,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1492,6 +1432,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load836.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1523,14 +1467,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1543,6 +1479,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load840.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1586,6 +1526,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load862.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From 9b364155e06ede7e4904c7bbca7470f7ddd08743 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 109/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 39dd4094285eb4e2a19c80d585b814ba4e2dd4f1 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 110/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From fc4b3e410ef96654fdf5b8f3a65c0748f84023ef Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 111/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 5d308192932928293a49d86d37eef79c6b17c392 Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 112/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 084f241a1aaad94886a64fa2c69e232cb18da966 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 113/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +++++++------------ .../network/util/AsymLvFeederParser.java | 6 +++ .../util/AsymIeeeFeederParserTest.java | 6 ++- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From 43785b9ed91b17eb953f9293314e988717ffdea9 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 114/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 0f836cbc3fc641d49722624de89f0b7491ec8e65 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 115/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++++++------- 1 file changed, 160 insertions(+), 104 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index b960dba8a4..2c6edd1e9b 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,9 +18,7 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -90,6 +88,14 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -102,15 +108,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Power.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -123,15 +133,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Impedant.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -144,10 +158,6 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Current.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -261,9 +271,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load802.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -318,6 +325,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -330,10 +345,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load808.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -460,6 +471,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -472,10 +491,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load816.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -509,6 +524,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -521,10 +544,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load818.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -558,6 +577,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -570,10 +597,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load820.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -631,6 +654,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -643,10 +674,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load824.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -704,6 +731,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -716,10 +751,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load828.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -751,6 +782,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -763,10 +802,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load830.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -798,6 +833,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -810,10 +853,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load854.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -894,6 +933,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -906,10 +953,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load832.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible - .add(); - // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -960,6 +1003,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -972,10 +1023,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load890.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1007,6 +1054,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1019,10 +1074,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load858.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1080,6 +1131,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1092,10 +1151,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load834.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1126,6 +1181,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1138,9 +1201,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load842.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1172,6 +1232,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1184,10 +1252,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1205,10 +1269,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - distrload844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1240,6 +1300,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1252,10 +1320,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load846.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1298,10 +1362,6 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); - - load848.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1364,10 +1424,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1385,10 +1441,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - distriload860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1420,6 +1472,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1432,10 +1492,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load836.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1467,6 +1523,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1479,10 +1543,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load840.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1526,10 +1586,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load862.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") From 77b49b6f63e72d655fe7ad59f1467d032e03700c Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 116/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 003756239ec8f258f35534765ab485c2fdb13817 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 117/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +-- .../network/util/AsymLvFeederParser.java | 6 + .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++----------- .../util/AsymIeeeFeederParserTest.java | 6 +- 4 files changed, 127 insertions(+), 188 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index 2c6edd1e9b..b960dba8a4 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,7 +18,9 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -88,14 +90,6 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -108,19 +102,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Power.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -133,19 +123,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Impedant.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -158,6 +144,10 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Current.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -271,6 +261,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load802.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -325,14 +318,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -345,6 +330,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load808.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -471,14 +460,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -491,6 +472,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load816.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -524,14 +509,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -544,6 +521,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load818.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -577,14 +558,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -597,6 +570,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load820.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -654,14 +631,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -674,6 +643,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load824.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -731,14 +704,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -751,6 +716,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load828.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -782,14 +751,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -802,6 +763,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load830.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -833,14 +798,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -853,6 +810,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load854.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -933,14 +894,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -953,6 +906,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load832.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible + .add(); + // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -1003,14 +960,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -1023,6 +972,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load890.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1054,14 +1007,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1074,6 +1019,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load858.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1131,14 +1080,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1151,6 +1092,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load834.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1181,14 +1126,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1201,6 +1138,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load842.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1232,14 +1172,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1252,6 +1184,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1269,6 +1205,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + distrload844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1300,14 +1240,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1320,6 +1252,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load846.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1362,6 +1298,10 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); + + load848.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1424,6 +1364,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1441,6 +1385,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + distriload860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1472,14 +1420,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1492,6 +1432,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load836.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1523,14 +1467,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1543,6 +1479,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load840.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1586,6 +1526,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load862.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From e53a83f63c1c8e555016fbaa258ad07769b05324 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 118/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 0e37bc820c671e2abb00463ce0401890516e0aff Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 119/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From c069fdbc84bca12e13e5258d70654c1b3a9755e5 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 120/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 68d598dbc388eb805ebd360fe333921b67c086c7 Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 121/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From d87f5d840802334f1646a1cbb192bfa86bcf0e41 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 122/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +++++++------------ .../network/util/AsymLvFeederParser.java | 6 +++ .../util/AsymIeeeFeederParserTest.java | 6 ++- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From abf378b7c6acb6e0e08f983d46f1b3bce417cbbb Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 123/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 26086a7c4d48a7f12998c9536e5a5df612c30c77 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 124/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++++++------- 1 file changed, 160 insertions(+), 104 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index b960dba8a4..2c6edd1e9b 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,9 +18,7 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -90,6 +88,14 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -102,15 +108,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Power.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -123,15 +133,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Impedant.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -144,10 +158,6 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Current.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -261,9 +271,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load802.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -318,6 +325,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -330,10 +345,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load808.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -460,6 +471,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -472,10 +491,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load816.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -509,6 +524,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -521,10 +544,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load818.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -558,6 +577,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -570,10 +597,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load820.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -631,6 +654,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -643,10 +674,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load824.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -704,6 +731,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -716,10 +751,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load828.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -751,6 +782,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -763,10 +802,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load830.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -798,6 +833,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -810,10 +853,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load854.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -894,6 +933,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -906,10 +953,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load832.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible - .add(); - // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -960,6 +1003,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -972,10 +1023,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load890.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1007,6 +1054,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1019,10 +1074,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load858.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1080,6 +1131,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1092,10 +1151,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load834.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1126,6 +1181,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1138,9 +1201,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load842.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1172,6 +1232,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1184,10 +1252,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1205,10 +1269,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - distrload844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1240,6 +1300,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1252,10 +1320,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load846.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1298,10 +1362,6 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); - - load848.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1364,10 +1424,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1385,10 +1441,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - distriload860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1420,6 +1472,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1432,10 +1492,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load836.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1467,6 +1523,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1479,10 +1543,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load840.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1526,10 +1586,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load862.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") From fb3552e1a3c0e1596f6b25bf28977ff861476dd6 Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 125/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From e886b8da667dc782fbf11cd3b7a3e394d96f61ae Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 126/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +++++++------------ .../network/util/AsymLvFeederParser.java | 6 +++ .../util/AsymIeeeFeederParserTest.java | 6 ++- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From 7c8fc6b50b43c3c08e2cf1ce4cf72ecbacabe700 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 127/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 55478441d7241dab70744b621408f0f8d0000f35 Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 128/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 630964fc0342f4e6e6ef1fd2cf964bb1426ab29e Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 129/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +-- .../network/util/AsymLvFeederParser.java | 6 + .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++----------- .../util/AsymIeeeFeederParserTest.java | 6 +- 4 files changed, 127 insertions(+), 188 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index 2c6edd1e9b..b960dba8a4 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,7 +18,9 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -88,14 +90,6 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -108,19 +102,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Power.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -133,19 +123,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Impedant.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -158,6 +144,10 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Current.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -271,6 +261,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load802.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -325,14 +318,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -345,6 +330,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load808.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -471,14 +460,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -491,6 +472,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load816.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -524,14 +509,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -544,6 +521,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load818.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -577,14 +558,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -597,6 +570,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load820.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -654,14 +631,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -674,6 +643,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load824.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -731,14 +704,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -751,6 +716,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load828.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -782,14 +751,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -802,6 +763,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load830.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -833,14 +798,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -853,6 +810,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load854.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -933,14 +894,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -953,6 +906,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load832.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible + .add(); + // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -1003,14 +960,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -1023,6 +972,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load890.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1054,14 +1007,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1074,6 +1019,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load858.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1131,14 +1080,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1151,6 +1092,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load834.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1181,14 +1126,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1201,6 +1138,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load842.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1232,14 +1172,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1252,6 +1184,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1269,6 +1205,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + distrload844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1300,14 +1240,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1320,6 +1252,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load846.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1362,6 +1298,10 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); + + load848.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1424,6 +1364,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1441,6 +1385,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + distriload860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1472,14 +1420,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1492,6 +1432,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load836.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1523,14 +1467,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1543,6 +1479,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load840.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1586,6 +1526,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load862.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From e5c4a5afc2be157088755af62330936547b89173 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 130/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 64dd42f91847c029063b53aca16412e8e4259866 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 131/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++++++------- 1 file changed, 160 insertions(+), 104 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index b960dba8a4..2c6edd1e9b 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,9 +18,7 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -90,6 +88,14 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -102,15 +108,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Power.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -123,15 +133,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Impedant.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -144,10 +158,6 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Current.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -261,9 +271,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load802.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -318,6 +325,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -330,10 +345,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load808.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -460,6 +471,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -472,10 +491,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load816.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -509,6 +524,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -521,10 +544,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load818.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -558,6 +577,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -570,10 +597,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load820.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -631,6 +654,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -643,10 +674,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load824.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -704,6 +731,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -716,10 +751,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load828.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -751,6 +782,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -763,10 +802,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load830.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -798,6 +833,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -810,10 +853,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load854.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -894,6 +933,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -906,10 +953,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load832.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible - .add(); - // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -960,6 +1003,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -972,10 +1023,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load890.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1007,6 +1054,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1019,10 +1074,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load858.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1080,6 +1131,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1092,10 +1151,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load834.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1126,6 +1181,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1138,9 +1201,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load842.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1172,6 +1232,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1184,10 +1252,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1205,10 +1269,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - distrload844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1240,6 +1300,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1252,10 +1320,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load846.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1298,10 +1362,6 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); - - load848.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1364,10 +1424,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1385,10 +1441,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - distriload860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1420,6 +1472,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1432,10 +1492,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load836.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1467,6 +1523,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1479,10 +1543,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load840.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1526,10 +1586,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load862.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") From 2a1e7a69d182012c2e736a3e26bd88c12ac6a874 Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 132/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From c306bac305165b23a58a4183b4891e08752eeeb6 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 133/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +++++++------------ .../network/util/AsymLvFeederParser.java | 6 +++ .../util/AsymIeeeFeederParserTest.java | 6 ++- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From e9e64f632c323ed6d032aef6cc18f72450cef367 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 134/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 9ffe7e25c391113350cc23d1be144dc9fb865a5a Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 135/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 7e918a839419d4ff1918b781624de56b254b8545 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 136/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +-- .../network/util/AsymLvFeederParser.java | 6 + .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++----------- .../util/AsymIeeeFeederParserTest.java | 6 +- 4 files changed, 127 insertions(+), 188 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index 2c6edd1e9b..b960dba8a4 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,7 +18,9 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -88,14 +90,6 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -108,19 +102,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Power.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -133,19 +123,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Impedant.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -158,6 +144,10 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Current.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -271,6 +261,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load802.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -325,14 +318,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -345,6 +330,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load808.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -471,14 +460,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -491,6 +472,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load816.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -524,14 +509,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -544,6 +521,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load818.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -577,14 +558,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -597,6 +570,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load820.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -654,14 +631,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -674,6 +643,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load824.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -731,14 +704,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -751,6 +716,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load828.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -782,14 +751,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -802,6 +763,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load830.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -833,14 +798,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -853,6 +810,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load854.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -933,14 +894,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -953,6 +906,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load832.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible + .add(); + // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -1003,14 +960,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -1023,6 +972,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load890.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1054,14 +1007,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1074,6 +1019,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load858.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1131,14 +1080,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1151,6 +1092,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load834.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1181,14 +1126,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1201,6 +1138,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load842.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1232,14 +1172,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1252,6 +1184,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1269,6 +1205,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + distrload844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1300,14 +1240,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1320,6 +1252,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load846.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1362,6 +1298,10 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); + + load848.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1424,6 +1364,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1441,6 +1385,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + distriload860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1472,14 +1420,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1492,6 +1432,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load836.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1523,14 +1467,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1543,6 +1479,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load840.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1586,6 +1526,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load862.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From a2db6c36bf4844845c7a63bb59c06f71adba0392 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 137/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From aa7527f3c89fe6159c40dc3dad36b06b8a3b2872 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 138/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../openloadflow/ac/Asym34BusFeederTest.java | 268 +++++++++++------- 1 file changed, 162 insertions(+), 106 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index b960dba8a4..c4ea034fef 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,9 +18,7 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -90,6 +88,14 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -102,15 +108,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Power.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -123,15 +133,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Impedant.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -144,10 +158,6 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Current.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -261,9 +271,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load802.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -318,6 +325,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -330,10 +345,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load808.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -460,6 +471,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -472,10 +491,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load816.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -509,6 +524,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -521,10 +544,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load818.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -558,6 +577,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -570,10 +597,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load820.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -631,6 +654,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -643,10 +674,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load824.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -704,6 +731,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -716,10 +751,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load828.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -751,6 +782,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -763,10 +802,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load830.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -798,6 +833,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -810,10 +853,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load854.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -884,7 +923,7 @@ public static Network ieee34LoadFeeder() { bus832.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(BusVariableType.WYE) .withPositiveSequenceAsCurrent(true) - .withFortescueRepresentation(true) + .withFortescueRepresentation(false) .add(); double p832 = 0.; @@ -894,6 +933,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -906,10 +953,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load832.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible - .add(); - // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -926,7 +969,7 @@ public static Network ieee34LoadFeeder() { bus888.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(BusVariableType.WYE) .withPositiveSequenceAsCurrent(true) - .withFortescueRepresentation(true) + .withFortescueRepresentation(false) .add(); // Bus 890 @@ -960,6 +1003,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -972,10 +1023,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load890.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1007,6 +1054,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1019,10 +1074,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load858.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1080,6 +1131,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1092,10 +1151,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load834.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1126,6 +1181,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1138,9 +1201,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load842.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1172,6 +1232,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1184,10 +1252,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1205,10 +1269,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - distrload844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1240,6 +1300,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1252,10 +1320,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load846.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1298,10 +1362,6 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); - - load848.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1364,10 +1424,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1385,10 +1441,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - distriload860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1420,6 +1472,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1432,10 +1492,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load836.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1467,6 +1523,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1479,10 +1543,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load840.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1526,10 +1586,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load862.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") From 95a951075107908c74f47f7923f41da5d9467a69 Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 139/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 90eae6b7acf69817e593618ee068f11626a4612f Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 140/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../powsybl/openloadflow/ac/Asym34BusFeederTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index c4ea034fef..2c6edd1e9b 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -923,7 +923,7 @@ public static Network ieee34LoadFeeder() { bus832.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(BusVariableType.WYE) .withPositiveSequenceAsCurrent(true) - .withFortescueRepresentation(false) + .withFortescueRepresentation(true) .add(); double p832 = 0.; @@ -934,12 +934,12 @@ public static Network ieee34LoadFeeder() { .setP0(p832) .setQ0(q832) .newZipModel() - .setC0p(0.) + .setC0p(1.) .setC1p(0.) - .setC2p(1.) - .setC0q(0.) + .setC2p(0.) + .setC0q(1.) .setC1q(0.) - .setC2q(1.) + .setC2q(0.) .add() .add(); @@ -969,7 +969,7 @@ public static Network ieee34LoadFeeder() { bus888.newExtension(BusAsymmetricalAdder.class) .withBusVariableType(BusVariableType.WYE) .withPositiveSequenceAsCurrent(true) - .withFortescueRepresentation(false) + .withFortescueRepresentation(true) .add(); // Bus 890 From 817a51bcba3d7b24d8a760ae8dcd766968de99d5 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 141/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +++++++------------ .../network/util/AsymLvFeederParser.java | 6 +++ .../util/AsymIeeeFeederParserTest.java | 6 ++- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From 5280134adf7a8da5dddde8e8b78e3d6835c22afe Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 142/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From d6c008069c499aba62d8c5338f6e45226402c451 Mon Sep 17 00:00:00 2001 From: JB-H Date: Tue, 10 Oct 2023 23:08:07 +0200 Subject: [PATCH 143/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 ++++++++++++------- .../network/util/AsymLvFeederParser.java | 6 --- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..e18c76dbdd 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,51 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); + ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); + var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + loadModel.setC2p(1.); + loadModel.setC2q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + loadModel.setC1p(1.); + loadModel.setC1q(1.); + loadModel.setC0p(0.); + loadModel.setC0q(0.); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -396,11 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); - - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -289,10 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } From 15007e4619dc08cb2f9dcc964d930a34d8fa4233 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 144/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 39 +-- .../network/util/AsymLvFeederParser.java | 6 + .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++----------- .../util/AsymIeeeFeederParserTest.java | 6 +- 4 files changed, 127 insertions(+), 188 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index e18c76dbdd..4ca3d3aea2 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,6 +4,7 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -355,51 +356,32 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); - ZipLoadModel loadModel = (ZipLoadModel) load.getModel().orElseThrow(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; + LoadType loadTypeOut; if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; + loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC2p(1.); - loadModel.setC2q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_IMPEDANCE; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadModel.setC1p(1.); - loadModel.setC1q(1.); - loadModel.setC0p(0.); - loadModel.setC0q(0.); + loadTypeOut = LoadType.CONSTANT_CURRENT; extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -414,6 +396,11 @@ private static void createLoad(Network network, String loadName, String busName, .withDeltaQc(qc / 1000.) .withConnectionType(loadConnectionType) .add(); + + load.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(loadTypeOut) + .add(); + } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index daafe704fc..5b70c85e15 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,6 +6,8 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -287,6 +289,10 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); + + l.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index 2c6edd1e9b..b960dba8a4 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,7 +18,9 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -88,14 +90,6 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -108,19 +102,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Power.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -133,19 +123,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Impedant.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -158,6 +144,10 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Current.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -271,6 +261,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load802.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -325,14 +318,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -345,6 +330,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load808.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -471,14 +460,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -491,6 +472,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load816.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -524,14 +509,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -544,6 +521,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load818.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -577,14 +558,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -597,6 +570,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load820.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -654,14 +631,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -674,6 +643,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load824.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -731,14 +704,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -751,6 +716,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load828.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -782,14 +751,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -802,6 +763,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load830.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -833,14 +798,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -853,6 +810,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load854.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -933,14 +894,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -953,6 +906,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load832.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible + .add(); + // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -1003,14 +960,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -1023,6 +972,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load890.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1054,14 +1007,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1074,6 +1019,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load858.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1131,14 +1080,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1151,6 +1092,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load834.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1181,14 +1126,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1201,6 +1138,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load842.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1232,14 +1172,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1252,6 +1184,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1269,6 +1205,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + distrload844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1300,14 +1240,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1320,6 +1252,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load846.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1362,6 +1298,10 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); + + load848.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1424,6 +1364,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1441,6 +1385,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + distriload860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1472,14 +1420,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1492,6 +1432,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load836.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1523,14 +1467,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1543,6 +1479,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load840.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1586,6 +1526,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load862.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From 87f38ab0fddd9f2b9ca5e52a2fe6d28459e5c3f4 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 145/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From b1bd097da2f14a3c5747c9a33cfd4c1e3996c798 Mon Sep 17 00:00:00 2001 From: JB-H Date: Wed, 11 Oct 2023 17:58:37 +0200 Subject: [PATCH 146/153] removal of load extension2 replaced by use of ZIP model Signed-off-by: JB-H --- .../network/util/AsymIeeeFeederParser.java | 37 ++- .../network/util/AsymLvFeederParser.java | 5 - .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++++++------- 3 files changed, 185 insertions(+), 121 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 4ca3d3aea2..7377a56f83 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -4,7 +4,6 @@ import com.powsybl.iidm.network.extensions.*; import com.powsybl.math.matrix.DenseMatrix; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; @@ -356,32 +355,50 @@ private static void createLoad(Network network, String loadName, String busName, .setBus(getBusId(busName)) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1) + .setC0q(1) + .setC1p(0) + .setC1q(0) + .setC2p(0) + .setC2q(0) + .add() .add(); var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; - LoadType loadTypeOut; + ZipLoadModel zipLoadModel = (ZipLoadModel) load.getModel().orElseThrow(); if (loadType.equals("Y-PQ")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("D-PQ")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_POWER; } else if (loadType.equals("Y-Z")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + zipLoadModel.setC0p(0); + zipLoadModel.setC0q(0); + zipLoadModel.setC2p(1); + zipLoadModel.setC2q(1); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_IMPEDANCE; + zipLoadModel.setC0p(0); + zipLoadModel.setC0q(0); + zipLoadModel.setC2p(1); + zipLoadModel.setC2q(1); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; - loadTypeOut = LoadType.CONSTANT_CURRENT; + zipLoadModel.setC0p(0); + zipLoadModel.setC0q(0); + zipLoadModel.setC1p(1); + zipLoadModel.setC1q(1); extensionBus.setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; - loadTypeOut = LoadType.CONSTANT_CURRENT; + zipLoadModel.setC0p(0); + zipLoadModel.setC0q(0); + zipLoadModel.setC1p(1); + zipLoadModel.setC1q(1); extensionBus.setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); @@ -397,10 +414,6 @@ private static void createLoad(Network network, String loadName, String busName, .withConnectionType(loadConnectionType) .add(); - load.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(loadTypeOut) - .add(); - } private static void createLoads(Network network, String path) { diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index 5b70c85e15..e796ecdd83 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -6,8 +6,6 @@ import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -290,9 +288,6 @@ private static void createLoads(Network network, String path) { .withDeltaQc(deltaQc) .add(); - l.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); } } diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index b960dba8a4..5ab400b34b 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,9 +18,7 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; -import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; -import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -90,6 +88,14 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -102,15 +108,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Power.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -123,15 +133,19 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Impedant.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -144,10 +158,6 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); - load810Current.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -261,9 +271,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load802.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -318,6 +325,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -330,10 +345,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load808.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -460,6 +471,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -472,10 +491,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load816.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -509,6 +524,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -521,10 +544,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load818.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -558,6 +577,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -570,10 +597,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load820.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -631,6 +654,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -643,10 +674,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load824.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -704,6 +731,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -716,10 +751,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load828.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -751,6 +782,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -763,10 +802,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load830.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -798,6 +833,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -810,10 +853,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load854.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -894,6 +933,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -906,10 +953,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load832.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible - .add(); - // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -960,6 +1003,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -972,10 +1023,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load890.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1007,6 +1054,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1019,10 +1074,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load858.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1080,6 +1131,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1092,10 +1151,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load834.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1126,6 +1181,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1138,9 +1201,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load842.newExtension(LoadAsymmetrical2Adder.class) - .add(); - // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1172,6 +1232,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) + .newZipModel() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1184,10 +1252,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_IMPEDANCE) - .add(); - Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1205,10 +1269,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - distrload844.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1240,6 +1300,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) + .newZipModel() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1252,10 +1320,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load846.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1298,10 +1362,6 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); - - load848.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1364,10 +1424,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1385,10 +1441,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - distriload860.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1420,6 +1472,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1432,10 +1492,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); - load836.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1467,6 +1523,14 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) + .newZipModel() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1479,10 +1543,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load840.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_CURRENT) - .add(); - // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1526,10 +1586,6 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); - load862.newExtension(LoadAsymmetrical2Adder.class) - .withLoadType(LoadType.CONSTANT_POWER) - .add(); - // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") From b752d065fb5b1de53d3af7b0528a0c92441a9144 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 147/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../openloadflow/ac/Asym34BusFeederTest.java | 280 +++++++++--------- 1 file changed, 140 insertions(+), 140 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index 5ab400b34b..2c6edd1e9b 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -89,13 +89,13 @@ void ieee34LoadAbcPowerTest() { .setP0(0.) .setQ0(0.) .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -114,13 +114,13 @@ void ieee34LoadAbcPowerTest() { .setP0(0.) .setQ0(0.) .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -139,13 +139,13 @@ void ieee34LoadAbcPowerTest() { .setP0(0.) .setQ0(0.) .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -326,13 +326,13 @@ public static Network ieee34LoadFeeder() { .setP0(p808) .setQ0(q808) .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -472,13 +472,13 @@ public static Network ieee34LoadFeeder() { .setP0(p816) .setQ0(q816) .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -525,13 +525,13 @@ public static Network ieee34LoadFeeder() { .setP0(p818) .setQ0(q818) .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -578,13 +578,13 @@ public static Network ieee34LoadFeeder() { .setP0(p820) .setQ0(q820) .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -655,13 +655,13 @@ public static Network ieee34LoadFeeder() { .setP0(p824) .setQ0(q824) .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -732,13 +732,13 @@ public static Network ieee34LoadFeeder() { .setP0(p828) .setQ0(q828) .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -783,13 +783,13 @@ public static Network ieee34LoadFeeder() { .setP0(p830) .setQ0(q830) .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -834,13 +834,13 @@ public static Network ieee34LoadFeeder() { .setP0(p854) .setQ0(q854) .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -934,13 +934,13 @@ public static Network ieee34LoadFeeder() { .setP0(p832) .setQ0(q832) .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -1004,13 +1004,13 @@ public static Network ieee34LoadFeeder() { .setP0(p890) .setQ0(q890) .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -1055,13 +1055,13 @@ public static Network ieee34LoadFeeder() { .setP0(p858) .setQ0(q858) .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1132,13 +1132,13 @@ public static Network ieee34LoadFeeder() { .setP0(p834) .setQ0(q834) .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1182,13 +1182,13 @@ public static Network ieee34LoadFeeder() { .setP0(p842) .setQ0(q842) .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1233,13 +1233,13 @@ public static Network ieee34LoadFeeder() { .setP0(p844) .setQ0(q844) .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() + .setC0p(0.) + .setC1p(0.) + .setC2p(1.) + .setC0q(0.) + .setC1q(0.) + .setC2q(1.) + .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1301,13 +1301,13 @@ public static Network ieee34LoadFeeder() { .setP0(p846) .setQ0(q846) .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() + .setC0p(1.) + .setC1p(0.) + .setC2p(0.) + .setC0q(1.) + .setC1q(0.) + .setC2q(0.) + .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1473,13 +1473,13 @@ public static Network ieee34LoadFeeder() { .setP0(p836) .setQ0(q836) .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1524,13 +1524,13 @@ public static Network ieee34LoadFeeder() { .setP0(p840) .setQ0(q840) .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() + .setC0p(0.) + .setC1p(1.) + .setC2p(0.) + .setC0q(0.) + .setC1q(1.) + .setC2q(0.) + .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) From 8d86bc0c698aa178281f4089b89229815b543737 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 148/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From 980703c5e6db40ee7cb4d4a812e8d7bf0315918c Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 149/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 09c69ea890d5d9dbf1ee762bf832ab729bf00d2b Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 24 Aug 2023 19:32:43 +0200 Subject: [PATCH 150/153] development of parsers for ieee asym feeder examples Signed-off-by: JB-H --- .../network/util/AsymLvFeederParser.java | 1 - .../openloadflow/ac/Asym34BusFeederTest.java | 264 +++++++----------- .../util/AsymIeeeFeederParserTest.java | 6 +- 3 files changed, 108 insertions(+), 163 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index e796ecdd83..daafe704fc 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -287,7 +287,6 @@ private static void createLoads(Network network, String path) { .withDeltaPc(deltaPc) .withDeltaQc(deltaQc) .add(); - } } diff --git a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java index 2c6edd1e9b..b960dba8a4 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/Asym34BusFeederTest.java @@ -18,7 +18,9 @@ import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; +import com.powsybl.openloadflow.network.extensions.iidm.LoadAsymmetrical2Adder; import com.powsybl.openloadflow.network.extensions.iidm.*; +import com.powsybl.openloadflow.network.extensions.iidm.LoadType; import com.powsybl.openloadflow.util.ComplexMatrix; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.complex.ComplexUtils; @@ -88,14 +90,6 @@ void ieee34LoadAbcPowerTest() { .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load810Power.newExtension(LoadAsymmetricalAdder.class) @@ -108,19 +102,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Power.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load load810Impedant = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_IMPEDANT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load810Impedant.newExtension(LoadAsymmetricalAdder.class) @@ -133,19 +123,15 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Impedant.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load load810Current = network.getVoltageLevel("VL_810").newLoad() .setId("LOAD_810_CURRENT") .setBus(bus810.getId()) .setP0(0.) .setQ0(0.) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load810Current.newExtension(LoadAsymmetricalAdder.class) @@ -158,6 +144,10 @@ void ieee34LoadAbcPowerTest() { .withConnectionType(LoadConnectionType.Y) .add(); + load810Current.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + OpenLoadFlowParameters.create(parameters) .setSlackBusSelectionMode(SlackBusSelectionMode.FIRST) .setMaxNewtonRaphsonIterations(100) @@ -271,6 +261,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load802.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 806 Substation substation806 = network.newSubstation() .setId("S806") @@ -325,14 +318,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus808.getId()) .setP0(p808) .setQ0(q808) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load808.newExtension(LoadAsymmetricalAdder.class) @@ -345,6 +330,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load808.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 810 Substation substation810 = network.newSubstation() .setId("S810") @@ -471,14 +460,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus816.getId()) .setP0(p816) .setQ0(q816) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load816.newExtension(LoadAsymmetricalAdder.class) @@ -491,6 +472,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load816.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 818 Substation substation818 = network.newSubstation() .setId("S818") @@ -524,14 +509,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus818.getId()) .setP0(p818) .setQ0(q818) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load818.newExtension(LoadAsymmetricalAdder.class) @@ -544,6 +521,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load818.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 820 Substation substation820 = network.newSubstation() .setId("S820") @@ -577,14 +558,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus820.getId()) .setP0(p820) .setQ0(q820) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load820.newExtension(LoadAsymmetricalAdder.class) @@ -597,6 +570,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load820.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 822 Substation substation822 = network.newSubstation() .setId("S822") @@ -654,14 +631,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus824.getId()) .setP0(p824) .setQ0(q824) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load824.newExtension(LoadAsymmetricalAdder.class) @@ -674,6 +643,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load824.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 826 Substation substation826 = network.newSubstation() .setId("S826") @@ -731,14 +704,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus828.getId()) .setP0(p828) .setQ0(q828) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load828.newExtension(LoadAsymmetricalAdder.class) @@ -751,6 +716,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load828.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 830 Substation substation830 = network.newSubstation() .setId("S830") @@ -782,14 +751,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus830.getId()) .setP0(p830) .setQ0(q830) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load830.newExtension(LoadAsymmetricalAdder.class) @@ -802,6 +763,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load830.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 854 Substation substation854 = network.newSubstation() .setId("S854") @@ -833,14 +798,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus854.getId()) .setP0(p854) .setQ0(q854) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load854.newExtension(LoadAsymmetricalAdder.class) @@ -853,6 +810,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load854.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 856 Substation substation856 = network.newSubstation() .setId("S856") @@ -933,14 +894,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus832.getId()) .setP0(p832) .setQ0(q832) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load832.newExtension(LoadAsymmetricalAdder.class) @@ -953,6 +906,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load832.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) // modified because with the transformer the bus must be fortescue and CONSTANT IMPEDANCE DELTA not compatible + .add(); + // Bus 888 VoltageLevel vl888 = substation832.newVoltageLevel() .setId("VL_888") @@ -1003,14 +960,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus890.getId()) .setP0(p890) .setQ0(q890) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load890.newExtension(LoadAsymmetricalAdder.class) @@ -1023,6 +972,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load890.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 858 Substation substation858 = network.newSubstation() .setId("S858") @@ -1054,14 +1007,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus858.getId()) .setP0(p858) .setQ0(q858) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load858.newExtension(LoadAsymmetricalAdder.class) @@ -1074,6 +1019,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load858.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 864 Substation substation864 = network.newSubstation() .setId("S864") @@ -1131,14 +1080,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus834.getId()) .setP0(p834) .setQ0(q834) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load834.newExtension(LoadAsymmetricalAdder.class) @@ -1151,6 +1092,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load834.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + // Bus 842 Substation substation842 = network.newSubstation() .setId("S842") @@ -1181,14 +1126,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus842.getId()) .setP0(p842) .setQ0(q842) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load842.newExtension(LoadAsymmetricalAdder.class) @@ -1201,6 +1138,9 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load842.newExtension(LoadAsymmetrical2Adder.class) + .add(); + // Bus 844 Substation substation844 = network.newSubstation() .setId("S844") @@ -1232,14 +1172,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus844.getId()) .setP0(p844) .setQ0(q844) - .newZipModel() - .setC0p(0.) - .setC1p(0.) - .setC2p(1.) - .setC0q(0.) - .setC1q(0.) - .setC2q(1.) - .add() .add(); load844.newExtension(LoadAsymmetricalAdder.class) @@ -1252,6 +1184,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_IMPEDANCE) + .add(); + Load distrload844 = vl844.newLoad() .setId("DISTR_LOAD_844") .setBus(bus844.getId()) @@ -1269,6 +1205,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + distrload844.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 846 Substation substation846 = network.newSubstation() .setId("S846") @@ -1300,14 +1240,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus846.getId()) .setP0(p846) .setQ0(q846) - .newZipModel() - .setC0p(1.) - .setC1p(0.) - .setC2p(0.) - .setC0q(1.) - .setC1q(0.) - .setC2q(0.) - .add() .add(); load846.newExtension(LoadAsymmetricalAdder.class) @@ -1320,6 +1252,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load846.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 848 Substation substation848 = network.newSubstation() .setId("S848") @@ -1362,6 +1298,10 @@ public static Network ieee34LoadFeeder() { .withDeltaQc(0.016 - 0.15) .withConnectionType(LoadConnectionType.DELTA) .add(); + + load848.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); /* Load compensload848 = vl848.newLoad() .setId("COMPENSE_LOAD_848") @@ -1424,6 +1364,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + Load distriload860 = vl860.newLoad() .setId("DISTRI_LOAD_860") .setBus(bus860.getId()) @@ -1441,6 +1385,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + distriload860.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 836 Substation substation836 = network.newSubstation() .setId("S836") @@ -1472,14 +1420,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus836.getId()) .setP0(p836) .setQ0(q836) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load836.newExtension(LoadAsymmetricalAdder.class) @@ -1492,6 +1432,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.DELTA) .add(); + load836.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 840 Substation substation840 = network.newSubstation() .setId("S840") @@ -1523,14 +1467,6 @@ public static Network ieee34LoadFeeder() { .setBus(bus840.getId()) .setP0(p840) .setQ0(q840) - .newZipModel() - .setC0p(0.) - .setC1p(1.) - .setC2p(0.) - .setC0q(0.) - .setC1q(1.) - .setC2q(0.) - .add() .add(); load840.newExtension(LoadAsymmetricalAdder.class) @@ -1543,6 +1479,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load840.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_CURRENT) + .add(); + // Bus 862 Substation substation862 = network.newSubstation() .setId("S862") @@ -1586,6 +1526,10 @@ public static Network ieee34LoadFeeder() { .withConnectionType(LoadConnectionType.Y) .add(); + load862.newExtension(LoadAsymmetrical2Adder.class) + .withLoadType(LoadType.CONSTANT_POWER) + .add(); + // Bus 838 Substation substation838 = network.newSubstation() .setId("S838") diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index faf2630875..d489c65980 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,13 +4,14 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.SparseMatrixFactory; +import com.powsybl.math.matrix.DenseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -23,7 +24,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -72,6 +73,7 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } + @Disabled @Test void testLvFeedersTest() { From c31294d0c7c1a9349bacdce647fa9522994a98d7 Mon Sep 17 00:00:00 2001 From: JB-H Date: Fri, 22 Sep 2023 22:24:29 +0200 Subject: [PATCH 151/153] use of sparse matrix for large parsed examples Signed-off-by: JB-H --- .../powsybl/openloadflow/util/AsymIeeeFeederParserTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java index d489c65980..faf2630875 100644 --- a/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java +++ b/src/test/java/com/powsybl/openloadflow/util/AsymIeeeFeederParserTest.java @@ -4,14 +4,13 @@ import com.powsybl.loadflow.LoadFlow; import com.powsybl.loadflow.LoadFlowParameters; import com.powsybl.loadflow.LoadFlowResult; -import com.powsybl.math.matrix.DenseMatrixFactory; +import com.powsybl.math.matrix.SparseMatrixFactory; import com.powsybl.openloadflow.OpenLoadFlowParameters; import com.powsybl.openloadflow.OpenLoadFlowProvider; import com.powsybl.openloadflow.network.SlackBusSelectionMode; import com.powsybl.openloadflow.network.util.AsymIeeeFeederParser; import com.powsybl.openloadflow.network.util.AsymLvFeederParser; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static com.powsybl.openloadflow.util.LoadFlowAssert.assertVoltageEquals; @@ -24,7 +23,7 @@ public class AsymIeeeFeederParserTest { @BeforeEach void setUp() { - loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new DenseMatrixFactory())); + loadFlowRunner = new LoadFlow.Runner(new OpenLoadFlowProvider(new SparseMatrixFactory())); parameters = new LoadFlowParameters().setNoGeneratorReactiveLimits(true) .setDistributedSlack(false); @@ -73,7 +72,6 @@ void test123BussesTest() { assertVoltageEquals(4.298876625269438, network.getBusBreakerView().getBus("Bus-72")); } - @Disabled @Test void testLvFeedersTest() { From 5d568fc42ed08a3b59deb7abe717fb3e7fa628e0 Mon Sep 17 00:00:00 2001 From: JB-H Date: Wed, 11 Oct 2023 18:26:15 +0200 Subject: [PATCH 152/153] pb rebasing Signed-off-by: JB-H --- .../java/com/powsybl/openloadflow/ac/nr/NewtonRaphson.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/powsybl/openloadflow/ac/nr/NewtonRaphson.java b/src/main/java/com/powsybl/openloadflow/ac/nr/NewtonRaphson.java index 2da1e5d48b..3cfda13036 100644 --- a/src/main/java/com/powsybl/openloadflow/ac/nr/NewtonRaphson.java +++ b/src/main/java/com/powsybl/openloadflow/ac/nr/NewtonRaphson.java @@ -330,7 +330,8 @@ public NewtonRaphsonResult run(VoltageInitializer voltageInitializer, Reporter r Vectors.minus(equationVector.getArray(), targetVector.getArray()); NewtonRaphsonStoppingCriteria.TestResult initialTestResult = parameters.getStoppingCriteria().test(equationVector.getArray(), equationSystem); - StateVectorScaling svScaling = StateVectorScaling.fromMode(parameters.getStateVectorScalingMode(), initialTestResult); + //StateVectorScaling svScaling = StateVectorScaling.fromMode(parameters.getStateVectorScalingMode(), initialTestResult); + StateVectorScaling svScaling = StateVectorScaling.fromMode(parameters, initialTestResult); LOGGER.debug("|f(x0)|={}", initialTestResult.getNorm()); From 34ce766482181fdb6ecc18310f4c268eff6a95a8 Mon Sep 17 00:00:00 2001 From: JB-H Date: Thu, 12 Oct 2023 22:50:19 +0200 Subject: [PATCH 153/153] Asymm Bus extension refactoring Signed-off-by: JB-H --- .../extensions/iidm/LineAsymmetrical.java | 4 + .../network/util/AsymIeeeFeederParser.java | 115 ++++++++++-------- .../network/util/AsymLvFeederParser.java | 40 +++--- 3 files changed, 87 insertions(+), 72 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/LineAsymmetrical.java b/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/LineAsymmetrical.java index 2987cbc2af..6105767a66 100644 --- a/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/LineAsymmetrical.java +++ b/src/main/java/com/powsybl/openloadflow/network/extensions/iidm/LineAsymmetrical.java @@ -74,6 +74,10 @@ public void setAsymConnectorBus2(AsymmetricalBranchConnector asymConnectorBus2) this.asymConnectorBus2 = asymConnectorBus2; } + public void setAsymConnectorBus1(AsymmetricalBranchConnector asymConnectorBus1) { + this.asymConnectorBus1 = asymConnectorBus1; + } + public static ComplexMatrix getAdmittanceMatrixFromImpedanceAndBmatrix(ComplexMatrix zabc, ComplexMatrix babc, boolean hasPhaseA, boolean hasPhaseB, boolean hasPhaseC, double length) { // The lines are sometimes specified as impedance and susceptance matrices. diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java index 7377a56f83..4bc7dab49b 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymIeeeFeederParser.java @@ -262,7 +262,8 @@ private static String getSubstationId(String busName) { return "Substation-" + busName; } - private static void createBuses(Network network, Map firstBusTfo, String path) { + private static void createBuses(Network network, Map firstBusTfo, String path, + Map bus2Connector) { for (BusData busData : parseCsv(path + "Bus.csv", BusData.class)) { String substationId = getSubstationId(busData.busName); @@ -287,18 +288,15 @@ private static void createBuses(Network network, Map firstBusTfo bus.setV(busData.uNom).setAngle(0.); // default settings for bus extensions, will be modified depending on the type of connected equipment : - bus.newExtension(BusAsymmetricalAdder.class) - .withBusVariableType(BusVariableType.WYE) - .withHasPhaseA(false) - .withHasPhaseB(false) - .withHasPhaseC(false) - .withPositiveSequenceAsCurrent(true) - .withFortescueRepresentation(true) - .add(); + AsymmetricalBranchConnector connector = new AsymmetricalBranchConnector(BusVariableType.WYE, + false, false, false, true, true); + + bus2Connector.put(bus.getId(), connector); } } - private static void createGenerators(Network network, String path) { + private static void createGenerators(Network network, String path, + Map bus2Connector) { for (GenData gen : parseCsv(path + "Gen.csv", GenData.class)) { VoltageLevel vl = network.getVoltageLevel(getVoltageLevelId(gen.busName)); Generator generator = vl.newGenerator() @@ -322,7 +320,7 @@ private static void createGenerators(Network network, String path) { .add(); // modification of bus extension due to generating unit - network.getBusBreakerView().getBus(getBusId(gen.busName)).getExtension(BusAsymmetrical.class).setPositiveSequenceAsCurrent(false); + bus2Connector.get(getBusId(gen.busName)).setPositiveSequenceAsCurrent(false); } } @@ -348,7 +346,8 @@ private static Map getFirstBusTfo(List listTfos) { } private static void createLoad(Network network, String loadName, String busName, String loadType, - double pa, double qa, double pb, double qb, double pc, double qc) { + double pa, double qa, double pb, double qb, double pc, double qc, + Map bus2Connector) { VoltageLevel vl = network.getVoltageLevel(getVoltageLevelId(busName)); Load load = vl.newLoad() .setId(loadName) @@ -365,7 +364,6 @@ private static void createLoad(Network network, String loadName, String busName, .add() .add(); - var extensionBus = network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class); LoadConnectionType loadConnectionType; ZipLoadModel zipLoadModel = (ZipLoadModel) load.getModel().orElseThrow(); if (loadType.equals("Y-PQ")) { @@ -378,28 +376,28 @@ private static void createLoad(Network network, String loadName, String busName, zipLoadModel.setC0q(0); zipLoadModel.setC2p(1); zipLoadModel.setC2q(1); - extensionBus.setFortescueRepresentation(false); + bus2Connector.get(getBusId(busName)).setFortescueRepresentation(false); } else if (loadType.equals("D-Z")) { loadConnectionType = LoadConnectionType.DELTA; zipLoadModel.setC0p(0); zipLoadModel.setC0q(0); zipLoadModel.setC2p(1); zipLoadModel.setC2q(1); - extensionBus.setFortescueRepresentation(false); + bus2Connector.get(getBusId(busName)).setFortescueRepresentation(false); } else if (loadType.equals("Y-I")) { loadConnectionType = LoadConnectionType.Y; zipLoadModel.setC0p(0); zipLoadModel.setC0q(0); zipLoadModel.setC1p(1); zipLoadModel.setC1q(1); - extensionBus.setFortescueRepresentation(false); + bus2Connector.get(getBusId(busName)).setFortescueRepresentation(false); } else if (loadType.equals("D-I")) { loadConnectionType = LoadConnectionType.DELTA; zipLoadModel.setC0p(0); zipLoadModel.setC0q(0); zipLoadModel.setC1p(1); zipLoadModel.setC1q(1); - extensionBus.setFortescueRepresentation(false); + bus2Connector.get(getBusId(busName)).setFortescueRepresentation(false); } else { throw new IllegalStateException("Unknown load type in csv at bus : " + busName); } @@ -416,28 +414,28 @@ private static void createLoad(Network network, String loadName, String busName, } - private static void createLoads(Network network, String path) { + private static void createLoads(Network network, String path, Map bus2Connector) { for (LoadData loadData : parseCsv(path + "SpotLoad.csv", LoadData.class)) { String loadName = "LOAD_" + loadData.busName + "-" + loadData.loadType; createLoad(network, loadName, loadData.busName, loadData.loadType, - loadData.ph1P, loadData.ph1Q, loadData.ph2P, loadData.ph2Q, loadData.ph3P, loadData.ph3Q); + loadData.ph1P, loadData.ph1Q, loadData.ph2P, loadData.ph2Q, loadData.ph3P, loadData.ph3Q, bus2Connector); } } - private static void createDistriLoads(Network network, String path) { + private static void createDistriLoads(Network network, String path, Map bus2Connector) { for (DistriLoadData loadData : parseCsv(path + "DistributedLoad.csv", DistriLoadData.class)) { String loadName = "LOAD_" + loadData.busNameA + "-" + loadData.busNameB + "-" + loadData.loadType; createLoad(network, loadName, loadData.busNameA, loadData.loadType, - loadData.ph1P, loadData.ph1Q, loadData.ph2P, loadData.ph2Q, loadData.ph3P, loadData.ph3Q); + loadData.ph1P, loadData.ph1Q, loadData.ph2P, loadData.ph2Q, loadData.ph3P, loadData.ph3Q, bus2Connector); } } - private static void createLines(Network network, String path) { + private static void createLines(Network network, String path, Map bus2Connector) { Map lineConfig = new HashMap<>(); for (LineConfigData lineCode : parseCsv(path + "LineConfig.csv", LineConfigData.class)) { lineConfig.put(lineCode.config, lineCode); @@ -516,26 +514,23 @@ private static void createLines(Network network, String path) { yabc = ComplexMatrix.getComplexMatrixFromRealCartesian(yabcRho); } + AsymmetricalBranchConnector c1 = bus2Connector.get(getBusId(line.nodeA)); + AsymmetricalBranchConnector c2 = bus2Connector.get(getBusId(line.nodeB)); + c1.setHasPhaseA(c1.isHasPhaseA() || hasPhaseA); + c1.setHasPhaseB(c1.isHasPhaseB() || hasPhaseB); + c1.setHasPhaseC(c1.isHasPhaseC() || hasPhaseC); + + c2.setHasPhaseA(c2.isHasPhaseA() || hasPhaseA); + c2.setHasPhaseB(c2.isHasPhaseB() || hasPhaseB); + c2.setHasPhaseC(c2.isHasPhaseC() || hasPhaseC); + l.newExtension(LineAsymmetricalAdder.class) .withYabc(ComplexMatrix.getMatrixScaled(yabc, yCoef)) .add(); - - // modification of bus extension depending on line connections: - var extensionBus1 = network.getBusBreakerView().getBus(getBusId(line.nodeA)).getExtension(BusAsymmetrical.class); - var extensionBus2 = network.getBusBreakerView().getBus(getBusId(line.nodeB)).getExtension(BusAsymmetrical.class); - - extensionBus1.setHasPhaseA(extensionBus1.isHasPhaseA() || hasPhaseA); - extensionBus1.setHasPhaseB(extensionBus1.isHasPhaseB() || hasPhaseB); - extensionBus1.setHasPhaseC(extensionBus1.isHasPhaseC() || hasPhaseC); - - extensionBus2.setHasPhaseA(extensionBus2.isHasPhaseA() || hasPhaseA); - extensionBus2.setHasPhaseB(extensionBus2.isHasPhaseB() || hasPhaseB); - extensionBus2.setHasPhaseC(extensionBus2.isHasPhaseC() || hasPhaseC); - } } - private static void createTfos(Network network, String path) { + private static void createTfos(Network network, String path, Map bus2Connector) { Map tfoConfigDataMap = new HashMap<>(); for (TfoConfigData tfoConfig : parseCsv(path + "TfoConfig.csv", TfoConfigData.class)) { tfoConfigDataMap.put(tfoConfig.config, tfoConfig); @@ -604,20 +599,31 @@ private static void createTfos(Network network, String path) { .withYc(buildSinglePhaseAdmittanceMatrix(zPhase, yPhase, yPhase)) .add(); - // modification of bus extension depending on line connections: - var extensionBus1 = network.getBusBreakerView().getBus(getBusId(tfoData.nodeA)).getExtension(BusAsymmetrical.class); - var extensionBus2 = network.getBusBreakerView().getBus(getBusId(tfoData.nodeB)).getExtension(BusAsymmetrical.class); + // modification of connector depending on line connections: + AsymmetricalBranchConnector c1 = bus2Connector.get(getBusId(tfoData.nodeA)); + AsymmetricalBranchConnector c2 = bus2Connector.get(getBusId(tfoData.nodeB)); + + c1.setHasPhaseA(true); + c1.setHasPhaseB(true); + c1.setHasPhaseC(true); + + c2.setHasPhaseA(true); + c2.setHasPhaseB(true); + c2.setHasPhaseC(true); - extensionBus1.setHasPhaseA(true); - extensionBus1.setHasPhaseB(true); - extensionBus1.setHasPhaseC(true); + c1.setFortescueRepresentation(true); + c2.setFortescueRepresentation(true); + } + } - extensionBus2.setHasPhaseA(true); - extensionBus2.setHasPhaseB(true); - extensionBus2.setHasPhaseC(true); + private static void updateLineConnectors(Network network, Map bus2Connector) { - extensionBus1.setFortescueRepresentation(true); - extensionBus2.setFortescueRepresentation(true); + for (Line line : network.getLines()) { + var extension2 = line.getExtension(LineAsymmetrical.class); + AsymmetricalBranchConnector c1 = bus2Connector.get(line.getTerminal1().getBusBreakerView().getBus().getId()); + AsymmetricalBranchConnector c2 = bus2Connector.get(line.getTerminal2().getBusBreakerView().getBus().getId()); + extension2.setAsymConnectorBus2(c2); + extension2.setAsymConnectorBus1(c1); } } @@ -643,12 +649,15 @@ public static Network create(NetworkFactory networkFactory, String path) { List listTfos = parseTfos(path); Map firstBusTfo = getFirstBusTfo(listTfos); - createBuses(network, firstBusTfo, path); - createLines(network, path); - createGenerators(network, path); - createLoads(network, path); - createDistriLoads(network, path); - createTfos(network, path); + Map bus2Connector = new HashMap<>(); + + createBuses(network, firstBusTfo, path, bus2Connector); + createLines(network, path, bus2Connector); + createGenerators(network, path, bus2Connector); + createLoads(network, path, bus2Connector); + createDistriLoads(network, path, bus2Connector); + createTfos(network, path, bus2Connector); + updateLineConnectors(network, bus2Connector); return network; } diff --git a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java index e796ecdd83..3c6a3f01f6 100644 --- a/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java +++ b/src/main/java/com/powsybl/openloadflow/network/util/AsymLvFeederParser.java @@ -3,9 +3,9 @@ import com.powsybl.commons.PowsyblException; import com.powsybl.iidm.network.*; import com.powsybl.iidm.network.extensions.*; -import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetrical; -import com.powsybl.openloadflow.network.extensions.iidm.BusAsymmetricalAdder; +import com.powsybl.openloadflow.network.extensions.iidm.AsymmetricalBranchConnector; import com.powsybl.openloadflow.network.extensions.iidm.BusVariableType; +import com.powsybl.openloadflow.network.extensions.iidm.LineAsymmetricalAdder; import com.univocity.parsers.annotations.Parsed; import com.univocity.parsers.common.processor.BeanListProcessor; import com.univocity.parsers.csv.CsvParser; @@ -183,7 +183,7 @@ public static class Transformer { double resistance; } - private static void createBuses(Network network, String path) { + private static void createBuses(Network network, String path, Map bus2Connector) { for (BusCoord busCoord : parseCsv(path + "Buscoords.csv", BusCoord.class)) { String substationId = getSubstationId(busCoord.busName); Substation s = network.getSubstation(substationId); @@ -201,19 +201,15 @@ private static void createBuses(Network network, String path) { .setId(getBusId(busCoord.busName)) .add(); - // default settings for bus extensions, will be modified depending on the type of connected equipment : - bus.newExtension(BusAsymmetricalAdder.class) - .withBusVariableType(BusVariableType.WYE) - .withHasPhaseA(true) - .withHasPhaseB(true) - .withHasPhaseC(true) - .withPositiveSequenceAsCurrent(true) - .withFortescueRepresentation(true) - .add(); + // default settings for connectors, will be modified depending on the type of connected equipment : + AsymmetricalBranchConnector connector = new AsymmetricalBranchConnector(BusVariableType.WYE, + true, true, true, true, true); + + bus2Connector.put(bus.getId(), connector); } } - private static void createLines(Network network, String path) { + private static void createLines(Network network, String path, Map bus2Connector) { Map lineCodes = new HashMap<>(); for (LineCode lineCode : parseCsv(path + "LineCodes.csv", LineCode.class)) { lineCodes.put(lineCode.name, lineCode); @@ -234,6 +230,10 @@ private static void createLines(Network network, String path) { .withRz(lineCode.r0 * line.length * coeff) .withXz(lineCode.x0 * line.length * coeff) .add(); + l.newExtension(LineAsymmetricalAdder.class) + .withAsymConnector1(bus2Connector.get(getBusId(line.bus1))) + .withAsymConnector2(bus2Connector.get(getBusId(line.bus2))) + .add(); } } @@ -291,7 +291,7 @@ private static void createLoads(Network network, String path) { } } - private static void createSource(Network network) { + private static void createSource(Network network, Map bus2Connector) { int busName = 1; VoltageLevel vl = network.getVoltageLevel(getVoltageLevelId(busName)); Generator generator = vl.newGenerator() @@ -314,8 +314,8 @@ private static void createSource(Network network) { .withXn(zn.getImaginary()) .add(); - // modification of bus extension due to generating unit - network.getBusBreakerView().getBus(getBusId(busName)).getExtension(BusAsymmetrical.class).setPositiveSequenceAsCurrent(false); + // modification of connector due to generating unit + bus2Connector.get(getBusId(busName)).setPositiveSequenceAsCurrent(false); } private static WindingConnectionType getConnectionType(String conn) { @@ -337,9 +337,11 @@ public static Network create(NetworkFactory networkFactory, String path) { Network network = networkFactory.createNetwork("EuropeanLvTestFeeder", "csv"); network.setCaseDate(DateTime.parse("2023-04-11T23:59:00.000+01:00")); - createBuses(network, path); - createSource(network); - createLines(network, path); + Map bus2Connector = new HashMap<>(); + + createBuses(network, path, bus2Connector); + createSource(network, bus2Connector); + createLines(network, path, bus2Connector); createLoads(network, path); return network; }