 Research
 Open access
 Published:
A new mathematical technique and its Python program to assess wind potential
BeniSuef University Journal of Basic and Applied Sciences volume 13, Article number: 61 (2024)
Abstract
Background
A new approach based on the Newton–Gauss method is used to find the Weibull parameters.
Results
A Python program was developed to employ the Newton–Gauss method. It is implemented to find Weibull parameters and wind potential of Pakistan’s eight cities (Hyderabad, Khuzdar, Multan, Quetta, Bahawalpur, Islamabad, Lahore, and Peshawar). Wind speed data recorded at an interval of ten minutes for 2016 is used to implement a Python program to calculate wind potential. To compare the values of the parameters, five known methods, the empirical method, method of moments, energy pattern factor method, maximum likelihood method, and modified maximum likelihood method, were also used to model and determine the wind potential. The root mean square error, mean absolute error, coefficient of determination, and Akaike information criterion were calculated to compare values of wind parameters and average wind speed. The correlation between recorded and modeled Weibull pdf was almost 99% for each city.
Conclusions
The new method only caters to those wind speeds that contribute to the wind potential; therefore, the average value of the wind speed is the least in the case of the new method. The maximum wind potential was observed for Hyderabad.
1 Background
Due to their depletion, the Crises of energy reservoirs turn the world community's attention toward perpetual and sustainable renewable energy resources. In recent years, studies in many countries have taken place for the assessment of wind power lines: Australia [1], Saudi Arabia [2], Iraq [3], Izmir [4], etc. In South Asian countries like India, different winding coastal locations were analyzed for wind potential using wind energy done by [5]. Regarding Karachi, Pakistan, the economic impact of wind power potential for the Hawke's Bay site was considered in a study by [6].
Different studies also suggest different approaches regarding wind speed analyses; for instance, [7] suggested inverse Weibull distribution, and [8] utilized the Chebyshev metric. Using different parameter estimations, groundbased Doppler SODAR is also utilized to determine wind power density [9]. Wind Assessment for Agricultural applications was carried out by [10], while [11] utilizes the Weibull distribution function to analyze seasonal and yearly wind power density and wind speed distribution. The same distribution was also utilized from an industrial perspective by [12] for resolving three potential issues in strength models for unidirectional fiberreinforced composites while for the analysis of experimental data used by [13], which is obtained from singlefiber strength distributions. Considering the application of two and three parametric Weibull distributions, the frequency of lower wind speed values and applied probability density function is used to analyze the wind energy [14].
Comparative studies have also been conducted in regions to determine the best estimated Weibull parameters. [15] determined the wind potential for the two locations on Kiribati Island by comparing different Weibull parameters. Katinas et al. [16] estimated the wind power generation in Lithuania by using statistical analysis of wind characteristics, which are based on the different methods of Weibull distribution. Arslan et al. [17] also compared numerical methods for determining Weibull parameters for wind potential. Chaurasiya et al. [18] also utilized metmast and remote sensing techniques for the comparative analysis of wind through Weibull parameters. [19] estimate the Weibull parameters by comparing the four methods, including the power density method (PDM), mean standard deviation (MSD), rank regression method (RRM), and maximum likelihood method (MLM) for Halaba, Iraq. [20] perform the comparative study of five methods, namely, empirical, energy pattern factor, maximum likelihood, modified maximum likelihood, and graphical, to get the Weibull parameters regarding wind analysis for Phangan island, Thailand.
Several efforts have been made to determine the Weibull parameters, for example, by [21] and [9] for Spain and Canada. In this respect, innovations and new approaches emerged [22] and [23]. Regarding Sindh, Pakistan, [24] considered the wind site of Babaurband to evaluate the wind production perspective and estimate Weibull parameters. Recently, [25] innovated the quartile method for assessing wind potential and determining Weibull parameters for three cities: Karachi, Hyderabad, and Quetta.
All the existing methods discussed in this manuscript determine approximately the same values of shape and scale parameters of the Weibull distribution and find the same average wind speed and wind potential. It has been observed that the wind turbines are not efficient enough to harness the same energy as predicted by the existing models. There could be many reasons: the overestimated average wind speed and wind potential value are among them. The new method determines the average wind speed lower than the one determined by the existing method, so it gives a lower potential and is reasonably closer to the energy harnessed by the wind turbine.
2 Data and methodology
2.1 Weibull distribution
This distribution was first introduced by Swedish Scientist Dr. Walodi Weibull (1887–1979) to characterize the behavior of systems or events that exhibit some degree of variability. It is a flexible distribution that may include features from several other distributions. This property has given rise to widespread applications. The Weibull distribution is the most widely used for failure data analysis. The Weibull distribution is a useful statistical technique for assessing the potential of wind power based on collected data and analyzing the data in a frequency distribution. The Weibull distribution is one of the most widely used in technical practice. It is often used in weather forecasting, rainfall, water level prediction, sky clearness index classification, and the theory of reliability and lifetime.
2.1.1 Probability distribution function (Pdf)
The wind speed probability density function (Pdf), also known as the wind speed distribution, is used in wind energy analysis. The pdf is given by
Here, f (v) is the probability of observing wind speed (v). The dimensionless shape parameter (k) and scale parameter (c) with unit m/s [26, 27] and [28]. One of the key characteristics of the Weibull distribution that makes it more relevant for wind applications is that once these parameters are determined at one height, they can be adjusted to multiple heights.
2.1.2 Cumulative distribution function (CDF)
The area obtains the cumulative distribution function (CDF) under the curve of Weibull Pdf.
2.2 Method of estimating Weibull parameter
Six different approaches have been used to calculate wind speed, including maximum likelihood estimation, modified maximum likelihood estimation, the technique of moments, the energy pattern factor method, the empirical approach, and the new approach, the Newton–Gauss method.
2.3 Maximum likelihood method (MLM)
The most popular method for parameter estimate is the maximum likelihood method (MLM). The likelihood function is generated, and optimization conditions are used to find the values of ‘k’ and ‘c’ (see Eqs. (3) and (4)).
2.4 Modified maximum likelihood method (MMLM)
The modified maximum likelihood method employs determining Weibull distribution by its likelihood function. This method differs from the maximum likelihood method as one needs group data to determine the maximum value. The maximum likelihood method can be used for groups and ungroup data. Equations (5) and (6) are the optimization results to find the values of ‘k’ and ‘c.’
2.5 Method of moment (MoM)
One of the simplest techniques is the method of the moment; it relies on the first moment about the origin and the second moment about the mean. It is an alternative to MLM [8]. It determines parameter estimation from the mean wind speed v and standard deviation σ.
where \(\Gamma\) is the gamma function.
2.6 Empirical method (EM)
The empirical method could be considered a special case of the moment method. Justus and Mikhail presented this approach in 1977. Using the standard deviation σ and average wind speed v, he estimated the values of k and c.
2.7 Energy pattern factor method (EPFM)
This method relies on e averaged wind speed data and their cube. The energy pattern factor (\({E}_{pf}\)) is computed by dividing the average cube of wind speed \((\overline{{v }^{3}})\) by the cube of average wind speed \(({\overline{v} }^{3})\) by the equation as
Once you get the energy pattern factor, put it in this equation.
2.8 Method of Newton–Gauss (MNG)
Nonlinear least squares problems are resolved using the Newton–Gauss approach, comparable to minimizing a sum of squared function values. It is a development of Newton’s method for locating a nonlinear function's minimum. Since a sum of squares cannot be negative, the technique can be thought of as iteratively approximating the zeroes of each component of the total using Newton's method, reducing the sum.
The least square is used to select a parameter.
f (v) are taken from Eq. (1),
where F is the vectorvalued function.
The gradient of f is,
The hessian matrix is,
It computes a search direction using the formula of the Newton–Gauss method and determines the best values of the parameters;
Newton–Gauss is an iterative method (Fig. 1).
The Newton–Gauss approach is an iterative method that approaches the best values of shape and scale parameters. An initial guess of shape and scale parameters is provided, the code determines new values of the parameters, and the process continues each time new values are found by using the previous values till the difference between them is minimized.
This approach does not converge if.

(i)
the initial value of either the shape or scale parameter is zero or negative and

(ii)
The shape and scale parameters are much greater than the average wind speed value.
The best initial choice for the parameters is the average wind speed value.
3 Selection of stations for wind speed distribution
The research was planned to study wind potential availability in each province of Pakistan. Therefore, wind speed data was collected for important and provincial capitals in addition to the federal capital of Pakistan. The environment and weather vary from city to city, so they have different wind potential. This study also classifies these cities based on the wind potential, e.g., Hyderabad, a city in the Sindh province of Pakistan with the highest wind potential. In contrast, Peshwar has the lowest wind potential among the eight cities under study.
The following factors were considered in the city selection process:
3.1 Geographical diversity
We aimed to include cities from different regions within the study area to capture the variability of wind patterns across different geographical locations.
3.2 Population centers
We selected cities that are significant population centers to ensure that our findings have relevance and potential impact on a larger scale.
3.3 Availability of data
We prioritized cities with reliable and sufficient wind speed data, which was crucial for conducting a comprehensive analysis.
By incorporating these criteria, we believe our city selection process is adequately justified and transparent.
4 Results
Wind speed distribution usually follows an unimodal function; many different unimodal functions are suggested for modeling wind distribution, and one of the most frequently used functions is Weibull distribution. A Weibull distribution with three and two parameters has been used for modeling wind speed distribution; however, two parameters of the Weibull function are sufficient for the modeling. Scientists evaluating Weibull parameters develop various techniques and methods; all methods overestimate wind potential. It is believed that the potential calculated by these methods is actual potential, but no wind turbine can exploit the potential associated with the wind. Newton Raphson’s method is one of the best for obtaining independent variable values to optimize the function. Its extended version, the Newton–Gauss method, can be used for a function of multiple independent variables. Since the Weibull distribution has two parameters, this method can be used to find its parameters. A computer program in Python has been developed to determine the Weibull parameters.
The Weibull parameters for wind distributions of nine cities of Pakistan (Karachi, Hyderabad, Quetta, Khuzdar, Multan, Bahawalpur, Lahore, Peshawar, and Islamabad) have been found for wind distributions in 2016. To compare the parameters determined by the Newton–Gauss method, five already known methods (empirical method, energy pattern factor method, method of moment, maximum likelihood method, and modified maximum likelihood method) were also used to determine these parameters. The coefficient of determination is also calculated for each method. Six different errors (root means square error, mean absolute error, coefficient of determination, and Akaike information criterion) have been used to compare the parameters obtained by new and existing methods. The results are given in Table 1 for all nine cities. The first two rows in each table show the scale and shape parameters (k & c). The next six rows show the errors calculated for each existing and new method. The last row shows the average wind speed calculated by these methods. The shape parameter determined by the new method does not differ significantly from that determined by known methods; however, the scale parameter determined by the new method has the lowest value for all cities and all years. Since the scale parameter measures average wind speed, the average wind speed determined by the new method is the lowest. This gives a wind potential, i.e., more realistic than the one obtained by wind turbines.
4.1 Statistical error
RMSE in Weibull parameter estimation is remarkable; its value for the new method is the lowest for Multan, Islamabad, Peshawar, Bahawalpur, and Multan. The coefficient of determination is around 99% for all cities and all methods. The values of MABE are excellent for all methods; the new method has the lowest values for Multan, Peshawar, Bahawalpur, Islamabad, and Quetta. AIC values for the new method are least for Peshawar, Lahore, Islamabad, and Khuzdar. All these values indicate the new method is a competitor of existing methods.
5 Discussion
There are two important points to be noted when the Newton–Gauss method is utilized to calculate Weibull parameters.

(i)
The wind distribution should have only one Global minimum and be close to the Weibull distribution.

(ii)
Newton–Gauss Method does not converge if the initial guesses are far from the actual values of the parameters. To avoid this problem, a criterion was set for initial guesses for the shape and scale parameters; the initial value is the average value of the data plus one for both parameters.
5.1 Pdfs of wind speed distribution
In Fig. 2, eight subfigures correspond to Hyderabad, Khuzdar, Multan, Quetta, Bahawalpur, Islamabad, Lahore, and Peshawar. Each represents a corresponding histogram generated from the wind speed distribution of the wind speed data recorded every ten minutes. Each histogram is also represented by the pdfs of Weibull distribution obtained from five known and one new (Newton–Gauss) method. The pdf drawn by the Weibull parameters obtained by the new method slightly differs from other pdfs; it only caters to those speeds that effectively contribute to the wind potential. It does not include lower speeds at the histogram's tail, so the new method calculates the wind speed value and potential. The wind potential calculated by the new method is closer to the wind potential generated by wind turbines for a particular place. Hence, the new method finds more realistic potential than other methods.
5.2 Wind rose diagram
The wind rose diagram in Fig. 3 gives the wind speed pattern of eight cities in Pakistan. It is drawn with the help of wind speed and its direction. It helps in deciding on installing wind turbines at a particular site. The wind speed distribution of Hyderabad showed the maximum wind potential among the eight cities under study. In Hyderabad, the wind blows from the Southwest most of the time; the wind blows in this direction almost 51% of the time. In Quetta, the most frequent wind directions are Northwest and Southeast; the wind blows almost 24% of the time in each direction. In Khuzdar, the most frequent direction is Northwest; the wind blows almost 30% of the time in this direction. The most frequent wind directions for Bahawalpur, Islamabad, Lahore, Multan, and Peshawar are North, West, Southeast, Southeast, and Southwest, respectively. Hyderabad's contribution in the most frequent direction is maximum; therefore, its wind potential is the highest.
5.3 Wind potential
Figure 4 shows the eight cities’ power densities calculated by EPM, MoM, EPFM, MLM, and MMLM. The highest wind potential is found in Hyderabad, which is more than double the other seven cities. The order of cities according to the wind potential is Hyderabad, Khuzdar, Multan, Quetta, Bahawalpur, Islamabad, Lahore, and Peshawar. The available wind potential calculated by the EPM, MoM, EPFM, MLM, and MMLM is higher than that calculated by the new method. The wind potential calculated by the new method is almost half that calculated by other methods. The wind potential obtained from wind turbines is also far behind that calculated by EPM, MoM, EPFM, MLM, and MMLM methods. The available wind turbines are believed to convert 20–40% of the available wind potential. The wind potential calculated by the new method is closer to that obtained by wind turbines; the other method overestimates the wind potential; however, its value calculated by the new method is more realistic.
6 Conclusion
A Python program was developed to determine the Weibull parameters using the Newton–Gauss method. The new method has calculated the shape and scale parameters and compared them to those calculated by EM, MoM, EPFM, MLM, and MMLM. The shape parameter determined by the new method is comparable to that determined by the known method. The scale parameter determined by the new method has the lowest values for all nine wind distributions for all eight cities. The average value of wind distribution calculated by the new method is also the least, indicating the lowest and most realistic wind potential measured by the new method. The modeled pdf generated by parameters determined by the new method has the least RMSE values for most of the wind distribution data sets. The AIC values for eight data sets of wind distribution are the lowest for the new method for four cities, and in other cases, they are close to those measured in known methods. Hence, the new method stands as the best among compared known methods. The coefficient of determination is almost 99% for all the wind distributions. The maximum wind potential is observed in Hyderabad. The wind rose diagram indicates that Hyderabad is the only city where the most frequent wind direction is Southwest; all other directions have nominal wind potential.
Availability of data and materials
The manuscript presents all the data; data can be sent on request.
Abbreviations
 PDF:

Probability distribution function
 CDF:

Cumulative distribution function
 MLM:

Maximum likelihood method
 MMLM:

Modified maximum likelihood method
 MoM:

Method of moments
 EM:

Empirical method
 EPFM:

Energy pattern factor method
 MNG:

Method of Newton Gauss
 RMSE:

Root mean square error
 MABE:

Mean absolute error
 AIC:

Akaike information criterion
References
Azad K, Rasul M, Halder P, Sutariya J (2019) Assessment of wind energy prospect by Weibull distribution for prospective wind sites in Australia. Energy Procedia 160:348–355
Baseer MA, Meyer JP, Rehman S, Alam MM (2017) Wind power characteristics of seven data collection sites in Jubail, Saudi Arabia using Weibull parameters. Renew Energy 102:35–49
Mahmood FH, Resen AK, Khamees AB (2020) Wind characteristic analysis based on Weibull distribution of AlSalman site, Iraq. Energy Repo 6:79–87
Ozay C, Celiktas MS (2016) Statistical analysis of wind speed using twoparameter Weibull distribution in Alaçatı region. Energy Convers Manag 121:49–54
Deep S, Sarkar A, Ghawat M, Rajak MK (2020) Estimation of the wind energy potential for coastal locations in India using the Weibull model. Renew Energy 161:319–339
Hulio ZH, Jiang W, Rehman S (2019) TechnoEconomic assessment of wind power potential of Hawke’s Bay using Weibull parameter: a review. Energy Strat Rev 26:100375
Akgül FG, Şenoğlu B, Arslan T (2016) An alternative distribution to Weibull for modeling the wind speed data: inverse Weibull distribution. Energy Convers Manag 114:234–240
Saeed MA, Ahmed Z, Yang J, Zhang W (2020) An optimal approach of wind power assessment using Chebyshev metric for determining the Weibull distribution parameters. Sustain Energy Technol Assess 37:100612
Chaurasiya PK, Ahmed S, Warudkar V (2018) Comparative analysis of Weibull parameters for wind data measured from metmast and remote sensing techniques. Renew Energy 115:1153–1165
Azad AK, Rasul MG, Yusaf T (2014) Statistical diagnosis of the best Weibull methods for wind power assessment for agricultural applications. Energies 7(5):3056–3085
Bilir L, Imir M, Devrim Y, Albostan A (2015) Seasonal and yearly wind speed distribution and wind power density analysis based on Weibull distribution function. Int J Hydro Energy 40(44):15301–15310
Swolfs Y, Verpoest I, Gorbatikh L (2015) Issues in strength models for unidirectional fiberreinforced composites related to Weibull distributions, fiber packings and boundary effects. Compo Sci Technol 114:42–49
Thomason JL (2013) On the application of Weibull analysis to experimentally determined single fiber strength distributions. Compo Sci Technol 77:74–80
Wais P (2017) A review of Weibull functions in the wind sector. Renew Sustain Energy Rev 70:1099–1107
Aukitino T, Khan MGM, Ahmed MR (2017) Wind energy resource assessment for Kiribati with a comparison of different methods of determining Weibull parameters. Energy Convers Manag 151:641–660
Katinas V, Marčiukaitis M, Gecevičius G, Markevičius A (2017) Statistical analysis of wind characteristics based on Weibull methods for estimating power generation in Lithuania. Renew Energy 113:190–201
Arslan T, Bulut YM, Yavuz AA (2014) Comparative study of numerical methods for determining Weibull parameters for wind energy potential. Renew Sustain Energy Rev 40:820–825
Chaurasiya PK, Ahmed S, Warudkar V (2018) Study of different parameters estimation methods of Weibull distribution to determine wind power density using groundbased Doppler SODAR instrument. Alex Eng J 57(4):2299–2311
Salahaddin AA (2013) Comparative study of four methods for estimating Weibull parameters for Halabj, Iraq. Int J Phys Sci 8(5):186–192
Werapun W, Tirawanichakul Y, Waewsak J (2015) Comparative study of five methods to estimate Weibull parameters for wind speed on Phangan Island, Thailand. Energy Procedia 79:976–981
Carrillo C, Cidrás J, DíazDorado E, ObandoMontaño AF (2014) An approach to determine the Weibull parameters for wind energy analysis: The case of Galicia (Spain). Energies 7(4):2676–2700
De Andrade CF, Neto HFM, Rocha PAC, da Silva MEV (2014) An efficiency comparison of numerical methods for determining Weibull parameters for wind energy applications: a new approach applied to the northeast region of Brazil. Energy Convers Manag 86:801–808
Usta I (2016) An innovative estimation method regarding Weibull parameters for wind energy applications. Energy 106:301–314
Khahro SF, Tabbassum K, Soomro AM, Dong L, Liao X (2014) Evaluation of wind power production prospective and Weibull parameter estimation methods for Babaurband, Sindh Pakistan. Energy Conver Manag 78:956–967
Uddin Z, Sadiq N (2022) Method of quartile for determination of Weibull parameters and assessing wind potential. Kuwait J Sci. https://doi.org/10.48129/kjs.20357
Rajput AA, Daniyal M, Zahid MM, Nafees H, Shafi M, Uddin Z (2022) New approach to calculate Weibull parameters and comparison of wind potential of five cities of Pakistan. Adv in Energy Res 8(2):95
Zaheer F, Jilani SU, Uddin MA, Insaf A, Mamnoon Akhtar S, Uddin Z (2021) A new approach to assess wind potential. Glob Nest Jr 23(4):532–543
Khan JK, Uddin Z, Tanweer IS, Ahmed F, Aijaz A, Jilani SU (2015) An analysis of wind speed distribution and comparison of five numerical methods for estimating weibull parameters at Ormara, Pakistan. Eur Acad Res II 11:14007–14015
Acknowledgements
We are thankful to the owner of the site below for the data Dow. The data used in the manuscript was downloaded from the website below; we are thankful to the site’s owner. https://datacatalog.worldbank.org/search/dataset/0038689.
Funding
There is no funding for this research work.
Author information
Authors and Affiliations
Contributions
Shafiq Ur Rehman developed models, Ahmed Raj Mustaqeem Zahid developed the Python program, Dr. Mahwish Khan and Dr. Iqbal prepared the manuscript, and Dr. Naeem Sadiq and Prof. Zaheer Uddin supervised the coding, writing, and development of the model.
Corresponding author
Ethics declarations
Ethics approval and consent to participate
There is no ethical issue in this research.
Consent for publication
Not applicable.
Competing interests
There is no conflict of interest among the authors.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Rehman, S.U., Sadiq, N., Tariq, I. et al. A new mathematical technique and its Python program to assess wind potential. BeniSuef Univ J Basic Appl Sci 13, 61 (2024). https://doi.org/10.1186/s4308802400510z
Received:
Accepted:
Published:
DOI: https://doi.org/10.1186/s4308802400510z