public ValueType coth(CalculatedValue g) { if (g.isComplex()) { return setComplexValue(g.getComplex().tanh().reciprocal()); } else { return setValue(1.0f / FastMath.tanh(g.real)); } }
public ValueType csc(CalculatedValue g) { if (g.isComplex()) { return setComplexValue(g.getComplex().sin().reciprocal()); } else { return setValue(1.0f / FastMath.sin(g.real)); } }
public ValueType sec(CalculatedValue g) { if (g.isComplex()) { return setComplexValue(g.getComplex().cos().reciprocal()); } else { return setValue(1.0f / FastMath.cos(g.real)); } }
public ValueType csch(CalculatedValue g) { if (g.isComplex()) { return setComplexValue(g.getComplex().sinh().reciprocal()); } else { return setValue(1.0f / FastMath.sinh(g.real)); } }
public ValueType sech(CalculatedValue g) { if (g.isComplex()) { return setComplexValue(g.getComplex().cosh().reciprocal()); } else { return setValue(1.0f / FastMath.cosh(g.real)); } }
public ValueType cot(CalculatedValue g) { if (g.isComplex()) { return setComplexValue(g.getComplex().tan().reciprocal()); } else { return setValue(1.0f / FastMath.tan(g.real)); } }
/** * Numerical cotangent. * * @param complex argument * @return cotangent */ public static Complex cot(Complex complex) { if (complex.isReal()) return new Complex(1 / FastMath.tan(complex.getReal().doubleValue())); return new Complex(new org.apache.commons.math3.complex.Complex(complex.getReal().doubleValue(), complex.getImaginary().doubleValue()).tan().reciprocal()); }
/** * Numerical arccotangent. * * @param complex argument * @return arccotangent */ public static Complex arccot(Complex complex) { if (complex.isReal()) return new Complex(FastMath.atan(1 / complex.getReal().doubleValue())); return new Complex(new org.apache.commons.math3.complex.Complex(complex.getReal().doubleValue(), complex.getImaginary().doubleValue()).reciprocal().atan()); }
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)); }
Bus calcStarBusV1V2V3Y(BranchTestCase w1, BranchTestCase w2, BranchTestCase w3) { Complex v1 = ComplexUtils.polar2Complex(w1.bus1.u, w1.bus1.theta); Complex v2 = ComplexUtils.polar2Complex(w2.bus1.u, w2.bus1.theta); Complex v3 = ComplexUtils.polar2Complex(w3.bus1.u, w3.bus1.theta); Complex ytr1 = new Complex(w1.branch.end1.r, w1.branch.end1.x).reciprocal(); Complex ytr2 = new Complex(w2.branch.end1.r, w2.branch.end1.x).reciprocal(); Complex ytr3 = new Complex(w3.branch.end1.r, w3.branch.end1.x).reciprocal(); // FIXME consider tap.rho and tap.alpha Complex a01 = new Complex(w1.branch.end2.ratedU / w1.branch.end1.ratedU, 0); Complex a1 = new Complex(1, 0); Complex a02 = new Complex(w2.branch.end2.ratedU / w2.branch.end1.ratedU, 0); Complex a2 = new Complex(1, 0); Complex a03 = new Complex(w3.branch.end2.ratedU / w3.branch.end1.ratedU, 0); Complex a3 = new Complex(1, 0); Complex ysh01 = new Complex(w1.branch.end2.g, w1.branch.end2.b); Complex ysh02 = new Complex(w2.branch.end2.g, w2.branch.end2.b); Complex ysh03 = new Complex(w3.branch.end2.g, w3.branch.end2.b); 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)); Complex v0 = y01.multiply(v1).add(y02.multiply(v2)).add(y03.multiply(v3)).negate() .divide(y0101.add(y0202).add(y0303)); Bus starBus = new Bus(); starBus.u = v0.abs(); starBus.theta = v0.getArgument(); return starBus; }
Complex i1 = s1.divide(v1).conjugate(); Complex ytr = new Complex(r, x).reciprocal(); Complex y1 = new Complex(g1, b1);
private void computeValues() { Complex ytr = new Complex(r, x).reciprocal(); Complex y1 = new Complex(g1, b1); Complex y2 = new Complex(g2, b2);