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

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

$$f\left( v \right) = \left( \frac{k}{c} \right)\left( \frac{v}{c} \right)^{k - 1} \exp \left( { - k\left( {\left( \frac{v}{c} \right)^{k} } \right)} \right)$$
(1)

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.

$$f\left( v \right) = 1 - {\text{exp}}\left[ { - \left( \frac{v}{c} \right)^{k} } \right]$$
(2)

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

$$k = \left[ {\frac{{\mathop \sum \nolimits_{i = 1}^{n} f_{i} v_{i}^{k} \ln \left( {v_{i} } \right)}}{{\mathop \sum \nolimits_{i = 1}^{n} v_{i}^{k} }} - \frac{{\mathop \sum \nolimits_{i = 1}^{n} f_{i} \ln \left( {v_{i} } \right)}}{{\mathop \sum \nolimits_{i = 1}^{n} f_{i} }}} \right]^{ - 1}$$
(3)
$$c = \left[ {\frac{1}{{\mathop \sum \nolimits_{i = 1}^{n} f_{i} }}\mathop \sum \limits_{i = 1}^{n} f_{i} v_{i}^{k} } \right]^{\frac{1}{k}}$$
(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.’

$$k = \left[ {\frac{{\mathop \sum \nolimits_{i = 1}^{n} f_{i} v_{i}^{k} \ln \left( {v_{i} } \right)}}{{\mathop \sum \nolimits_{i = 1}^{n} f_{i} \left( {v_{i} } \right)v_{i}^{k} }} - \frac{{\mathop \sum \nolimits_{i = 1}^{n} f_{i} \left( {v_{i} } \right)\ln \left( {v_{i} } \right)}}{{f\left( {v > 0} \right)}}} \right]^{ - 1}$$
(5)
$$c = \left[ {\frac{1}{{f\left( {v > 0} \right)}}\mathop \sum \limits_{i = 1}^{n} f_{i} \left( {v_{i} } \right)v_{i}^{k} } \right]^{\frac{1}{k}}$$
(6)

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

$$\overline{v} = c\Gamma \left( {1 + \frac{1}{k}} \right)$$
(7)
$$\sigma = c\left[ {\Gamma \left( {1 + \frac{2}{k}} \right) - \Gamma^{2} \left( {1 + \frac{1}{k}} \right)} \right]^{\frac{1}{2}}$$
(8)

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.

$$k = \left( {\frac{\sigma }{{\overline{v}}}} \right)^{ - 1.086}$$
(9)
$$c = \frac{{\overline{v}}}{{\Gamma \left( {1 + \frac{1}{k}} \right)}}$$
(10)

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

$$E_{pf} = \frac{{\overline{{v^{3} }} }}{{\overline{v}^{3} }}$$
(11)

Once you get the energy pattern factor, put it in this equation.

$$k = 1 + \frac{3.69}{{E_{pf}^{2} }}$$
(12)
$$c = \frac{{\overline{v}}}{{\Gamma \left( {1 + \frac{1}{k}} \right)}}$$
(13)

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.

$$\mathop {{\text{minimize}}}\limits_{x} f\left( x \right) = \mathop \sum \limits_{i = 1}^{m} f_{i} \left( x \right)^{2}$$

The least square is used to select a parameter.

$$\mathop {{\text{minimize}}}\limits_{k,c} f\left( {k,c} \right) = \mathop \sum \limits_{i = 1}^{m} \left( {f\left( v \right) - v} \right)^{2}$$

f (v) are taken from Eq. (1),

$$\mathop {{\text{minimize}}}\limits_{k,c} f\left( {k,c} \right) = \frac{1}{2}\mathop \sum \limits_{i = 1}^{m} f_{i} \left( v \right)^{2} = \frac{1}{2}F\left( v \right)^{T} F\left( v \right)$$

where F is the vector-valued function.

$$F\left( v \right) = \left( {f_{1} \left( v \right) + f_{2} \left( v \right) + \ldots + f_{m} \left( v \right)} \right)$$

The gradient of f is,

$$\nabla f\left( v \right) = \nabla F\left( v \right)F\left( v \right)$$

The hessian matrix is,

$$\nabla^{2} f\left( v \right) = \nabla F\left( v \right)^{T} \nabla F\left( v \right)$$

It computes a search direction using the formula of the Newton–Gauss method and determines the best values of the parameters;

$$\nabla^{2} f\left( v \right)\left( {k,c} \right) = - \nabla f\left( v \right)$$
$$\left( {k,c} \right) = - \frac{\nabla f\left( v \right)}{{\nabla^{2} f\left( v \right)}}$$
(14)

Newton–Gauss is an iterative method (Fig. 1).

Fig. 1
figure 1

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

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.

  1. (i)

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

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

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

5 Discussion

There are two important points to be noted when the Newton–Gauss method is utilized to calculate Weibull parameters.

  1. (i)

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

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

Fig. 2
figure 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

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.

Fig. 3
figure 3figure 3

a–h Wind rose diagram for wind distributions of cities Hyderabad, Quetta, Khuzdar, Islamabad, Peshawar, Bahawalpur, Multan, and Lahore

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.

Fig. 4
figure 4

The power densities were calculated by EPM, MoM, EPFM, MLM, and MMLM for the eight cities

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.