public static Complex[] conj(Complex[] x) { Complex[] result = new Complex[x.length]; for(int i = 0; i < x.length; ++i) { result[i] = x[i].conjugate(); } return result; }
public void addPoleZeroConjugatePairs(Complex pole, Complex zero) { if (pole == null) System.out.println("LayoutBase addConj() pole == null"); if (zero == null) System.out.println("LayoutBase addConj() zero == null"); if (m_pair == null) System.out.println("LayoutBase addConj() m_pair == null"); m_pair[m_numPoles / 2] = new PoleZeroPair(pole, zero, pole.conjugate(), zero.conjugate()); m_numPoles += 2; }
/** * @return */ public IComplexNum conjugate() { return newInstance(fComplex.conjugate()); }
private static Complex[] multiplyWithConjugateInPlace(Complex[] complexNumbers) { for (int i = 0; i < complexNumbers.length; i++) { complexNumbers[i] = complexNumbers[i].multiply(complexNumbers[i].conjugate()); } return complexNumbers; }
boolean isConjugate () { return second.equals(first.conjugate()); }
/** * c = conjugate(a) Michael Borcherds 2010-02-07 * * @param a * a * @param c * c */ public static void complexConjugate(GeoVec2D a, GeoVec2D c) { Complex out = new Complex(a.x, a.y); out = out.conjugate(); c.x = out.getReal(); c.y = out.getImaginary(); c.setMode(Kernel.COORD_COMPLEX); }
boolean isMatchedPair () { if (first.getImaginary() != 0) return second.equals(first.conjugate()); else return second.getImaginary() == 0 && second.getReal() != 0 && first.getReal() != 0; }
public void evaluate(List<Datum> data) { double[] values = formatData(data); // FFT Complex[] fft = fftTran.transform(values, TransformType.FORWARD); // Multiply by complex conjugate for (int i = 0; i < fft.length; i ++) { fft[i] = fft[i].multiply(fft[i].conjugate()); } // Inverse transform fft = fftTran.transform(fft, TransformType.INVERSE); correlations = new double[maxLag]; for (int i = 1; i < maxLag; i++) { correlations[i] = fft[i].getReal() / fft[0].getReal(); } }
public SV otherSide(double r, double x, double g, double b, double ratio) { Complex z = new Complex(r, x); // z=r+jx Complex y = new Complex(g, b); // y=g+jb Complex s1 = new Complex(p, q); // s1=p1+jq1 Complex u1 = ComplexUtils.polar2Complex(u, Math.toRadians(a)); Complex v1 = u1.divide(Math.sqrt(3f)); // v1=u1/sqrt(3) Complex v1p = v1.multiply(ratio); // v1p=v1*rho Complex i1 = s1.divide(v1.multiply(3)).conjugate(); // i1=conj(s1/(3*v1)) Complex i1p = i1.divide(ratio); // i1p=i1/rho Complex i2 = i1p.subtract(y.multiply(v1p)); // i2=i1p-y*v1p Complex v2 = v1p.subtract(z.multiply(i2)); // v2=v1p-z*i2 Complex s2 = v2.multiply(3).multiply(i2.conjugate()); // s2=3*v2*conj(i2) Complex u2 = v2.multiply(Math.sqrt(3f)); return new SV(-s2.getReal(), -s2.getImaginary(), u2.abs(), Math.toDegrees(u2.getArgument())); }
public StateVariable toSv1(StateVariable sv2) { Complex s2 = new Complex(-sv2.p, -sv2.q); // s2=p2+jq2 Complex u2 = ComplexUtils.polar2Complex(sv2.u, Math.toRadians(sv2.theta)); Complex v2 = u2.divide(SQUARE_3); // v2=u2/sqrt(3) Complex i2 = s2.divide(v2.multiply(3)).conjugate(); // i2=conj(s2/(3*v2)) Complex v1p = v2.add(z.multiply(i2)); // v1'=v2+z*i2 Complex i1p = i2.negate().add(y.multiply(v1p)); // i1'=-i2+v1'*y Complex i1 = i1p.multiply(ratio); // i1=i1p*ration Complex v1 = v1p.divide(ratio); // v1=v1p/ration Complex s1 = v1.multiply(3).multiply(i1.conjugate()); // s1=3*v1*conj(i1) Complex u1 = v1.multiply(SQUARE_3); return new StateVariable(-s1.getReal(), -s1.getImaginary(), u1.abs(), Math.toDegrees(u1.getArgument())); }
public SV otherSide(double r, double x, double g1, double b1, double g2, double b2, double ratio) { Complex z = new Complex(r, x); // z=r+jx Complex y1 = new Complex(g1, b1); // y1=g1+jb1 Complex y2 = new Complex(g2, b2); // y2=g2+jb2 Complex s1 = new Complex(p, q); // s1=p1+jq1 Complex u1 = ComplexUtils.polar2Complex(u, Math.toRadians(a)); Complex v1 = u1.divide(Math.sqrt(3f)); // v1=u1/sqrt(3) Complex v1p = v1.multiply(ratio); // v1p=v1*rho Complex i1 = s1.divide(v1.multiply(3)).conjugate(); // i1=conj(s1/(3*v1)) Complex i1p = i1.divide(ratio); // i1p=i1/rho Complex i2p = i1p.subtract(y1.multiply(v1p)); // i2p=i1p-y1*v1p Complex v2 = v1p.subtract(z.multiply(i2p)); // v2p=v1p-z*i2 Complex i2 = i2p.subtract(y2.multiply(v2)); // i2=i2p-y2*v2 Complex s2 = v2.multiply(3).multiply(i2.conjugate()); // s2=3*v2*conj(i2) Complex u2 = v2.multiply(Math.sqrt(3f)); return new SV(-s2.getReal(), -s2.getImaginary(), u2.abs(), Math.toDegrees(u2.getArgument())); }
public StateVariable toSv2(StateVariable sv1) { Complex s1 = new Complex(-sv1.p, -sv1.q); // s1=p1+jq1 Complex u1 = ComplexUtils.polar2Complex(sv1.u, Math.toRadians(sv1.theta)); Complex v1 = u1.divide(SQUARE_3); // v1=u1/sqrt(3) Complex v1p = v1.multiply(ratio); // v1p=v1*rho Complex i1 = s1.divide(v1.multiply(3)).conjugate(); // i1=conj(s1/(3*v1)) Complex i1p = i1.divide(ratio); // i1p=i1/rho Complex i2 = i1p.subtract(y.multiply(v1p)).negate(); // i2=-(i1p-y*v1p) Complex v2 = v1p.subtract(z.multiply(i2)); // v2=v1p-z*i2 Complex s2 = v2.multiply(3).multiply(i2.conjugate()); // s2=3*v2*conj(i2) Complex u2 = v2.multiply(SQUARE_3); return new StateVariable(-s2.getReal(), -s2.getImaginary(), u2.abs(), Math.toDegrees(u2.getArgument())); }
Complex[] result = new Complex[fftY.length]; for(int i=0;i<fftY.length;i++){ result[i] = fftY[i].multiply(fftOrd[i].conjugate());
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)); }
Complex a1 = ComplexUtils.polar2Complex(1 / rho1, -alpha1); Complex a2 = ComplexUtils.polar2Complex(1 / rho2, -alpha2); Complex a1cc = a1.conjugate(); Complex a2cc = a2.conjugate(); Complex i21 = y22.multiply(v2).add(y21.multiply(v1)); Complex s1 = i12.conjugate().multiply(v1); Complex s2 = i21.conjugate().multiply(v2);
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; }