Skip to content

Commit 5b9e936

Browse files
committed
Correct power coefficient function
1 parent 37934e6 commit 5b9e936

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

windpowerlib/power_output.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,18 @@ def power_coefficient_curve(wind_speed, power_coefficient_curve_wind_speeds,
6666
Wirtschaftlichkeit". 4. Auflage, Springer-Verlag, 2008, p. 542
6767
6868
"""
69-
power_curve_values = (1 / 8 * 1.225 * rotor_diameter ** 2 * np.pi *
70-
np.power(power_coefficient_curve_wind_speeds,
71-
3) *
72-
power_coefficient_curve_values)
73-
power_output = power_curve_density_correction(
69+
power_coefficient_time_series = np.interp(
7470
wind_speed, power_coefficient_curve_wind_speeds,
75-
power_curve_values, density)
71+
power_coefficient_curve_values, left=0, right=0)
72+
power_output = (1 / 8 * density * rotor_diameter ** 2 * np.pi *
73+
np.power(wind_speed, 3) *
74+
power_coefficient_time_series)
75+
# Power_output as pd.Series if wind_speed is pd.Series (else: np.array)
76+
if isinstance(wind_speed, pd.Series):
77+
power_output = pd.Series(data=power_output, index=wind_speed.index,
78+
name='feedin_power_plant')
79+
else:
80+
power_output = np.array(power_output)
7681
return power_output
7782

7883

0 commit comments

Comments
 (0)