# A Method of Discriminating Between Power Swings and Faults Based on Principal Component Analysis
## 3 Power Swing Blocking Method Using PCA
### Basic Principle
\(\overline{\mathbf{X}}\overline{\mathbf{X}}^{\text{T}}\), used in PCA calculation process, can be expressed as follows:  
\[\overline{\mathbf{X}}\overline{\mathbf{X}}^{\text{T}}=\mathbf{X}\overline{\mathbf{X}}^{\text {T}}= \begin{bmatrix}\mathbf{x}_{\text{A}}^{\text{T}}\mathbf{x}_{\text{A}}&\mathbf{x}_{ \text{A}}^{\text{T}}\mathbf{x}_{\text{B}}&\mathbf{x}_{\text{A}}^{\text{T}}\mathbf{x}_{\text {C}}\\ \mathbf{x}_{\text{B}}^{\text{T}}\mathbf{x}_{\text{A}}&\mathbf{x}_{\text{B}}^{\text{T}}\mathbf{x} _{\text{B}}&\mathbf{x}_{\text{B}}^{\text{T}}\mathbf{x}_{\text{C}}\\ \mathbf{x}_{\text{C}}^{\text{T}}\mathbf{x}_{\text{A}}&\mathbf{x}_{\text{C}}^{\text{T}}\mathbf{x} _{\text{B}}&\mathbf{x}_{\text{C}}^{\text{T}}\mathbf{x}_{\text{C}}\end{bmatrix}  \tag{11}\]According to (8)-(10), \(\mathbf{X}\mathbf{X}^{\rm T}\) is a symmetric matrix, and \(x_{\rm A}^{\rm T}x_{\rm A}=x_{\rm B}^{\rm T}x_{\rm B}=x_{\rm C}^{\rm T}x_{\rm C}\), where \(x_{\rm A}^{\rm T}x_{\rm A}\) can be calculated as follows:  
\[x_{\rm A}^{\rm T}x_{\rm A}=\frac{M^{2}}{2}\sum_{k=0}^{N-1}\left[\cos(2\omega_{ 0}k\Delta t)+1\right] \tag{12}\]  
Since the value of \(M^{2}/2\sum_{k=0}^{N-1}\cos(2\omega_{0}k\Delta t)\) can be regarded as 0, it is found that \(x_{\rm A}^{\rm T}x_{\rm A}\) is equal to \(NM^{2}/2\). Similarly, \(x_{\rm A}^{\rm T}x_{\rm B}\), \(x_{\rm A}^{\rm T}x_{\rm C}\), and \(x_{\rm B}^{\rm T}x_{\rm C}\) can be calculated as follows:  
\[x_{\rm A}^{\rm T}x_{\rm B}=x_{\rm A}^{\rm T}x_{\rm C}=x_{\rm B}^{\rm T}x_{\rm C }=-NM^{2}/4 \tag{13}\]  
Therefore, the eigenvalues of \(\mathbf{M}\) are \(\lambda_{1,2}=3/2\) and \(\lambda_{3}=0\). The eigenvectors corresponding to \(\lambda_{1,2}\) are \(\xi_{1}=\sqrt{2}/2[-1,0,1]^{\rm T}\) and \(\xi_{2}=\sqrt{6}/6[-1,2,-1]^{\rm T}\), respectively. Vectors \(\xi_{1}\) and \(\xi_{2}\) are the vector basis required for constructing a new two-dimensional coordinate system. Using the directions of \(\xi_{1}\) and \(\xi_{2}\), respectively, as the directions of the X and Y axes, a new coordinate system, denoted by \(XOY_{\rm U}\), is established. Define matrix \(\mathbf{P}\) as follows:  
\[\mathbf{P}= \begin{bmatrix}\xi_{1}^{\rm T}\\ \xi_{2}^{\rm T}\end{bmatrix} = \begin{bmatrix}-\frac{\sqrt{2}}{2}&0&\frac{\sqrt{2 }}{2}\\ -\frac{\sqrt{6}}{6}&\frac{\sqrt{6}}{3}&-\frac{\sqrt{6}}{6}\end{bmatrix}  \tag{14}\]  
The corresponding coordinates of the three-dimensional points, whose coordinate values are represented by the column vectors of matrix \(\mathbf{X}\) shown in (7), in \(XOY_{\rm U}\) can be calculated as follows:  
\[ \begin{bmatrix}\mathbf{x}_{\rm U}\\ \mathbf{y}_{\rm U}\end{bmatrix} =\mathbf{P}\mathbf{X} \tag{15}\]  
where \(\mathbf{x}_{\rm U}\) and \(\mathbf{y}_{\rm U}\) are \(N\)th-order row vectors, and the expressions for each element of vector \(\mathbf{x}_{\rm U}\) and \(\mathbf{y}_{\rm U}\) are as follows:  
\[ \begin{cases}x_{\rm U}(k)=\frac{\sqrt{6}}{2}M\sin\Bigl{(}\omega_{0}k\Delta t +\frac{4}{3}\pi\Bigr{)}\\ y_{\rm U}(k)=\frac{\sqrt{6}}{2}M\cos\Bigl{(}\omega_{0}k\Delta t+\frac{4}{3}\pi \Bigr{)}\end{cases}  \tag{16}\]  
where \(k=0,1,2,\ldots,N-1\). It is found from (16) that during normal operation, the distance from the coordinate point to the coordinate origin in \(XOY_{\rm U}\) remains unchanged. Moreover, the distance is proportional to the amplitude of the voltage. Considering the fact that the amplitude of the voltage will become small within a short time after a three-phase shorting fault occurs, but will change slowly during a power swing, the distance mentioned above will become small in a short period of time after a three-phase fault occurs, but will change slowly during a power swing. The projection results shown in Figure 2 also confirm the analysis. In this figure, the blue line represents normal operation conditions and the red line represents disturbance conditions. Figure 2a shows the results of a three-phase shorting fault, and Figure 2b shows the results of a power swing with an oscillation frequency of 5 Hz.