code: @Override
     public double error(){
          errorForEachExperimentalData.clear();
          double error =0;
          for (ExperimentalData pair: experimental){
              double temperature = pair.getTemperature();
              substance.setTemperature(temperature);
              substance.dewPressure(substance.getPressure());
              double expP = pair.getPressure();
              double calcP = substance.getPressure();
              double relativeError = (calcP - expP)/expP;
              double squareError = Math.pow(relativeError,2);
              
              
              if(!Double.isNaN(squareError) && Double.isFinite(squareError)){
  	            error += squareError;
  	            errorForEachExperimentalData.add(new ErrorData(expP, calcP, relativeError,temperature));
              }
          }   
          totalError = error;
          return error;   
     }
docs: to class function