# Three-Dimensional Magnetic Inversion Based on an Adaptive Quadtree Data Compression
## 2 Methods  
### Inversion Method  
The inversion is the calculation of the physical or geometric parameters of a subsurface structure or an anomaly from anomalous data on the observation surface. For the linear inversion problem, the subterranean space discretizes into units that satisfy the following Equation (1):  
\[\mathbf{d}=\mathbf{Am} \tag{1}\]  
In the magnetic inversion, \(\mathbf{d}\) denotes the vector of observed magnetic data, \(\mathbf{d}=(d_{1},d_{2},\ldots,d_{N})^{T}\), where \(N\) is the number of data. \(\mathbf{m}\) is the vector of model parameters, \(\mathbf{m}=\left(m_{1},m_{2},\ldots,m_{M}\right)^{T}\), where \(M\) is the number of dissected grids, and \(\mathbf{A}\) denotes the sensitivity matrix of N \(\times\) M dimensions, expressed as A\({}_{ij}\) (\(i\) =1,..., \(N\)); \(j\) = 1,..., \(M\)), which represents the response of the \(j\)-th unit at the \(i\)-th observation point. Theoretically, it can be solved for the linear group of Equations (1) using Equation (2). \[\mathbf{m}=\mathbf{A}^{-1}\mathbf{d}, \tag{2}\]  
The solution for \(\mathbf{A}\) in Equation (2) only applies if \(\mathbf{A}\) is a square matrix, and no longer applies if \(\mathbf{A}\) is an overdetermined or underdetermined matrix. In geophysics, the amount of data collected is often much smaller than the parameters of the required solution, so the solution to Equation (1) is an underdetermined problem with multiple solutions. The Tikhonov regularization method, which has become a classic strategy, effectively solves this problem by minimizing the objective function, [45]. The objective function is composed of fitting items, model constraints, and regularization parameters, which is expressed as:  
\[\text{min}\;\phi(\mathbf{m})=\phi_{d}(\mathbf{m})+\mu\phi_{m}(\mathbf{m}), \tag{3}\]  
Of these, \(\phi_{d}\) represents the data fitting item, \(\phi_{m}\) represents the model fitting item, and \(\mu\) represents the regularization parameter, which is used to control the weight of the model fitting item and the data fitting item. When \(\mu\) is large, the model fitting term has a greater impact on the equation, and when \(\mu\) is small, the data fitting term has a greater impact on the equation. The data fitting term is expressed as follows:  
\[\phi_{\text{d}}=\|\mathbf{W}_{d}(\mathbf{Am}-\mathbf{d})\|_{2}^{2}, \tag{4}\]  
where \(\|\;\|_{2}^{2}\) denotes the square of L2 norm, and \(\mathbf{W}_{d}\) is the data weighting matrix, usually composed of the covariance of the data noise. If the data noise is less, it can be taken as 1. The difference between the existing different forms of constraint inversion methods lies in the way of constructing model constraints, which requires the selection of appropriate constraints in relation to the geological problem. A general form of the model fitting term is as follows:\[\phi_{m}=\|\mathbf{W}_{m}(\mathbf{m}-\mathbf{m}_{0})\|_{2}^{2}, \tag{5}\]  
where \(\mathbf{m}_{0}\) is the reference model and \(\mathbf{W}_{m}\) is the constraint weight term of the model, including the depth weight constraint \(\mathbf{W}_{z}\)[13] and the minimum support constraint \(\mathbf{W}_{e}\)[12]. Thus, Equation (5) can be written in the form of Equation (6). \[\phi_{m}=\|\mathbf{W}_{z}\mathbf{W}_{e}(\mathbf{m}-\mathbf{m}_{0})\|_{2}^{2}, \tag{6}\]  
\[\mathbf{W}_{z}(z)=diag\left(\frac{1}{\left(z+z_{0}\right)^{\beta/2}}\right) \tag{7}\]  
\[\mathbf{W}_{e}(m)=\text{diag}(w_{e}(m)),\,w_{e}(m)=\frac{m^{2}}{m^{2}+e^{2}}, \tag{8}\]  
\(\mathbf{W}_{z}\) is to counteract the influence of skin effect so that the inversion results are not concentrated at the surface. \(z\) is the central buried depth of the model element, and \(z_{0}\) is the value related to the model element and height. \(\beta\) is a positive number used to control the size of the weighting function. \(\mathbf{W}_{e}\) is introduced to make the inversion parameters more focused. In Equation (8), \(m\) represents the value of any grid, and \(e\) is called the focusing factor, which is a constant with a small value.