## 4 Discussion
### Effect of Cooling Rate on RF Performance of Nb\({}_{3}\)Sn Cavity  
Minimizing the thermal gradient across the cavity during cooldown, particularly during the superconducting transition, is crucial for optimizing the RF performance of the cavity. Due to the thermoelectric effect, thermal currents will be generated between the Nb/Nb\({}_{3}\)Sn bimetallic structures, which in turn generates magnetic fields, which may be trapped by the cavity at \(T_{c}\), resulting in an increase in \(R_{s}\) and worse cavity performance [37; 38] Although this effect is more pronounced at high \(E_{acc}\), it is also reflected in our experiments. For NS04 cavity, at nearly the same \(P_{l}\) (0.936 W and 0.937 W), the \(E_{acc}\) and \(Q_{0}\) of the Nb\({}_{3}\)Sn cavity after temperature cycling are slightly higher than those obtained after the initial cooldown. For the NS03 cavity, the surface resistance (\(R_{s}\)), the BCS surface resistance (\(R_{BCS}\)), and the residual surface resistance (\(R_{res}\)) were calculated for three cooling conditions. The \(R_{s}\) of Nb\({}_{3}\)Sn cavity can be calculated from the experimental data using Equation (2) [33], where G is the geometric factor of the cavity, and G is 270 for 1.3 GHz TESLA cavity used in the experiment. The theoretical calculation formula of \(R_{s}\) is Equation (3) [33], and \(R_{BCS}\) is the temperature-dependent BCS resistance, which can be calculated using Equation (4) [33] for a Nb\({}_{3}\)Sn cavity, where \(f\) is the resonant frequency and \(T\) is the cavity temperature. The \(R_{BCS}\) of the Nb\({}_{3}\)Sn cavity is 2.6 n\(\Omega\) and 10 n\(\Omega\) at 4.2 K and 5 K; \(R_{res}\) is the main source of \(R_{s}\) in the experiment. After subtracting the \(R_{BCS}\), we obtain the curve of \(R_{res}\) with \(E_{acc}\), as shown in Figure 16. The controlled slow cooling near the \(T_{c}\) reduced the temperature difference over the cavity, resulting in the smaller trapped flux due to the thermal current and lower \(R_{res}\), and the performance of the cavity was significantly improved.  
Controlling the power of the heaters allows the cavity to have a smaller temperature gradient during cooling, but the current of the heaters increase the ambient magnetic field, which may in turn increase \(R_{res}\). Therefore, it is necessary to use heaters with a large resistance in order to reduce the heating current and to rationally arrange the location. In this paper, the heaters were placed in the thermal links away from the cavity instead of on the cavity to minimize the magnetic field generated by the heaters. The magnetometers showed significant increases in the ambient magnetic field when the heaters were used individually, but there was no significant change in the magnetic field when all four heaters were used at the same time, which may be due to the fact that the symmetrical placement of the heaters allowed the generated magnetic fields to cancel each other out, which also allowed the \(R_{res}\) to be significantly reduced. Overall, this arrangement and use of heaters is effective.  
\[R_{s}=\frac{G}{Q_{0}} \tag{2}\]  
\[R_{s}=R_{BCS}+R_{res} \tag{3}\]  
\[R_{BCS}=9.4\times 10^{-5}\frac{f^{2}}{T}e^{-\frac{22T_{c}}{T}} \tag{4}\]