A Novel Smart Grid State Estimation Method Based on Neural Networks

The rapid development in smart grids needs efficient state estimation methods. This paper presents a novel method for smart grid state estimation (e.g., voltages, active and reactive power loss) using artificial neural networks (ANNs). The proposed method which is called SE-NN (state estimation using neural network) can evaluate the state at any point of smart grid systems considering fluctuated loads. To demonstrate the effectiveness of the proposed method, it has been applied on IEEE 33-bus distribution system with different data resolutions. The accuracy of the proposed method is validated by comparing the results with an exact power flow method. The proposed SE-NN method is a very fast tool to estimate voltages and re/active power loss with a high accuracy compared to the traditional methods.


I. Introduction
T HE smart grid technologies are a step towards developing the utility industry, whereas it could overcome the drawbacks of the existing power grid [1]. The high demand for electricity cannot serve the high increasing population rate and the low response. The manual control and the high losses during transmission made the manufacturers think about alternative solutions. Smart grids can deal with the needs of the high population [2], achieve reliability, automated control which leads to the high response, and decrease the losses in transmission lines by providing efficiency of data transmission from head to tail [3]- [5].
The feeding of the smart grid [6] can be renewable energy resources (e.g., photovoltaic (PV) and wind) in parallel with the utility grid to provide a low overall cost. On the other side, these resources have negative impacts on the distribution system, such as the high power loss due to the back feeding of the power flow [7], fluctuation and unbalanced voltage [8], and voltage rise [9].
Many researchers evaluated the steady-state conditions of distribution system by using the state-of-the-art techniques, such as Gauss-Seidel and Newton-Raphson, which supposed that the system is already stable [10]. The power flow techniques have been applied to determine the steady-state operation conditions during transmitting the electricity, Kirchhoff's current law and other methods to determine the voltage magnitude, angle, and active/reactive power. Other iterative methods are detailed in [11], [12]. A technique for the multiphase unbalanced system, which was developed to deal with different types of loads (constant current, constant power, and constant impedance), is presented in [13]. To model the harmonics resulting by the variable load with the time variant, a simulator is modeled based on the openDSS program to estimate the value of harmonics [14].
Impact of PV integration was studied in [15]. A study for modeling and simulating the penetration effects by two feeders in different scenarios is illustrated in [16].
A quasi-static time-series (QSTS) is presented for analyzing and simulating the operation of PV distribution system and evaluating the effects of the PV integration during a specified duration (day or year).
In [17], several works have been proposed to reduce the execution time of QSTS. The authors presented two methods for shortening the time-series for power flow calculations in the presence of the distributed generation. The size of the input data, as well as the power flow calculation, was decreased. The first method depends on downsampling data through reducing time resolution. This method has the disadvantage of losing the peak values during down-sampling. The second method chooses the similar intervals, and then performs the calculation on them. This method also has the disadvantage of missing the rest of data, which makes the simulations inaccurate.
In [18] and [19], the neural networks control the electrical systems with nonlinear dynamic characteristics. Ref [20] explained the use of neural networks with fully connected neuron learning combined with power flow for optimizing smart grids.
The limitation of the methods reported in the literature is that they take very long execution time to estimate smart grid state. In this paper, we propose a fast method (SE-NN) to calculate the state of the smart grid (voltage, active power, and reactive power) in a short time and accurate way using a neural network model.

II. Background
Power flow analysis is essential for monitoring system distribution by calculating active/reactive power, currents, and voltages at each time step for a specified duration. Iterative power flow methods are used for determining the operation of the system at the steady-state condition. In [21], a Newton-Raphson method algorithm was used for solving non-linear equations. The problem with this method is that the memory space is not sufficient for large-scale systems. A modified Gauss-Seidel algorithm was presented in [22]. This algorithm solves the problem of the limited memory size with small execution time.
The state estimation is used for estimating the power flow solution of different real-time information because of the large number of nodes, few phase measurements, and disability of the system to be hardly provided with a meter at each node and each branch. The commonly used state estimator is weighted least square criteria (WLS). A study on state estimation depending on Tikhonov regularization compared with the WLS is detailed in [23]. Due to the changeable nature of the energy environment, the distribution system needs new system modeling that can adapt to the new advanced technologies. In [24], the authors discussed the new methodologies for wide area monitoring and analyzing of the smart grids. Another approach for wide-area network estimation called multi-area state estimation (MASE) is illustrated in [25]. This approach relies on a two-step procedure, the overall network area is divided into subareas according to its geographical characteristics and measurement estimator. The first step is performing all the available measurements for each area. The subareas have the same nodes number and the estimator is working in parallel for low execution time. In the second step, the data of the first step is processed and refined for different operation conditions. The previous methods have drawbacks of the long execution time [26]. In general, iterative power flow methods require a long time to estimate the states of the smart grid. In this paper, we propose a fast method for real-time analysis with high accuracy. To demonstrate the effectiveness of our method, we have compared it with a well-known power flow method.

A. Neural Networks
The artificial neural networks are a close simulation of the human brain. We use the neural network in state estimation because of its high efficiency in processing signals and predicting output in a fast and accurate way. The neural network model either contains one layer (input and output are directly connected), two layers (the first layer for receiving data, and the other layer for output results) or multilayer whereas three or more layers are connected in parallel (input layer, hidden layer(s), and output layer) [27]- [29].
There are many algorithms to train neural networks; the preferable one is the back-propagation algorithm in which the error is calculated by computing the difference between the target and the measured output, and the weights are adjusted and propagated backward from the output to the input until finding the weights that minimize the error. Then the network is being learned for the desired output. More details about learning of neural network can be found in [30]. Fig. 1 shows a neural network containing three layers. The first layer is the input layer which contains four neurons, the second layer is the hidden layer that contains three neurons, and the last one is the output layer. The connection lines w and b denote the weights and biases. The output of the first layer can be expressed as follow: where y j is the summation of the inputs x i multiplied by the weights w ij , and added to the biases b j [30]. Using equation (2), the weights are updated every iteration until the errors are minimized to a level equal or less than the threshold value (0.05).
where α is the learning rate which is adjusted to a small value. The output of the summation function (y j ) is the input to another function called activation function. The common types of activation function are shown in Fig. 2. The step function or threshold function in Fig.2 (a) is limited with (-1 or +1), If the output is less than or equal to 0, the output will be -1, if it is more than 0, the resulting output will be +1. In Fig.2 (b), the output of the linear function is increasing linearly from -1 to +1. In Fig.2 (c), the output of the sigmoid function is increasing from 0 to +1. The final output of the neural network (z) can be expressed using equation (3).
where f is the activation function, and the updated weights and biases are w~ and b~.

B. SE-NN Method
In the proposed method, the network is constructed directly between the input data and the desired output. The input of the network is a training data set divided into samples within a limited duration called load factor. The load factor samples can be presented by the following equation: (4) where t is the time step, and m is the number of samples. The output of the network is the state estimation for the generated load profiles which are sampled by the load factor along with a specified duration. If we considered that the output is presented by a matrix A as shown in equation (5), each element in the matrix A represents the state of a known bus or line at a known sample.
The rows in the matrix A represent the bus number (in case of voltage calculation) or the line number (in case of losses calculations). Note that the number of lines is less than the number of buses by one. The columns represent the values of the input sample with regards to the data set. The symbol X can be replaced with V, P or Q. For example, if we want to find the voltage at bus 15 through all durations, we will extract the vector of 15 th row of the matrix as below: (6) Another example, if we want to find the reactive losses at line 10 (the line from bus 10 to bus 11), we will extract the vector of 10 th row of the matrix as the following equation: (7) In our approach, we used an efficient method for solving the power flow called quadratic based backward/forward sweep (QBBFS) [31]. Unlike the traditional quadratic based methods that cannot be employed for the unbalanced systems, the QBBFS method accommodates multiphase systems and different load types. Although QBBFS is an efficient method, it requires a long time to estimate the state of the grid. The QBBFS method is used for the large system, where the backward sweep is used for calculating the branch currents from the far ends, and the forward sweep is used for calculating the voltages from the slack bus. In QBBFS, the iteration is repeated until reaching to high convergence rate. Fig. 3 shows the steps of estimation the real-time voltage using a neural network model.

C. The Solution Steps
1. Read the data inputs from the load profiles.
2. Sample the input data and solve it using QBBFS method.
3. Redirect the QBBFS outputs (voltages or re/active power) to the SE-NN model. 4. Create the SE-NN model using the feed forward neural network with initial parameters and Levenberg-Marquardt algorithm that has high efficiency.
5. Train the SE-NN model with the initialize network created and training parameters. In the training process, the actual QBBFS output is compared with the measured SE-NN output until the network performance goal is met (maximum 300 epochs, minimum 5% gradient and 1e-3 goal error). If the goal is not met, the weights and biases are updated with the learning machine rate until the error is equal or less than the network goal.
6. Once the model is trained, it would be able to simulate the output results for any change in the input data set (Load Factor).
7. Finally, the results are printed.
The proposed algorithm overcomes the high complexity of the computational methods. The function of the QBBFS method is to solve the power flow and redirect the output for training the network, once the network model is learned, the model is saved and used to simulate and reproduce the output rapidly and accurately for any new input data without the need for the QBBFS method.

IV. Assessing the Accuracy of the Proposed Method
To validate the accuracy of the proposed method, we compute the difference between the actual output using the QBBFS method and the network output using the SE-NN method. To perform this we compute different types of errors such as the mean square error (MSE) which is expressed as the average of the square difference between the actual output and the network output. (8) where M is the size of the duration, i denotes to the bus number (for voltage calculations) or the line number (for losses calculations), and X represents the state estimation (e.g., voltage, active or reactive power), is the QBBFS output, and is the SE-NN output. In equation (9) we calculate the square root of the mean of the squared difference between actual and estimated output which is called the root mean square error (RMSE). The maximum value of the absolute difference between actual and measured output which is called the maximum absolute error (MAE)) is expressed in (10). The mean absolute percentage error (MAPE) and the sum of the squared error (SSE) are expressed in (11) and (12), respectively.
The maximum values of the previous errors are computed to evaluate the accuracy of the proposed method.

V. Results and Discussions
This section presents the results of state estimation using the proposed SE-NN method in smart grids. This method has been implemented at 2.20GHZ CPU, Intel Core i5 and 4GB RAM using MATLAB. The test is applied to a 33-bus distribution system as shown in Fig. 4. To assess the performance of the proposed method, two training datasets with different sizes are provided (200 and 1440 data resolutions). To validate the accuracy of the proposed method, the following steps are carried out: • We analyze the state estimation of the smart grid using two training datasets (200 and 1440 samples).
• We compare the proposed SE-NN method and the exact QBBFS method.
• To validate the accuracy of the proposed method, we calculate MSE, RMSE, MAE, MAPE, and MSSE.
• For outlining the contribution of the proposed method, we calculate the execution time for producing the SE-NN output and then compare it with the execution time of the exact one.  Fig. 5 shows a comparison between the actual voltages computed by the exact power flow method and the estimated voltage computed by the SE-NN method with data resolution of 200 for three buses (10, 25 and 32 buses). We use the per unit expression as a fraction of the base unit for simplifying the calculations. The other dataset is applied, which is a day data per minutes containing 1440 samples (24*60). Fig.  6 shows the estimated and exact voltages at 10, 25, and 32 buses. It is important to note that there is a little difference between the actual and estimated voltages for both data resolutions. This implies that the proposed method gives very accurate estimations of voltages.

B. Active Power Estimation
The same data resolutions are applied for computing active power losses. We choose three lines (1, 25 and 30) for testing the datasets. The active power losses for the three lines with 200 and 1440 data sets are shown in Fig. 7 and Fig. 8, respectively. The total active losses for all the system are also shown in Fig. 9 for 200 and 1440 data resolutions.
We notice a strong match between the losses computed by the proposed method and the exact one.

C. Reactive Power Estimation
The reactive losses are also computed for testing the accuracy of the proposed method with respect to the exact method. A comparison between the actual reactive losses computed by the QBBFS method and the estimated reactive losses computed by the SE-NN method with 200 and 1440 samples at three lines (1, 25, and 30) are shown in Fig. 10 and Fig. 11, respectively. The total reactive losses in the distribution system are shown in Fig. 12 for both data resolutions. Similar to the active power loss estimation results, the reactive power estimation results of the proposed method are very close to the exact QBBFS method.

D. Performance Comparison
To assess the validity of the proposed method, the different errors are computed for comparing the QBBFS and SE-NN outputs of voltages and re/active power loss.   For further illustrating the effectiveness and contribution of the SE-NN method, the required time for producing the output from QBBFS and SE-NN is compared. With the 200-data resolution, the QBBFS method takes longer execution time (around 16 sec) than the SE-NN method which is not exceeding 0.5 sec, as shown in Table III. For the data size of 1440, a slight change occurs in the execution time of the SE-NN (less than 0.6 sec), while the execution time of QBBFS increases dramatically (more than 115 sec), as shown in Table IV. It worth noting that the computational performance of the SE-NN method is not affected by increasing the data size as in the case of the iterative method.

VI. Conclusion
In this paper, the SE-NN method has been proposed for estimating the state of smart grid systems. The proposed method utilizes the feedforward neural network to determine the state estimation of smart grids. The existing power flow methods take very long execution time, while the proposed method estimates the state at any point in a quick and accurate way. The experiments have been carried out at two different training sets (200 and 1440 data resolution). The proposed method has been compared with the QBBFS method for validation. SE-NN has the ability to estimate the state of smart grid rapidly with high accuracy rate. The proposed method can be a helpful tool for system operators for monitoring the real-time operation of smart grids. The future work will be directed to simulating large-scale distribution systems with renewable energy sources, such as photovoltaic and wind generation systems. In addition, we will use deep learning methods to estimate the state of smart grids