Package flanagan.complex

Examples of flanagan.complex.ComplexMatrix


        return this.getArray_as_Complex_rowMatrix();
    }

    public ComplexMatrix getArray_as_Complex_rowMatrix(){
        Complex[] cc = this.getArray_as_Complex();
        ComplexMatrix mat = ComplexMatrix.rowMatrix(cc);
        return mat;
    }
View Full Code Here


        return this.getArray_as_Complex_columnMatrix();
    }

    public ComplexMatrix getArray_as_Complex_columnMatrix(){
        Complex[] cc = this.getArray_as_Complex();
        ComplexMatrix mat = ComplexMatrix.columnMatrix(cc);
        return mat;
    }
View Full Code Here

    public ComplexMatrix subarray_as_Complex_rowMatrix(int start, int end){
        if(end>=this.length)throw new IllegalArgumentException("end, " + end + ", is greater than the highest index, " + (this.length-1));
        Complex[] cc = this.getArray_as_Complex();
        Complex[] retArray = new Complex[end-start+1];
        for(int i=start; i<=end; i++)retArray[i-start] = cc[i];
        ComplexMatrix mat = ComplexMatrix.rowMatrix(retArray);
        return mat;
    }
View Full Code Here

    public ComplexMatrix subarray_as_Complex_columnMatrix(int start, int end){
        if(end>=this.length)throw new IllegalArgumentException("end, " + end + ", is greater than the highest index, " + (this.length-1));
        Complex[] cc = this.getArray_as_Complex();
        Complex[] retArray = new Complex[end-start+1];
        for(int i=start; i<=end; i++)retArray[i-start] = cc[i];
        ComplexMatrix mat = ComplexMatrix.columnMatrix(retArray);
        return mat;
    }
View Full Code Here

        if(this.segmentLength==-1)throw new IllegalArgumentException("No distance along the line as been entered");
        if(this.distributedResistance==0.0D && this.distributedConductance==0.0D){
            this.generalABCDmatrix = this.getIdealABCDmatrix();
        }
        else{
            this.generalABCDmatrix = new ComplexMatrix(2,2);
            Complex gammal = this.getPropagationConstant().times(this.segmentLength);
            Complex zed0 = this.getCharacteristicImpedance();
            this.generalABCDmatrix.setElement(0, 0, Complex.cosh(gammal));
            this.generalABCDmatrix.setElement(0, 1, Complex.sinh(gammal).times(zed0));
            this.generalABCDmatrix.setElement(1, 0, Complex.sinh(gammal).over(zed0));
View Full Code Here

    // calculate the ABCD matrix - ideal line
    public ComplexMatrix getIdealABCDmatrix(){
        if(this.segmentLength==-1)throw new IllegalArgumentException("No distance along the line as been entered");

        this.idealABCDmatrix = new ComplexMatrix(2,2);
        double betal = this.getIdealPhaseConstant()*this.segmentLength;
        double zed0 = this.getIdealCharacteristicImpedanceAsReal();
        this.idealABCDmatrix.setElement(0, 0, new Complex(Math.cos(betal), 0.0D));
        this.idealABCDmatrix.setElement(0, 1, new Complex(0.0D, Math.sin(betal)*zed0));
        this.idealABCDmatrix.setElement(1, 0, new Complex(0.0D, Math.sin(betal)/zed0));
View Full Code Here

    // calculate the ABCD matrix - low loss line
    public ComplexMatrix getLowLossABCDmatrix(){
        if(this.segmentLength==-1)throw new IllegalArgumentException("No distance along the line as been entered");

        this.lowLossABCDmatrix = new ComplexMatrix(2,2);
        Complex gammal = this.getLowLossPropagationConstant().times(this.segmentLength);
        Complex zed0 = this.getLowLossCharacteristicImpedance();
        this.lowLossABCDmatrix.setElement(0, 0, Complex.cosh(gammal));
        this.lowLossABCDmatrix.setElement(0, 1, Complex.sinh(gammal).times(zed0));
        this.lowLossABCDmatrix.setElement(1, 0, Complex.sinh(gammal).over(zed0));
View Full Code Here

    // given voltage and current at the start of the segment
    // output as Complex
    // preset segment length
    public Complex[] voltageAndCurrentAsComplex(){
        Complex[] outputVector = {this.outputVoltage, this.outputCurrent};
        ComplexMatrix abcdMatrix = this.getABCDmatrix();
        Complex[] inputVector = abcdMatrix.solveLinearSet(outputVector);
        this.inputVoltage = inputVector[0];
        this.inputCurrent = inputVector[1];
        return inputVector;
    }
View Full Code Here

    // given voltage and current at the start of the segment
    // output as phasor
    public Phasor[] voltageAndCurrentAsPhasor(double segLen){
        this.segmentLength = segLen;
        Complex[] outputVector = {this.outputVoltage, this.outputCurrent};
        ComplexMatrix abcdMatrix = this.getABCDmatrix();
        Complex[] inputVector = abcdMatrix.solveLinearSet(outputVector);
        this.inputVoltage = inputVector[0];
        this.inputCurrent = inputVector[1];
        Phasor[] input = {Phasor.toPhasor(this.inputVoltage), Phasor.toPhasor(this.inputCurrent)};
        return input;
    }
View Full Code Here

    // given voltage and current at the start of the segment
    // output as Phasor
    // preset segment length
    public Phasor[] voltageAndCurrentAsPhasor(){
        Complex[] outputVector = {this.outputVoltage, this.outputCurrent};
        ComplexMatrix abcdMatrix = this.getABCDmatrix();
        Complex[] inputVector = abcdMatrix.solveLinearSet(outputVector);
        this.inputVoltage = inputVector[0];
        this.inputCurrent = inputVector[1];
        Phasor[] input = {Phasor.toPhasor(this.inputVoltage), Phasor.toPhasor(this.inputCurrent)};
        return input;
    }
View Full Code Here

TOP

Related Classes of flanagan.complex.ComplexMatrix

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.