*1.1. Power System State Estimation*

The power system state estimation (PSSE) technique is used for the detection of bad data received in the control room. All the received measurements are placed in a vector, which is denoted by **z**. The measurement vector contains the real forward powers, reactive forward powers, real backward powers, reactive backward powers, real powers injected into all the buses, reactive powers injected into all buses, voltage magnitudes, and voltage angles [20–23]. The measurement vector **z** and the state variable **x** have the following relationship:

$$\mathbf{z} = \mathbf{h}(\mathbf{x}) + \mathbf{e} \tag{1}$$

**h(x)** represents the non-linear function that gives the dependencies between measured values and the state variables, and it can be found using the power system topology. **e** represents random noise of Gaussian form with a zero mean and some known covariance.

In the case of AC state estimation (SE), the weighted least-squares method is adopted for solving the state variables with an objective function [24,25]:

$$\min F(\mathbf{x}) = \left(\mathbf{z} - \mathbf{h}(\mathbf{x})\right)^{\mathrm{T}} \mathbf{W}(\mathbf{z} - \mathbf{h}(\mathbf{x})) \tag{2}$$

where **W** is the weighting matrix, as given in [26]. This is an unconstrained optimization problem whose first-order optimality condition is given by:

$$\left.\frac{\partial F(\mathbf{x})}{\partial \mathbf{x}}\right|\_{\mathbf{x}=\hat{\mathbf{x}}} = -2\mathbf{H}^{\mathrm{T}}(\hat{\mathbf{x}})\mathbf{W}(\mathbf{z} - \mathbf{h}(\hat{\mathbf{x}})) = 0\tag{3}$$

Here, **H** represents the Jacobian matrix and **x**ˆ is taken as the vector of the estimated states. An iterative process can be used for solving this non-linear equation [27].

The non-linear function can be approximated by a linear function by using some DC assumptions. Those assumptions are given as follows:


$$\mathbf{z} = \mathbf{H}\mathbf{x} + \mathbf{e} \tag{4}$$

**H** is known as the Jacobian matrix of the power system topology. If the measurement vector has *m* values and the number of states is *n*, then the Jacobian matrix **H** will have an order of "*m* × *n*". In (4), **x** contains the bus voltage angles. **z** contains the values of active powers flowing through the transmission lines and injected into all the buses.

The Jacobian matrix **H** is constant during each iteration of the linearization process. In the DC power flow model (4), the Jacobian matrix **H** is constant throughout. Equation (4) will be valid for each iteration of the linearization model (3). Therefore, the same notation is adopted for both the linearized model (3) and the DC power flow model (4).

The weighted least square (WLS) approach is used for estimating the states. In the WLS algorithm, the estimated state **x**ˆ can be written as follows [19,22]:

$$
\hat{\mathbf{x}} = \left(\mathbf{H}^T \mathbf{R}^{-1} \mathbf{H}\right)^{-1} \mathbf{H}^T \mathbf{R}^{-1} \mathbf{z} \tag{5}
$$

**R** represents the covariance matrix of **e**. The estimated states, as well as the measurement vector **z**, are used for the calculation of the measurement residue.

$$
\mathbf{r} = \mathbf{z} - \mathbf{H}\hat{\mathbf{x}}\tag{6}
$$

Then, the normalized *L*2-norm is calculated for **r**.

$$L(\mathbf{r}) = \mathbf{r}^{\mathrm{T}} \mathbf{R}^{-1} \mathbf{r} \tag{7}$$

A comparison of *L*(**r**) is done with the threshold τ for finding the presence of bad data. The *X*2—test is used for the determination of the threshold τ.

$$\mathbf{r}^{\mathrm{T}}\mathbf{R}^{-1}\mathbf{r} \le \mathbf{r}$$

Bad data do not exist if the condition in (8) is satisfied. Similarly, when the condition is not satisfied, bad data exist in the system.
