diff --git a/demandlib/bdew.py b/demandlib/bdew.py index 3a0d4b5..38c5aa6 100644 --- a/demandlib/bdew.py +++ b/demandlib/bdew.py @@ -342,3 +342,47 @@ def get_normalized_bdew_profile(self): heat_profile_normalized = (kw * h * f * sf) return heat_profile_normalized + + def get_cop(self, heatpump_type = "Air", water_temp = 60): + """ Calculation of the coefficient of performance depending + on the outside temperature + + Parameters + ---------- + heatpump_type: string + defines the technology used. Ground is more efficient than Air. + water_temp: int + temperature needed for the heating system + + References + ---------- + .. [1]: 'https://www.researchgate.net/publication/255759857_A_review_of_domestic_heat_pumps' + Research paper about domestic heatpumps, containing the formulas used + """ + + cop_lst = [] + + if heatpump_type == "Air": + for tmp in self.temperature: + cop = (6.81 - 0.121 * (water_temp - tmp) + + 0.00063 * (water_temp - tmp)**2) + cop_lst.append(cop) + + elif heatpump_type == "Ground": + for tmp in self.temperature: + cop = (8.77 - 0.15 * (water_temp - tmp) + + 0.000734 * (water_temp - tmp)**2) + cop_lst.append(cop) + + else: + # TODO Raise Error + print("Heatpump type is not defined") + return -9999 + + self.cop = pd.DataFrame({"cop" : cop_lst}) + self.cop.set_index(self.df.index, inplace = True) + + + return self.cop + + \ No newline at end of file