Package flanagan.complex

Examples of flanagan.complex.Complex


        // Reads a Complex from the dialog box
        // No prompt message, No default option
        public static final synchronized Complex readComplex(){
                String line="";
                String mess="Input type: Complex (x + jy)";
                Complex c = new Complex();
                boolean finish = false;
                System.out.flush();

                while(!finish){
                        line = JOptionPane.showInputDialog(mess);
View Full Code Here


        double[]  derivRe = {0, -1.09443e+015, 4.50671e+014, -1.64535e+015, 2.64916e+015, -1.73921e+015, 2.84877e+014, 8.69272e+014, -1.77518e+015, 1.48932e+015, -1.89758e+015, 1.70681e+015, -1.10717e+015, 7.52799e+014, -2.81357e+014, 2.35816e+014, 1.51436e+014, -7.66855e+014, -3.01095e+014, 1.50003e+014, -2.68399e+015, 3.86776e+014, -6.17426e+015, 9.62736e+015, -2.62139e+015, 7.94178e+014, -1.68944e+014, 1.98255e+014, -3.52453e+013, -5.72818e+013, 5.05039e+013, 3.32047e+013, -4.0284e+013, 1.33103e+012, 3.42212e+013, -5.30981e+013, 4.73552e+013, -3.35549e+013, 9.74718e+012, -4.54863e+012, 1.1835e+013, -6.76495e+012, 2.08137e+012, -2.15834e+012, 6.30268e+012, -2.73772e+012, -7.13134e+011, 1.15139e+012, 0};
        // second derivatives - imaginary part
        double[]  derivIm = {0, 5.49257e+014, -4.99584e+014, -1.45243e+013, -2.5674e+014, -3.33755e+014, 5.01553e+013, -3.21087e+014, -3.68608e+014, 8.65942e+014, -4.85862e+014, 2.02151e+014, -6.51859e+013, -1.59369e+014, -3.45625e+014, 3.33754e+013, -7.21153e+014, -1.75627e+014, -4.86315e+014, -1.32704e+015, -1.65707e+015, -2.19007e+014, 1.01945e+016, -4.17064e+015, 5.88854e+014, -8.77761e+014, 4.82107e+013, -2.72544e+014, 1.09375e+014, -1.88393e+014, -8.63708e+013, 1.01638e+014, -1.07779e+014, 2.5244e+013, 2.97971e+013, -8.56009e+013, 4.64112e+013, -4.16531e+013, 1.48883e+013, -5.07977e+011, -1.77458e+013, 2.84057e+013, -2.4881e+013, 9.90519e+012, 5.74546e+012, -1.37589e+013, 1.24799e+013, -9.3404e+012, 0};
        int n = wavl.length;
        double  yRe, yIm;
        Complex  ri = new Complex();

      if(wavelength>=wavl[0] && wavelength<=wavl[n-1]){
        // cubic spline interpolation - real part
        yRe=CubicSpline.interpolate(wavelength, wavl, rfInRe, derivRe);
        // cubic spline interpolation - imaginary part
        yIm=CubicSpline.interpolate(wavelength, wavl, rfInIm, derivIm);
        ri.reset(yRe, RefractiveIndex.imagPlusMinus*yIm);
        }
      else{
        throw new IllegalArgumentException("Wavelength is outside the limits (187.86nm - 1937.2nm) of the tabulated data");
    }
      return ri;
View Full Code Here

        // e.g.  2 + j3, 2 + i3 are NOT allowed
        public final synchronized Complex readComplex(){

                this.inputType = true;
                String word="";
                Complex cc = null;

                if(!this.testFullLineT) this.enterLine();
                word = nextWord();

                if(!eof)cc = Complex.parseComplex(word.trim());
View Full Code Here

    }

    // Set the proportional gain
    public void setKp(double kp){
        this.kp = kp;
        super.sNumer.resetCoeff(0, new Complex(this.kp, 0.0D));
        if(super.sZeros==null)super.sZeros = Complex.oneDarray(1);
        super.sZeros[0].reset(-this.kp/this.kd, 0.0D);
        super.addDeadTimeExtras();
    }
View Full Code Here

    // Set the derivative gain
    public void setKd(double kd){
        this.kd=kd;
        this.td=kd/this.kp;
        super.sNumer.resetCoeff(1, new Complex(this.kd, 0.0D));
        if(super.sZeros==null)super.sZeros = Complex.oneDarray(1);
        super.sZeros[0].reset(-this.kp/this.kd, 0.0D);
        super.addDeadTimeExtras();
    }
View Full Code Here

    // Set the derivative time constant
    public void setTd(double td){
        this.td=td;
        this.kd=this.td*this.kp;
        if(super.sZeros==null)super.sZeros = Complex.oneDarray(1);
        super.sNumer.resetCoeff(1, new Complex(this.kd, 0.0D));
        super.sZeros[0].reset(-this.kp/this.kd, 0.0D);
        super.addDeadTimeExtras();
    }
View Full Code Here

    //  Get the s-domain output for a given s-value and a given input.
    public Complex getOutputS(Complex sValue, Complex iinput){
        super.sValue=sValue;
        super.inputS=iinput;
        Complex term = this.sValue.times(this.kd);
        term = term.plus(this.kp);
        super.outputS=term.times(super.inputS);
        if(super.deadTime!=0.0D)super.outputS = super.outputS.times(Complex.exp(super.sValue.times(-super.deadTime)));
        return super.outputS;
    }
View Full Code Here

        return super.outputS;
    }

    //  Get the s-domain output for the stored input and  s-value.
    public Complex getOutputS(){
        Complex term = this.sValue.times(this.kd);
        term = term.plus(this.kp);
        super.outputS=term.times(super.inputS);
        if(super.deadTime!=0.0D)super.outputS = super.outputS.times(Complex.exp(super.sValue.times(-super.deadTime)));
        return super.outputS;
    }
View Full Code Here

        super.addDeadTimeExtras();
    }

    public void setA(double aa){
        this.aConst = aa;
        Complex co = new Complex(this.aConst, 0.0);
        super.sDenom.resetCoeff(1, co);
        this.calcPolesZerosS();
        super.addDeadTimeExtras();
    }
View Full Code Here

        super.addDeadTimeExtras();
    }

    public void setB(double bb){
        this.bConst = bb;
        Complex co = new Complex(this.bConst, 0.0);
        super.sDenom.resetCoeff(0, co);
        this.calcPolesZerosS();
        super.addDeadTimeExtras();
    }
View Full Code Here

TOP

Related Classes of flanagan.complex.Complex

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.