BranchData { public String getId() { return id; } BranchData(String id,
        double r, double x,
        double rho1, double rho2,
        double u1, double u2, double theta1, double theta2,
        double alpha1, double alpha2,
        double g1, double g2, double b1, double b2,
        double p1, double q1, double p2, double q2,
        boolean connected1, boolean connected2,
        boolean mainComponent1, boolean mainComponent2,
        double epsilonX, boolean applyReactanceCorrection);  BranchData(String id,
            double r, double x,
            double rho1, double rho2,
            double u1, double u2, double theta1, double theta2,
            double alpha1, double alpha2,
            double g1, double g2, double b1, double b2,
            double p1, double q1, double p2, double q2,
            boolean connected1, boolean connected2,
            boolean mainComponent1, boolean mainComponent2,
            int phaseAngleClock,
            double epsilonX, boolean applyReactanceCorrection);  BranchData(Line line, double epsilonX, boolean applyReactanceCorrection);  BranchData(TwoWindingsTransformer twt, double epsilonX, boolean applyReactanceCorrection, boolean twtSplitShuntAdmittance);  BranchData(TwoWindingsTransformer twt, int phaseAngleClock, double epsilonX, boolean applyReactanceCorrection, boolean twtSplitShuntAdmittance); String getId(); double getR(); double getX(); double getZ(); double getY(); double getKsi(); double getRho1(); double getRho2(); double getU1(); double getU2(); double getTheta1(); double getTheta2(); double getAlpha1(); double getAlpha2(); double getG1(); double getG2(); double getB1(); double getB2(); boolean isConnected1(); boolean isConnected2(); boolean isMainComponent1(); boolean isMainComponent2(); double getP1(); double getQ1(); double getP2(); double getQ2(); double getComputedP1(); double getComputedQ1(); double getComputedP2(); double getComputedQ2(); double getComputedP(Side side); double getComputedQ(Side side); int getPhaseAngleClock();  }
@Test public void testCAS2EntsoeLoadFlowExplicitLineAndPhaseShifter() { BranchTestCase line = cas2EntsoeLoadFlowExplicitLine(); BranchTestCase pst = cas2EntsoeLoadFlowExplicitPhaseShiftTransformer(); Flow load = cas2EntsoeLoadFlowExplicitLoad(); Flow generator = cas2EntsoeLoadFlowExplicitGenerator(); BranchData pline = piModelFlows(line); BranchData ppst = piModelFlows(pst); 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 testCAS2EntsoeLoadFlowExplicitLineAndPhaseShifterMovedToEnd1() { BranchTestCase line = cas2EntsoeLoadFlowExplicitLine(); BranchTestCase pst = cas2EntsoeLoadFlowExplicitPhaseShiftTransformer(); Flow load = cas2EntsoeLoadFlowExplicitLoad(); Flow generator = cas2EntsoeLoadFlowExplicitGenerator(); 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); }