Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Case study
A R T I C L E I N F O A BS T RAC T
Keywords: The development of a MATLAB based computer code, AP3DMT, for modeling and inversion of 3D
Magnetotelluric Magnetotelluric (MT) data is presented. The code comprises two independent components: grid generator
MATLAB code and modeling/inversion code. The grid generator code performs model discretization and acts as an
Numerical modeling interface by generating various I/O files. The inversion code performs core computations in modular form –
Inversion
forward modeling, data functionals, sensitivity computations and regularization. These modules can be readily
Parallelization
extended to other similar inverse problems like Controlled-Source EM (CSEM). The modular structure of the
code provides a framework useful for implementation of new applications and inversion algorithms. The use of
MATLAB and its libraries makes it more compact and user friendly. The code has been validated on several
published models. To demonstrate its versatility and capabilities the results of inversion for two complex models
are presented.
⁎
Corresponding author.
E-mail address: arunsingh2626@gmail.com (A. Singh).
http://dx.doi.org/10.1016/j.cageo.2017.03.019
Received 19 February 2016; Received in revised form 22 March 2017; Accepted 24 March 2017
Available online 27 March 2017
0098-3004/ © 2017 Elsevier Ltd. All rights reserved.
A. Singh et al. Computers & Geosciences 104 (2017) 1–11
Am e = s, (2) mn +1 = JT bn ; l.
(JJT + λ I) bn = d (7)
where Am is a frequency dependent Ne × Ne sparse symmetric To avoid explicit computation and storage of J, (6) and (7) are solved
complex matrix with 13 non-zero elements per row; s is the Ne with a memory efficient Krylov subspace iterative solver such as
dimensional source vector and e is the Ne dimensional vector repre- conjugate gradients (CG). In this approach, the product of matrix
senting electric fields at the Ne internal nodes. This sparse linear system and an arbitrary vector such as (JT J + λ I) m is computed and this can
is solved iteratively using bi-conjugate gradient stabilized (BiCGSTAB) be performed at the cost of just two forward problems. Following
scheme which belongs to a class of Krylov subspace techniques. The Newman and Alumbaugh (1997), at the nth inversion iteration, the
incomplete LU decomposition of the diagonal sub-block matrix regularization parameter λ for GN is determined as λ = rsum /2n−1 where,
(Mackie et al., 1994) is used for pre-conditioning. rsum is the largest row sum of real (JT J).
For stable and accurate solutions of (2) at low frequencies, a
divergence correction is periodically applied (Smith, 1996) by solving 2.2.2. Non-linear inversion using conjugate gradient
a Poisson-like equation with pre-conditioned conjugate gradients (CG). In this approach, (4) is directly minimized using a gradient based
Smith (1996) has shown that the convergence is improved by applying optimization technique like non-linear conjugate gradient (NLCG)
divergence correction and it thereby significantly reduces the computa- (Rodi and Mackie, 2001; Newman and Boggs, 2004; Kelbert et al.,
tional time needed for solution of (2). 2014). Here, the gradient of (4) with respect to the variation in model
parameter m is computed as,
2.2. Inversion
∂ϕ
= −2JT r + 2λ mn ,
All the inversion algorithms aim at finding a meaningful model m͠ , a ∂m mn (8)
M - dimensional model parameter vector, while fitting the data dobs of
and it is used to a compute new ‘conjugate’ search direction. The ‘line
dimension Nd to an acceptable level in a stable manner. We consider
search’ is used to minimize the penalty functional along this direction
minimization of the penalty functional defined as
and it requires solving forward problem few times and the gradient is
∼ ∼ recomputed. Basic computational steps for NLCG include solving
ϕ (m͠ , dobs) = (dobs − F (m͠ ))T C−1
d (d
obs − F (m͠ )) + λ (m͠ − m 0)T C−1
m (m͠
forward problem for model parameter mn and multiplication of JT by
− m 0), (3)
the residual r. However, for the regularization parameter approach
∼
where F (m͠ ) is the forward mapping, Cd is the data covariance matrix, described above, this scheme does not work because varying the
m 0 is the apriori model, Cm is the model covariance matrix or regularization parameter would compromise the orthogonality of
regularization term and λ is the trade-off parameter. Cd is generally search directions (Egbert, 2012). Following Kelbert et al. (2008),
diagonal hence, it can be eliminated from definition of penalty NLCG iterations are performed for fixed value of λ and when misfit
functional by simply rescaling of data and forward mapping. Both m 0 stalls i.e. difference between misfits of two previous iterations is less
and Cm can also be eliminated from (3) by setting m = C−1/2
m (m ͠ − m 0) . than a predefined threshold, λ is reduced by a predetermined factor (10
2
A. Singh et al. Computers & Geosciences 104 (2017) 1–11
in present study). for the first polarization. Performing such operation for all the model
The schemes for minimizing (4), as discussed above, are expressed parameters results in a Ne × M matrix. However, columns of P af can
in terms of data and model parameter vectors dobs and m, forward also be written as αEA′mi, f where, E is the Ne × Ne diagonal matrix and
mapping F (m), Jacobian J (or JT ), data and model covariance matrices A′mi, f is now a column vector of length Ne. Hence, P af can be written as
Cd and Cm . The modular implementation of any inversion algorithm αEA′m, f with A′m, f being a Ne × M matrix. Thus Pf can be written for
can be readily carried out using these components. In the next section both the polarizations as
we briefly discuss and provide formulation of Jacobian J in terms of the
⎡ E a 0 ⎤ ⎡ P ⎤ ⎡ P af ⎤
forward solver, model parameterization and the numerical simulation Pf = α ⎢ ⎥ ⎢ ⎥ = ⎢ ⎥.
of the necessary observation operator as implemented in AP3DMT ⎣ 0 E b ⎦ ⎣ P ⎦ ⎢⎣ P bf ⎥⎦ (16)
code.
The components E and E are diagonal matrices with electric fields
a b
3
A. Singh et al. Computers & Geosciences 104 (2017) 1–11
Table 1 provide an input model file (.xls file) which contains stations, manual
Main functions used for grid generation and sensitivity computations (* D′Errico, 2006). grids (if any) and model description (synthetic and/or initial guess) on
different sheets. In this file, the model is described in terms of layers,
Functions Purpose Description
target bodies and modeling domain. The cuboid shaped target bodies
gridfit* Grid Generation Models a surface on a 2D grid from are defined using seven parameters (six for location and one for
scattered or semi-scattered z(x,y) resistivity) whereas, the polyhedron shaped bodies are defined using
inhull* Grid Generation Tests if a set of points are inside a
three times the total number of vertices for location description and
convex hull
grid3D Grid Generation Grid generation and resistivity matrix one parameter for resistivity. The program uses information from GUI
construction and the.xls file and generates four files to be subsequently used in
intercoeff Forward Solution Compute interpolation coefficients inversion code (see Fig. 3). These files include parameter file, data file
ForwardResp Forward Solution Compute Predicted Data and Field (data corresponding to all data types and for all stations and frequen-
Solutions (optional)
cies) and model file (synthetic and/or apriori model).
BoundCond Forward Solution Set Source and Boundary Conditions
DiscreteSolver Forward Solution Forward Solver A−1
In this code, the main component is a grid generation program
OutInterp Forward Solution Data Functional which efficiently handles arbitrarily shaped target bodies along with
JacobJob Jacobian Multiply Jacobian or its transpose by topography (or bathymetry). Some examples are given here under.
computations vector
LpJob Jacobian Multiply Data Sensitivity, L by vector
3.1.1. Cuboid bodies
computations
LTpJob Jacobian Multiply L transpose by vector For cuboid shaped target bodies, the grids are generated on the
computations basis of skin depths across an interface. First, the domain of modeling
PpJob Jacobian Multiply Solver Sensitivity P, by vector is divided into regions on the basis of target bodies and a resistivity
computations
matrix is constructed. For example, let us consider two blocks of
PTpJob Jacobian Multiply P transpose by vector
computations resistivities ρa and ρb (1 and 100 Ω-m respectively with each of
dimensions 40 × 20 × 10 km) placed adjacent to each other and in a
half space of resistivity ρh (10 Ω-m) (see Fig. 4a). At an interface (say
3.1. Preparation of files vertical interface number ‘2′‘, Fig. 4b), the minimum skin depth, δ ,
among the two different regions, is computed (columns between
When the main function ProgramRun is called, a GUI pops up interface 1–2 and interface 2–3) and then two grid lines are generated
allowing the user to fill the necessary details like, dimension, type of on either side of the interface with spacing equal to δ/4 and then δ/3
grid (manual or automatic), impedance units, field variation, frequen- and so on. This approach ensures fine grids near the conductivity
cies, solver details and inversion parameters (see Fig. 2). The user must contrast to obtain accurate results in these areas. The coarseness of the
grid, increases as one moves away from the interface (see Fig. 5a). The
Fig. 2. Figure showing Graphic User Interface (GUI) for providing user input.
4
A. Singh et al. Computers & Geosciences 104 (2017) 1–11
Fig. 3. Schematic representation of AP3DMT showing grid generation, file making and inversion part.
coarseness of the grid can be easily increased by preserving the overall assigned of the target body resistivity else that of the background. For
pattern but changing period used for skin depth computation. Once the the construction of resistivity matrix for some complex model like, a
grids are generated, final resistivity matrix is created where each helical conductor in half space see the Supplementary material.
element represents a discretized cell of constant resistivity.
Alternatively, manual grids can also be provided in the input file but
3.1.3. Topography
one must ensure that a grid line passes through each interface. This
To incorporate topography (and/or bathymetry), we first model, in
feature makes the code more user friendly as the user can assign
the form of z(x,y), a surface from the scattered or semi-scattered data
desired grids as per the requirement.
using the MATLAB function gridfit. Although gridfit is not an inter-
polant, it builds a surface over a complete lattice (models grids in xy
plane), extrapolating smoothly into the corners. Once the surface has
3.1.2. Polyhedron bodies
been modeled, a uniform grid in the vertical direction is generated till
To represent the complex geological features and structures,
the maximum elevation (depression) is reached. Later, based on these
polyhedrons are best suited. For example, consider a body of resistivity
surface values the resistivity matrix is modified.
ρa (5 Ω-m with dimensions 80 × 28 × 16 km with top at 4 km depth),
with its major axis making an angle of 45° with respect to y-axis,
embedded in half space a of resistivity ρh (100 Ω-m) (see Fig. 4c). This 3.2. Modeling/Inversion
polyhedron body (oblique block) is initially approximated by a cuboid
abcd (length and breadth along cartesian coordinate system) which In any inversion scheme, the basic working vectors are: data dobs ,
encapsulates the whole target body (Fig. 4c) and a resistivity matrix is model parameter vector m , EM field solution e and source field s .
created. Uniform grids of specified size (2 km) are generated for this For an MT problem, the complete data set (dobs ) is multi-frequency,
region as a stair case model which is better suited for such bodies. In multi-receiver and multi-component. For example, there are set of
other regions of the model, the grids are generated on the basis of skin frequencies, each requiring separate solutions for the two independent
depth criteria, as discussed above (see Fig. 5b). After grids generation, source polarizations. For each frequency, there will be number of sites
construction of the resistivity matrix begins. All the cell centers of the and for each site there will be multi-component data, e.g., there are
cuboid (encapsulating all the polyhedron bodies) are checked using the four complex components in impedance tensor and two in vertical
MATLAB function inhull which tests whether a point is inside a convex magnetic field TFs.
hull or not. If the cell center lies inside a convex hull then the cell is The data set is organized according to three attributes which are
Fig. 4. (a) Top view of a model with 2 blocks of resistivity ρa and ρb Ω-m placed adjacent to each other and embedded in ρh Ω-m half space. (b) Model is discretized into regions on the
basis of target bodies. (c) Top view of a model with ρa Ω-m body, major axis rotated by 45°, embedded in ρh Ω-m half space.
5
A. Singh et al. Computers & Geosciences 104 (2017) 1–11
Fig. 5. Schematic diagram showing top view of the (a) 3D model with conductive (1 Ω-m) and resistive (100 Ω-m) prisms buried in a layered Earth (Mackie et al., 1993) with grids at
z=0 km. Period of 1 s was used for computing the skin depth. (b) 5 Ω-m body, major axis rotated anticlockwise by 45° with respect to y-axis, embedded in 100 Ω-m half space with grids
at z=4.37 km.
referred to as transmitter, data type and receiver (observation sites). up computations, parallelization over frequency is implemented.
These three attributes are read from one data file and are stored as In summary, the interaction among various components of
fields of a structured array defined as CData in the code. This structure Jacobian (sensitivity functional L; solver A−1
m ; operator P) is efficiently
array also stores other parameters like solver information (from and smoothly managed in sensitivity function JacobJob. As we discuss
parameter file), etc. The attribute transmitter consists of a list of in the next section, a coarse grain parallelization, over frequency,
frequencies to setup and solve the forward problem. Fields in attribute similar to that of Siripunvaraporn and Egbert (2009), is also imple-
data type define the data functionals such as impedance, vertical mented.
magnetic field TFs, phase tensor, etc. and are accessed by name. The
attribute receiver provides information about all the unique observa-
tion sites (Cartesian coordinate system). Thus, the full data vector (dobs ) 4. Parallelization
is an array corresponding to different frequencies. Each, in turn, stores
all the components corresponding to all the data types for all the active AP3DMT implements a coarse grained parallelization over forward
receivers. A binary array is used to keep track of certain missing problem. Implementation of parallelization over number of frequencies
components, if any, in the data set. is quite simple. Fig. 8 explains the basic scheme of implementation.
The data vector structure allows for mixing of different data types MATLAB's inbuilt function parfor is used which executes loop itera-
and simplifies addition of new data types by adding new fields tions in parallel. The command matlabpool (parpool in 2015a version)
corresponding to the new data type. Addition of new data type starts a pool, with the pool size specified by parallel preferences and the
simultaneously allows computing predicted data and/or sensitivity default profile or one can manually start a pool with desired number of
calculations for all the active receivers by solving the forward problem workers. After initialization, one processor acts as the master, and the
only once. others act as workers. The master performs the main job of the code
The main feature of AP3DMT is its easy implementation of until a step requiring parallel computations (like forward problem or
linearized inversion scheme that can be expressed in terms of (dobs ), multiplication of Jacobian with a vector) is reached i.e. parfor loop
m, e, s, forward mapping F (m), Jacobian J and the model and data over number of frequencies. At this point the master sends a message
covariance matrices Cm and Cd respectively. During the inversion, indicating nature of the task and the necessary input data to all the
various operations are performed like, multiplication of data by C−1/2 d
active workers. The worker performs the task for a single frequency by
and C1/2 1/2
d , multiplication of model parameters by C m , C m or C m ,
−1/2 calling appropriate functions like FwdResTotal. When the task has
multiplication of J with arbitrary model space vector vm and JT with been performed, it returns the solution to master. These functions are
arbitrary data space vector vd . The Jacobian function is further same as called in the sequential version. Note, that in absence of any
modularized, using the decomposition given in (15), to implement pool parfor is equivalent to for.
multiplication by J (or JT ) using the operators L , P and the solver for The communication between master and worker can be minimized
discrete system matrix A−1 m (or their adjoints) (Figs. 6 and 7). To speed by transferring some fixed components or data to all the active workers
in the beginning itself and storing there to avoid transfer during each
Predicted Data
Fig. 6. Schematic representation of AP3DMT for forward modeling. Frequency Parallelization is implemented for computing forward responses.
6
A. Singh et al. Computers & Geosciences 104 (2017) 1–11
Read models m, m0
Read data dobs from file
and other information
Inversion Algorithms
Forward Solver, A-1 Parallel Computation
(NLCG, GN-CG, DCG)
Fig. 7. Schematic representation of AP3DMT for inverse modeling. Frequency Parallelization is implemented for multiplication of J and JT with model and data space vectors
respectively.
7
A. Singh et al. Computers & Geosciences 104 (2017) 1–11
Ex , E y , Hx , Hy and Hz at the site and applies these to solutions for both and phase or phase tensor, first the perturbations in impedance are
polarizations. For computation of magnetic field from electric field, the computed and therefrom the perturbations in the desired datatype are
transformation h = Te (T is a transformation matrix) has been computed. LpJobs performs the product of Lf with vef to form
incorporated in the interpolation coefficients so that this functional vdf = Lf vef . LTpJobs multiplies this vector by the appropriate data
can be applied directly to the field vector. The transformation matrix T components to form LTf vdf . Here, instead of implementing LTf vdf , we
is scaled by (−iωμ)−1 to keep it real and frequency independent. After have implemented (v dTf Lf )T . This does away with the need to imple-
computing, h fields are multiplied by (−iωμ)−1 to take care of the scaling ment LTf .
factor. Once the field components are computed, the impedance tensor For the addition of new data type or mixing different data types,
and/or the vertical magnetic field TFs or any other transformations appropriate changes are required in OutInterp, LpJobs and LTpJobs
required for a particular data type (e.g., apparent resistivity or phase) for computing the predicted data and the sensitivity calculations.
can be computed. Multiple data types are supported with appropriate
selection. The interpolation implemented in the current version is
5.2.2. Forward solver
based on tri-linear interpolation coefficients. Since these interpolation
The function DiscreteSolver is common to the forward modeling,
coefficients are stored in a sparse format and do not affect other
and sensitivity computations. This function includes the standard
modules, other functions would remain unchanged (e.g., calculation of
BiCGSTAB iterative solver (MATLAB library) for solving (2) with the
impedance). Further, addition of new data types or their combinations
incomplete LU decomposition for pre-conditioning and the pre-condi-
will not demand any changes to interpolation aspect.
tioned conjugate gradients for divergence correction. For each fre-
For a different numerical discretization like, finite element method
quency, the output vector ve consists of two sets of solutions corre-
with a non-structured grid, changes in the construction of coefficient
sponding to the two modes of polarizations, requiring two solver calls
matrix and boundary conditions (if any) are required. Since the system
with different right hand side vectors (boundary conditions) for each
matrix is explicitly formed and stored, any change in its structure will
frequency. The DiscreteSolver implements the general solver, allowing
not affect the matrix solver which is not the case when the forward
for boundary conditions and solution for both the forward problem and
operator is implemented using a matrix-free approach.
its transpose. Addition of new sources can be easily incorporated by
appropriate boundary conditions and additional solver calls for new
5.2. Inversion
solutions. Also, it is very easy to replace one solver with another like
replacing BiCGSTAB with QMR (Quasi-Minimal Residual). With
In inversion algorithm the main operators are forward operator,
MATLAB inbuilt solvers and preconditioners (like incomplete
data and model covariance matrices and Jacobian. As discussed earlier,
Cholesky, Incomplete LU, Modified Incomplete LU, etc.), one can test
the main task is the multiplication of these operators with vectors like,
various numerical implementations easily.
C−1/2
d with data vector, C−1/2
m with model parameter vector, J by model
space vector, etc. Since these are standalone operators with no direct
interaction with the inversion function, a new inversion algorithm can 5.2.3. Solver sensitivity
be easily implemented. Symmetric covariance operators, both data and One of the main components of Jacobian is Pf , which defines the
model, are standalone with input and output being the data vector or product of the sensitivity of the coefficient matrix Am, f to the model
model parameter vector. For data covariances, full matrix can be parameters (log conductivity) with the electric field. (13) Provides the
provided. However, for our inversion tests, we have used diagonal error derivative of the field with respect to the parameters. This derivative
covariances into error functional for noisy measurements; these are can be interpreted as the field due to a collection of sources described
generally based on the standard deviations of the measurements. The as the product of derivatives of Am, f and the field vector e. As discussed
model covariances are much more complicated, like C−1 m can be earlier, the operator Pf consists of two components. The first part
represented by DT D where D is a finite difference approximation of provides the scaled derivative of the coefficient matrix with respect to
the gradient or the Laplacian (∇2) operator, as in Occam inversion the model parameters (see (13)). For a FD approximation, only the
(Constable et al., 1987), or as defined by Kelbert et al. (2008). A model diagonal elements of the matrix Am, f depend on conductivity elements
covariance file (optional) allows the user to turn off the smoothening in the form of iωμσ . Here, σ is the volume average of the conductivity of
across the domain boundaries, and also allows the model parameters nearby cells. Hence, each parameter contributes to twelve internal
within a domain to be frozen (e.g., water, air in case of topography, nodes. This results in a maximum of twelve non-zero elements per
etc.). Since this function is completely independent of other functions, parameter. The derivatives of Am, f are made real and frequency
various covariance operators can be easily implemented and tested for independent by simply scaling these with the factor (iωμ)−1. Once these
3D EM problems. The multiplication of J (or J T ) with a vector is derivatives are obtained, these are multiplied with the model parameter
performed using the components of J as discussed earlier: (i) the vector to perform the operation Pvm . This product can be viewed as
M
operator P; (ii) the forward solver; (iii) the sensitivity functional, L. ∑i =1 mi A′mi, f where A′mi, f is a column vector of length Ne with only 12
Details of how these components are formed for a single frequency f, non-zero elements with their indices defined by the mapping. These
are given below. non-zero elements are −Vexp i (mi ) where, Vi is the integration volume
for the ith cell having parameter mi defined as log conductivity.
5.2.1. Sensitivity functional Afterwards, this vector is multiplied element by element with the
The function LpJobs implements the sensitivity functionals for use electric field solution e n , corresponding to frequency f, and finally by
in sensitivity computations. This function performs the linearization of iωμ to obtain the final solution Pf vm in PpJob. For the transpose case,
the data functional with respect to variations in the EM solution e . these steps are reversed in PTpJob. In this function, first the input
Here, the Lf matrix is not explicitly formed, rather the product of Lf vector vef is multiplied element by element with the electric field e n
and vector vef or of LTf and vector vdf is computed using the components resulting in vef = (v e af , v e bf ) (solutions for two source polarization).
of Lf . If the measured component is EM field itself, then Lf simply Finally, the operation iωμ[PT (v e af + v e bf )] is performed resulting in a
computes the interpolated values (using Ex , E y , etc.) at the sites and model parameter vector vmf .
stores them in a vector. For datatype like Impedance or vertical The multiplication of J with the model parameter vector vm is
magnetic field TFs the components of Lf include the interpolation parallelized over frequency. Master sends a copy of vm and other
and transformation matrices (λex , λey , λbx etc.), the magnetic field and necessary information to each worker. Each worker computes
the impedance values at the observation sites (see Appendix A for vdf = Lf A−1
m, f Pf vm . The product vsf = Pf vm results in a matrix with two
detailed expression of L). For other datatype viz. apparent resistivity columns for the two modes of polarization. Hence, for vef = A−1 m, f vsf , the
8
A. Singh et al. Computers & Geosciences 104 (2017) 1–11
matrix solver is called twice for different right hand side vectors.
Finally, the product vdf = Lf vef is obtained using the linear combination
of product of each block of Lf matrix and column of vef (see (18)). If the
operation JTf vdf is required (like JT J in GN-CG) then the same worker
performs the operation vmf = P Tf A−1 T
m, f Lf vdf . If only the gradient is
required, like in NLCG, then the master sends the residual vector r f ,
corresponding to each frequency, to each worker and the workers
compute the gradient. Once the gradient is computed for each
frequency, the linear sum is computed and final JT vd is formed.
JacobJob implements all these three tasks viz. Jvm , JT vd and JT Jvm
computations depending on the call. JJT vd is computed using the
combination of JT vd and Jvm .
6. Results
Fig. 10. Ratio between model parameters of the inverse models as obtained by AP3DMT
The AP3DMT code has been tested and validated over a variety of and ModEM.
3D standard models available in literature. For demonstration, we have
selected two synthetic test models. The first test model is a ‘checker- then increase logarithmically downwards. AP3DMT is used to compute
board’ conductivity distribution, Rubick Model, (Egbert and Kelbert, the impedance tensor for 12 periods logarithmically spaced between
2012) and the second is Dublin Test Model 2 (DTM2) (Groom and 0.01 and 10000 s at 49 sites, located on circles of different radii from
Bailey, 1991; Miensopust et al., 2013). These two data sets were the center of the hemisphere except one at the center. An error floor of
inverted using NLCG algorithm on HP Z620, Intel Xeon E2643, 32 GB 5% of |Zxy Z yx |1/2 is assigned to the impedance tensor. For inversion,
with 8 cores for parallelization. again a homogeneous model of 100 Ω-m, discretized into 54 × 54 × 37
The first model consists of 10 and 1000 Ω-m blocks in a homo- cells (500 m × 500 m × 50 m , vertical extent increasing with depth) is
geneous 100 Ω-m half-space (Fig. 9a). For comparison of inversion used as apriori and initial model. In 42 NLCG iterations the nRMS
results, the synthetic data and the initial guess model are taken from error reduced from 18.3 to 1.12. The inverted model thus obtained is
the test files provided along with the ModEM code. This data set shown in Fig. 11 (right panel). The circular shape of the hemisphere
includes the impedance tensor and the vertical magnetic field TFs and the correct order of resistivity were recovered. The correct
sampled at 225 sites distributed on a regular 2D array with 80 and representation of the circular body is limited due to the use of
40 km spacing in x- and y- directions respectively for 12 periods, rectangular meshing. Table 2 summarizes the above results in a tabular
logarithmically spaced between 10 and 10000 s. Errors floor is set as form along with the run time and other details.
3% of |Zxy Z yx |1/2 for impedance tensor and 0.03 for vertical magnetic For both these models and for the other models tested, the edges of
TFs. For computation of this data, authors of ModEM code discretized the target bodies are not represented by a sharp boundary as in the true
the test model into 67 × 67 × 60 cells (excluding cells in air), with model. The resistivity gradually changes across the boundary of a
nominal resolution of 20 km horizontally. For inversion a homoge- structure resulting in smearing out of structures. This is so because the
neous model of 100 Ω-m, discretized into same number of cells, is used current code is based on smooth model approach.
as apriori and initial model. In 58 NLCG iterations the normalized
root-mean-square (nRMS) error reduced from 12.38 to 1.06. The
inverted model thus obtained is shown in Fig. 9b. Fig. 10 shows the 7. Conclusions
ratio between model parameters of the inverted models as obtained by
AP3DMT and ModEM. The main model features present in the test We have presented the development of a MATLAB based code,
model are recovered. As expected, there is some degradation in the AP3DMT, for modeling and inversion of 3D MT data. The capability of
features below the conductive structures. this program for performing inversion is demonstrated through two
The second model DTM2, Fig. 11 (left panel), consists of a synthetic test models. The key feature is its compactness and simplicity
hemisphere of 10 Ω-m and radius of 5 km directly beneath the surface and its potential as a tool for rapid development and testing of new
of a homogeneous 300 Ω-m half space. The origin of the coordinate applications. Basic functions are simple and readily available. Thus, it
system has been taken as the center of the hemisphere. The model is would be easy to replace one scheme with another one like replacing
discretized into 54 × 54 × 42 cells with horizontal cell dimensions of NLCG with quasi-Newton (e.g., Nocedal and Wright, 2000; Newman
500 m. Cell thicknesses are 500 m in the upper 5 km of the model and and Boggs, 2004) or one iterative solver with another one. AP3DMT
Fig. 9. (a) Resistivity model for 3D test, with site locations shown at top (Egbert and Kelbert, 2012), and (b) inverse solution obtained with AP3DMT after 58 iterations by fitting full
impedances and vertical field TFs. In the cut-away view the upper surface shown is at 2 km depth, but the structures shown extend to the surface.
9
A. Singh et al. Computers & Geosciences 104 (2017) 1–11
Fig. 11. A plan view of true model and the inversion model. The black dots represent the used sites.
provides a natural platform for development and comparison of not BiCGSTAB, ILU, etc. may be considered both as its strength and
only inversion search algorithms but also various modeling schemes or weakness. Use of these global functions make the code more versatile,
its components like iterative solvers, preconditioners and modified compact and user friendly which will open opportunities for develop-
finite differences schemes. ment and experimentation. It may be mentioned that the MATLAB
Use of MATLAB platform and its in-built functions such as functions have multiple checks and are therefore slower than the
Table 2
List of inversion results. Beside the model name, information about the data, mesh and inversion parameters are given as well as the number of iterations, RMS value (initial/final) and
target tolerance (TT).
10
A. Singh et al. Computers & Geosciences 104 (2017) 1–11
corresponding functions of a Fortran code. However, in a MATLAB authors are thankful to Ministry of Earth Sciences, Govt. of India for
code the implementation, parallelization etc. are much easier. providing computational facilities. The authors are thankful to Institute
Computer Center, IIT Roorkee for providing MATLAB-2013. The
Acknowledgment authors are also thankful to Gary Egbert and Anna Kelbert for
providing ModEM code.We also thank Jef Caers (the editor) and the
Two of the authors, Arun Singh and Rahul Dehiya, are grateful to three anonymous reviewers, for their detailed comments, which helped
Ministry of Human Resource Development, Govt. of India for provid- us to improve this paper.
ing financial support during the preparation of this manuscript. The
Let Z be a 2×2 impedance tensor with its elements defined as Z11, Z12, Z 21 and Z22. For a single frequency, the data d can be written as
⎡ Z11 ⎤
⎢ ⎥
Z
d = ⎢ 12 ⎥
⎢ Z21 ⎥
⎢⎣ Z22 ⎥⎦ (A.1)
where, each block (i = 1, 2; j = 1, 2) is a complex column vector (of length equal to number of sites) with elements representing the corresponding
components of impedance values at the observation sites.
The matrix L (complex) takes the form as
⎡ ∂Z11 ⎤
⎢ ∂e ⎥ ⎡ Bx (λex − Z11λbx − Z12 λby ) Bay (λex − Z11λbx − Z12 λby ) ⎤
a
⎢ ∂Z12 ⎥ ⎢ b ⎥
⎢ ⎥ ⎢ Bx (λex − Z11λbx − Z12 λby ) Bby (λex − Z11λbx − Z12 λby ) ⎥
L = ⎢ ∂Z∂e ⎥ = ⎢ a ⎥
− Z22 λby ) Bay (λey − Z21λbx − Z22 λby )⎥
⎢ ∂e ⎥ ⎢ x ey
21 B (λ − Z21λbx
⎢
⎢ ∂Z22 ⎥ ⎣ Bbx (λey − Z 21λbx ⎥
− Z 22 λby ) Bby (λey − Z 21λbx − Z22 λby ) ⎦
⎣ ∂e ⎦ (A.2)
with each block of size nobs × Ne . In (A.2), Bkx and Bky (k = a, b ) are diagonal matrices with elements as inverse of magnetic fields at local sites,
Zik (i = 1, 2; j = 1, 2) represents the diagonal matrices with elements as impedance values at local sites and λex , λey and λbx , λby are interpolation and
transformation matrices respectively. Note that the transformation matrices λbx , λby are real and frequency independent, hence care must be taken
while performing any operation involving these matrices. For example Z11λbx will become α Z11λbx where α is −iωμ)−1.
For VTFs only first 2 rows in (A.2) exists with λex replaced by λbz and vertical field TFs matrices by impedance matrices.
Supplementary data associated with this article can be found in the online version at http://dx.doi.org/10.1016/j.cageo.2017.03.019.
11