## 2 Theoretical Analysis  
A large amount of positive and negative magnetic charge gathers around defects and residual stress boundaries. From the theory of electromagnetism, for a magnetic dipole with magnetic moment \(m\), the magnetic field generated at \(r\) is [27]  
\[H=\frac{m}{r^{3}}\ (2e_{r}\cos\theta+e_{\theta}\sin\theta) \tag{1}\]  
where \(e_{r}\) and \(e_{\theta}\) are the basis vectors of the vector diameter \(r\) and the polar angle \(\theta\) in spherical coordinates, respectively. According to the vector operation rule, the absolute value of the combined vector is the sum of the squares of the basis vectors. Therefore, the absolute value of \(H\) is  
\[H=\frac{m}{r^{3}}\Big{(}1+3\ \cos^{2}\ \theta\Big{)}^{\frac{1}{2}} \tag{2}\]  
Since the defect is buried inside the specimen and the magnetic signal of the residual stress is scattered outward from inside the weld, the distance of the defect and the residual stress-affected zone from the specified signal location is set to \(R\), the adequate thickness of the defect and the residual stress-affected zone is \(dR\), and the number of magnetic charge particles carried within the adequate thickness is \(dn\); therefore, the mean value of the magnetic field generated on the detection probe is [28]  
\[\overline{H_{R}^{2}}=dn*\overline{h^{2}}=dn*\frac{m^{2}}{R^{6}}\int_{0}^{ \frac{\pi}{2}}(1+3\ \cos^{2}\ \theta)\sin\theta d\theta=2 dn\frac{m^{2}}{R^{6}} \tag{3}\]  
If the number of particles per unit volume in the aggregate is \(n_{0}\), then \(dn=n_{0}4\pi R^{2}dR\), so the above equation can be rewritten as  
\[\overline{H_{R}^{2}}=\frac{8\pi n_{0}m^{2}dR}{R^{4}} \tag{4}\]  
Equation (4) is integrated over the entire volume, and the mean square value of the magnetic field generated by all particles in the ensemble at the specified point, excluding the specified point, is obtained, i.e., [29]  
\[\overline{H_{m}^{2}}=8\pi n_{0}m^{2}\int_{r_{0}}^{\infty}\frac{dR}{R^{4}}= \frac{8\pi n_{0}m^{2}}{3r_{0}^{3}} \tag{5}\]  
The lower limit of the integral of Equation (5) is taken as \(r_{0}\) because the specified point of a particle occupies a linear degree of \(r_{0}\), that is, a particle occupies a space of \({r_{0}}^{3}\). As there are \(n_{0}\) particles in the unit volume of the aggregate, \(n_{0}\)\({r_{0}}^{3}=1\), so  
\[\overline{H_{m}^{2}}=\frac{8\pi n_{0}^{2}m^{2}}{3n_{0}r_{0}^{3}}=\frac{8\pi}{ 3}n_{0}^{2}m^{2} \tag{6}\]  
where  
\[\overline{H_{m}^{2}}=\overline{H_{x}^{2}}+\overline{H_{y}^{2}}+\overline{H_{z }^{2}} \tag{7}\]  
Residual stresses and weld defects of different sizes occur during the reworking of welded seams. After welding, a large amount of magnetic charge is gathered in the residual stress area and the defect area, forming N and S poles, causing the residual stress area and the defect area to scatter the magnetic field outward. From Equations (6) and (7), it is known that the magnetic field strength is related to the number of magnetic charges per unit volume, \(n_{0}\). According to the principle of minimum magnetic free energy of the magnetic charge system, under the action of Coulomb force, a large amount of magnetic charge of the ferromagnetic component gathers at the boundary of the defect, making the number of magnetic charges \(n_{0}\) per unit volume surge. In the residual stress region, due to the continuous distribution of the ferromagnetic medium, the magnetic charge distribution is sparse and uniform, making the magnetic charge number per unit volume \(n_{0}\) much less than that in the defect region, which leads to a sudden increase in the magnetic field strength in the defect region. In contrast, the magnetic field strength in the residual stress region is lower than that in the defect region. Therefore, the differential value of the magnetic field strength has a very high amplitude at the defect due to a large amount of magnetic charge aggregation.