11"""
2- The ``power_curves`` module contains functions for applying alterations to the
3- power curve of a wind turbine, wind farm or wind turbine cluster.
2+ The ``power_curves`` module contains functions for applying alterations like
3+ power curve smoohting or reducing power values by an efficiency to the power
4+ curve of a wind turbine, wind farm or wind turbine cluster.
45
56"""
67
@@ -21,22 +22,23 @@ def smooth_power_curve(power_curve_wind_speeds, power_curve_values,
2122
2223 Parameters
2324 ----------
24- power_curve_wind_speeds : pandas.Series
25+ power_curve_wind_speeds : pandas.Series or numpy.array
2526 Wind speeds in m/s for which the power curve values are provided in
2627 `power_curve_values`.
2728 power_curve_values : pandas.Series or numpy.array
2829 Power curve values corresponding to wind speeds in
2930 `power_curve_wind_speeds`.
3031 block_width : float
31- Width of the moving block. Default: 0.5.
32+ Width between the wind speeds in the sum of the equation shown below in
33+ Notes. Default: 0.5.
3234 wind_speed_range : float
3335 The sum in the equation below is taken for this wind speed range below
3436 and above the power curve wind speed. Default: 15.0.
3537 standard_deviation_method : string
3638 Method for calculating the standard deviation for the Gauss
3739 distribution. Options: 'turbulence_intensity', 'Staffell_Pfenninger'.
3840 Default: 'turbulence_intensity'.
39- mean_gauss : float or integer
41+ mean_gauss : float
4042 Mean of the Gaus distribution in
4143 :py:func:`~.tools.gauss_distribution`:. Default: 0.
4244
@@ -49,9 +51,8 @@ def smooth_power_curve(power_curve_wind_speeds, power_curve_values,
4951 Returns
5052 -------
5153 smoothed_power_curve_df : pd.DataFrame
52- Smoothed power curve. DataFrame has 'wind_speed' and
53- 'power' columns with wind speeds in m/s and the corresponding power
54- curve value in W.
54+ Smoothed power curve. DataFrame has 'wind_speed' and 'power' columns
55+ with wind speeds in m/s and the corresponding power curve value in W.
5556
5657 Notes
5758 -----
@@ -60,17 +61,19 @@ def smooth_power_curve(power_curve_wind_speeds, power_curve_values,
6061 P_{smoothed}(v_{std}) = \sum\limits_{v_i}^{} \Delta v_i \cdot P(v_i)
6162 \cdot \frac{1}{\sigma \sqrt{2 \pi}}
6263 \exp \left[-\frac{(v_{std} - v_i -\mu)^2}{2 \sigma^2} \right]
63-
64+
6465 with:
6566 P: power [W], v: wind speed [m/s],
66- :math:`\sigma`: standard deviation (Gauss), :math: `\mu`: mean (Gauss),
67-
67+ :math:`\sigma`: standard deviation (Gauss), :math: `\mu`: mean (Gauss)
68+
6869 :math:`P_{smoothed}` is the smoothed power curve value,
6970 :math:`v_{std}` is the standard wind speed in the power curve,
7071 :math: `\Delta v_i` is the interval length between
7172 :math: `$v_\text{i}$` and :math: `$v_\text{i+1}$`
72-
73- This way of smoothing power curves is also used in [2]_ and [3]_.
73+
74+ Power curve smoothing is applied to take account for the spatial
75+ distribution of wind speed. This way of smoothing power curves is also used
76+ in [2]_ and [3]_.
7477
7578 References
7679 ----------
@@ -99,7 +102,7 @@ def smooth_power_curve(power_curve_wind_speeds, power_curve_values,
99102 normalized_standard_deviation = 0.2
100103 # Initialize list for power curve values
101104 smoothed_power_curve_values = []
102- # Append wind speeds to `power_curve_wind_speeds` until last value + range
105+ # Append wind speeds to `power_curve_wind_speeds`
103106 maximum_value = power_curve_wind_speeds .values [- 1 ] + wind_speed_range
104107 while (power_curve_wind_speeds .values [- 1 ] < maximum_value ):
105108 power_curve_wind_speeds = power_curve_wind_speeds .append (
@@ -108,11 +111,10 @@ def smooth_power_curve(power_curve_wind_speeds, power_curve_values,
108111 power_curve_values = power_curve_values .append (
109112 pd .Series (0.0 , index = [power_curve_values .index [- 1 ] + 1 ]))
110113 for power_curve_wind_speed in power_curve_wind_speeds :
111- # Create array of wind speeds for the moving block
112- wind_speeds_block = (np .arange (- wind_speed_range ,
113- wind_speed_range + block_width ,
114- block_width ) +
115- power_curve_wind_speed )
114+ # Create array of wind speeds for the sum
115+ wind_speeds_block = (np .arange (
116+ - wind_speed_range , wind_speed_range + block_width , block_width ) +
117+ power_curve_wind_speed )
116118 # Get standard deviation for Gauss function
117119 standard_deviation = (
118120 (power_curve_wind_speed * normalized_standard_deviation + 0.6 )
@@ -126,15 +128,14 @@ def smooth_power_curve(power_curve_wind_speeds, power_curve_values,
126128 power_curve_wind_speed - wind_speed ,
127129 standard_deviation , mean_gauss )
128130 for wind_speed in wind_speeds_block )
129- # Add value to list - add 0 if `smoothed_value` is nan. This occurs
130- # because the Gauss distribution is not defined for 0.
131+ # Add value to list - add 0 if `smoothed_value` is nan.
131132 smoothed_power_curve_values .append (0 if np .isnan (smoothed_value )
132133 else smoothed_value )
133- # Create smoothed power curve DataFrame
134+ # Create smoothed power curve data frame
134135 smoothed_power_curve_df = pd .DataFrame (
135136 data = [list (power_curve_wind_speeds .values ),
136137 smoothed_power_curve_values ]).transpose ()
137- # Rename columns of DataFrame
138+ # Rename columns of the data frame
138139 smoothed_power_curve_df .columns = ['wind_speed' , 'power' ]
139140 return smoothed_power_curve_df
140141
@@ -147,7 +148,7 @@ def wake_losses_to_power_curve(power_curve_wind_speeds, power_curve_values,
147148
148149 Parameters
149150 ----------
150- power_curve_wind_speeds : pandas.Series
151+ power_curve_wind_speeds : pandas.Series or numpy.array
151152 Wind speeds in m/s for which the power curve values are provided in
152153 `power_curve_values`.
153154 power_curve_values : pandas.Series or numpy.array
@@ -157,10 +158,9 @@ def wake_losses_to_power_curve(power_curve_wind_speeds, power_curve_values,
157158 Efficiency of the wind farm. Either constant (float) or efficiency
158159 curve (pd.DataFrame) containing 'wind_speed' and 'efficiency' columns
159160 with wind speeds in m/s and the corresponding dimensionless wind farm
160- efficiency (reduction of power).
161- Default: None.
161+ efficiency (reduction of power). Default: None.
162162 wake_losses_model : String
163- Defines the method for talking wake losses within the farm into
163+ Defines the method for taking wake losses within the farm into
164164 consideration. Options: 'power_efficiency_curve',
165165 'constant_efficiency'. Default: 'power_efficiency_curve'.
166166
@@ -193,8 +193,8 @@ def wake_losses_to_power_curve(power_curve_wind_speeds, power_curve_values,
193193 wake_losses_model , wind_farm_efficiency ))
194194 df = pd .concat ([power_curve_df .set_index ('wind_speed' ),
195195 wind_farm_efficiency .set_index ('wind_speed' )], axis = 1 )
196- # Add by efficiency reduced power column (nan values of efficiency
197- # are interpolated)
196+ # Add column with reduced power (nan values of efficiency are
197+ # interpolated)
198198 df ['reduced_power' ] = df ['power' ] * df ['efficiency' ].interpolate (
199199 method = 'index' )
200200 reduced_power = df ['reduced_power' ].dropna ()
0 commit comments