# Intelligent Measurement of Coal Moisture Based on Microwave Spectrum via Distance-Weighted kNN
## 2 Materials and Methods  
### Measurement Principle  
The polarization phenomenon of the SUT dielectric can change the dielectric properties of the SUT and the energy of the applied electromagnetic field [27]. The SUT composition can be obtained by measuring changes in the mentioned values. The interaction diagram of the SUT and electromagnetic waves is presented in Figure 1.  
As shown in Figure 1a, it is assumed that the electromagnetic waves propagate through the air medium and are perpendicularly incident to the interface (\(s=0\)) of the SUT with a thickness of \(L\). Part of the incident waves are reflected into the air medium, and the remaining part is transmitted through the interface (\(s=0\)) to the inside of the SUT. The wave transmitted into the SUT can also be reflected or transmitted to the interface (\(s=L\)). This propagation channel is equivalent to a two-port network, as shown in Figure 1b. Thus, part of the electromagnetic waves incident to the SUT surface will be reflected on port 1 and indicated by the reflection coefficient (\(S_{11}\)); yet, the other part will pass through the SUT and be transmitted to port 2, which is indicated by the transmission coefficient (\(S_{21}\)). The reflection and transmission coefficients are respectively expressed as:  
\[S_{11}=\frac{\Gamma(1-T^{2})}{1-\Gamma^{2}T^{2}}, \tag{1}\]  
\[S_{21}=\frac{T(1-\Gamma^{2})}{1-\Gamma^{2}T^{2}}, \tag{2}\]  
where \(\Gamma\) is the reflection coefficient at the SUT interface (\(s=0\)), and \(T\) is the transmission coefficient inside the SUT, which is also called the propagation factor.  
The Nicolson-Ross-Weir method [28; 29] gives the key equations for determining the relative permittivity \(\varepsilon_{r}\) and magnetic permeability \(\mu_{r}\), as follows:  
\[\mu_{r}=\frac{1+\Gamma}{\Lambda(1-\Gamma)\sqrt{\frac{1}{\lambda_{0}^{2}}- \frac{1}{\lambda_{c}^{2}}}}, \tag{3}\]  
\[\varepsilon_{r}=\frac{\lambda_{0}^{2}}{\mu_{r}}\bigg{(}\frac{1}{\lambda_{c}^ {2}}+\frac{1}{\Lambda}\bigg{)}, \tag{4}\]  
\[\frac{1}{\Lambda}=-\bigg{[}\frac{1}{2\pi L}\ln(\frac{1}{T})\bigg{]}^{2}, \tag{5}\]  
where \(\lambda_{0}\) and \(\lambda_{c}\) are the wavelengths corresponding to the free-space propagation frequency and the cutoff frequency, respectively.  
By substituting Equations (1) and (2) into Equations (3)-(5), the relative permittivity of the SUT (non-magnetic medium) can be obtained by:  
\[\varepsilon_{r}=\bigg{(}\frac{1-\Gamma}{1+\Gamma}\bigg{)}^{2}=\Big{[}\Big{(}j \frac{c}{\omega L}\Big{)}\ln(T)\Big{]}^{2}, \tag{6}\]  
Figure 1: The interaction diagram of the SUT and electromagnetic waves. (**a**) The schematic diagram of the interaction; (**b**) The propagation channel is equivalent to a two-port network.  
where \(c\) is the free space velocity and \(\omega\) is the angular frequency.  
The \(S_{11}\) and \(S_{21}\) are generally expressed in a complex form consisting of real and imaginary parts. Therefore, the dielectric constant of the SUT can also be expressed as a complex number, which is called complex relative permittivity (\(\epsilon_{r}=\epsilon_{r}^{\prime}-je_{r}^{\prime\prime}\)).