1111import pandas as pd
1212
1313
14- def power_coefficient_curve (wind_speed , cp_values ,
15- rotor_diameter , density , density_corr = False ):
14+ def power_coefficient_curve (wind_speed , cp_values , rotor_diameter , density ,
15+ density_correction = False ):
1616 r"""
1717 Calculates the turbine power output using a power coefficient curve.
1818
1919 This function is carried out when the parameter `power_output_model` of an
20- instance of the :class:`~.modelchain.ModelChain` class is 'cp_values'. If
21- the parameter `density_corr` is True the density corrected power curve
22- (:py:func:`~._p_curve_density_corr`) is used.
20+ instance of the :class:`~.modelchain.ModelChain` class is
21+ 'power_coefficient_curve'. If the parameter `density_correction` is True
22+ the density corrected power curve (See
23+ :py:func:`~.power_curve_density_correction`) is used.
2324
2425 Parameters
2526 ----------
@@ -32,7 +33,7 @@ def power_coefficient_curve(wind_speed, cp_values,
3233 Rotor diameter in m.
3334 density : pandas.Series or numpy.array
3435 Density of air at hub height in kg/m³.
35- density_corr : boolean
36+ density_correction : boolean
3637 If the parameter is True the density corrected power curve is used for
3738 the calculation of the turbine power output. Default: False.
3839
@@ -66,20 +67,21 @@ def power_coefficient_curve(wind_speed, cp_values,
6667 Wirtschaftlichkeit". 4. Auflage, Springer-Verlag, 2008, p. 542
6768
6869 """
69- if density_corr is False :
70+ if density_correction is False :
7071 cp_time_series = np .interp (wind_speed , cp_values .index , cp_values ,
7172 left = 0 , right = 0 )
7273 power_output = (1 / 8 * density * rotor_diameter ** 2 * np .pi
7374 * np .power (wind_speed , 3 ) * cp_time_series )
74- elif density_corr is True :
75+ elif density_correction is True :
7576 p_values = (1 / 8 * 1.225 * rotor_diameter ** 2 * np .pi *
7677 np .power (cp_values .index , 3 ) * cp_values )
7778 p_values = pd .Series (np .array (p_values ), index = cp_values .index )
78- power_output = _p_curve_density_corr (wind_speed , p_values , density )
79+ power_output = power_curve_density_correction (wind_speed , p_values ,
80+ density )
7981 else :
80- raise TypeError ("'{0}' is an invalid type." .format (type (
81- density_corr )) + "`density_corr` must be Boolean " +
82- "(True or False)." )
82+ raise TypeError ("'{0}' is an invalid type. " .format (type (
83+ density_correction )) + "`density_corr` must be " +
84+ "Boolean (True or False)." )
8385
8486 # Power_output as pd.Series if wind_speed is pd.Series (else: np.array)
8587 if isinstance (wind_speed , pd .Series ):
@@ -90,14 +92,14 @@ def power_coefficient_curve(wind_speed, cp_values,
9092 return power_output
9193
9294
93- def power_curve (wind_speed , p_values , density = None , density_corr = False ):
95+ def power_curve (wind_speed , p_values , density = None , density_correction = False ):
9496 r"""
9597 Calculates the turbine power output using a power curve.
9698
9799 This function is carried out when the parameter `power_output_model` of an
98- instance of the :class:`~.modelchain.ModelChain` class is 'p_values '. If
99- the parameter `density_corr ` is True the density corrected power curve
100- ( :py:func:`~._p_curve_density_corr `) is used.
100+ instance of the :class:`~.modelchain.ModelChain` class is 'power_curve '. If
101+ the parameter `density_correction ` is True the density corrected power
102+ curve (See :py:func:`~.power_curve_density_correction `) is used.
101103
102104 Parameters
103105 ----------
@@ -109,7 +111,7 @@ def power_curve(wind_speed, p_values, density=None, density_corr=False):
109111 density : pandas.Series or numpy.array
110112 Density of air at hub height in kg/m³. This parameter is needed
111113 if `density_corr` is True. Default: None.
112- density_corr : boolean
114+ density_correction : boolean
113115 If the parameter is True the density corrected power curve is used for
114116 the calculation of the turbine power output. In this case `density`
115117 cannot be None. Default: False.
@@ -126,15 +128,16 @@ def power_curve(wind_speed, p_values, density=None, density_corr=False):
126128 and below the minimum wind speed given in the power curve is zero.
127129
128130 """
129- if density_corr is False :
131+ if density_correction is False :
130132 power_output = np .interp (wind_speed , p_values .index , p_values ,
131133 left = 0 , right = 0 )
132- elif density_corr is True :
133- power_output = _p_curve_density_corr (wind_speed , p_values , density )
134+ elif density_correction is True :
135+ power_output = power_curve_density_correction (wind_speed , p_values ,
136+ density )
134137 else :
135- raise TypeError ("'{0}' is an invalid type." .format (type (
136- density_corr )) + "`density_corr` must be Boolean " +
137- "(True or False)." )
138+ raise TypeError ("'{0}' is an invalid type. " .format (type (
139+ density_correction )) + "`density_corr` must be " +
140+ "Boolean (True or False)." )
138141 # Power_output as pd.Series if wind_speed is pd.Series (else: np.array)
139142 if isinstance (wind_speed , pd .Series ):
140143 power_output = pd .Series (data = power_output , index = wind_speed .index ,
@@ -144,13 +147,13 @@ def power_curve(wind_speed, p_values, density=None, density_corr=False):
144147 return power_output
145148
146149
147- def _p_curve_density_corr (wind_speed , p_values , density ):
150+ def power_curve_density_correction (wind_speed , p_values , density ):
148151 r"""
149152 Calculates the turbine power output using a density corrected power curve.
150153
151154 This function is carried out when the parameter `power_output_model` of an
152- instance of the :class:`~.modelchain.ModelChain` class is 'p_values' and
153- the parameter `density_corr ` is True.
155+ instance of the :class:`~.modelchain.ModelChain` class is 'power_curve'
156+ and the parameter `density_correction ` is True.
154157
155158 Parameters
156159 ----------
@@ -209,8 +212,8 @@ def _p_curve_density_corr(wind_speed, p_values, density):
209212 """
210213 if density is None :
211214 raise TypeError ("`density` is None. For the calculation with a " +
212- "density corrected power curve density at hub height " +
213- "is needed." )
215+ "density corrected power curve density at hub " +
216+ "height is needed." )
214217 return [(np .interp (wind_speed [i ],
215218 p_values .index * (1.225 / density [i ])** (
216219 np .interp (p_values .index , [7.5 , 12.5 ], [1 / 3 , 2 / 3 ])),
0 commit comments