private void checkBusBalance3wStarBus( BranchTestCase w1, BranchTestCase w2, BranchTestCase w3, Bus starBus, double toleranceBalance, String label) { w1.bus2 = starBus; w2.bus2 = starBus; w3.bus2 = starBus; BranchData r1 = checkTestCase(label, w1); BranchData r2 = checkTestCase(label, w2); BranchData r3 = checkTestCase(label, w3); Flow f1 = flow(r1, Side.TWO); Flow f2 = flow(r2, Side.TWO); Flow f3 = flow(r3, Side.TWO); checkBusBalance(label, toleranceBalance, f1, f2, f3); }
@Test public void testCAS2EntsoeLoadFlowExplicitLine() { checkTestCase("line", cas2EntsoeLoadFlowExplicitLine()); }
@Test public void testCAS2EntsoeLoadFlowExplicitPhaseShiftTransformer() { checkTestCase("pst", cas2EntsoeLoadFlowExplicitPhaseShiftTransformer()); }
@Test public void testDanglingLine() { BranchTestCase t = lineEnd2Disconnected(); // The expected values at the other end will be the same when we disconnect end // 1 or end 2 // If we use the same voltage at the connected end double expectedU = 381.9095; double expectedTheta = -0.000503; // First obtain results when end 2 is disconnected BranchData b2disconnected = checkTestCase("End 2 disconnected", t); assertEquals(expectedU, b2disconnected.getComputedU2(), t.config.toleranceVoltage); assertEquals(expectedTheta, b2disconnected.getComputedTheta2(), t.config.toleranceVoltage); // Now change the disconnected end and check the same results are obtained t.bus2.u = t.bus1.u; t.bus2.theta = t.bus1.theta; t.bus1.u = Double.NaN; t.bus1.theta = Double.NaN; t.branch.end2.connected = true; t.branch.end1.connected = false; t.expectedFlow2.p = t.expectedFlow1.p; t.expectedFlow2.q = t.expectedFlow1.q; t.expectedFlow1.p = Double.NaN; t.expectedFlow1.q = Double.NaN; BranchData b1disconnected = checkTestCase("End 1 disconnected", t); assertEquals(expectedU, b1disconnected.getComputedU1(), t.config.toleranceVoltage); assertEquals(expectedTheta, b1disconnected.getComputedTheta1(), t.config.toleranceVoltage); }
BranchData b2disconnected = checkTestCase("End 2 disconnected", t); assertEquals(expectedU, b2disconnected.getComputedU2(), t.config.toleranceVoltage); assertEquals(expectedTheta, b2disconnected.getComputedTheta2(), t.config.toleranceVoltage); t.expectedFlow2.p = 0.02946635; t.expectedFlow2.q = -43.611687; BranchData b1disconnected = checkTestCase("End 1 disconnected", t); assertEquals(expectedU, b1disconnected.getComputedU1(), t.config.toleranceVoltage); assertEquals(expectedTheta, b1disconnected.getComputedTheta1(), t.config.toleranceVoltage);