private void testCAS1EntsoeMicroGrid3wTx(CAS1EntsoeMicroGrid3wTxVariant variant) { LOG.debug(""); LOG.debug("CAS1 ENTSO-E MicroGrid 3-widing transformer, variant " + variant); BranchTestCase w380 = cas1EntsoeMicroGrid3wTxW380(variant); BranchTestCase w225 = cas1EntsoeMicroGrid3wTxW225(variant); BranchTestCase w21 = cas1EntsoeMicroGrid3wTxW21(variant); check3wTx(w380, w225, w21); }
@Test public void testCAS2EntsoeLoadFlowExplicitLineAndPhaseShifter() { BranchTestCase line = cas2EntsoeLoadFlowExplicitLine(); BranchTestCase pst = cas2EntsoeLoadFlowExplicitPhaseShiftTransformer(); Flow load = cas2EntsoeLoadFlowExplicitLoad(); Flow generator = cas2EntsoeLoadFlowExplicitGenerator(); // Obtain flows at both ends of line and phase shifter BranchData pline = piModelFlows(line); BranchData ppst = piModelFlows(pst); // And check bus balance at each side // At end1 (load) the mismatch should be zero // because load values are given with all significant digits // and voltages have been copied from Excel documentation, // where they have sufficient precision // At end2 (generator, slack bus) the mismatch should be small: // generator injection in P and Q are provided with low precision // (P with 10e-2, Q with 10e-4) LOG.debug(""); LOG.debug("Balance at ends of parallel branches " + pline.getId() + ", " + ppst.getId()); Flow line1 = flow(pline, Side.ONE); Flow line2 = flow(pline, Side.TWO); Flow pst1 = flow(ppst, Side.ONE); Flow pst2 = flow(ppst, Side.TWO); checkBusBalance("End 1", TOLERANCE_BALANCE_EXACT, TOLERANCE_BALANCE_EXACT, line1, pst1, load); checkBusBalance("End 2", 1e-2, 1e-4, line2, pst2, generator); }
@Test public void testCAS2EntsoeLoadFlowExplicitLine() { checkTestCase("line", cas2EntsoeLoadFlowExplicitLine()); }
Bus starBus1tx = calcStarBusFromVkSk(w1); Bus starBus2tx = calcStarBusFromVkSk(w2); Bus starBus3tx = calcStarBusFromVkSk(w3); Bus starBusV1V2V3Ytx = calcStarBusV1V2V3Y(w1, w2, w3); w1.config.convertAsTransformer = false; w2.config.convertAsTransformer = false; w3.config.convertAsTransformer = false; Bus starBus1 = calcStarBusFromVkSk(w1); Bus starBus2 = calcStarBusFromVkSk(w2); Bus starBus3 = calcStarBusFromVkSk(w3); Bus starBusV1V2V3Y = calcStarBusV1V2V3Y(w1, w2, w3); LOG.debug("comparing voltages computed from different alternatives"); LOG.debug("applying conversion to IIDM transformer modeling for each end"); logVoltage(label1, starBus1tx); logVoltage(label2, starBus2tx); logVoltage(label3, starBus3tx); logVoltage(label123, starBusV1V2V3Ytx); LOG.debug("without applying conversion to IIDM transformer modeling for each end"); logVoltage(label1, starBus1); logVoltage(label2, starBus2); logVoltage(label3, starBus3); logVoltage(label123, starBusV1V2V3Y); w2.config.toleranceFlow = TOLERANCE_FLOW_WHEN_3W_STAR_BUS_FROM_VS; w3.config.toleranceFlow = TOLERANCE_FLOW_WHEN_3W_STAR_BUS_FROM_VS; checkBusBalance3wStarBus(w3, w2, w1, starBus1, TOLERANCE_BALANCE_3W_STAR_BUS, label1); checkBusBalance3wStarBus(w3, w2, w1, starBus2, TOLERANCE_BALANCE_3W_STAR_BUS, label2); checkBusBalance3wStarBus(w3, w2, w1, starBus3, TOLERANCE_BALANCE_3W_STAR_BUS, label3);
private BranchTestCase cas2EntsoeLoadFlowExplicitLine() { BranchTestCase t = new BranchTestCase(); t.branch.id = "FFNOD0L41__FNO"; t.branch.end1.ratedU = 380; t.branch.end2.ratedU = 380; t.branch.end1.r = 4.1956; t.branch.end1.x = 12.73; // Voltage and angle for bus 1 have been taken from Excel documentation // with much more precision that the one found in SV data files t.bus1.u = cas2EntsoeLoadFLowExplicitU1(); t.bus1.theta = Math.toRadians(cas2EntsoeLoadFLowExplicitTheta1()); t.bus2.u = 397.1; t.bus2.theta = Math.toRadians(0); t.expectedFlow1.p = -534.9869; t.expectedFlow1.q = 153.1046; t.expectedFlow2.p = 543.2755; t.expectedFlow2.q = -127.9559; return t; }
private BranchTestCase cas2EntsoeLoadFlowExplicitPhaseShiftTransformer() { BranchTestCase t = new BranchTestCase(); t.branch.id = "FNOD041__FNOD021__1_PT"; t.branch.end1.ratedU = 380; t.branch.end2.ratedU = 380; t.branch.end1.r = 4.1956; t.branch.end1.x = 12.73; t.bus1.u = cas2EntsoeLoadFLowExplicitU1(); t.bus1.theta = Math.toRadians(cas2EntsoeLoadFLowExplicitTheta1()); t.bus2.u = 397.1; t.bus2.theta = Math.toRadians(0); t.expectedFlow1.p = 202.9869; t.expectedFlow1.q = -75.1046; t.expectedFlow2.p = -201.7355; t.expectedFlow2.q = 78.9091; t.branch.end2.tap.rho = 0.997829; t.branch.end2.tap.alpha = Math.toRadians(-3.77605); return t; };
@Test public void testCAS2EntsoeLoadFlowExplicitLineAndPhaseShifterMovedToEnd1() { BranchTestCase line = cas2EntsoeLoadFlowExplicitLine(); BranchTestCase pst = cas2EntsoeLoadFlowExplicitPhaseShiftTransformer(); Flow load = cas2EntsoeLoadFlowExplicitLoad(); Flow generator = cas2EntsoeLoadFlowExplicitGenerator(); // Move phase shift from end 2 to end 1 pst.branch.end1.tap.rho = 1 / pst.branch.end2.tap.rho; pst.branch.end1.tap.alpha = -pst.branch.end2.tap.alpha; double rho2square = pst.branch.end2.tap.rho * pst.branch.end2.tap.rho; double dz = 100 * (1 / rho2square - 1); double dy = 100 * (rho2square - 1); pst.branch.end1.tap.r = dz; pst.branch.end1.tap.x = dz; pst.branch.end1.tap.g = dy; pst.branch.end1.tap.b = dy; pst.branch.end2.tap.rho = 1; pst.branch.end2.tap.alpha = 0; BranchData pline = piModelFlows(line); BranchData ppst = piModelFlows(pst); LOG.debug(""); LOG.debug("Balance at ends of parallel branches " + pline.getId() + ", " + ppst.getId()); LOG.debug("After moving phase shifter to side 1"); Flow line1 = flow(pline, Side.ONE); Flow line2 = flow(pline, Side.TWO); Flow pst1 = flow(ppst, Side.ONE); Flow pst2 = flow(ppst, Side.TWO); checkBusBalance("End 1", TOLERANCE_BALANCE_EXACT, TOLERANCE_BALANCE_EXACT, line1, pst1, load); checkBusBalance("End 2", 1e-2, 1e-4, line2, pst2, generator); }