private void calculateExperimentalImpedances(){
        if(this.referenceSet && this.appliedVoltageSet){
            for(int i=0; i<this.numberOfFrequencies; i++){
                // voltage divider calculation

                this.impedances[i] = (this.referenceImpedance.times(this.voltages[i])).over(this.appliedVoltage.minus(this.voltages[i]));

                this.realZ[i] = this.impedances[i].getReal();
                this.imagZ[i] = this.impedances[i].getImag();

                this.impedanceMagnitudes[i] = this.impedances[i].abs();
                this.impedancePhasesRad[i] = this.impedances[i].arg();
                this.impedancePhasesDeg[i] = Math.toDegrees(this.impedancePhasesRad[i]);

                if(this.weightsSet && this.voltageErrorSet){
                    ComplexErrorProp appliedV = new ComplexErrorProp(this.appliedVoltage.getReal(), this.appliedVoltageError.getReal(), this.appliedVoltage.getImag(), this.appliedVoltageError.getImag());
                    ComplexErrorProp expertlV = new ComplexErrorProp(this.realV[i], this.realVweights[i], this.imagV[i], this.imagVweights[i]);
                    ComplexErrorProp refImped = new ComplexErrorProp(this.referenceImpedance.getReal(), 0.0D, this.referenceImpedance.getImag(), 0.0D);
                    ComplexErrorProp eVoverAv = (expertlV.over(appliedV)).times(refImped);
                    this.realZweights[i] = eVoverAv.getRealError();
                    this.imagZweights[i] = eVoverAv.getImagError();
                }
                this.impedancesSet = true;
            }
        }
    }