Skip to content

Commit ccb25ea

Browse files
committed
Merge branch 'features/wind_farms_and_clusters' into dev
2 parents 242e5a2 + 541cd78 commit ccb25ea

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

windpowerlib/power_output.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import numpy as np
1111
import pandas as pd
12+
from windpowerlib import tools
1213

1314

1415
def power_coefficient_curve(wind_speed, power_coefficient_curve_wind_speeds,

windpowerlib/tools.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,53 @@ def linear_interpolation_extrapolation(df, target_height):
7171
return ((df[heights_sorted[1]] - df[heights_sorted[0]]) /
7272
(heights_sorted[1] - heights_sorted[0]) *
7373
(target_height - heights_sorted[0]) + df[heights_sorted[0]])
74+
75+
76+
def gaussian_distribution(function_variable, standard_deviation, mean=0):
77+
r"""
78+
Normal distribution or gaussian distribution.
79+
80+
Parameters
81+
----------
82+
function_variable : Float
83+
Variable of the gaussian distribution.
84+
standard_deviation : Float
85+
Standard deviation of the gaussian distribution.
86+
mean : Float
87+
Defines the offset of the gaussian distribution function. Default: 0.
88+
89+
Returns
90+
-------
91+
pandas.Series or numpy.array
92+
Wind speed at hub height. Data type depends on type of `wind_speed`.
93+
94+
Notes
95+
-----
96+
The following equation is used [1]_:
97+
98+
.. math:: f(x) = \frac{1}{\sigma \sqrt{2 \pi}} exp
99+
\left[ -\frac{(x-\mu)^2}{2 \sigma^2} \right]
100+
101+
with:
102+
# TODO: add variables
103+
104+
References
105+
----------
106+
.. [1] Berendsen, H.: "A Student's Guide to Data and Error Analysis".
107+
New York, Cambridge University Press, 2011, p. 37
108+
109+
# TODO: add references
110+
111+
"""
112+
return (1 / (standard_deviation * np.sqrt(2 * np.pi)) *
113+
np.exp(-(function_variable - mean)**2 /
114+
(2 * standard_deviation**2)))
115+
116+
117+
def estimate_turbulence_intensity(height, roughness_length):
118+
"""
119+
Calculate turbulence intensity.
120+
121+
"""
122+
# TODO: Search other possibilities for TI.
123+
return 1 / (np.log(height / roughness_length))

0 commit comments

Comments
 (0)