A new mathematical technique and its Python program to assess wind potential

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, Islama-bad, 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.


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, ground-based 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 fiber-reinforced composites while for the analysis of experimental data used by [13], which is obtained from single-fiber 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 met-mast 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.

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.

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.

Cumulative distribution function (CDF)
The area obtains the cumulative distribution function (CDF) under the curve of Weibull Pdf.

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.

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)).

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.'

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 Ŵ is the gamma function.

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. (

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 divid- ing the average cube of wind speed (v 3 ) by the cube of aver- age wind speed (v 3 ) by the equation as Once you get the energy pattern factor, put it in this equation.

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 vector-valued function.(10) 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.

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:

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.

Population centers
We selected cities that are significant population centers to ensure that our findings have relevance and potential impact on a larger scale.

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.

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 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.

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.

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.

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.

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.

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.

Fig. 1
Fig. 1 Flowchart of the Python program to calculate Weibull parameters using a new method

Fig. 2 a
Fig. 2 a-h Pdfs generated by five known and new methods to compare wind distributions of cities Hyderabad, Quetta, Khuzdar, Multan, Lahore, Bahawalpur, Islamabad, and Peshawar

Table 1
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 Comparison of k and c between the Newton-Gauss method and five other methods with corresponding statistical errors for eight cities under study

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.