## 3 Discretization  
For numerical solutions of equivalent electric and magnetic currents on the media interfaces, the Galerkin's method and the Rao-Wilton-Glisson (RWG) basis functions [16; 26] are utilized to discretize the continuous formulations Equations (18) and (19) [27]. The media interface of each layer is discretized into planar triangular elements, with \(T_{i,n}=T_{i,n}^{+}\cup T_{i,n}^{-}\) which is defined as the \(n\)th triangular element on surface \(S_{i}\), \(i=0,1,2,...,K-1\) and \(n=0,1,2,...,N_{i}\). The RWG basis function \(\mathbf{f}_{i,n}\) assigned to a pair of triangular elements on surface \(S_{i}\) is defined as:  
\[\mathbf{f}_{i,n}(\mathbf{r}^{\prime})=\left\{\begin{array}{cc}\frac{L_{i,n}}{2A_{i,n}^{ \prime}}(\mathbf{r}^{\prime}-\mathbf{p}_{i,n}^{+}),\ \mathbf{r}^{\prime}\in T_{i,n}^{+}\\ -\frac{L_{i,n}}{2A_{i,n}^{\prime}}(\mathbf{r}^{\prime}-\mathbf{p}_{i,n}^{-}),\ \mathbf{r}^{ \prime}\in T_{i,n}^{-},\\ 0\quad,\quad,\ \where \(\mathbf{p}_{i,n}^{+}\) and \(\mathbf{p}_{i,n}^{-}\) are the vertex of triangular elements \(T_{i,n}^{+}\) and \(T_{i,n}^{-}\), which share a common edge of length \(L_{i,n}\)[18]. \(A_{i,n}^{+}\) and \(A_{i,n}^{-}\) are the areas of triangular elements \(T_{i,n}^{+}\) and \(T_{i,n}^{-}\), respectively. Spatial distribution of RWG functions are shown in Figure 2.  
The unknown surface current distribution \(\mathbf{J}_{i}\) and \(\mathbf{M}_{i}\) on surface \(S_{i}\) are replaced by an expansion in the basis in numerical computations:  
\[\mathbf{J}_{i}\ =\ \sum_{n=1}^{N_{i}}\alpha_{i,n}\mathbf{f}_{i,n},\ \ \mathbf{M}_{i}\ =\ \sum_{n=1}^{N_{i}}\beta_{i,n}\mathbf{f}_{i,n} \tag{21}\]  
where \(\alpha_{i,n}\) and \(\beta_{i,n}\ (i=0,1,2,...,K-1;n=0,1,2,...,N_{i})\) are the \(n\)th complex expansion coefficients of \(\mathbf{J}_{i}\) and \(\mathbf{M}_{i}\). By substituting (21) into (18) and (19), and testing them with RWG basis, the matrix equation for media interface \(S_{i}\) can be written as  
\[\left[\mathbf{Z}_{i-1}^{i}\ \mathbf{Z}_{i}^{i}\ \mathbf{Z}_{i+1}^{i}\right]\left[ \begin{array} []{c}\mathbf{I}_{i-1}\\ \mathbf{I}_{i+1}\end{array} \right]=\mathbf{V}_{i}^{\text{EH}} \tag{22}\]  
where,  
\[\mathbf{Z}_{i-1}^{i}=\left( \begin{array}{c}\left[Z_{E,mn}^{I_{i-1}}\right]_{ N_{i}\times N_{i-1}}\ \left[Z_{E,mn}^{M_{i-1}}\right]_{N_{i}\times N_{i-1}}\\ \left[Z_{H,mn}^{I_{i-1}}\right]_{N_{i}\times N_{i-1}}\ \left[[PERSON]_{H,mn}^{M_{i-1}} \right]_{N_{i}\times N_{i-1}}\end{array} \right),\]  
\[\mathbf{Z}_{i}^{i}=\left( \begin{array}{c}\left[Z_{E,mn}^{I_{i}}\right]_{N_{i }\times N_{i}}\ \left[Z_{E,mn}^{M_{i}}\right]_{N_{i}\times N_{i}}\\ \left[[PERSON]_{H,mn}^{I_{i}}\right]_{N_{i}\times N_{i}}\ \left[[PERSON]_{H,mn}^{M_{i}} \right]_{N_{i}\times N_{i}}\end{array} \right),\]  
\[\mathbf{Z}_{i+1}^{i}=\left( \begin{array}{c}\left[[PERSON]_{E,mn}^{I_{i+1}}\right]_{ N_{i}\times N_{i+1}}\ \left[[PERSON]_{E,mn}^{M_{i+1}}\right]_{N_{i}\times N_{i+1}}\\ \left[[PERSON]_{H,mn}^{I_{i+1}}\right]_{N_{i}\times N_{i+1}}\ \left[[PERSON]_{H,mn}^{M_{i+1}} \right]_{N_{i}\times N_{i+1}}\end{array} \right),\]  
\[\left[ \begin{array}{c}\mathbf{I}_{i-1}\\ \mathbf{I}_{i+1}\end{array} \right]=\left( \begin{array}{c}\left[\alpha_{i-1,n }\right]_{N_{i-1}\times 1}\\ \left[\beta_{i-1,n}\right]_{N_{i-1}\times 1}\\ \left[\alpha_{i,n}\right]_{N_{i}\times 1}\\ \left[\beta_{i,n}\right]_{N_{i}\times 1}\\ \left[\alpha_{i+1,n}\right]_{N_{i+1}\times 1}\\ \left[\beta_{i+1,n}\right]_{N_{i+1}\times 1}\end{array} \right),\]  
Figure 2: Spatial distribution of Rao–Wilton–Glisson (RWG) functions.