## 2 Materials and Methods
### Levenberg-Marquardt Algorithm  
The Taylor expansion of the objective function can be written in the following form:  
\[f(u_{k}+\Delta u)\approx f(u_{k})+\mathbf{J}(u_{k})\Delta u \tag{15}\]  
where \(u_{k}\) is the solution to the nonlinear problem, \(k\) is the iteration number, \(\Delta u\) indicates the direction of the next iteration, and \(\mathbf{J}(u_{k})\) is the Jacobian matrix of the residuals. The optimization problem can be expressed in the following form [46; 47; 48]:  
\[\underset{\Delta u}{\text{arg}min}\parallel f(u_{k})+\mathbf{J}(u_{k})\Delta u \parallel^{2} \tag{16}\]  
The LM algorithm uses a damping factor \(\lambda\) to interpolate between the Gauss-Newton and gradient descent algorithms, adjusting their characteristics.  
\[\underset{\Delta u}{\text{arg}min}\ D(\Delta u)=\parallel f(u_{k})+\mathbf{J} (u_{k})\Delta u\parallel^{2}+\lambda\Delta u^{T}\Delta u \tag{17}\]  
If the derivative of \(\Delta u\) is zero, the optimal solution can be obtained as follows:  
\[\Delta u^{*}=-\Big{(}\mathbf{J}\Big{(}u_{k})^{T}\mathbf{J}(u_{k})+\lambda \mathbf{I}\Big{)}^{-1}\mathbf{J}(u_{k})^{T}f(u_{k}) \tag{18}\]  
Setting \(\mathbf{J}(u_{k})^{T}\mathbf{J}(u_{k})=\mathbf{H}\) and \(\mathbf{J}(u_{k})^{T}f(u_{k})=\mathbf{g}\). Then, the iteration direction of the LM algorithm can be expressed in the following form.  
\[\Delta u=-\Big{(}\mathbf{H}+\lambda\mathbf{I}\Big{)}^{-1}\mathbf{g} \tag{19}\]  
The Hessian matrix \(\mathbf{H}\) in the LM algorithm is constructed using the Jacobian matrix \(\mathbf{J}\) of the residual vector \(R_{l}(\mathbf{u})\). In addition, the identity matrix \(\mathbf{I}\) ensures numerical stability. The \(\mathbf{J}^{T}\mathbf{J}\) is the Hessian matrix, and \(\lambda\) is a scalar damping factor. The matrix \(\mathbf{H}+\lambda\mathbf{I}\) becomes invertible due to the value of \(\lambda\), which influences the step size and direction of iteration. The calculation of \((\mathbf{J}^{T}\mathbf{J})\) avoids the need to compute any second-order derivatives of the residuals. The value of \(\lambda\) ensures that the matrix \(\mathbf{H}+\lambda\mathbf{I}\) is invertible and impacts the step length and iteration direction.  
The value of the damping factor \(\lambda\) can be updated based on the gain ratio \(\rho\), which characterizes the similarity between the first-order Taylor expansion approximation and the true function, to obtain a suitable iteration direction and step length. When the gain ratio is high, indicating that the current direction of change, \(\Delta u\), is optimal, it is necessary to reduce \(\lambda\) appropriately to increase the step length, improving the convergence rate. If the gain ratio is low, a new iteration direction is required, and \(\lambda\) should be increased to reduce the step length until the optimal descent direction is found.  
\[\rho=\frac{\parallel f(u_{k})\parallel^{2}-\parallel f(u_{k}+\Delta u) \parallel^{2}}{\parallel f(u_{k})\parallel^{2}-\parallel f(u_{k})+\mathbf{J}(u _{k})\Delta u\parallel^{2}} \tag{20}\]  
Figure 4 depicts the flowchart of the LM-OBF algorithm, where boundary effects are initially mitigated by performing edge expansion on the input data. Then, a two-dimensional orthogonal basis decomposition is conducted to obtain the coefficient square sum energy \(E\) as the forward modeling equation. The horizontal position of the magnetic dipole source is calculated based on the energy peak of \(E\). After setting the initial values of the parameters, the LM algorithm updates the parameters. Once the iterative termination conditions of the optimization algorithm are met, the final results of the parameter estimation are output, achieving the parameter estimation of the magnetic dipole source.