public void consolidate(){

        // add feedback boxes to forward path boxes
        this.closedPath = this.forwardPath.copy();
        for(int i=0; i<this.nFeedbackBoxes; i++){
            this.closedPath.addBoxToPath(this.feedbackPath.get(i));
        }

        // combine forward path boxes
        this.forwardPath.consolidate();
        if(!this.forwardPath.getCheckNoMix())this.checkNoMix = false;

        // combine closed path boxes
        this.closedPath.consolidate();
        if(!this.closedPath.getCheckNoMix())this.checkNoMix = false;

        // Calculate transfer function
        ComplexPoly fpNumer = this.forwardPath.getSnumer();
        ComplexPoly fpDenom = this.forwardPath.getSdenom();
        ComplexPoly cpNumer = this.closedPath.getSnumer();
        ComplexPoly cpDenom = this.closedPath.getSdenom();
        if(fpDenom.isEqual(cpDenom)){
            super.setSnumer(fpNumer.copy());
            super.setSdenom((cpNumer.plus(fpDenom)).copy());
        }
        else{
            super.setSnumer(fpNumer.times(cpDenom));
            super.setSdenom((cpNumer.times(fpDenom)).plus(cpDenom.times(fpDenom)));
        }
        this.checkConsolidate = true;
        this.deadTimeSum  = this.closedPath.getDeadTime();
        super.deadTime = 0.0;
        this.checkConsolidate = true;
    }