diff --git a/matpower/matpower-converter/src/main/java/com/powsybl/matpower/converter/MatpowerExporter.java b/matpower/matpower-converter/src/main/java/com/powsybl/matpower/converter/MatpowerExporter.java index 03b60066bae..2d584d8b037 100644 --- a/matpower/matpower-converter/src/main/java/com/powsybl/matpower/converter/MatpowerExporter.java +++ b/matpower/matpower-converter/src/main/java/com/powsybl/matpower/converter/MatpowerExporter.java @@ -14,6 +14,8 @@ import com.powsybl.iidm.network.extensions.SlackTerminal; import com.powsybl.iidm.network.util.HvdcUtils; import com.powsybl.matpower.model.*; + +import org.apache.commons.math3.complex.Complex; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -200,20 +202,7 @@ private void createLines(Network network, MatpowerModel model, Context context) for (Line l : network.getLines()) { Terminal t1 = l.getTerminal1(); Terminal t2 = l.getTerminal2(); - Bus bus1 = t1.getBusView().getBus(); - Bus bus2 = t2.getBusView().getBus(); - if (isConnectedToMainCc(bus1) && isConnectedToMainCc(bus2)) { - VoltageLevel vl2 = t2.getVoltageLevel(); - MBranch mBranch = new MBranch(); - mBranch.setFrom(context.mBusesNumbersByIds.get(bus1.getId())); - mBranch.setTo(context.mBusesNumbersByIds.get(bus2.getId())); - mBranch.setStatus(CONNECTED_STATUS); - double zb = vl2.getNominalV() * vl2.getNominalV() / BASE_MVA; - mBranch.setR(l.getR() / zb); - mBranch.setX(l.getX() / zb); - mBranch.setB((l.getB1() + l.getB2()) * zb); - model.addBranch(mBranch); - } + createMBranch(t1, t2, l.getR(), l.getX(), l.getB1(), l.getB2(), context).ifPresent(model::addBranch); } } @@ -249,23 +238,54 @@ private void createTieLines(Network network, MatpowerModel model, Context contex for (TieLine l : network.getTieLines()) { Terminal t1 = l.getDanglingLine1().getTerminal(); Terminal t2 = l.getDanglingLine2().getTerminal(); - Bus bus1 = t1.getBusView().getBus(); - Bus bus2 = t2.getBusView().getBus(); - if (isConnectedToMainCc(bus1) && isConnectedToMainCc(bus2)) { - VoltageLevel vl2 = t2.getVoltageLevel(); - MBranch mBranch = new MBranch(); - mBranch.setFrom(context.mBusesNumbersByIds.get(bus1.getId())); - mBranch.setTo(context.mBusesNumbersByIds.get(bus2.getId())); - mBranch.setStatus(CONNECTED_STATUS); - double zb = vl2.getNominalV() * vl2.getNominalV() / BASE_MVA; - mBranch.setR(l.getR() / zb); - mBranch.setX(l.getX() / zb); - mBranch.setB((l.getB1() + l.getB2()) * zb); - model.addBranch(mBranch); - } + createMBranch(t1, t2, l.getR(), l.getX(), l.getB1(), l.getB2(), context).ifPresent(model::addBranch); + } + } + + private static Optional createMBranch(Terminal t1, Terminal t2, double r, double x, double b1, double b2, Context context) { + Bus bus1 = t1.getBusView().getBus(); + Bus bus2 = t2.getBusView().getBus(); + if (isConnectedToMainCc(bus1) && isConnectedToMainCc(bus2)) { + VoltageLevel vl1 = t1.getVoltageLevel(); + VoltageLevel vl2 = t2.getVoltageLevel(); + MBranch mBranch = new MBranch(); + mBranch.setFrom(context.mBusesNumbersByIds.get(bus1.getId())); + mBranch.setTo(context.mBusesNumbersByIds.get(bus2.getId())); + mBranch.setStatus(CONNECTED_STATUS); + + double rpu = impedanceToPerUnitForLine(r, vl1.getNominalV(), vl2.getNominalV(), BASE_MVA); + double xpu = impedanceToPerUnitForLine(x, vl1.getNominalV(), vl2.getNominalV(), BASE_MVA); + Complex ytr = impedanceToAdmittance(r, x); + double b1pu = admittanceEndToPerUnitForLine(ytr.getImaginary(), b1, vl1.getNominalV(), vl2.getNominalV(), BASE_MVA); + double b2pu = admittanceEndToPerUnitForLine(ytr.getImaginary(), b2, vl2.getNominalV(), vl1.getNominalV(), BASE_MVA); + mBranch.setR(rpu); + mBranch.setX(xpu); + mBranch.setB(b1pu + b2pu); + return Optional.of(mBranch); + } else { + return Optional.empty(); } } + // avoid NaN when r and x, both are 0.0 + private static Complex impedanceToAdmittance(double r, double x) { + return r == 0.0 && x == 0.0 ? new Complex(0.0, 0.0) : new Complex(r, x).reciprocal(); + } + + private static double impedanceToPerUnitForLine(double impedance, double nominalVoltageAtEnd, + double nominalVoltageAtOtherEnd, double sBase) { + // this method handles also line with different nominal voltage at ends + return impedance * sBase / (nominalVoltageAtEnd * nominalVoltageAtOtherEnd); + } + + private static double admittanceEndToPerUnitForLine(double transmissionAdmittance, double shuntAdmittanceAtEnd, + double nominalVoltageAtEnd, double nominalVoltageAtOtherEnd, double sBase) { + // this method handles also line with different nominal voltage at ends + // note that ytr is in engineering units + return (shuntAdmittanceAtEnd * nominalVoltageAtEnd * nominalVoltageAtEnd + + (nominalVoltageAtEnd - nominalVoltageAtOtherEnd) * nominalVoltageAtEnd * transmissionAdmittance) / sBase; + } + private void createDanglingLineBranches(Network network, MatpowerModel model, Context context) { for (DanglingLine dl : network.getDanglingLines(DanglingLineFilter.UNPAIRED)) { Terminal t = dl.getTerminal(); diff --git a/matpower/matpower-converter/src/test/java/com/powsybl/matpower/converter/MatpowerExporterTest.java b/matpower/matpower-converter/src/test/java/com/powsybl/matpower/converter/MatpowerExporterTest.java index 9a4cb063860..395ba59b16d 100644 --- a/matpower/matpower-converter/src/test/java/com/powsybl/matpower/converter/MatpowerExporterTest.java +++ b/matpower/matpower-converter/src/test/java/com/powsybl/matpower/converter/MatpowerExporterTest.java @@ -9,25 +9,33 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.io.ByteStreams; import com.powsybl.cgmes.conformity.CgmesConformity1ModifiedCatalog; +import com.powsybl.commons.datasource.FileDataSource; import com.powsybl.commons.datasource.MemDataSource; +import com.powsybl.commons.test.AbstractConverterTest; import com.powsybl.iidm.network.Network; +import com.powsybl.iidm.network.NetworkFactory; import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory; import com.powsybl.iidm.network.test.FourSubstationsNodeBreakerFactory; import com.powsybl.matpower.model.MatpowerModel; +import com.powsybl.matpower.model.MatpowerModelFactory; import com.powsybl.matpower.model.MatpowerReader; +import com.powsybl.matpower.model.MatpowerWriter; + import org.junit.jupiter.api.Test; import java.io.ByteArrayInputStream; import java.io.IOException; import java.nio.charset.StandardCharsets; +import java.nio.file.Path; import java.util.Objects; +import java.util.Properties; import static org.junit.jupiter.api.Assertions.assertEquals; /** * @author Geoffroy Jamgotchian */ -class MatpowerExporterTest { +class MatpowerExporterTest extends AbstractConverterTest { private static void exportToMatAndCompareTo(Network network, String refJsonFile) throws IOException { MemDataSource dataSource = new MemDataSource(); @@ -64,4 +72,19 @@ void testWithHvdcLines() throws IOException { var network = FourSubstationsNodeBreakerFactory.create(); exportToMatAndCompareTo(network, "/fourSubstationFactory.json"); } + + @Test + void testCase30ConsideringBaseVoltage() throws IOException { + MatpowerModel model = MatpowerModelFactory.create30(); + model.setCaseName("ieee30-considering-base-voltage"); + String caseId = model.getCaseName(); + Path matFile = tmpDir.resolve(caseId + ".mat"); + MatpowerWriter.write(model, matFile); + + Properties properties = new Properties(); + properties.put("matpower.import.ignore-base-voltage", false); + Network network = new MatpowerImporter().importData(new FileDataSource(tmpDir, caseId), NetworkFactory.findDefault(), properties); + + exportToMatAndCompareTo(network, "/ieee30-considering-base-voltage.json"); + } } diff --git a/matpower/matpower-converter/src/test/resources/be.json b/matpower/matpower-converter/src/test/resources/be.json index 4a0539d47d7..22ecdd4a6d4 100644 --- a/matpower/matpower-converter/src/test/resources/be.json +++ b/matpower/matpower-converter/src/test/resources/be.json @@ -231,7 +231,7 @@ "branches" : [ { "from" : 5, "to" : 4, - "r" : 0.0038222222222222225, + "r" : 0.003822222222222222, "x" : 0.06755555555555556, "b" : 0.021470821875, "rateA" : 0.0, @@ -245,9 +245,9 @@ }, { "from" : 5, "to" : 4, - "r" : 0.010277530864197531, + "r" : 0.010277530864197533, "x" : 0.1402469135802469, - "b" : 0.010131024375, + "b" : 0.010131024374999999, "rateA" : 0.0, "rateB" : 0.0, "rateC" : 0.0, diff --git a/matpower/matpower-converter/src/test/resources/ieee30-considering-base-voltage.json b/matpower/matpower-converter/src/test/resources/ieee30-considering-base-voltage.json new file mode 100644 index 00000000000..0063d3c0b4d --- /dev/null +++ b/matpower/matpower-converter/src/test/resources/ieee30-considering-base-voltage.json @@ -0,0 +1,1164 @@ +{ + "caseName" : "ieee30-considering-base-voltage", + "baseMva" : 100.0, + "version" : "2", + "buses" : [ { + "number" : 1, + "type" : "REF", + "name" : "VL-1_0", + "realPowerDemand" : 0.0, + "reactivePowerDemand" : 0.0, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.06, + "voltageAngle" : 0.0, + "baseVoltage" : 132.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 139.92000000000002, + "minimumVoltageMagnitude" : 124.08 + }, { + "number" : 2, + "type" : "PV", + "name" : "VL-2_0", + "realPowerDemand" : 21.7, + "reactivePowerDemand" : 12.7, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.043, + "voltageAngle" : -5.48, + "baseVoltage" : 132.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 139.92000000000002, + "minimumVoltageMagnitude" : 124.08 + }, { + "number" : 3, + "type" : "PQ", + "name" : "VL-3_0", + "realPowerDemand" : 2.4, + "reactivePowerDemand" : 1.2, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.021, + "voltageAngle" : -7.96, + "baseVoltage" : 132.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 139.92000000000002, + "minimumVoltageMagnitude" : 124.08 + }, { + "number" : 4, + "type" : "PQ", + "name" : "VL-4_0", + "realPowerDemand" : 7.6, + "reactivePowerDemand" : 1.6, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.012, + "voltageAngle" : -9.62, + "baseVoltage" : 132.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 139.92000000000002, + "minimumVoltageMagnitude" : 124.08 + }, { + "number" : 5, + "type" : "PV", + "name" : "VL-5_0", + "realPowerDemand" : 94.2, + "reactivePowerDemand" : 19.0, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.01, + "voltageAngle" : -14.37, + "baseVoltage" : 132.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 139.92000000000002, + "minimumVoltageMagnitude" : 124.08 + }, { + "number" : 6, + "type" : "PQ", + "name" : "VL-6_0", + "realPowerDemand" : 0.0, + "reactivePowerDemand" : 0.0, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.01, + "voltageAngle" : -11.34, + "baseVoltage" : 132.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 139.92000000000002, + "minimumVoltageMagnitude" : 124.08 + }, { + "number" : 7, + "type" : "PQ", + "name" : "VL-7_0", + "realPowerDemand" : 22.8, + "reactivePowerDemand" : 10.9, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.002, + "voltageAngle" : -13.12, + "baseVoltage" : 132.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 139.92000000000002, + "minimumVoltageMagnitude" : 124.08 + }, { + "number" : 8, + "type" : "PV", + "name" : "VL-8_0", + "realPowerDemand" : 30.0, + "reactivePowerDemand" : 30.0, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.01, + "voltageAngle" : -12.1, + "baseVoltage" : 132.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 139.92000000000002, + "minimumVoltageMagnitude" : 124.08 + }, { + "number" : 9, + "type" : "PQ", + "name" : "VL-9_0", + "realPowerDemand" : 0.0, + "reactivePowerDemand" : 0.0, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.051, + "voltageAngle" : -14.38, + "baseVoltage" : 1.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 1.06, + "minimumVoltageMagnitude" : 0.94 + }, { + "number" : 10, + "type" : "PQ", + "name" : "VL-10_0", + "realPowerDemand" : 5.8, + "reactivePowerDemand" : 2.0, + "shuntConductance" : 0.0, + "shuntSusceptance" : 19.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.045, + "voltageAngle" : -15.97, + "baseVoltage" : 33.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 34.980000000000004, + "minimumVoltageMagnitude" : 31.02 + }, { + "number" : 11, + "type" : "PV", + "name" : "VL-11_0", + "realPowerDemand" : 0.0, + "reactivePowerDemand" : 0.0, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.082, + "voltageAngle" : -14.39, + "baseVoltage" : 11.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 11.66, + "minimumVoltageMagnitude" : 10.34 + }, { + "number" : 12, + "type" : "PQ", + "name" : "VL-12_0", + "realPowerDemand" : 11.2, + "reactivePowerDemand" : 7.5, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.057, + "voltageAngle" : -15.24, + "baseVoltage" : 33.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 34.980000000000004, + "minimumVoltageMagnitude" : 31.02 + }, { + "number" : 13, + "type" : "PV", + "name" : "VL-13_0", + "realPowerDemand" : 0.0, + "reactivePowerDemand" : 0.0, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.071, + "voltageAngle" : -15.24, + "baseVoltage" : 11.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 11.66, + "minimumVoltageMagnitude" : 10.34 + }, { + "number" : 14, + "type" : "PQ", + "name" : "VL-14_0", + "realPowerDemand" : 6.2, + "reactivePowerDemand" : 1.6, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.042, + "voltageAngle" : -16.13, + "baseVoltage" : 33.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 34.980000000000004, + "minimumVoltageMagnitude" : 31.02 + }, { + "number" : 15, + "type" : "PQ", + "name" : "VL-15_0", + "realPowerDemand" : 8.2, + "reactivePowerDemand" : 2.5, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.038, + "voltageAngle" : -16.22, + "baseVoltage" : 33.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 34.980000000000004, + "minimumVoltageMagnitude" : 31.02 + }, { + "number" : 16, + "type" : "PQ", + "name" : "VL-16_0", + "realPowerDemand" : 3.5, + "reactivePowerDemand" : 1.8, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.045, + "voltageAngle" : -15.83, + "baseVoltage" : 33.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 34.980000000000004, + "minimumVoltageMagnitude" : 31.02 + }, { + "number" : 17, + "type" : "PQ", + "name" : "VL-17_0", + "realPowerDemand" : 9.0, + "reactivePowerDemand" : 5.8, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.04, + "voltageAngle" : -16.14, + "baseVoltage" : 33.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 34.980000000000004, + "minimumVoltageMagnitude" : 31.02 + }, { + "number" : 18, + "type" : "PQ", + "name" : "VL-18_0", + "realPowerDemand" : 3.2, + "reactivePowerDemand" : 0.9, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.028, + "voltageAngle" : -16.82, + "baseVoltage" : 33.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 34.980000000000004, + "minimumVoltageMagnitude" : 31.02 + }, { + "number" : 19, + "type" : "PQ", + "name" : "VL-19_0", + "realPowerDemand" : 9.5, + "reactivePowerDemand" : 3.4, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.026, + "voltageAngle" : -17.0, + "baseVoltage" : 33.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 34.980000000000004, + "minimumVoltageMagnitude" : 31.02 + }, { + "number" : 20, + "type" : "PQ", + "name" : "VL-20_0", + "realPowerDemand" : 2.2, + "reactivePowerDemand" : 0.7, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.03, + "voltageAngle" : -16.8, + "baseVoltage" : 33.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 34.980000000000004, + "minimumVoltageMagnitude" : 31.02 + }, { + "number" : 21, + "type" : "PQ", + "name" : "VL-21_0", + "realPowerDemand" : 17.5, + "reactivePowerDemand" : 11.2, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.033, + "voltageAngle" : -16.42, + "baseVoltage" : 33.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 34.980000000000004, + "minimumVoltageMagnitude" : 31.02 + }, { + "number" : 22, + "type" : "PQ", + "name" : "VL-22_0", + "realPowerDemand" : 0.0, + "reactivePowerDemand" : 0.0, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.033, + "voltageAngle" : -16.41, + "baseVoltage" : 33.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 34.980000000000004, + "minimumVoltageMagnitude" : 31.02 + }, { + "number" : 23, + "type" : "PQ", + "name" : "VL-23_0", + "realPowerDemand" : 3.2, + "reactivePowerDemand" : 1.6, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.027, + "voltageAngle" : -16.61, + "baseVoltage" : 33.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 34.980000000000004, + "minimumVoltageMagnitude" : 31.02 + }, { + "number" : 24, + "type" : "PQ", + "name" : "VL-24_0", + "realPowerDemand" : 8.7, + "reactivePowerDemand" : 6.7, + "shuntConductance" : 0.0, + "shuntSusceptance" : 4.300000000000001, + "areaNumber" : 1, + "voltageMagnitude" : 1.021, + "voltageAngle" : -16.78, + "baseVoltage" : 33.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 34.980000000000004, + "minimumVoltageMagnitude" : 31.02 + }, { + "number" : 25, + "type" : "PQ", + "name" : "VL-25_0", + "realPowerDemand" : 0.0, + "reactivePowerDemand" : 0.0, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.017, + "voltageAngle" : -16.35, + "baseVoltage" : 33.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 34.980000000000004, + "minimumVoltageMagnitude" : 31.02 + }, { + "number" : 26, + "type" : "PQ", + "name" : "VL-26_0", + "realPowerDemand" : 3.5, + "reactivePowerDemand" : 2.3, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.0, + "voltageAngle" : -16.77, + "baseVoltage" : 33.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 34.980000000000004, + "minimumVoltageMagnitude" : 31.02 + }, { + "number" : 27, + "type" : "PQ", + "name" : "VL-27_0", + "realPowerDemand" : 0.0, + "reactivePowerDemand" : 0.0, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.023, + "voltageAngle" : -15.82, + "baseVoltage" : 33.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 34.980000000000004, + "minimumVoltageMagnitude" : 31.02 + }, { + "number" : 28, + "type" : "PQ", + "name" : "VL-28_0", + "realPowerDemand" : 0.0, + "reactivePowerDemand" : 0.0, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.007, + "voltageAngle" : -11.97, + "baseVoltage" : 132.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 139.92000000000002, + "minimumVoltageMagnitude" : 124.08 + }, { + "number" : 29, + "type" : "PQ", + "name" : "VL-29_0", + "realPowerDemand" : 2.4, + "reactivePowerDemand" : 0.9, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 1.003, + "voltageAngle" : -17.06, + "baseVoltage" : 33.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 34.980000000000004, + "minimumVoltageMagnitude" : 31.02 + }, { + "number" : 30, + "type" : "PQ", + "name" : "VL-30_0", + "realPowerDemand" : 10.6, + "reactivePowerDemand" : 1.9, + "shuntConductance" : 0.0, + "shuntSusceptance" : 0.0, + "areaNumber" : 1, + "voltageMagnitude" : 0.9919999999999999, + "voltageAngle" : -17.94, + "baseVoltage" : 33.0, + "lossZone" : 1, + "maximumVoltageMagnitude" : 34.980000000000004, + "minimumVoltageMagnitude" : 31.02 + } ], + "generators" : [ { + "number" : 1, + "realPowerOutput" : 260.2, + "reactivePowerOutput" : -16.1, + "maximumReactivePowerOutput" : 10.0, + "minimumReactivePowerOutput" : 0.0, + "voltageMagnitudeSetpoint" : 1.06, + "totalMbase" : 0.0, + "status" : 1, + "maximumRealPowerOutput" : 360.2, + "minimumRealPowerOutput" : 0.0, + "pc1" : 0.0, + "pc2" : 0.0, + "qc1Min" : 0.0, + "qc1Max" : 0.0, + "qc2Min" : 0.0, + "qc2Max" : 0.0, + "rampAgc" : 0.0, + "rampTenMinutes" : 0.0, + "rampThirtyMinutes" : 0.0, + "rampQ" : 0.0, + "apf" : 0.0 + }, { + "number" : 2, + "realPowerOutput" : 40.0, + "reactivePowerOutput" : 50.0, + "maximumReactivePowerOutput" : 50.0, + "minimumReactivePowerOutput" : -40.0, + "voltageMagnitudeSetpoint" : 1.045, + "totalMbase" : 0.0, + "status" : 1, + "maximumRealPowerOutput" : 140.0, + "minimumRealPowerOutput" : 0.0, + "pc1" : 0.0, + "pc2" : 0.0, + "qc1Min" : 0.0, + "qc1Max" : 0.0, + "qc2Min" : 0.0, + "qc2Max" : 0.0, + "rampAgc" : 0.0, + "rampTenMinutes" : 0.0, + "rampThirtyMinutes" : 0.0, + "rampQ" : 0.0, + "apf" : 0.0 + }, { + "number" : 5, + "realPowerOutput" : 0.0, + "reactivePowerOutput" : 37.0, + "maximumReactivePowerOutput" : 40.0, + "minimumReactivePowerOutput" : -40.0, + "voltageMagnitudeSetpoint" : 1.01, + "totalMbase" : 0.0, + "status" : 1, + "maximumRealPowerOutput" : 100.0, + "minimumRealPowerOutput" : 0.0, + "pc1" : 0.0, + "pc2" : 0.0, + "qc1Min" : 0.0, + "qc1Max" : 0.0, + "qc2Min" : 0.0, + "qc2Max" : 0.0, + "rampAgc" : 0.0, + "rampTenMinutes" : 0.0, + "rampThirtyMinutes" : 0.0, + "rampQ" : 0.0, + "apf" : 0.0 + }, { + "number" : 8, + "realPowerOutput" : 0.0, + "reactivePowerOutput" : 37.3, + "maximumReactivePowerOutput" : 40.0, + "minimumReactivePowerOutput" : -10.0, + "voltageMagnitudeSetpoint" : 1.01, + "totalMbase" : 0.0, + "status" : 1, + "maximumRealPowerOutput" : 100.0, + "minimumRealPowerOutput" : 0.0, + "pc1" : 0.0, + "pc2" : 0.0, + "qc1Min" : 0.0, + "qc1Max" : 0.0, + "qc2Min" : 0.0, + "qc2Max" : 0.0, + "rampAgc" : 0.0, + "rampTenMinutes" : 0.0, + "rampThirtyMinutes" : 0.0, + "rampQ" : 0.0, + "apf" : 0.0 + }, { + "number" : 11, + "realPowerOutput" : 0.0, + "reactivePowerOutput" : 16.2, + "maximumReactivePowerOutput" : 24.0, + "minimumReactivePowerOutput" : -6.0, + "voltageMagnitudeSetpoint" : 1.082, + "totalMbase" : 0.0, + "status" : 1, + "maximumRealPowerOutput" : 100.0, + "minimumRealPowerOutput" : 0.0, + "pc1" : 0.0, + "pc2" : 0.0, + "qc1Min" : 0.0, + "qc1Max" : 0.0, + "qc2Min" : 0.0, + "qc2Max" : 0.0, + "rampAgc" : 0.0, + "rampTenMinutes" : 0.0, + "rampThirtyMinutes" : 0.0, + "rampQ" : 0.0, + "apf" : 0.0 + }, { + "number" : 13, + "realPowerOutput" : 0.0, + "reactivePowerOutput" : 10.6, + "maximumReactivePowerOutput" : 24.0, + "minimumReactivePowerOutput" : -6.0, + "voltageMagnitudeSetpoint" : 1.071, + "totalMbase" : 0.0, + "status" : 1, + "maximumRealPowerOutput" : 100.0, + "minimumRealPowerOutput" : 0.0, + "pc1" : 0.0, + "pc2" : 0.0, + "qc1Min" : 0.0, + "qc1Max" : 0.0, + "qc2Min" : 0.0, + "qc2Max" : 0.0, + "rampAgc" : 0.0, + "rampTenMinutes" : 0.0, + "rampThirtyMinutes" : 0.0, + "rampQ" : 0.0, + "apf" : 0.0 + } ], + "branches" : [ { + "from" : 1, + "to" : 2, + "r" : 0.0192, + "x" : 0.05750000000000001, + "b" : 0.0528, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 1, + "to" : 3, + "r" : 0.04519999999999999, + "x" : 0.16520000000000004, + "b" : 0.0408, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 2, + "to" : 4, + "r" : 0.057, + "x" : 0.1737, + "b" : 0.0368, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 3, + "to" : 4, + "r" : 0.013200000000000002, + "x" : 0.0379, + "b" : 0.008399999999999998, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 2, + "to" : 5, + "r" : 0.047200000000000006, + "x" : 0.1983, + "b" : 0.0418, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 2, + "to" : 6, + "r" : 0.0581, + "x" : 0.17630000000000004, + "b" : 0.037399999999999996, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 4, + "to" : 6, + "r" : 0.0119, + "x" : 0.0414, + "b" : 0.008999999999999998, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 5, + "to" : 7, + "r" : 0.046000000000000006, + "x" : 0.116, + "b" : 0.0204, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 6, + "to" : 7, + "r" : 0.0267, + "x" : 0.082, + "b" : 0.017, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 6, + "to" : 8, + "r" : 0.012000000000000002, + "x" : 0.04200000000000001, + "b" : 0.008999999999999998, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 9, + "to" : 11, + "r" : 0.0, + "x" : 0.208, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 9, + "to" : 10, + "r" : 0.0, + "x" : 0.11, + "b" : 3.637978807091713E-14, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 12, + "to" : 13, + "r" : 0.0, + "x" : 0.14, + "b" : 2.2737367544323206E-15, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 12, + "to" : 14, + "r" : 0.1231, + "x" : 0.2559, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 12, + "to" : 15, + "r" : 0.0662, + "x" : 0.1304, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 12, + "to" : 16, + "r" : 0.0945, + "x" : 0.19869999999999993, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 14, + "to" : 15, + "r" : 0.221, + "x" : 0.1997, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 16, + "to" : 17, + "r" : 0.0524, + "x" : 0.1923, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 15, + "to" : 18, + "r" : 0.10729999999999998, + "x" : 0.21849999999999997, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 18, + "to" : 19, + "r" : 0.0639, + "x" : 0.1292, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 19, + "to" : 20, + "r" : 0.034, + "x" : 0.068, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 10, + "to" : 20, + "r" : 0.09359999999999999, + "x" : 0.209, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 10, + "to" : 17, + "r" : 0.0324, + "x" : 0.08449999999999999, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 10, + "to" : 21, + "r" : 0.0348, + "x" : 0.0749, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 10, + "to" : 22, + "r" : 0.07270000000000001, + "x" : 0.14989999999999998, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 21, + "to" : 22, + "r" : 0.0116, + "x" : 0.023600000000000003, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 15, + "to" : 23, + "r" : 0.09999999999999999, + "x" : 0.202, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 22, + "to" : 24, + "r" : 0.11500000000000002, + "x" : 0.17900000000000002, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 23, + "to" : 24, + "r" : 0.13199999999999998, + "x" : 0.27, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 24, + "to" : 25, + "r" : 0.1885, + "x" : 0.3292, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 25, + "to" : 26, + "r" : 0.2544, + "x" : 0.38000000000000006, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 25, + "to" : 27, + "r" : 0.10930000000000001, + "x" : 0.2087, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 27, + "to" : 29, + "r" : 0.2198, + "x" : 0.4153, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 27, + "to" : 30, + "r" : 0.3202, + "x" : 0.6027, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 29, + "to" : 30, + "r" : 0.2399, + "x" : 0.4533, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 8, + "to" : 28, + "r" : 0.0636, + "x" : 0.19999999999999998, + "b" : 0.042800000000000005, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 6, + "to" : 28, + "r" : 0.0169, + "x" : 0.059899999999999995, + "b" : 0.013000000000000001, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.0, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 6, + "to" : 9, + "r" : 0.0, + "x" : 0.208, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.978, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 6, + "to" : 10, + "r" : 0.0, + "x" : 0.556, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.969, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 4, + "to" : 12, + "r" : 0.0, + "x" : 0.256, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.932, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + }, { + "from" : 28, + "to" : 27, + "r" : 0.0, + "x" : 0.396, + "b" : 0.0, + "rateA" : 0.0, + "rateB" : 0.0, + "rateC" : 0.0, + "ratio" : 0.9679999999999999, + "phaseShiftAngle" : 0.0, + "status" : 1.0, + "angMin" : 0.0, + "angMax" : 0.0 + } ] +} \ No newline at end of file diff --git a/matpower/matpower-converter/src/test/resources/sim1-with-tie-lines.json b/matpower/matpower-converter/src/test/resources/sim1-with-tie-lines.json index b8ceb2c1ff8..d56a0e24a5c 100644 --- a/matpower/matpower-converter/src/test/resources/sim1-with-tie-lines.json +++ b/matpower/matpower-converter/src/test/resources/sim1-with-tie-lines.json @@ -91,7 +91,7 @@ "to" : 3, "r" : 0.0020775623268698053, "x" : 0.022853185595567867, - "b" : 0.5573840000000113, + "b" : 0.5573840000000114, "rateA" : 0.0, "rateB" : 0.0, "rateC" : 0.0, @@ -105,7 +105,7 @@ "to" : 3, "r" : 0.0020775623268698053, "x" : 0.022853185595567867, - "b" : 0.5573840000000113, + "b" : 0.5573840000000114, "rateA" : 0.0, "rateB" : 0.0, "rateC" : 0.0,