Mockito.when(leg1.getX()).thenReturn(X1); Mockito.when(leg1.getRatedU()).thenReturn(RATED_U1); Mockito.when(leg1.getB()).thenReturn(B); Mockito.when(leg1.getG()).thenReturn(G); Mockito.when(leg1.getTerminal()).thenReturn(leg1Terminal);
double maximumGenerationMVAR = 0.0; double shuntConductanceG = t.getLeg1().getG() * zBase; double shuntSusceptanceB = t.getLeg1().getB() * zBase; double loadMW = 0.0; double loadMVAR = 0.0;
public static Complex calcStarVoltage(ThreeWindingsTransformer twt, double ratedU0) { Objects.requireNonNull(twt); Complex v1 = ComplexUtils.polar2Complex(getV(twt.getLeg1()), getTheta(twt.getLeg1())); Complex v2 = ComplexUtils.polar2Complex(getV(twt.getLeg2()), getTheta(twt.getLeg2())); Complex v3 = ComplexUtils.polar2Complex(getV(twt.getLeg3()), getTheta(twt.getLeg3())); Complex ytr1 = new Complex(twt.getLeg1().getR(), twt.getLeg1().getX()).reciprocal(); Complex ytr2 = new Complex(adjustedR(twt.getLeg2()), adjustedX(twt.getLeg2())).reciprocal(); Complex ytr3 = new Complex(adjustedR(twt.getLeg3()), adjustedX(twt.getLeg3())).reciprocal(); Complex a01 = new Complex(1, 0); Complex a1 = new Complex(twt.getLeg1().getRatedU() / ratedU0, 0); Complex a02 = new Complex(1, 0); Complex a2 = new Complex(1 / rho(twt.getLeg2(), ratedU0), 0); Complex a03 = new Complex(1, 0); Complex a3 = new Complex(1 / rho(twt.getLeg3(), ratedU0), 0); // IIDM model includes admittance to ground at star bus side in Leg1 Complex ysh01 = new Complex(twt.getLeg1().getG(), twt.getLeg1().getB()); Complex ysh02 = new Complex(0, 0); Complex ysh03 = new Complex(0, 0); Complex y01 = ytr1.negate().divide(a01.conjugate().multiply(a1)); Complex y02 = ytr2.negate().divide(a02.conjugate().multiply(a2)); Complex y03 = ytr3.negate().divide(a03.conjugate().multiply(a3)); Complex y0101 = ytr1.add(ysh01).divide(a01.conjugate().multiply(a01)); Complex y0202 = ytr2.add(ysh02).divide(a02.conjugate().multiply(a02)); Complex y0303 = ytr3.add(ysh03).divide(a03.conjugate().multiply(a03)); return y01.multiply(v1).add(y02.multiply(v2)).add(y03.multiply(v3)).negate() .divide(y0101.add(y0202).add(y0303)); }
double x1 = twt.getLeg1().getX() / zb1; double g1 = twt.getLeg1().getG() * zb1; double b1 = twt.getLeg1().getB() * zb1; double r2 = twt.getLeg2().getR() / zb2; double x2 = twt.getLeg2().getX() / zb2;
b = twt.getLeg1().getB();
@Override protected void writeRootElementAttributes(ThreeWindingsTransformer twt, Substation s, NetworkXmlWriterContext context) throws XMLStreamException { XmlUtil.writeDouble("r1", twt.getLeg1().getR(), context.getWriter()); XmlUtil.writeDouble("x1", twt.getLeg1().getX(), context.getWriter()); XmlUtil.writeDouble("g1", twt.getLeg1().getG(), context.getWriter()); XmlUtil.writeDouble("b1", twt.getLeg1().getB(), context.getWriter()); XmlUtil.writeDouble("ratedU1", twt.getLeg1().getRatedU(), context.getWriter()); XmlUtil.writeDouble("r2", twt.getLeg2().getR(), context.getWriter()); XmlUtil.writeDouble("x2", twt.getLeg2().getX(), context.getWriter()); XmlUtil.writeDouble("ratedU2", twt.getLeg2().getRatedU(), context.getWriter()); XmlUtil.writeDouble("r3", twt.getLeg3().getR(), context.getWriter()); XmlUtil.writeDouble("x3", twt.getLeg3().getX(), context.getWriter()); XmlUtil.writeDouble("ratedU3", twt.getLeg3().getRatedU(), context.getWriter()); writeNodeOrBus(1, twt.getLeg1().getTerminal(), context); writeNodeOrBus(2, twt.getLeg2().getTerminal(), context); writeNodeOrBus(3, twt.getLeg3().getTerminal(), context); if (context.getOptions().isWithBranchSV()) { writePQ(1, twt.getLeg1().getTerminal(), context.getWriter()); writePQ(2, twt.getLeg2().getTerminal(), context.getWriter()); writePQ(3, twt.getLeg3().getTerminal(), context.getWriter()); } }
private static BranchData legBranchData(String twtId, Leg1 leg, Complex starVoltage, double epsilonX, boolean applyReactanceCorrection) { // In IIDM only the Leg1 has admittance to ground // And it is modeled at end corresponding to star bus return legBranchData(twtId, Side.ONE, leg, leg.getG(), leg.getB(), leg.getRatedU(), starVoltage, epsilonX, applyReactanceCorrection); }