Package flanagan.complex

Examples of flanagan.complex.Complex


            case 13:BigInteger[] bi = this.getArray_as_BigInteger();
                   for(int i=0; i<this.length; i++)am.array.add(bi[i]);
                   am.type = this.type;
                   break;
            case 14:Complex[] co = this.getArray_as_Complex();
                   for(int i=0; i<this.length; i++)am.array.add(new Complex(Math.rint(co[i].getReal()), Math.rint(co[i].getImag())));
                   am.type = this.type;
                   break;
            case 15:Phasor[] ph = this.getArray_as_Phasor();
                   for(int i=0; i<this.length; i++)am.array.add(new Phasor(Math.rint(ph[i].getMagnitude()), Math.rint(ph[i].getPhaseInDegrees())));
                   am.type = this.type;
View Full Code Here


                    this.summ.add(sumbi);
                    bi = null;
                    sumbi = null;
                    break;
            case 14: Complex[] cc = this.getArray_as_Complex();
                    Complex sumcc = Complex.zero();
                            for(int i=0; i<this.length; i++)sumcc.plus(cc[i]);
                        this.summ.add(sumcc);
                    break;
            case 15: Phasor[] pp = this.getArray_as_Phasor();
                    Phasor sumpp = Phasor.zero();
                    for(int i=0; i<this.length; i++)sumpp.plus(pp[i]);
View Full Code Here

    }

    public Complex getSum_as_Complex(){
        if(this.suppressMessages)Conv.suppressMessages();
        if(!this.sumDone)this.calcSum();
        Complex sum = Complex.zero();
        switch(this.type){
            case 0:
            case 1:
            case 2:
            case 3:
            case 18: sum = new Complex(((Double)this.summ.get(0)).doubleValue());
                    break;
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
            case 9:
            case 10:
            case 11:
            case 16:
            case 17: if(this.sumlongToDouble){
                        sum = new Complex(((Double)this.summ.get(0)).doubleValue());
                    }
                    else{
                        sum = new Complex(((Long)this.summ.get(0)).doubleValue());
                    }
                    break;
            case 12: sum = new Complex(((BigDecimal)this.summ.get(0)).doubleValue());
                    break;
            case 13: sum = new Complex(((BigInteger)this.summ.get(0)).doubleValue());
                    break;
            case 14:
            case 15: throw new IllegalArgumentException("The " + this.typeName[this.type] + " is not a numerical type for which a sum as Complex is meaningful/supported");
            default: throw new IllegalArgumentException("Data type not identified by this method");
        }
View Full Code Here

                    this.productt.add(productbi);
                    bi = null;
                    productbi = null;
                    break;
            case 14: Complex[] cc = this.getArray_as_Complex();
                    Complex productcc = Complex.plusOne();
                    for(int i=0; i<this.length; i++)productcc.times(cc[i]);
                    this.productt.add(productcc);
                    break;
            case 15: Phasor[] pp = this.getArray_as_Phasor();
                    Phasor productpp = Phasor.plusOne();
                    for(int i=0; i<this.length; i++)productpp.times(pp[i]);
View Full Code Here

    }

    public Complex getProduct_as_Complex(){
        if(this.suppressMessages)Conv.suppressMessages();
        if(!this.productDone)this.calcProduct();
        Complex product= Complex.zero();
        switch(this.type){
            case 0:
            case 1:
            case 2:
            case 3:
            case 18: product= new Complex(((Double)this.productt.get(0)).doubleValue());
                    break;
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
            case 9:
            case 10:
            case 11:
            case 16:
            case 17: if(this.productlongToDouble){
                        product= new Complex(((Double)this.productt.get(0)).doubleValue());
                    }
                    else{
                        product= new Complex(((Long)this.productt.get(0)).doubleValue());
                    }
                    break;
            case 12: product= new Complex(((BigDecimal)this.productt.get(0)).doubleValue());
                    break;
            case 13: product= new Complex(((BigInteger)this.productt.get(0)).doubleValue());
                    break;
            case 14:
            case 15: throw new IllegalArgumentException("The " + this.typeName[this.type] + " is not a numerical type for which a productas Complex is meaningful/supported");
            default: throw new IllegalArgumentException("Data type not identified by this method");
        }
View Full Code Here

        super.addDeadTimeExtras();
    }

    // Set the proportional gain
    public void setKp(double kp){
        super.sNumer.resetCoeff(1, new Complex(kp, 0.0));
        super.calcPolesZerosS();
        super.addDeadTimeExtras();
    }
View Full Code Here

    // Set the integral gain
    public void setKi(double ki){
        this.ki=ki;
        this.ti=this.kp/ki;
        super.sNumer.resetCoeff(0, new Complex(ki, 0.0));
        super.calcPolesZerosS();
        super.addDeadTimeExtras();
    }
View Full Code Here

    // Set the integral time constant
    public void setTi(double ti){
        this.ti=ti;
        this.ki=this.kp/ti;
        super.sNumer.resetCoeff(0, new Complex(ki, 0.0));
        super.calcPolesZerosS();
        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 = super.sValue.times(this.kp);
        term = term.plus(this.ki);
        term = term.over(super.sValue);
        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 = super.sValue.times(this.kp);
        term = term.plus(this.ki);
        term = term.over(super.sValue);
        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

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.