# Voltage Distribution on Transformer Windings Subjected to Lightning Strike Using State-Space Method
## 3 Materials and Methodology
### State-Space Modeling and Analysis  
The state-space method is used to investigate the effects of a lightning strike on a single-phase transmission line and transformer windings. The equivalent circuit shown in Figure 7 is employed for transient analysis. Based on this model, equations for the inductor currents and capacitor voltages are derived using the graph theory. The general form of the state equations is expressed in (21). However, as presented in Appendix A, the state equations take the form shown in (22) for the system illustrated in Figure 7. To resolve this discrepancy, both sides of the equation were multiplied from the left by F\({}^{-1}\), resulting in (23) and (24).  
\[\dot{x}(t)=Ax(t)+Bu(t) \tag{21}\]  
\[F\dot{x}(t)=Ax(t)+Bu(t) \tag{22}\]  
\[F^{-1}F\dot{x}(t)=F^{-1}(Ax(t)+Bu(t)) \tag{23}\]  
\[\dot{x}(t)=F^{-1}Ax(t)+F^{-1}Bu(t) \tag{24}\]  
or  
\[\dot{x}(t)=A^{\prime}x(t)+B^{\prime}u(t) \tag{25}\]  
where \(A^{\prime}=F^{-1}A\) and \(B=F^{-1}B\).  
To obtain the state equations, first matrices A, B, and F are formed by incorporating the values of the circuit elements of the lightning model, transmission line, and transformer. Next, values for x\({}_{k+1}\) are calculated by updating A\({}^{\prime}\) each time using the trapezoidal integration rule. The current and voltage values of the lossy transmission line are calculated using (3) and (4). The current and voltage values in the transformer windings are determined based on capacitor voltages and inductor currents. The flow diagram of the analysis is illustrated in Figure 9.  
While creating matrices A, B, and F, it is important to consider the number of discs used in the disc structure transformer winding. The state-space equations derived from the circuits for \(N\) = 1, \(N\) = 2, and \(N\) = 3 are provided in the Appendix A, in (A1), (A2), and (A3). Here, the value of \(N\) represents the number of discs (sections) in the transformer.  
As can be seen from (A1), (A2), and (A3), the dimension of state equations obtained increases as the number of discs increases. In the case of a large number of discs, obtaining these equations will both take time and may cause errors in the creation of the equations. When these equations are examined, matrix elements and dimensions change according to a certain pattern rule. In this study, the codes for the simulation were written by including the pattern rule. Using the prepared algorithm, the matrices needed for any \(N\) value are automatically obtained. In the case that a transformer consisting of \(N\) discs is used in the circuit, F and A matrices are produced as \((2N+2)\times(2N+2)\) and the B matrix is produced as \((2N+2)\times 3\). Accordingly, for the model used in this study, the generated F and A matrices are \((22\times 22)\) dimensional, and the B matrix is \((22\times 3)\) dimensional. Integrating the pattern rule into the written codes provides ease of operation. \(C_{2N-1}\), \(C_{N+1}\), \(R_{N}\), \(L_{N}\), \(L_{s}\), \(Z_{h}\), and \(Z_{0}\) in the equations represent \(C_{g}\), \(C_{tr}\), \(R_{tr}\), \(L_{tr}\), series inductance, lightning path impedance, and characteristic impedance of the line, respectively. \(I_{h}(t)=I_{max}\) is the maximum current value in the Heidler lightning model. \(i_{L}(t)\) and \(V_{c}(t)\) are the inductor currents and capacitor voltages, respectively. The transient analysis method used in the study was developed by coding completely in MATLAB without using SIMULINK simulations.