Keywords

1 Introduction

Rapidly increasing demand for energy and decrease in the conventional energy resources have led to the use of renewable energy for power generation across the world. The most popular are solar power and wind power. In India, the potential for electricity generation using wind power is approximately of 102 GW. But wind energy cannot be utilized efficiently due to its alternating nature which affects the output power. It is therefore important to forecast the wind power for proper grid operation. It plays a crucial part in planning of the power systems, operation control, distribution, ease of use, consistency of the system, and so on [1].

The utilization of wind for energy generation has gained a lot of attention globally despite the fluctuation in wind speed and other weather factors that affect the wind power [2]. The reliability of the system can be increased by short-term wind power forecasting; this also reduces the operational cost and helps in load management. Forecasting can be done using either physical or statistical procedure.

In this paper, month-ahead wind power is predicted using the statistical model where a relation between generation data and set of variables is found out for the given set of data. This approach uses historical data of a particular location for the construction of model [3]. The parameters for the model is selected, namely the wind speed, day of the week, temperature, and the length of blades for wind generators. The accuracy of the results depends on these parameters. Two modeling techniques have been used, one being the artificial neural networks (ANNs) and the other hybridization of ANN with particle swarm optimization (PSO).

Artificial neural network can be used for the approximation of any nonlinear function, it has a feature of self-learning through which it can familiarize to any change in the surroundings [4]. ANN can be used for mapping a relationship between the given input and the desired output. Since ANN is not an optimization method, we use particle swarm optimization (PSO) for better results [5]. PSO is an optimization method based on the population, and it has a better mechanism for sharing of information and can efficiently solve any optimization problems which includes a lot of constraints. PSO is used to minimize the errors in ANN by modification of the weight matrix and is included in ANN during its training phase [7]. This method is cheap as compared to other techniques, and its implementation is easy.

2 Methodology

The day of the week (\( D_{i} \)), 24-h previous wind power (\( D_{i - 1} \)), and the 24-h previous wind speed (\( W_{i - 1} \)) have been given where \( Y_{i} \) the 24-h wind power of the forecasted day and the general form of the predicator is given by [8]:

$$ Y_{i} = f(Y_{i - 1} ,W_{i - 1} ,D_{i} ) $$
(1)

Thus, we might use the data from the previous power as well as wind speed history along with the type of the day of the week of the forecasted. At the midnight previous day (i − 1), it is, hence, needed to formulate the next day’s 24-h prediction (i). This forecasting would further be implemented for arranging and optimizing the power generators of wind used to be started in the day of working (i).

  • The brief description of wind power generation

In the energy conversion system of wind, kinetic energy of the moving air molecules and wind turbines is used to store the energy in the wind and converts it to the needful electrical power. The following equation can be used to calculate the power (P) contained in the air that flows through the wind turbine [10]

$$ P = 0.5*(S*D*V)*V^{2} $$
(2)

where

S :

Swept area of rotor,

D :

Density of air, and

V :

Velocity of air at turbine’s rotor level.

The hybrid approach model has been presented in the paper for the short-term wind power forecasting, typically, the next 24 h, for India. An observable efficient increase in the efficiency of working has been found after the application of PSO on ANN. Wind speed and wind power inputs have been considered in the proposed model. Historical dependency of data of one year has been incorporated. The wind data of India has been gathered from the National Renewable Energy Laboratory, Western Wind Resources Dataset [11].

  • Major components of the model

  1. A.

    The Neural Network for wind power forecasting

ANN is inspired by biological nervous systems and consists of simple elements operating in parallel. Training of neural network is done by altering the values of the connections to perform a particular function. Neural networks are trained so that a particular input leads to a specific target output.

The implemented model of artificial neural network basically consists of a two-layered network, namely the input layer, hidden layer as well as the output layer. ANN can be used for modeling of linear and nonlinear systems without the need to make assumptions implicitly. The amount of accuracy depends upon the number of hidden layers in the network and the connection between these layers and output as depicted in Fig. 1 . The number of hidden layers used in our model is 30.

Fig. 1
figure 1

Concept of neural network

The power of the network is determined by the connecting neurons. It consists of weighted inputs, a transfer function, and one output to the inputs. The transfer function of a neural network describes its behavior. Since the weights are a parameter that can be adjusted, the whole network is parameterized (Fig. 2).

Fig. 2
figure 2

Block diagram of the proposed model

  • Pre-processing of data

After the collection of data, the missing data is assumed by taking average of the neighboring data, and then, the data is normalized before feeding it to the neural network.

  • Network building

In this stage, the user provides the number of hidden layers in the network, the connections between the layer and the output and the transfer function for the given neural network. For multilayer perceptron, the transfer function is given below:

$$ Yi = f\left( {\mathop \sum \limits_{i = 1}^{n} WijXi} \right) $$
(3)

where f is a simple threshold function, Xi is the input signal, and Wij is the strength of the respective connections

  • Training of data

During training of data, the input weights are so adjusted that the error calculated between the actual and predicted value is the least. The error is calculated using the following formula in Eq. (4)

$$ Error\_percent = abs\left( {err} \right)/test*100 $$
(4)
  • Testing of data

The testing of the input data is performed, and the root mean square is calculated to determine the extent of error produced. The lower the RMSE, the more accurate is the estimation.

Equation (5) gives the formula for calculating the root-mean-square error

$$ {\text{RMSE}} = {\text{mean}}({\text{sqrt}}(r^{2} )). $$
(5)

The r-squared is the regression sum of the squares divided by the total sum of squares. It is also known as the ‘coefficient of determination’ and denoted by r2. It is a proportion and is always a number between 0 and 1. It can be calculated using the following equations:

$$ {\text{SSR}}:{\text{Regression}}\,{\text{sum}}\,{\text{of}}\,{\text{squares}} = \mathop \sum \limits_{i = 1}^{n} \left( {\hat{y}_{i} - \bar{y} } \right)^{2} $$
(6)
$$ {\text{SSE}}:{\text{Error}}\,{\text{sum}}\,{\text{of}}\,{\text{squares}} = \mathop \sum \limits_{i = 1}^{n} \left( {y_{i} - \hat{y}_{i} } \right)^{2} $$
(7)
$$ {\text{SSTO}}:{\text{Total}}\,{\text{sum}}\,{\text{of}}\,{\text{squares}} = \mathop \sum \limits_{i = 1}^{n} \left( {y_{i} - \bar{y}} \right)^{2} $$
(8)

Hence, the ‘coefficient of determination’ \( r^{2} \) is given by:

$$ \frac{{{\text{SSR}}}}{{{\text{SSTO}}}} = 1 - \frac{{{\text{SSE}}}}{{{\text{SSTO}}}} $$
(9)

In certain situations, the ANN model cannot be able to provide great accuracy. Hence, a hybrid mechanism of ANN-PSO is involved, wherein PSO is an evolutionary algorithm which is generally implemented for the set of weight optimization of the ANN.

The mean absolute percentage error (MAPE) is used to examine the forecasting accuracy of the proposed models

$$ {\text{MAPE}}\,\left[ \% \right] = \frac{1}{N}\mathop \sum \limits_{i = 1}^{i = n} \frac{{|P_{\text{A}}^{i} - P_{\text{F}}^{i} |}}{{P_{\text{A}}^{i} }} \times 100 $$
(10)

In Eq. (10), \( P_{\text{A}}^{i} \,{\text{and}}\,P_{\text{F}}^{i} \) are representing the actual and forecasted energy. N and I are thus representing the number of hours and respective indices.

  1. B.

    Particle Swarm Optimization for Weight Optimization of ANN

Particle swarm optimization (PSO) is a type of evolutionary computation which was initially inspired by the flocking of birds and thus was built with swarm optimization. The algorithm obtains an optimal solution which is designed on the observations from clustering of animals. It is thus, a heuristic methodological approach which was first proposed by Kennedy and Eberhart in 1995 [12] for dealing with the optimization of continuous and discontinuous function decision making. Hence, as the name suggests, it is based on the sociological and biological animal behavior including flock of birds in the search of food.

A basic variant of this algorithm simply functions by using a collection known as swarm of candidate solutions which are generally known as particles. These particles are then made to roam about for the search space with regard to some formulas. This movement of particles is further guided by their own best known position in the search space and the best known position of the entire swarm. When these improved positions are being searched, these will come to guide the swarm’s movement. The entire process is repeated with the hope of solution that is satisfactorily optimal. A PSO primarily can be said to have two operators:

  • velocity update operator—determining the particle velocity

  • position update operator—determining the particle position.

In PSO, each particle is made to flow through the dimensional space of search with random variable as well as velocity which is adaptable with the aim to find the function values that are low (global minimum). In the standard PSO algorithm process of convergence, the particles are manipulated using Eqs. (11) and (12), wherein each particle is accelerated and tries to adjust the velocity in accordance with the best possible positions previously taken which is further saved in the memory known as personal best. The adjustment is also made in accordance with the previous best position captured via the adjacent particle named global best, thus figuring out to look for a better position. Hence, communication between the particles takes place with a view to spread the information during their search with one another.

$$ v_{i} = {\text{w}}v_{i} (t) + r_{1} c_{1} \left( {p_{\text{best}} - x_{i} \left( t \right)} \right) + r_{2} c_{2} \left( {g_{\text{best}} - x_{i} \left( t \right)} \right) $$
(11)
$$ x_{i} ({\text{t}} + 1) = x_{i} ({\text{t}}) + v_{i} ({\text{t}} + 1) $$
(12)

where the variables have the following significance:

w :

Inertia weight providing a balance between two explorations, local and global,

\( v_{i} \) :

Current velocity for each iteration,

\( v_{i} \) (t + 1):

Modified velocity for each iteration,

\( c_{1} \) :

Cognitive component, and

\( c_{2} \) :

Social component.

These are the positive numerical to control the movement of particles during every iteration.

\( r_{1} \) and \( r_{2} \):

uniform distribution numbers ranging from [0, 1],

\( x_{i} \left( t \right) \) and \( x_{i} \)(t + 1):

present and the changed position for every iteration, and N is the number of particles between the input and the hidden as well as the further hidden layers to the final output layers; the connection weights are depicted in two of the matrices, namely \( w_{1} \) and \( w_{2} \) with the dimensional size of \( (m_{1 } \times n_{1} ) \) and \( (n_{1} \times m_{2} ) \), respectively; \( x_{i} \left( t \right) \) the present position for each particle that is depicted by \( w_{i} ({\text{t}}) = \{ w_{1} ,w_{2} \} \). Hence, a set of weights for the present iteration is represented by each particle’s position. Using Eqs. (5) and (6), the error of the network is reduced to a minimum value by determining the position for each particle as well as the new velocity. The number of weights that are linked with the network determines the search space dimension. Also, the weight matrix’s new position value depicts the fitness value for each particle.

The algorithm flowchart of the proposed method is shown in Fig. 3.

Fig. 3
figure 3

Algorithmic flowchart

  • Proposed Algorithm of the technique:

The following algorithm has been used to power the ANN model using the PSO optimization technique.

  • Step 1: Select the ANN structure. Set the number of neurons and create a feedforward network to train.

  • Step 2: Train the ANN by BP algorithm for selected dataset. The dataset is divided into three different sets like training, validation, and testing datasets. After completion of the training, store the weight matrices for further updates.

  • Step 3: Do short-term load forecasting by using the present ANN found in Step 2.

  • Step 4: Generate a number of matrix sets called candidate particles from the stored weight matrices in Step 2. This step explores the opportunity of randomness and generates more search spaces.

  • Step 5: Initialize local best (pbest), global best (gbest), and other PSO parameters w, c1, and c2 using the standard PSO rules.

  • Step 6: Do short-term load forecasting using the ANN having the new weight matrices.

  • Step 7: If the performance of Step 6 is better than the previous one, then go to Step 8; otherwise, go to Step 9.

  • Step 8: Update pbest and gbest parameters based on the performances of current solution.

  • Step 9: In this step, update the present solutions (particles) based on (1–2); thus, a new set of solutions is obtained and the said process repeats.

  • Step 10: If stopping criterion is met, take the global best weight matrix set as the solution of the proposed method and go to the next step; otherwise, go back to Step 6 for further exploration.

  • Step 11: Put the updated weighted matrix in the ANN structure. The new ANN is constructed by applying PSO. The newly trained ANN powered by PSO optimization generally always performs better than conventional ANN networks as created in Step 3.

  • Step 12: Enter training and validation data as input, and results are found for ANN-PSO model.

  • Step 13: Compare the performance of Step 3 and Step 12.

  • Step 14: Print results.

3 Results and Comparison

In this section, we have demonstrated the outcomes of proposed techniques and their accuracy for the wind power forecasting using MATLAB 2016(a). Figure 4 represents the graph obtained from the ANN method of wind forecasting.

Fig. 4
figure 4

Actual and forecasted plot of wind power using ANN with error percentage plot

In Fig. 5, the results obtained through ANN powered by PSO are shown. The graph consists of actual (blue) wind power and forecasted (red) wind power curve. It is clearly observed from the graph that forecasted (red) wind power is closely followed the curve of actual (blue) wind power.

Fig. 5
figure 5

Actual and forecasted plot of wind power using ANN-PSO and error plot

Table 1 shows the calculated values of the proposed algorithms, ANN and ANN-PSO of RMSE, MAPE, and R-squared.

Table 1 Calculated error values

The MAPE, RMSE as well as R-squared for the two techniques of forecasting are compared graphically and depicted in Fig. 6. The vertical axis shows the error.

Fig. 6
figure 6

Graphical representation for errors of ANN and ANN-PSO methods

Figures 7 and 8, respectively, show the regression plots of the two techniques used, namely ANN and ANN-PSO, showing a wide area of scattering in the plot of ANN.

Fig. 7
figure 7

Regression plot for ANN

Fig. 8
figure 8

Regression plot for ANN-PSO

4 Conclusion

This paper proposes ANN and ANN-PSO approaches for short-term wind power forecasting, and forecasting accuracies of the methods are compared. The effectiveness of the proposed methods is thus examined by calculating the MAPE, RMSE, and R-squared values. It has been noticed that the forecasting error is reduced due to the optimization of bias weight using PSO to train the ANN network. The MAPE values are 2.0534 and 1.8236% for ANN and ANN-PSO, respectively. The RMSE values are 4.1316 and 3.6132% for ANN and ANN-PSO, respectively. R-squared values are 79.03 and 82.27% for ANN and ANN-PSO, respectively. Hence, the results show the superiority of the PSO-optimized model forecasting over the conventional ANN technique. In future, we can consider the other parameters like wind mill area, the diameter of the wind mill, and direction of wind, weather condition, and height of the turbine to improve the forecasting accuracy.