Elris2D: A Matlab Package For The 2D Inversion of DC Resistivity/IP Data
Elris2D: A Matlab Package For The 2D Inversion of DC Resistivity/IP Data
Abstract
ELRIS2D is an open source code written in MATLAB for the two-
dimensional inversion of direct current resistivity (DCR) and time do-
main induced polarization (IP) data. The user interface of the program is
designed for functionality and ease of use. All available settings of the
program can be reached from the main window. The subsurface is discre-
tized using a hybrid mesh generated by the combination of structured and
unstructured meshes, which reduces the computational cost of the whole
inversion procedure. The inversion routine is based on the smoothness
constrained least squares method. In order to verify the program, re-
sponses of two test models and field data sets were inverted. The models
inverted from the synthetic data sets are consistent with the original test
models in both DC resistivity and IP cases. A field data set acquired in an
archaeological site is also used for the verification of outcomes of the
program in comparison with the excavation results.
Key words: 2D inversion, GUI, finite elements, hybrid mesh.
1. INTRODUCTION
Direct current resistivity (DCR) method is one of the most frequently used
geophysical tools for the solution of near surface problems. Impressive de-
velopments occur in the multichannel resistivity measurement technologies,
________________________________________________
Ownership: Institute of Geophysics, Polish Academy of Sciences;
© 2016 Akca. This is an open access article distributed under the Creative Commons
Attribution-NonCommercial-NoDerivs license,
http://creativecommons.org/licenses/by-nc-nd/3.0/.
444 I. AKCA
thus enabling thousands of readings in a few hours. This ability leads to ex-
plore a survey site in more details, increasing the volume of the data to be
processed. An exhaustive review about the recent developments in DCR im-
aging may be found in the paper by Loke et al. (2013) where some applica-
tions for a variety of survey objectives are included. Although three-
dimensional (3D) data inversion and interpretation techniques are available
(e.g., Pidlisecky et al. 2007), two-dimensional interpretation of DCR and IP
data is still a valuable option. Two-dimensional inversion of DCR data is an
extensively-studied research area which produced several commercial and
academic inversion codes and software (i.e., Res2DInv 2014, EarthImager
2009, DC2DInvRes 2014). These packages have their own originalities with
plenty of customization options and routines for the inversion and visualiza-
tion of DCR/IP data. In addition to the above-mentioned packages, there are
several open source codes (i.e., Karaoulis et al. 2013, Pidlisecky and Knight
2008) developed for different purposes.
This paper presents a new open source two-dimensional inversion pro-
gram named ELRIS2D. The novelty of the program arose from the discreti-
zation routine involving the hybrid use of structured and unstructured
meshes and the design of the user interface. ELRIS2D provides a simple and
convenient user interface designed for the ease of use to invert and visualize
DCR/IP data which is written in MATLAB. All available options can be
reached from the main window by clicking on the corresponding user inter-
face element. This approach in the design of user interface speeds up the
process of multiple data sets. A hybrid mesh application for the finite-
element method reduces the computational requirements and consumed CPU
time. ELRIS2D uses the smoothness constrained least squares method (Loke
and Barker 1996, Tsourlos et al. 1998) for the definition of objective func-
tion to be minimized. The parameter correction vector is calculated by solv-
ing the linear system of equations via the MATLAB built-in function
“mldivide”. A variety of techniques have been suggested for the incorpora-
tion of a smoothing operator to stabilize the inversion process and extract
structural information from the geolectrical models (see Zhou et al. 2014,
Akca and Baokur 2010, Baokur and Akca 2011). A five point Laplacian
operator is used as the smoothness constraint in ELRIS2D for simplicity.
The user interface provides some options and tools to enhance the view of
the data and model sections. Outputs of the program may be exported as a
snapshot, pdf or text files. ELRIS2D was tested with the responses of syn-
thetic models and a field data set measured at the ancient city of Pisidian An-
tioch, in western Turkey. Test results show that the new open source code
ELRIS2D is a powerful tool for the detection of subsurface targets and addi-
tional functionalities can easily be added by other researchers.
ELRIS2D 445
Fig. 1: (a) Unstructured, (b) structured, and (c) hybrid finite element meshes.
lows the solution of potentials due to all possible single current sources at
once. Therefore, each column of S includes one nonzero element corre-
sponding to the strength of the virtual current source which is set to 2A.
Other elements of the source matrix are set as 0. Although the numerical cal-
culations are based on conductivity and potential distribution, in practice the
potential difference and apparent resistivity quantities are used. Therefore,
the potential differences should be converted to apparent resistivities based
on the layout of electrodes. Marescot et al. (2006) gave a comprehensive de-
scription of approaches for the definition of apparent resistivities. The defini-
tion called “general approach” is given by:
'V
Ua U0 , (3)
'V0
2.3 Inversion
Inversion of DC resistivity data is a non-linear and ill-posed problem. An
initial model supplied by the user is updated by an iterative process. Usually,
a kind of model smoothness constraint is required to stabilize the inversion.
ELRIS2D 449
where mi is the model correction vector, J is the Jacobian matrix, is the
regularization parameter, d is the data discrepancy vector, i denotes the it-
eration number, Wd is data weighting matrix, and C is the five-point finite
difference Laplacian. The data weighting matrix is in the given form:
Wd diag 1 i , (6)
In Eq. 8 only the partial derivatives of potentials with respect to cell conduc-
tivities are unknown. K and v matrices are already produced during the for-
ward solution. The partial derivative of the stiffness matrix with respect to
model parameters can be easily calculated by assigning 1 to relevant conduc-
tivities and 0 to all others. Because the approach of Marescot et al. (2006) is
used for apparent resistivity evaluation, K is calculated twice. In the first
450 I. AKCA
case all conductivities are assigned as 1 and result is stored as K1. Therefore,
it is sufficient to pick the values of K1 relevant to the triangles inside a pa-
rameter block to calculate its derivative with respect to a certain parameter.
This is easily implemented by creating an index of triangles relating them
with the parameters during the mesh creation. Equation 8 then can be han-
dled as a linear system of equations in the form of Ax = b and must be
solved for each model parameter. This is done as described previously for
Eq. 2. In this manner, the Jacobian matrix is calculated for every iteration.
An updated model is achieved by adding the calculated corrections to the
model parameters. The new model is verified by comparing its response with
the measured data. Data fitness is measured in the sense of RMS defined as:
Wd 'd Wd 'd
T
RMS , (9)
N
where N is the number of datum and superscript T denotes matrix transpose.
The misfit function given in Eq. 9 is the cost function to be minimized by the
inversion routine. The inversion process usually converges after 5 to 8 itera-
tions.
For the IP data inversion I followed the third method proposed by
Oldenburg and Li (1994). The proposed method aims to minimize the objec-
tive function given in Eq. 9 by solving a nonlinear inverse problem where
the data discrepancies are now defined as
'd Kam Kac ,
where Kam and Kac are the measured and calculated apparent chargeability
values in mV/V, respectively. The methodology used in the inversion of ap-
parent resistivity data is used in the same form for apparent chargeability in-
version. Equation 5 is solved once more to calculate the model parameter
corrections where the model vector now contains chargeability values of the
model cells and the data vector is formed by the observed apparent chargea-
bility values. The sensitivity matrix in Eq. 5 is replaced with the following
one:
wd i VVi
J ijK V 1 K J ij , (10)
wK j V
K
i 2
where V and V are the calculated potentials for conductivity and chargea-
bility models, respectively; and i and j are the data and parameter indices, re-
spectively. J is the sensitivity matrix for the DC resistivity problem
(Oldenburg and Li 1994). A known resistivity model is required for the
evaluation of the response of a chargeability model. Therefore, the IP data
ELRIS2D 451
3. USER INTERFACE
The user interface of ELRIS2D is designed for ease of use with all controls
and options available on the same window (Fig. 2). The main window is di-
vided into several panels. The first panel located on top left of the window is
a useful and simple file explorer. As soon as the program starts, root folder
(where the program is called) is scanned by a routine to find the data files
with the supported file format. The data file format supported by ELRIS2D
is identical to the format of well-known program RES2DInv. The program
currently supports Pole-Pole, Pole-Dipole, Dipole-Dipole, Wenner, and
Schlumberger arrays. The data are assumed to be measured by equally
spaced electrodes. Please refer to the User Manual located in the root folder
of the program for further details. Unsupported data file formats are simply
not listed in the File Explorer panel. The folder names in the current direc-
tory (if any) are given at the top of the list enclosed with brackets. This list
box permits some interactions:
(1) double clicking on a folder name opens and scans the selected folder for
supported data files,
(2) clicking on the name of a data file directly displays the content of the
file as a pseudo-section,
(3) double clicking on to a data filename displays the results of previous in-
version if available.
Browse and Directory Up buttons are also located at the top of the list
box for changing the working directory (Fig. 2). The Refresh button may be
used to update the file list in case of copying or producing new data files. In-
formation about a selected data file is displayed in the next panel titled as
“Data Info”. In this context, the user can explore the content of a file just by
clicking on the filename as a pseudosection supported by basic data infor-
mation.
This is more practical than using a popup menu used in the order: File >
Read Data > Select Folder > Select File > Ok. If the data file has already
been inverted, it is indicated in the Data Info panel and the user can recall the
results by just double clicking the filename.
The Inversion Settings panel includes two options: number of iterations
and the mesh type. Available mesh types are “normal” and “fine”. Normal
mesh corresponds to a discretization where a rectangular cell is located be-
tween each adjacent electrode. Fine mesh is constructed by dividing the
space between adjacent electrodes into two rectangular cells. Inversion must
be restarted after changing the mesh type.
The panels on the right hand side include most common options for dis-
playing DCR/IP data and 2D model sections. The pseudosection plotting is
done following the pseudo-depth concept defined by Edwards (1977). The
x-location of a datum is assumed to be at the midpoint of the electrode array
for a single measurement. Following this aspect, the datum coordinate is
plotted on the section with a black dot. The user can toggle to display or not
to display the locations of datum. In a similar way, the user has the option of
displaying electrode locations. Pseudosections are plotted as color coded
sections. However, the user has the option to display the contour lines as
well. Resistivities of earth materials vary in a very wide range. Therefore,
logarithmic color scales are favorable for a better representation of the
changes in the measured data and model resistivities. An option is present in
the “Visuals” panel to toggle the logarithmic and linear color scales. Any
change in the available options is applied immediately to the displayed sec-
tions.
ELRIS2D 453
4. EXAMPLES
4.1 Test model 1
ELRIS2D was tested with synthetic and field data sets. The first example is a
synthetic data set calculated for the model given in Fig. 3d. The model con-
sists of two embedded bodies and a laterally discontinued overburden. The
resistivities of the background, overburden and embedded bodies are set as
100, 250, and 2500 ohm-m, respectively. The embedded bodies simulate a
cross-section of walls perpendicular to the section plane. The data were
simulated for dipole-dipole electrode array with 25 equally spaced electrodes.
454 I. AKCA
the data. The overall inversion process for 10 iterations took 25.04 s on a PC
with Pentium Dual Core processor and 4 GB RAM. The resulting inverse
model resistivity section is given in Fig. 3c. Some cells in the illustrated
model are faded. Fading of the model parameters is related with the value of
total sensitivity of the cell, calculated by a samovar through the columns of
Jacobian matrix at first iteration. The values are normalized with the maxi-
mum sensitivity and assigned as the degree of transparency for each cell.
The exact locations of the model components are marked with white rectan-
gles in Fig. 3c. The locations and size of the bodies are well defined in the
reconstructed model.
Fig. 4. The inversion results of test model 2. The left panel is for resistivity data and
models, while chargeability data and models are shown on the right.
on the radio button group placed at the bottom of the sections panel. The in-
version results of the IP data are demonstrated in the axes placed on the right
panel of Fig. 4. The model and data space for IP inversion is linear. The re-
covered chargeability model is demonstrated in Fig. 4g with the exact loca-
tion of embedded blocks marked with white rectangles. Remember that only
the embedded blocks were chargeable and the background chargeability was
set to zero. By visual comparison of the actual and recovered chargeability
models it may be stated that the algorithm has the ability of outlining the po-
sition and chargeability of the anomalous bodies. This conclusion is sup-
ported with the fitness between the measured and calculated data sets. The
apparent chargeability values are noise free and the data space is linear.
Therefore, the data fitness is calculated as 0.82% after 10 iterations.
Fig. 5: (a) Location of survey area, (b) general view of the survey site, and (c) field
data measured at Aedilis Hill.
taken by a multi-electrode system with 25 electrodes. The field data set was
measured on the hill called “Aedilis” overlooking the city (Fig. 5b). Archae-
ologists expected the existence of a kind of temple due to the location of the
hill. Therefore, a preliminary survey was carried out at the mentioned loca-
tion. A Wenner–Schlumberger array with 2 m electrode spacing was used to
measure the data on five parallel profiles 2 m apart. Profiles are numbered
P1 to P5, starting from the one located at NW. The apparent resistivity pseu-
dosections of the measured lines are demonstrated in Fig. 5c.
The data were inverted using a fine mesh consisting of 288 parameters.
The number of iterations was set to 10. All data were inverted using the
same settings. Data misfits varied between 5 to 11%. Inverted model resis-
tivity sections of all profiles are illustrated in Fig. 6a with same color range
and a common logarithmic scale. Two main anomalous bodies can be distin-
guished from the background. The first one is located at a distance of around
20 m from the beginning of the lines. The strength of the anomaly reaches to
2000 ohm-m where the background resistivity is assumed to be around
500 ohm-m. The second anomaly is located between 36 to 42 m of the lines
and may be interpreted as two close embedded bodies. The overall inspec-
tion of the resistivity sections proves the existence of the remains of an an-
cient structure. The study was a preliminary examination of the survey area;
458 I. AKCA
Fig. 6. Inversion results of field data: (a) model resistivity sections, (b) resistivity
map of z = –1.0 m depth, and (c) excavation result at survey site.
ELRIS2D 459
therefore, the electrode and profile spacing were set to 2 m which is quite
large for an archaeogeophysical survey. The survey site was excavated dur-
ing the studies in 2011, which resulted in the exploration of the sixth church
of the ancient city (Özhanl, private communication). Figure 6c shows a pic-
ture of the excavation area. The anomaly located between 36 to 42 m of the
lines corresponded to two walls made of limestone 2 m apart. The depth of
the top of walls was 1.25 m from the surface. The dimension and locations
of the walls are marked on the resistivity map of 1.0 m depth given in
Fig. 6b. The other anomaly, clearly seen around 18-20 m, possibly arose
from another structure, such as a wall. However, this interpretation has not
verified because that part of the survey area is still unexcavated.
5. CONCLUSIONS
Two-dimensional inversion of resistivity and IP data is a well-established re-
search area in geophysical community. Several commercial and non-
commercial inversion codes are produced with good coverage of available
inversion and visualization options. Emerging capabilities of measuring de-
vices produce large amount of data in shorter times. Therefore, practical in-
version programs are needed for the fast and efficient interpretation of
acquired data sets. A new MATLAB program named ELRIS2D was devel-
oped for the two-dimensional inversion of DC resistivity and IP data to meet
these demands. Two main new features of the program are the approach used
to construct the model mesh and the practical user interface. Both features
help to reduce the computation requirements and the time spent by the inter-
preter to process multiple data sets. The interactive file list box permits
switching between data files in the current folder by just a mouse click or us-
ing arrow keys. Content of selected data files and previous inversion results
(if available) are displayed immediately by appropriate mouse clicks. The
inversion algorithm is based on the smoothness constrained least squares
scheme. Based on the availability, program automatically inverts the appar-
ent chargeability data whenever a resistivity data inversion is completed.
A non-linear scheme is used to invert IP data. Switching between resistivity/
chargeability sections are as easy as clicking a radio button place on the user
interface. The program provided satisfactory processing times (~ 1.5 seconds/
iteration for a moderate model although the Jacobian matrix is recalculated
at each iteration).
ELRIS2D is an open source program which is expected to be improved
by potential users and developers. Support for including topography in the
inversion, simultaneous visualization of multiple sections, more visual and
inversion options may be added for the next releases. The current version of
the program is verified by two test models and a set of field data.
460 I. AKCA
References
Akca, I., and A.T. Baokur (2010), Extraction of structure-based geoelectric models
by hybrid genetic algorithms, Geophysics 75, 1, F15-F22, DOI: 10.1190/
1.3273851.
Baokur, A.T., and I. Akca (2011), Object-based model verification by a genetic al-
gorithm approach: Application in archeological targets, J. Appl. Geophys.
74, 4, 167-174, DOI: 10.1016/j.jappgeo.2011.05.004.
Bertin, J., and J. Loeb (1976), Experimental and Theoretical Aspects of Induced Po-
larization, Vols. 1 and 2, Gebrüder Borntraeger, Berlin.
Coggon, J.H. (1971), Electromagnetic and electrical modeling by the finite element
method, Geophysics 36, 1, 132-155, DOI: 10.1190/1.1440151.
DC2DInvRes (2014), DC2DInvRes – Tutorial, http://www. resistivity.net.
Dey, A., and H.F. Morrison (1979), Resistivity modelling for arbitrarily shaped two-
dimensional structures, Geophys. Prospect. 27, 1, 106-136, DOI: 10.1111/
j.1365-2478.1979.tb00961.x.
EarthImager (2009) EarthImager 2D. Resistivity and IP inversion software. Instruc-
tion manual, Advanced Geosciences, Inc., Austin, USA, 139 pp.
ELRIS2D 461
Edwards, L.S. (1977), A modified pseudosection for resistivity and IP, Geophysics
42, 5, 1020-1036, DOI: 10.1190/1.1440762.
Farquharson, C.G., and D.W. Oldenburg (1998), Non-linear inversion using general
measures of data misfit and model structure, Geophys. J. Int. 134, 1, 213-
227, DOI: 10.1046/j.1365-246x.1998.00555.x.
Fink, J.B., E.O. McAlister, B.K. Sternberg, W.G. Wieduwilt, and S.H. Ward (eds.)
(1990), Induced Polarization: Applications and case histories, Investiga-
tions in Geophysics, No. 4, Society of Exploration Geophysicists, Tulsa,
DOI: 10.1190/1.9781560802594.
Günther, T. (2004), Inversion methods and resolution analysis for the 2D/3D recon-
struction of resistivity structures from DC measurements, Ph.D. Thesis,
Technische Universitaet Bergakademie, Freiberg, Germany.
Günther, T., and C. Rücker (2015), Boundless Electrical Resistivity Tomography
BERT 2 – the user tutorial, http://resistivity.net/download/bert-tutorial.pdf.
Karaoulis, M., A. Revil, P. Tsourlos, D.D. Werkema, and B.J. Minsley (2013),
IP4DI: A software for time-lapse 2D/3D DC-resistivity and induced polari-
zation tomography, Comput. Geosci. 54, 164-170, DOI: 10.1016/j.cageo.
2013.01.008.
Loke, M.H. (2014), Tutorial: 2-D and 3-D electrical imaging surveys, http://www.
geotomosoft.com/coursenotes.zip.
Loke, M.H., and R.D. Barker (1996), Rapid least-squares inversion of apparent re-
sistivity pseudosections by a quasi-Newton method, Geophys. Prospect. 44,
1, 131-152, DOI: 10.1111/j.1365-2478.1996.tb00142.x.
Loke, M.H., J.E. Chambers, D.F. Rucker, O. Kuras, and P.B. Wilkinson (2013), Re-
cent developments in the direct-current geoelectrical imaging method,
J. Appl. Geophys. 95, 135-156, DOI: 10.1016/j.jappgeo.2013.02.017.
Marescot, L., S. Rigobert, S.P. Lopes, R. Lagabrielle, and D. Chapellier (2006),
A general approach for DC apparent resistivity evaluation on arbitrarily
shaped 3D structures, J. Appl. Geophys. 60, 1, 55-67, DOI: 10.1016/
j.jappgeo.2005.12.003.
Mufti, I.R. (1976), Finite-difference resistivity modeling for arbitrarily shaped two-
dimensional structures, Geophysics 41, 1, 62-78, DOI: 10.1190/1.1440608.
Oldenburg, D.W., and Y. Li (1994), Inversion of induced polarization data, Geo-
physics 59, 9, 1327-1341, DOI: 10.1190/1.1443692.
Öztürk Akca, C. (2011), Geoarcheological and new archaeogeopyhsical methods
applied at ancient settlements: Psidia Antiocheia example, Ph.D. Thesis,
Süleyman Demirel University, Isparta, Turkey.
Pelton, W.H., L. Rijo, and C.M. Swift (1978), Inversion of two-dimensional resistiv-
ity and induced-polarization data, Geophysics 43, 4, 788-803, DOI:
10.1190/1.1440854.
462 I. AKCA
Pidlisecky, A., and R. Knight (2008), FW2_5D: A MATLAB 2.5-D electrical resis-
tivity modeling code, Comput. Geosci. 34, 12, 1645-1654, DOI: 10.1016/
j.cageo.2008.04.001.
Pidlisecky, A., E. Haber, and R. Knight (2007), RESINVM3D: A 3D resistivity in-
version package, Geophysics 72, 2, H1-H10, DOI: 10.1190/1.2402499.
Res2DInv (2014), Res2DInv user manual. Version 4.03, Geotomo Software, Pe-
nang, Malaysia.
Rijo, L. (1977), Modeling of electric and electromagnetic data, Ph.D. Thesis, Uni-
versity of Utah, Salt Lake City, USA.
Rücker, C. (2011), Advanced electrical resistivity modelling and inversion using un-
structured discretization, Ph.D. Thesis, Leipzig University, Germany.
Sasaki, Y. (1994), 3-D resistivity inversion using the finite-element method, Geo-
physics 59, 12, 1839-1848, DOI: 10.1190/1.1443571.
Seigel, H.O. (1959), Mathematical formulation and type curves for induced polariza-
tion, Geophysics 24, 3, 547-565, DOI: 10.1190/1.1438625.
Shewchuk, R.J. (1997), Delaunay refinement mesh generation, Ph.D. Thesis, Carne-
gie Mellon University, Pittsburgh, USA.
Si, H. (2008), Three dimensional boundary conforming Delaunay mesh generation,
Ph.D. Thesis, Inst. für Mathematik, Technische Universitat Berlin, Germany.
Spitzer, K. (1998), The three-dimensional DC sensitivity for surface and subsurface
sources, Geophys. J. Int. 134, 3, 736-746, DOI: 10.1046/j.1365-246x.1998.
00592.x.
Sumner, J.S. (1976), Principles of Induced Polarization for Geophysical Explora-
tion, Developments in Economic Geology, Vol. 5, Elsevier Science Publ.
Co., Amsterdam.
Tripp, A.C., G.W. Hohmann and C.M. Swift (1984), Two-dimensional resistivity
inversion, Geophysics 49, 10, 1708-1717, DOI: 10.1190/1.1441578.
Tsourlos, P.I., J.E. Szymanski, and G.N. Tsokas (1998), A smoothness constrained
algorithm for the fast 2-D inversion of DC resistivity and induced polariza-
tion data, J. Balkan Geophys. Soc. 1, 1, 3-13.
Ward, S.H. (ed.) (1990), Geotechnical and Environmental Geophysics, Vols. 1-3,
Investigations in Geophysics, No. 5, Soc. of Explor. Geophysicists, Tulsa.
Wolke, R., and H. Schwetlick (1988), Iteratively reweighted least squares: algo-
rithms, convergence analysis, and numerical comparisons, SIAM J. Sci.
Stat. Comput. 9, 5, 907-921, DOI: 10.1137/0909062.
Zhou, J., A. Revil, M. Karaoulis, D. Hale, J. Doetsch, and S. Cuttler (2014), Image-
guided inversion of electrical resistivity data, Geophys. J. Int. 197, 1, 292-
309, DOI: 10.1093/gji/ggu001.