## Materials and Methods
### Thevenin Equivalent Circuit  
The virtual buses in the power sending and load parts are constructed with Equations (1)-(6) using the phasor measurement data. Figure 4 shows the TE circuit model of the electric power system. As shown in Figure 4, \(\overline{Z_{S}}\) and \(\overline{Z_{T}}\) are the shunt and series impedances of the transmission line in the TE form, respectively. It is necessary to calculate the \(\overline{Z_{g}}\) impedance of the generators and transformers and the \(\overline{E_{g}}\) in the generation part. Further, it is extremely important to calculate \(\overline{Z_{g}}\) and \(\overline{E_{g}}\) because they could affect the TE impedance. Previously, for calculating those values, offline steady-state data were used. The generation part was decided; subsequently, \(\overline{Z_{g}}\) and \(\overline{E_{g}}\) were obtained from the \(P\) and \(Q\) injections. Subsequently, the average voltage of the generator is obtained. These values are inaccurate and difficult to apply for a real-time situation. Hence, a new concept to calculate \(\overline{Z_{g}}\) and \(\overline{E_{g}}\) is proposed herein. In most power systems, the severe contingencies that cause the voltage instability arising from a reactive power imbalance occur in the load part instead of in the generation part. Therefore, it is possible to assume that \(\overline{Z_{g}}\) and \(\overline{E_{g}}\) are not varying quickly when the power system suffers events such as sudden changes in voltage magnitude and load demand. Thus, they can be regarded as the same at times \(t\) and \(t^{\prime}\), as follows:  
\[\overline{Z_{g}}=\overline{Z_{g}}^{\prime} \tag{7}\]  
\[\overline{E_{g}}=\overline{E_{g}}^{\prime}. \tag{8}\]  
Using [PERSON]'s voltage law (KVL), the equations for \(\overline{Z_{g}}\) and \(\overline{E_{g}}\) can be expressed as follows:  
\[\frac{\overline{E_{g}}-\overline{V_{s}}}{\overline{Z_{g}}}=\overline{I_{s}} \tag{9}\]  
\[\frac{\overline{E_{g}}-\overline{V_{s}}^{\prime}}{\overline{Z_{g}}}=\overline {I_{s}}^{\prime}. \tag{10}\]  
Figure 4: Thevenin equivalent circuit model of power system. By eliminating \(\overline{E_{g}}\) from Equations (9) and (10), the simultaneous equations can be solved and Equation (11) is obtained. \[\overline{Z_{g}}=\frac{\overline{V_{s}}-\overline{V_{s}}^{\prime}}{\overline{I_{ s}^{\prime}}-\overline{I_{s}}} \tag{11}\]  
where \(\overline{V_{s}}\) and \(\overline{I_{s}}\) are the load voltage and current phasor measured at time \(t\), respectively, while \(\overline{V_{s}}^{\prime}\) and \(\overline{I_{s}}^{\prime}\) are those measured at time \(t^{\prime}\), respectively. The equivalent voltage source can be derived as  
\[\overline{E_{g}}=\overline{Z_{g}}\ \overline{I_{s}}+\overline{V_{s}}. \tag{12}\]  
The equations above assume that the TE does not vary between times \(t\) and \(t^{\prime}\); they are implemented over time to track the impedances. From Equation (11), if no changes occur in \(\overline{V_{s}}\) and \(\overline{I_{s}}\), \(\overline{Z_{g}}\) cannot be calculated. Events that change the voltage and current by more than some threshold should occur. In addition, oscillation is terminated because logic is required to determine the time \(t^{\prime}\) when transient stability does not affect the voltage and current. This concept is represented in Figure 5.  
As shown in Figure 5, if the bus voltage is varying significantly or oscillating for a long time, it is difficult to determine the \(t^{\prime}\). The primary objective is to determine the normal condition time \(t\) and obtaining the appropriate time \(t^{\prime}\). When the data are measured, the occurrence of an event is verified. If no event occurs, then the present is the time t. If an event is occurring, wait until the oscillations of the phasors are less than the threshold \(\varepsilon\) such that the time \(t^{\prime}\). Figure 6 represents the framework for deciding the \(t^{\prime}\). After the phasor data are obtained at times \(t\) and \(t^{\prime}\), the TE impedance is calculated.