State Estimation in Electric Power Systems Using an Approach Based on a Weighted Least Squares Non-Linear Programming Modeling

: In this work, the state estimation problem of electric power systems is represented through a mathematical programming approach. Initially, a non-linear mathematical model based on the classical method of weighted least squares is proposed to solve the state estimation problem for comparative purposes. Due to the inherent limitations that this classical model presents when dealing with errors in the set of measurements, a new mathematical model is proposed that can be used within an iterative procedure to reduce the impact of measurement errors on the estimated results. Several tests on a didactic 5-bus power system and IEEE benchmark power test systems showed the effectiveness of the proposed approach which achieved better results than the proposed classical state estimation model. The non-linear programming models proposed in this paper are implemented in the mathematical modeling language AMPL. Additionally, to validate the results of the proposed methodologies, the power system operation points are compared with the results obtained using the Matpower simulation package. The results allowed concluding that the proposed mathematical models can be successfully applied to perform state estimation studies in power systems.


Introduction
Determining the operating point of an Electric Power System (EPS) requires the knowledge of its state variables, which are the magnitudes and angles of the nodal voltages. From this information, it is possible to calculate the active and reactive power flows through the transmission lines, the net power injections in all buses, as well as the power losses of the EPS, among other information. From the determination of the operation point of an EPS, further studies and procedures can be carried out, such as control and security actions, contingency analysis, expansion planning, system loading studies, voltage regulation analysis and reliability assessment, among others [1,2]. One of the available tools to determine the steady state operating point of an EPS is the state estimator. State estimation plays and important role in modern power systems, allowing the system operator to make informed decisions that directly impacts the security and reliability of the network. The state estimation can be defined as a procedure that converts redundant meter readings, as well as other available information, into an estimate of the state of the EPS [3]. This information is of utmost importance for both system operators and planners. Despite the extensive research work on this topic, there are still areas of research that remain almost unexplored and are susceptible to provide new insights.
Generally, state estimators are used in real time applications to calculate the state variables, using the information coming from metering devices installed within the EPS. Such information includes voltages and power injections in some buses and power flows in some transmission lines. Additionally, unlike other studies used to determine the operating point of an EPS, in state estimation, it is possible to calculate the operating point from several measurements greater than the minimum required; also, it is possible to carry out a procedure of error handling that allows evaluating whether there are inconsistencies in the input data [2,4,5].
Several studies have been reported in the specialized literature regarding the state estimation problem. In [6], the authors propose a Semidefinite Programming (SDP) formulation to approach the state estimation problem. In this case, a convex semidefinite relaxation is carried out which renders the state estimation efficiently solvable. In [7], the dynamic state estimation (DSE) problem is approached from a statistical decision theory point of view; therefore, the initial state of the system is regarded as deterministic and unknown. DSE is also studied in [8]. In this case, the authors discuss the advantages of DSE as compared to the static state case, as well as implementation differences between the two of them. In [9], the authors propose a data-driven robust state estimation method through off-line learning and on-line matching to solve the estate estimation problem in EPS. On the other hand, robust state estimators have been proposed as an important alternative to reduce the effects of measurement errors. In [10,11] a comparison between different robust state estimators is performed.
Traditionally, state estimation has been solved through the Weighted Least Squares (WLS) method. This method is characterized using a nodal formulation, in which the operation point of the EPS is obtained iteratively by solving a set of non-linear equations [12,13]. Although the iterative procedure of the WLS method has been widely used in state estimation studies, there are alternative ways for solving this problem [14,15].
Some of the previous works claim that the classical WLS method may present certain difficulties when there are errors in the measurements. Bearing this in mind, this work proposes a novel strategy that allows using a non-linear programming model of the WLS method to reduce the impact of bad measurements on the estimated results; therefore, contributing to fill the research gap concerning the effectiveness of the solution to the state estimation problem through the WLS method. This solution approach allows the addition of new variables and operational constraints in the formulation, which cannot be considered in the classical WLS method. Additionally, representing the state estimation as a mathematical optimization problem has the advantage of its easy implementation and solution through mathematical optimization software widely used in studies and research in EPS. Furthermore, this approach to solve the state estimation problem can be used for solving other optimization problems of greater mathematical complexity, such as the optimal location of phasor measurement units (PMUs) and observability analyses [16][17][18]. Accordingly, it is important to represent the state estimation problem through mathematical optimization models. Although this possibility has not been widely explored as shown in [12], recent studies show that various mathematical programming methods have been proposed to solve the state estimation problem with promising results [10,19].
Based on the aforementioned facts, two strategies are proposed in this work to determine the solution of the state estimation problem in EPS:

•
The first strategy consists of a mathematical programming approach labeled as classical non-linear programming model (classical NLPM). Such model emulates the formulation and iterative process of the WLS state estimator. • The second strategy is a new mathematical model based on some modifications of the classical NLPM. This mathematical model is used within a new state estimation procedure that allows reducing the negative impact on the estimated results of conventional state estimation studies due to errors presented in the set of measurements. This strategy is labeled as New NLPM.
To summarize, the main features and contributions of this paper are as follows: (i) it presents a novel approach to carry out the state estimation process in electric power systems based on non-linear programming modeling; (ii) the proposed approach is able to reduce the impact caused by the presence of multiple errors in the set of measurements, without using additional statistical error treatment procedures; (iii) the proposed methodology outperforms the results obtained with the classical WLS estimator.
The models proposed in this work were implemented in AMPL mathematical programming language. The first validation of results is explained in detail using a didactic 5-bus power system. Results obtained with IEEE 14, 30, 57 and 118 bus test systems are also presented and discussed. The operating point is calculated both with and without adding errors in the set of measurements. The results estimated by the mathematical models are validated through the comparison of the operating points calculated by Matpower [20]. The results obtained show that the proposed mathematical models can be successfully applied to carry out state estimation studies in EPS.

State Estimation in EPS
State estimation in EPS is a unique solution problem that consists of obtaining the values of complex nodal voltages, represented by their magnitude and angle (V, θ). These values are obtained from the data of different metering devices within the EPS. The solution of the state estimation problem is commonly obtained through the WLS method [1,21,22]. This method aims to determine the minimum weighted root error represented by Equation (1).
In ideal conditions, the solution to the problem consists of finding the values ofx such that J(x) = 0. However, in real-life applications, it is not possible to satisfy this condition due to several factors that include the limited precision and calibration problems of the meters; as well as noise presented in the SCADA data acquisition system, among others [1,2].
In general terms, to determine thex values that satisfy Equation (1), it is necessary to execute the iterative procedure presented in Figure 1. As can be seen in Figure 1, after estimating the values ofx, a statistical error treatment procedure is performed. This is done with the aim of debugging eventual errors that could be presented in the measurements, allowing the results obtained by the state estimator to be more reliable. Despite the importance of error handling in state estimation, this issue is beyond the scope of the present research and can be consulted in [4,23].

Representation of the State Estimation Problem as a Mathematical Programming Model
In this section, it is shown that the state estimation problem can be represented as an equivalent mathematical programming model. The main advantage of this approach lies on the fact that with some modifications the impact caused by errors in the set of measurements can be significantly reduced. To represent the state estimation problem as a mathematical programming model, it is necessary to define the set of decision variables, the objective function and the mathematical constraints of the model. In this work, two different models for state estimation are proposed and described below.

Classical NLPM
Based on the formulation of the WLS method presented in Section 2 and the iterative procedure illustrated in Figure 1, it was found that a classical NLPM can be implemented to solve the state estimation problem as given by Equations (2) and (3).
Equation (2) represents the function of the WLS method and the constraint given by (3) corresponds to the residual of the measurements calculated as the difference between the measured value z mij and the calculated value of h(x) mij . Please note that to compute h(x) mij , the type of measurement (m) and its location (ij) must be considered, as shown in Equations (4) and (5).
• Active and reactive power injection measurements: In this case, the elements of the Y BUS matrix in (4) and (5) are calculated using Equations (6) to (9). Please note that both conventional and phase-shifting transformers are taken into account.
• Active power flow measurements: • Reactive power flow measurements: • Voltage measurements: By solving the mathematical model given by (2)-(14), it is possible to obtain the values of V i and θ i in all buses of the EPS; as well as the value of J(x) and the residuals r mij of each measurement. In general terms, the classic NLPM proposed in this section has the main disadvantage of not considering the error treatment procedure, which implies that the estimated results may be directly affected by the presence of errors in the set of measurements.

New NLPM
The effectiveness of the WLS method is affected when there are measurement errors. To overcome this issue, some modifications must be implemented in the classical NLPM. According to (3), h(x) mij cannot be equal to the parameter z mij when there are errors in ΩM. Clearly this condition prevents obtaining values of r mij ≈ 0. Therefore, for solving this problem, the mathematical model given by Equations (15) s.t.
where the variable ∆z mij in (16) represents the maximum deviation allowed for each z mij ; also, the parameter p in Equation (17) corresponds to the percentage of z mij that determines the range of allowed values for ∆z mij (where p = 0 represents an ideal meter). Please note that the inclusion of the variable ∆z mij in the model would allow considering the following situations when reaching convergence: • Neglect the presence of errors in ΩM: For a specific measurement z mij ≈ h(x) mij , ∆z mij ≈ 0 and r mij ≈ 0, and the objective function J(x) ≈ 0. • Consider the presence of errors in ΩM: For a specific measurement z mij = h(x) mij , ∆z mij = 0 and r mij = 0, and the objective function J(x) > 0.
In the same way as the classic NLPM, it is evident that the previous mathematical model does not solve the problem by itself when there are errors in ΩM. Thus, an it-erative procedure is proposed in this work where the measurements are updated using Equation (18).
The iterative procedure that allows modifying the values of z mij is presented in Figure 2, so that it is possible to obtain values of J(x) ≈ 0. The proposed algorithm allows reducing the impact of errors in measurements without using additional statistical error treatment procedures.

Numerical Results
In this section, the simulations carried out for evaluating the performance of the proposed mathematical models are presented. First, a didactic 5-bus test system is used as a reference to explain the validation of results in detail. Two scenarios are analyzed; one without errors in the set of measurements and another with multiple errors in the database. Subsequently, the same procedure is applied on the IEEE 14, 30, 57 and 118 bus test systems. A comparison is carried out with the classical and new NLPM. It is worth mentioning that the implementation of other state estimation methodologies for comparison purposes is out of the scope of this paper. The proposed mathematical models were implemented in the student version of the mathematical modeling language AMPL [24] and solved by Knitro solver [25]. Simulations were performed on a personal computer with an Intel(R) Core (TM) i7 processor and 8 GB of RAM.

Preliminary Considerations
Preliminary power flow studies are required to calculate the operating point of the test systems and select the set of measurements used in the state estimation studies. Then, the results obtained by Matpower are used as a validation parameter of the results obtained by the proposed models. On the other hand, taking into account the concept of redundancy level (RL) and its importance in studies of state estimation [26], a RL ≈ 2 is considered in this work. In this way, a set of measurements is strategically selected from the power flow results to avoid observability problems.
Finally, it is assumed that voltage, power flow and power injection measurements have a Gaussian distribution and a standard deviation of 0.004, 0.008 and 0.01, respectively, according to the state estimation studies presented in [19,22].

Results with a 5-Bus Didactic Power System
The validation procedure of the proposed mathematical models is explained in detail below using the EPS available in [27] as reference.

No Bad Data in the Measurement Set
The operating point obtained with Matpower and through the proposed mathematical models is presented in Tables 1 and 2.  The previous results show that the estimated errors can be neglected and, therefore, the operating point has been correctly calculated through the proposed mathematical models.

Multiple Bad Data Measurements in the Measurement Set
To represent the presence of errors in the database, the set of measurements is modified by adding random errors between 0.1% and 5%, applying Equation (19) for each measurement.
Under these conditions, the EPS operating point is calculated as shown in Tables 3 and 4. Table 3. Estimated values ofx considering bad data measurements.  The previous results show that the addition of errors in the set of measurements has a direct impact on the estimated results. This impact can be measured individually, computing the absolute error of bus voltages as shown in Figure 3, taking the power flow results as a reference. The maximum calculated absolute errors correspond to 0.31% in the case of voltage modules (or magnitudes) and 0.65% for their corresponding angles. On the other hand, the impact of the errors can be measured by calculating the total absolute errors of the modules of voltages ( V ), the phase angles ( θ ), the active power losses ( P L ) and the reactive power losses ( Q L ), as shown in Figure 4.  Figures 3 and 4 show that the results of the New NLPM are better than those obtained through the classical NLPM, since the absolute errors of the power losses, voltage magnitudes and angles were reduced to 0.69%, 0.34% and 0.12%, respectively.

IEEE Power Systems
The proposed mathematical models were validated using as reference the operating points of the IEEE 14, 30, 57 and 118 bus test systems available in [28].

No Bad Data in the Measurement Set
The values of the power losses calculated with Matpower and the proposed mathematical models are presented in Table 5. According to the results of power losses presented in Table 5, the estimated errors can be neglected since the maximum absolute error is 0.0171% for the classical NLPM and 0.0154% for the New NLPM.

Multiple Bad Data Measurements in the Measurement Set
After adding errors to the set of measurements, the IEEE test systems operating point is calculated. The power loss values are shown in Table 6. The total absolute errors of voltage magnitudes ( V ), phase angles ( θ ), active power losses ( P L ) and reactive power losses ( Q L ), are presented for each test system in Figure 5.
It can be observed in Figure 5 that adding errors in the set of measurements has a more significant impact on the phase angles than on the other variables under observation. Additionally note that there is a lower absolute error when using the New NLPM. The maximum absolute errors of the voltages for each test system are presented in Figure 6. The results show that the New NLPM is more accurate in determining the operation points of the IEEE systems used in the simulations.

Conclusions
This paper presented a novel approach to the state estimation problem in power systems using non-linear programming modeling. Two models were developed and analyzed: one based on the WLS method that is implemented for comparative purposes, and a second one that introduces some modifications to the classic approach and can be used within an iterative procedure to reduce the impact of measurement errors.
The tests carried out on a didactic 5-bus power system and on benchmark test systems (IEEE 14, 30, 57, and 118 bus test systems) demonstrated the advantages of representing the state estimation as a mathematical optimization problem and allowed to show the effectiveness and applicability of the proposed approach. Based on the results obtained, it was found that the proposed approach satisfactorily determines the operating point of any electric power system.
It was shown that it is possible to develop new strategies to solve the error treatment problem, such as the one proposed in this paper, which reduces the impact of errors in the set of measurements without resorting to conventional error treatment procedures.
The new approach to the state estimation problem in EPS opens the door to new applications related to the state estimation problem. For example, error treatment procedures may be incorporated, and studies could be carried out considering different types of errors in the set of measurements. development of this work.

Conflicts of Interest:
The authors declare no conflict of interest.

Nomenclature
The following abbreviations are used in this manuscript: Sets: ΩM Set of system's measurements. ΩB Set of system's buses. ΩL Set of system's transmission lines. Parameters: g ij Line conductance at node i and j. b ij Line susceptance at node i and j. b sh ij Line shunt susceptance at node i and j. b sh i Shunt susceptance at node i. t ij Transformer tap ratio at node i and j.
ϕ ij Phase-shifting transformer angle at node i and j. G ii , G ij Conductance of the Ybus matrix. B ii , B ij Susceptance of the Ybus matrix. z mij Measurement m located at node i and j.

W mij
Weight of the measurement m at node i and j. p Allowed mismatch percentage. Tolerance of the iterative state estimator procedure. e Random errors added in measurement set. Variables: x State variables of the system.

J(x)
Least squares function. r mij Residual value of the measurement m located at node i and j. h mij (x) Non-linear measurement functions. ∆z mij Measurement mismatch. V i , θ i Voltage module and phase angle at node i. P ij , P ji Active power flow of branch ij. Q ij , Q ji Reactive power flow of branch ij. P L , Q L Total active and reactive power loss.