## 4 Algorithm Validation
### Validation by Measurement
In order to calculate SE analytically, the separate parts of the proposed algorithm were implemented in GNU Octave. According to the algorithm, in case 1, \(Z_{ap}\) was determined, using Flowchart 2, based on Equation (13) at \(X=a/2\) and \(Y=b/2\). The equivalent circuit transformation was performed using Flowchart 5, taking into account only the \(TE_{10}\) mode. In case 2, \(Z_{ap}\) was defined, as in case 1, but the circuit transformation was performed according to Flowchart 6, calculating \(Z_{ap}\) using (35). In case 3, the circuit was transformed, as in case 1, and Equation (23) was used to obtain \(Z_{ap}\) at \(C^{\prime}\approx 62.8\) pF/m and C \(\approx 31.9\) pF/m. When we performed indirect measurements and calculations using the proposed algorithm, the frequency dependencies of the SE were determined at a frequency resolution of about 1 MHz. For the measurement in the anechoic chamber, the frequency resolution was different for all three cases, but it was not less than 20 MHz. Additionally, in the resonance region, the number of frequency points was deliberately increased in order to determine the level of SE more accurately. To confirm the validity of the proposed algorithm, the average values of the absolute error modulus \(\left|\Delta\right|\) were estimated. The calculation of \(\left|\Delta\right|\) took into account all obtained SE values, including those in the resonance range. Frequency error (difference between resonances in SE frequency dependencies) was not taken into account. The \(\left|\Delta\right|\) values were calculated as:  
\[\left|\Delta\right|=\frac{\sum_{i=1}^{T_{f}}\left|\frac{\text{SE}^{T}(f_{i})- \text{SE}^{A}(f_{i})}{T_{f}}\right|}{T_{f}} \tag{38}\]  
where;\(f_{i}\) is some frequency point, indices \(T\) and \(A\) denote \"true\" (measured) and \"observed\" (calculated by the algorithm) values of the SE, and \(T_{f}\) is the number of points in the frequency dependence of \"true\" SE values. Figure 20 shows the results of the analytical calculation and measurements for case 1 (for an empty enclosure with an 80 \(\times\) 80 mm\({}^{2}\) aperture). First of all, it can be seen that the enclosure SE is complex and can take positive and negative values when the frequency is changed. Negative SE occurs when coherent waves with the same phase are combined inside the enclosure, leading to cavity resonances. These resonances are a serious problem for electromagnetic compatibility of electronic equipment, as, at their frequencies, the shielding enclosure can amplify, rather than attenuate, interferences. Figure 20 also shows that the SE frequency dependencies obtained by different approaches are quite similar. The value of \(\left|\Delta\right|\) between the results of the generalized algorithm and the indirect measurement was 5.7 dB. When comparing the results of the analytical calculation and the IEEE STD 299.1 measurement, a small difference (not more than 10 MHz) can be seen between the resonance frequencies. This difference may be caused by inaccuracy in the enclosure manufacture and the influence of the monopole antenna used in the measurement. Despite this, \(\left|\Delta\right|=5.2\) dB. Figure 21 illustrates the SE frequency dependencies for cases 2 and 3, obtained by measurements and the proposed algorithm. It can be seen that, in both cases, the measured and calculated dependencies are close. The \(\left|\Delta\right|\) values were 5.6 dB and 4.2 dB for cases 2 and 3, respectively. Thus, the results shown in Figures 20 and 21 confirm that the generalized algorithm can evaluate the SE with acceptable accuracy.