You are on page 1of 7

ERT2D: A 2D MATLAB Simulator for

Electrical Resistance Tomography


Alireza Aghasi

Abstract
ERT2D is a MATLAB simulator for electrical resistance tomography (ERT).
The code provides the data vector and the model Jacobian matrix to be used in
any gradient-based inversion scheme. The software is specifically designed for 2D
geophysics examples, although with slight modifications the code would support
other applications (e.g. medical). The simulator uses the finite difference tech-
nique to numerically solve the underlying partial differential equation (PDE) and
employs an Adjoint technique to calculate the model Jacobian matrix.

1 Problem Setup
For an imaging domain with surface boundary , the forward model of interest
motivated by several geophysical applications is

((x)(x)) = s(x) in , (1)



(x) (x) + (x)(x) = 0 on . (2)
n
In the context of electrical tomography as a basic modality, is the electrical potential,
s the current distribution and is the electrical conductivity. All quantities are as-
sumed to be functions of 2D spatial coordinates, x = [x y]T . Regarding the boundary
condition (2), the notation /n denotes the normal component of the gradient of
on , and (x) and (x) are functions defined on the surface (i.e., x ) which are
not simultaneously zero.
A common geophysical problem associated with the model in (1)(2) is shown in
Figure 1. In this problem consist of n , the interface between the earth and air

School of Electrical and Computer Engineering, Georgia Institute of Technology, Atlanta, GA,
USA
Email contact: aghasi@gatech.edu

1
Figure 1: The 2D modeling region for ERT. The imaging region of size `y by `x is
surrounded by the sources and detectors. A Neumann boundary condition is considered
for the top region (y = 0) and absorbing boundary condition is considered for the
remaining boundaries. The dashed lines correspond to the dipole nodes used in every
experiment.

where we impose a zero current condition ( = 0, = 1) and m , a surface with Robin


boundary condition where the values and are chosen to model an infinite half-space
(as if the imaging domain is extended to infinity from the left, right and bottom sides).
A well established absorbing boundary condition (ABC) to model an infinite half
space is the one proposed by Dey and Morrison [3]. For a current point source located
at xs , i.e., s(x) = (x xs ), the proposed ABC is in the form of [1]

(x) + (x)(x) = 0, (3)
n
where
(x xs ) n
(x) = , x m (4)
x xs 2
and n is the outward unit normal vector at x m . Clearly the ABC considered is
dependent on the source position and therefore the boundary condition changes when
we consider different source locations for different experiments.
For simplicity here, we only consider real-valued conductivity (that is the
ERT problems) although the approach can easily be adapted to handle complex valued
conductivity (impedance tomography).

2
1.1 Experiment Setup
The ERT test configuration for the problem is shown in Figure 1. The imaging domain
of size `y `x extends from `x /2 to `x /2 in the x direction and from `y to 0 in the y
direction. The top side (y = 0) represents the air interface where a Neumann boundary
condition is applied. At the remaining sides, absorbing boundary condition is applied
to model an infinite half space.
The sensor placement and configuration are also shown in the figure. In total ns
sensors may be located on the periphery of the imaging domain. To make the set of
electrical measurements denser, ne experiments may be carried out. In each experiment
two sensors should act as the current dipole (connected via the lines in Figure 1) and
the remaining sensors measure the corresponding electric potential. The dipoles are
usually chosen in a cross medium configuration to make the data more sensitive to the
objects within the central parts of the domain. It should be noted that ERT2D only
supports electrical currents in the dipole form. With this setup the size of the
total data vector becomes ne (ns 2).
Measurement data are generated by a finite difference solution of the Poissons
equation, over the rectangular domain shown. For this purpose the imaging domain
is discretized into m grids in the y direction and n grids in the x direction (Figure2).
In fact, the proposed boundary condition in [3] models an infinite half space more
accurately as the distance to the current source increases. For this purpose the program
allows some grid extension in the x and y direction, here denoted as nx and ny . We
would like to note that the grid extension in the y direction only takes place at the
bottom side.
As an implementation detail, it is discussed in [4] that to apply the aforementioned
ABC, in a finite difference scheme a Dirichlet boundary condition may be considered
and instead the conductivity of the boundary nodes may be scaled by (x). ERT2D
follows the same strategy in imposing the proposed ABC.

1.2 Adjoint Field Sensitivity Calculation


ERT2D may be employed by any gradient-based inversion scheme to invert for the
conductivity values based on the observed data. ERT2D is equipped with the Adjoint
technique to calculate the sensitivity of the sensor readings to the conductivity of each
grid within the domain [2]. The details of the Adjoint technique are brought here as a
general overview of the method.
For s(x) = (x xs ), i.e., a point source current at xs , we denote by s (x) the
resulting potential over the domain and consider the measured potential at xd
as
ds = s (x)(x xd )dx. (5)

3
Figure 2: The imaging domain is discretized into m grids in the y direction and n grids
in the x direction. The program allows some grid extension in the x and y direction,
here shown as nx and ny . To apply the proposed ABC, the conductivity values are
scaled by (x) at the boundary nodes. The scaling is shown by the varying values of
the conductivity at the boundary nodes. Here the scaling corresponds to the current
point source highlighted in the figure.

As stated in [2], the variation of ds resulting from a perturbation in the conductivity


(i.e., the Frechet derivative of the measurements with respect to the conductivity) can
be expressed as
dds
[] = s d dx, (6)
d
where d is the adjoint field that results from placing the current point source at xd .
Using the superposition principle the result may be easily adapted to the dipole current
source case.
In a discrete representation, denoting ei as the electric potential at the i-th sensor
resulted from a current point source at the j-th sensor, and k the conductivity of the
k-th pixel in the domain (k = 1, , nm), we have

ei
= (i ) (j ), (7)
k
which would be central equation in calculating the Jacobian entries.

4
1.3 The MATLAB Code
ERT2D package consists of two main functions:

1. paramPackGenerator.m

2. ERT2D.m

The package is also equipped with a demo file (Demo.m) for a sample simulation.
The paramPackGenerator function generates a single struct as the output which
contains matrices and variables that only need to be calculated once. This struct is
used by the ERT2D to generate the data vector and the Jacobian matrix. The function
is called in the following manner:
ERTParams=paramPackGenerator(domainGridSize, sigmaBackground,...
domainDimX, domainDimY, ExNo sides, ExNo bottom)

The input variables are as follows:

domainGridSize: is the domain grid size as a 1 2 vector [m, n] where m and


n are the vertical and horizontal number of grids, depicted in Figure 2.

sigmaBackground: is the background conductivity value, or basically the con-


ductivity value near the boundaries. This is a positive scalar. The program
assigns this conductivity to the extended grids. To apply the ABC this con-
ductivity value is appropriately scaled at the extended boundaries to model an
infinite half space.

domainDimX: is simply `x in meters.

domainDimX: is `y in meters.

ExNo sides: is the horizontal grid extension nex .

ExNo bottom: is the vertical grid extension ney .

The output is ERTParams which contains several variables required by the ERT2D pro-
gram. Many data files and matrices (e.g., the finite difference gradient matrices) that
can be calculated only once are encapsulated inside ERTParams and enable ERT2D to
be evaluated multiple times without a need to generate such matrices each time. This
is of course a desirable feature in inversion programs that ERT2D needs to be called
iteratively.
The program also requires three setting files to be made available as .mat files:

5
nodes.mat: is a matrix of size ns 2 which contains the normalized x and y
coordinates of each sensor in the domain. Note that the coordinates need
to be normalized to the length of the domain in each direction. In
the normalized domain the x values vary from 0.5 to 0.5 and the y values vary
between 1 and 0. For instance if `x = 10 and `y = 6, a sensor positioned at the
point [5, 3] should be represented by the coordinates [0.5, 0.5] in the data
file nodes.mat.
dipole configuration.mat: contains the dipole architecture. This is a matrix
of size ne 2 that indicates which sensors are used as the dipole nodes at each
experiment. For instance if a row of dipole configuration contains the num-
bers 5 and 7, it means the sensors on the fifth and seventh lines of the variable
nodes are considered as dipoles in one of the experiments.
dipole voltages.mat: This is also a matrix of size ne 2 that indicates the
dipole voltages in each experiment. Normally, this is only a matrix of 1 entries.
The main program ERT2D is called in the following manner:

[sens data Jacobian]=ERT2D(cond disb, evaluation, ERTParams)

The input variables are as follows:


cond disb: is an mn matrix which contains the values of electrical conductivity
at each grid. The program is meant to calculate the sensor measurements and
sensitivity matrix for such conductivity distribution.
evaluation: only takes values of 1 and 2. If 1, the output is only the sensor
data and the Jacobian calculation is skipped (the Jacobian matrix is empty). If
2, both the sensor data as well as the Jacobian matrix are evaluated.
ERTParams: is the encapsulated variable generated by the paramPackGenerator
function which allows passing all required inputs and settings via a single variable.
The output variables are as follows:
sens data: is a vector of size ne (ns 2) which contains all the sensor potential
measurements for the given cond disb. The first ns 2 elements of sens data are
the sensor readings in the first experiment, the second ns 2 elements correspond
to the second experiment sensor readings and so on.
Jacobian: is a matrix of size ne (ns 2) nm where the j-th column corre-
sponds to the sensitivity of the ne (ns 2) sensor readings to the j-th pixel in the
conductivity matrix.

6
Finally, Demo.m is a simple demo that models ERT in a given domain with some
generic input files. The program illustrates the problem setting and shows the data
for a test conductivity distribution. Also the Jacobian is evaluated and compared by
once using infinitesimal perturbation of a certain pixel in the conductivity and once
extracting the corresponding column of the Jacobian matrix generated by the program.

1.4 Parallel Processing


ERT2D code supports MATLAB parallel processing feature, which may significantly
speed up the processing time. Enabling the parallel processing option is simply possi-
ble by applying the following command in the MATLAB command window:

>> matlabpool open

If MATLAB is able to successfully connect to multiple processing units, any calls


to ERT2D afterwards would enjoy the parallel precessing feature.

Acknowledgement
This program is based upon work supported by the National Science Foundation under
grant no. EAR 0838313. Any opinions, findings, and conclusions or recommendations
expressed in this material are those of the authors and do not necessarily reflect the
views of theNational Science Foundation.

References
[1] Alireza Aghasi, Parametric Shape Based Methods for Inverse Problems, PhD
thesis, Tufts University, 2012.

[2] A. Aghasi and E.L. Miller, Sensitivity calculations for Poissons equation via
the adjoint field method, Geoscience and Remote Sensing Letters, IEEE, 9 (2012),
pp. 237 241.

[3] A. Dey and HF Morrison, Resistivity modeling for arbitrarily shaped three-
dimensional structures, Geophysics, 44 (1979), pp. 753780.

[4] Jie Zhang, Randall L Mackie, and Theodore R Madden, 3-d resistivity
forward modeling and inversion using conjugate gradients, Geophysics, 60 (1995),
pp. 13131325.

You might also like