0% found this document useful (0 votes)
45 views57 pages

Grav3d Manual

This document provides an overview and instructions for using GRAV3D v5.0, a program library for forward modeling and inverting gravity data over 3D structures. Key updates from the previous version include improved parallelization using OpenMP, a new MPI-based cluster code, and the ability to model borehole gravity surveys. The library contains programs for forward modeling, calculating depth weights, generating sensitivity matrices, predicting data from models, and inverting data. It was developed with industry support to facilitate 3D modeling and inversion of gravity surveys.

Uploaded by

Fatimah Az Zahra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views57 pages

Grav3d Manual

This document provides an overview and instructions for using GRAV3D v5.0, a program library for forward modeling and inverting gravity data over 3D structures. Key updates from the previous version include improved parallelization using OpenMP, a new MPI-based cluster code, and the ability to model borehole gravity surveys. The library contains programs for forward modeling, calculating depth weights, generating sensitivity matrices, predicting data from models, and inverting data. It was developed with industry support to facilitate 3D modeling and inversion of gravity surveys.

Uploaded by

Fatimah Az Zahra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

GRAV3D

A Program Library for Forward Modelling and


Inversion of Gravity Data over 3D Structures
Version 5.0

Developed under the consortium research project:

COOPERATIVE INVERSION OF GEOPHYSICAL


AND GEOLOGICAL DATA

Release date: September 2013

UBC - Geophysical Inversion Facility 1988 – 2013


Table of Contents

1 Package overview 1
1.1 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 GRAV3D program library content . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Licensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Installing GRAV3D v5.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 GRAV3D v5.0: Highlights of changes from version 4.0 . . . . . . . . . . . . . . . . . 3
1.6 Notes on computation speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 Background theory 5
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Forward Modelling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Inversion methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.4 Depth Weighting and Distance Weighting . . . . . . . . . . . . . . . . . . . . . . . . 8
2.5 Wavelet Compression of Sensitivity Matrix . . . . . . . . . . . . . . . . . . . . . . . 10

3 Elements of the program GRAV3D 13


3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.2 General files for GRAV3D v5.0programs . . . . . . . . . . . . . . . . . . . . . . . . . 13

4 Running the programs 21


4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.2 GZFOR3D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.3 PFWEIGHT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.4 GZSEN3D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.5 GZINV3D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.6 GZPRE3D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

5 Examples 33
5.1 Forward modelling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.2 Inversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.3 Wavelet diagnostic tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

6 References 53

iv
1 Package overview

1.1 Description

GRAV3D v5.0 is a program library for carrying out forward modelling and inversion of surface and
airborne gravity data over 3D structures. The program library carries out the following functions:

1. Forward modelling of the vertical component of the gravity response to a 3D volume of density
contrast.

2. The model is specified in the mesh of rectangular cells, each with a constant value of density
contrast. Topography is included in the mesh. The vertical gravity response can be calculated
anywhere within the model volume, including above the topography to simulate ground or
airborne surveys. There is also a capability to simulate and invert data collected beneath the
surface (e.g. borehole surveys) and combinations of ground and borehole surveys.

• The inversion is solved as an optimization problem with the simultaneous goals of (i)
minimizing a model objective function and (ii) generating synthetic data that match
observations to within a degree of misfit consistent with the statistics of those data.
• To counteract the inherent lack of information about the distance between source and
measurement, the formulation incorporates depth or distance weighting.
• By minimizing the model objective function, distributions of subsurface susceptibility
contrast are found that are both close to a reference model and smooth in three di-
mensions. The degree to which either of these two goals dominates is controlled by the
user by incorporating a priori geophysical or geological information into the inversion.
Explicit prior information may also take the form of upper and lower bounds on the
susceptibility contrast in any cell.
• The regularization parameter (controlling relative importance of objective function and
misfit terms) is determined in either of three ways, depending upon how much is known
about errors in the measured data.
• Implementation of parallel computing architecture (OpenMP) allows the user to take
full advantage of multi-core processors on a CPU. A cluster-based code using Message
Passing Interface (MPI) is also available. Notes on computation speed are found at the
end of this section.

3. The large size of 3D inversion problems is mitigated by the use of wavelet compression.
Parameters controlling the implementation of this compression are available for advanced
users.

The initial research underlying this program library was funded principally by the mineral
industry consortium “Joint and Cooperative Inversion of Geophysical and Geological Data” (1991
- 1997) which was sponsored by NSERC (Canada’s National Science and Engineering Research
Council) and the following 11 companies: BHP Minerals, CRA Exploration, Cominco Exploration,
Falconbridge, Hudson Bay Exploration and Development, INCO Exploration & Technical Services,

1
Kennecott Exploration Company, Newmont Gold Company, Noranda Exploration, Placer Dome,
and WMC.
The current improvements have been funded by the consortium “Potential fields and software
for advanced inversion” sponsored by Newmont, Teck, Xstrata, Vale, Computational Geoscience
Inc, Cameco, Barrick, Rio Tinto, and Anglo American.

1.2 GRAV3D program library content

1. Executable programs. For performing 3D forward modelling and inversion of magnetic


surveys. The MAG3D library (Windows or Linux platforms) consists of four major programs:
• GZFOR3D: performs forward modelling
• PFWEIGHT: calculates the depth/distance weighting function
• GZSEN3D: calculates the sensitivity matrix
• GZPRE3D: multiplies the sensitivity file by the model to get the predicted data
• GZINV3D: performs 3D gravity inversion.
2. Graphical user interfaces. GUI-based utilities for these codes include respective viewers
for the data and models. They are only available on Windows platforms and can be freely
downloaded through the UBC-GIF website:
• GM-DATA-VIEWER: a utility for viewing raw surface or airborne data (not borehole data),
error distributions, and for comparing observed to predicted data directly or as difference
maps.
• MESHTOOLS3D: a utility for displaying resulting 3D models as volume renderings. Suscep-
tibility volumes can be sliced in any direction, or isosurface renderings can be generated.
3. Documentation is provided for GRAV3D v5.0.
4. An example data set are provided in “Examples” directory within the compressed folder.
The example data set is also given at the end of this manual.

1.3 Licensing

A constrained educational version of the program is available with the IAG package (please visit
UBC-GIF website for details). The educational version is fully functional so that users can learn
how to carry out effective and efficient 3D inversions of magnetic data. However, RESEARCH
OR COMMERCIAL USE IS NOT POSSIBLE because the educational version only
allows a limited number of data and model cells.
Licensing for an unconstrained academic version is available - see the Licensing policy document.
NOTE: All academic licenses will be time-limited to one year. You can re-apply after that
time. This ensures that everyone is using the most recent versions of codes.
Licensing for commercial use is managed by third party distributors. Details are in the Licensing
policy document.

2
1.4 Installing GRAV3D v5.0

There is no automatic installer currently available for the GRAV3D v5.0. Please follow the following
steps in order to use the software:

1. Extract all files provided from the given zip-based archive and place them all together in a
new folder such as C:\ubcgif\grav3d\bin

2. Add this directory as new path to your environment variables.

Two additional notes about installation:

• Do not store anything in the “bin” directory other than executable applications and Graphical
User Interface applications (GUIs).

• A Message Pass Interface (MPI) version is available for Linux upon and the installation
instructions will accompany the code.

1.5 GRAV3D v5.0: Highlights of changes from version 4.0

The principal upgrades, described below, allow the new code to take advantage of current multi-core
computers and also provide greater flexibility to incorporate the geological information.
Improvements since version 4.0:

1. A new projected gradient algorithm is used to implement hard constraints.

2. Fully parallelized computational capability (for both sensitivity matrix calculations and in-
version calculations).

3. A facility to have active and inactive (i.e. fixed) cells.

4. Bounds are be specified through two separate files, rather than one two-column file.

5. Additional flexibility for incorporating the reference model in the model objective function
facilitates the generation of smooth models when borehole constraints are incorporated.

6. The gzinv3d.log file has been simplified and detailed information on the inversion can be
found in the gzinv3d.out file.

7. An alternative version of the software compatible with Message Pass Interface (MPI) is avail-
able for Linux.

8. Backward compatibility: The new version has changed the input file format and the bounds
file. Data, mesh, model, and topographic file formats have not changed.

3
1.6 Notes on computation speed

• For large problems, GRAV3D v5.0 is significantly faster than the previous single processor
inversion because of the parallelization for computing the sensitivity matrix computation and
inversion calculations. Using multiple threads for running the parallelized version resulted in
sensitivity matrix calculation speedup proportional to the number of threads. The increase
in speed for the inversion was less pronounced, but still substantial.

• It is strongly recommended to use multi-core processors for running the gzsen3d and gzinv3d.
The calculation of the sensitivity matrix (G) is directly proportional to the number of data.
The parallelized calculation of the n rows of G is split between p processors. By default,
all available processors are used. There is a feature to limit p to a user-defined number of
processors.

• In the parallelized inversion calculation, GT G is multiplied by a vector, therefore each par-


allel process uses only a sub-matrix of G and then the calculations are summed. Since there
is significant communication between the CPUs, the speedup is less than a direct propor-
tionality to the number of processors. However when running the same inversion under MPI
environment on multiple computers the advantage is that a single computer does not have to
store the entire sensitivity matrix.

• For incorporating bound information, the implementation of the “projected gradient” algo-
rithm in version 5.0 is primarily that the projected gradient results in a significantly faster
solution than the logarithmic barrier technique used in earlier versions.

4
2 Background theory

2.1 Introduction

This manual presents theoretical background, numerical examples, and explanation for implement-
ing the program library GRAV3D v5.0. This suite of algorithms, developed at the UBC Geophysical
Inversion Facility, is needed to invert gravimetric responses over a 3 dimensional distribution of den-
sity contrast, or anomalous density. The manual is designed so that geophysicists who are familiar
with the gravity experiment, but who are not necessarily versed in the details of inverse theory,
can use the codes and invert their data. In the following, we describe the basics of the algorithm,
but readers are referred to (Li and Oldenburg, 1998) for an in-depth discussion of various aspects
of the algorithm. Note that an understanding of these components is necessary for the user to have
a global view of the algorithms and to use the program library correctly.
A gravity experiment involves measuring the vertical components of the gravity field produced
by anomalous (either excess or deficient) mass beneath the surface. A distribution of anomalous
mass, characterized by anomalous density ρ(x, y, z), produces its own gravity field, gs , which is
superimposed on the ambient gravity field. By measuring the resultant field and removing the
ambient field from the measurements through numerical processing, one obtains the field due to
the anomalous mass.
The vertical component of the gravity field produced by the density ρ(x, y, z) is given by

z − zo
Z
gz (ro ) = γ ρ(r) dv, (1)
|r − ro |3
V

where ro = (xo , yo , zo ) is the vector denoting the observation location and r = (x, y, z) is the source
location. The volume of the anomalous mass is V and γ is the gravitational constant. Here we
have adopted a Cartesian coordinate system having its origin on the earth’s surface and the z−axis
pointing vertically downward. In the following, we outline the basics of the forward and inverse
procedures used by the GRAV3D v5.0 program library.

2.2 Forward Modelling

Forward modelling of gravity data is a linear problem and can be carried out by performing the
integration in equation 1. We divide the region of interest into a set of 3D prismatic cells by using
a 3D orthogonal mesh and assume a constant density contrast within each cell. We discretize the
density contrast model in this manner since it is best suited for our inversion methodology. Given
such a discretization, the gravity field at the ith location can be written as:

5
di ≡ gz (roi ),
 
M  
z − zo
X  Z 
= ρj γ dv ,
j=1

 |r − roi |3  
∆Vj
M
X
≡ ρj Gij . (2)
j=0

In equation 2, ρj and ∆Vj are the anomalous density and volume of the j th cell, di is introduced
as a generic symbol for the ith datum, and Gij , defined by the expression in brackets, quantifies
the contribution of the j th cell to the ith datum. The solution for the integral in equation 2 can be
found in (Nagy, 1966) and we have adopted the solution by (Haáz, 1953) here.

2.3 Inversion methodology

Let the set of extracted anomaly data be d = (d1 , d2 , ..., dN )T and the density contrast of cells in
the model be ρ = (ρ1 , ρ2 , ..., ρM )T . The two are related by the sensitivity matrix

d = Gρ. (3)

The matrix has elements gij which quantify the contribution to the ith datum due to a unit density
in the j th cell. The program GZSEN3D performs the calculation of the sensitivity matrix, which is
to be used by the subsequent inversion. The sensitivity matrix provides the forward mapping from
the model to the data during the entire inverse process. We will discuss its efficient representation
via the wavelet transform in a separate section.
For magnetic inversion the first question that arises concerns definition of the “model”. We
choose density contrast, ρ, as the model for GZINV3D since the anomalous field is directly propor-
tional to the density contrast. The inverse problem is formulated as an optimization problem where
a global objective function, φ, is minimized subject to the constraints in equation 3. The global
objective functions consists of two components: a model objective function, φm , and a data misfit
function, φd , such that

min φ = φd + βφm (4)


l u
s. t. ρ ≤ ρ ≤ ρ ,

where β is a trade off parameter that controls the relative importance of the model smoothness
through the model objective function and data misfit function. When the standard deviations of
data errors are known, the acceptable misfit is given by the expected value φd and we will search for
the value of β via an L-curve criterion (Hansen, 2000) that produces the expected misfit. Otherwise,
a user-defined value is used. Bound are imposed through the projected gradient method so that
the recovered model lies between imposed lower (ρl ) and upper (ρu ) bounds.

6
We next discuss the construction of a model objective function which, when minimized, pro-
duces a model that is geophysically interpretable. The objective function gives the flexibility to
incorporate as little or as much information as possible. At the very minimum, this function drives
the solution towards a reference model ρo and requires that the model be relatively smooth in the
three spatial directions. Here we adopt a right handed Cartesian coordinate system with positive
north and positive down. Let the model objective function be

 2
∂w(r)[ρ(r) − ρo ]
Z Z
2
φm (ρ) = αs ws {w(r)[ρ(r) − ρo ]} dv + αx wx dv (5)
∂x
V V
 2  2
∂w(r)[ρ(r) − ρo ] ∂w(r)[ρ(r) − ρo ]
Z Z
+ αy wy dv + αz wz dv,
∂y ∂z
V V

where the functions ws , wx , wy and wz are spatially dependent, while αs , αx , αy and αz are
coefficients, which affect the relative importance of different components in the objective function.
The reference model is given as ρo and w(r) is a generalized depth weighting function. The purpose
of this function is to counteract the geometrical decay of the sensitivity with the distance from the
observation location so that the recovered density contrast is not concentrated near the observation
locations. The details of the depth weighting function will be discussed in the next section.
The objective function in equation 5 has the flexibility to incorporate many types of prior
knowledge into the inversion. The reference model may be a general background model that is
estimated from previous investigations or it will be a zero model. The reference model would
generally be included in the first component of the objective function but it can be removed if
desired from the remaining terms; often we are more confident in specifying the value of the model
at a particular point than in supplying an estimate of the gradient. The choice of whether or not
to include ρo in the derivative terms can have significant effect on the recovered model as shown
through the synthetic example. The relative closeness of the final model to the reference model at
any location is controlled by the function ws . For example, if the interpreter has high confidence
in the reference model at a particular region, he can specify ws to have increased amplitude there
compared to other regions of the model. The weighting functions wx , wy , and wz can be designed to
enhance or attenuate gradients in various regions in the model domain. If geology suggests a rapid
transition zone in the model, then a decreased weighting on particular derivatives of the model will
allow for higher gradients there and thus provide a more geologic model that fits the data.
Numerically, the model objective function in equation 5 is discretized onto the mesh defining
the density contrast model using a finite difference approximation. This yields:

φm (ρ) = (ρ − ρo )T (αs WsT Ws + αx WxT Wx + αy WyT Wy + αz WzT Wz )(ρ − ρo ),


≡ (ρ − ρo )T Wm
T
Wm (ρ − ρo ),
= kWm (ρ − ρo )k2 , (6)

where m and mo are M -length vectors representing the recovered and reference models, respectively.
Similarly, there is an option to remove to the reference model from the spatial derivatives in equation

7
6 such that

φm (ρ) = (ρ − ρo )T (αs WsT Ws )(ρ − ρo ) + ρT (αx WxT Wx + αy WyT Wy + αz WzT Wz )ρ,


≡ (ρ − ρo )T WsT Ws (ρ − ρo ) + ρT Wm
T
Wm ρ,
= kWs (ρ − ρo ) + Wm ρk2 . (7)

In the previous two equations, the individual matrices Ws , Wx , Wy , and Wz are straight-forwardly
calculated once the model mesh and the weighting functions w(r) and ws , wx , wy , wz are defined.
The cumulative matrix Wm T W is then formed for the chosen configuration.
m

The next step in setting up the inversion is to define a misfit measure. Here we use the l2 -norm
measure

φd = kWd (Gρ − d)k2 . (8)

For the work here, we assume that the contaminating noise on the data is independent and Gaussian
with zero mean. Specifying Wd to be a diagonal matrix whose ith element is 1/σi , where σi is the
standard deviation of the ith datum makes φd a chi-squared distribution with N degrees of freedom.
The optimal data misfit for data contaminated with independent, Gaussian noise has an expected
value of E[χ2 ] = N , providing a target misfit for the inversion. We now have the components to
solve the inversion as defined in equation 4.
To solve the optimization problem when constraints are imposed we use the projected gradients
method (Calamai and Moré, 1987; Vogel, 2002). This technique forces the gradient in the Krylov
sub-space minimization (in other words a step during the conjugate gradient process) to zero if
the proposed step would make a model parameter exceed the bound constraints. The result is a
model that reaches the bounds, but does not exceed them. This method is computationally faster
than the log-barrier method because (1) model parameters on the bounds are neglected for the next
iteration and (2) the log-barrier method requires the calculation of a barrier term. Previous versions
of GRAV3D used the logarithmic barrier method (Wright, 1997; Nocedal and Wright, 1999).
The weighting function is generated by the program PFWEIGHTS that is in turn given as input to
the sensitivity generation program GZSEN3D. This gives the user full flexibility in using customized
weighting functions. This program allows user to specify whether to use a generalized depth
weighting or a distance-based weighting that is useful in regions of largely varying topography.
Distance weighting is required to be used when borehole data are present.

2.4 Depth Weighting and Distance Weighting

It is a well-known fact that vertical gravity data have no inherent depth resolution. A numerical
2
R
consequence of this is that when an inversion is performed, which minimizes m(r) dv, subject to
fitting the data, the constructed density contrast is concentrated close to the observation locations.
This is a direct manifestation of the kernel’s decay with the distance between the cell and observation
locations. Because of the rapidly diminishing amplitude, the kernels of gravity data are not sufficient
to generate a function, which possess significant structure at locations that are far away from
observations. In order to overcome this, the inversion requires a weighting to counteract this
natural decay. Intuitively, such a weighting will be the inverse of the approximate geometrical

8
decay. This give cells at all locations equal probability to enter into the solution with a non-zero
density contrast.

2.4.1 Depth weighting for surface or airborne data

For surface data, the sensitivity decays predominantly in the depth direction. Numerical exper-
iments indicate that the function of the form (z + zo )−2 closely approximates the kernel’s decay
directly under the observation point provided that a reasonable value is chosen for zo . The value
of 2 in the exponent is consistent with the fact that, to first order, a cuboidal cell acts like a dipole
source whose gravity field decays as inverse distance squared. The value of zo can be obtained by
matching the function 1/(z + zo )2 with the field produced at an observation point by a column of
cells. Thus we use a depth weighting function of the form

 1/2
Z
 1 dz
w(rj ) =  , j = 1, ..., M. (9)

∆zj (z + zo )α

∆zij

For the inversion of surface data, where α = 2.0, rj is used to identify the j th cell, and ∆zj is
its thickness. This weighting function is first normalized so that the maximum value is unity.
Numerical tests indicate that when this weighting is used, the density contrast model constructed
by minimizing a model objective function in equation 5, subject to fitting the data, places the
recovered anomaly at approximately the correct depth.
If the data set involves highly variable observation heights the normal depth weighting function
might not be most suitable. Distance weighting used for borehole data may be more appropriate
as explained in the next section.

2.4.2 Distance weighting for borehole data

For data sets that contain borehole measurements, the sensitivities do not have a predominant decay
direction, therefore a weighting function that varies in three dimensions is needed. We generalize
the depth weighting used in surface data inversion to form such a 3D weighting function called
distance weighting:

  2 1/4
 N Z 
1 X dv 
w(rj ) = p , j = 1, ..., M, (10)
 
(Rij + Ro )α 
 
∆Vj 
 i=1 
∆Vj

where α = 2.0, Vj is the volume of j th cell, Rij is the distance between a point within the source
volume and the ith observation, and Ro is a small constant used to ensure that the integral is well-
defined (chosen to be a quarter of the smallest cell dimension). Similarly, this weighting function
is normalized to have a maximum value of unity. For inversion of borehole data, it is necessary to
use this more general weighting. This weighting function is also advantageous if surface data with
highly variable observation heights are inverted.

9
2.5 Wavelet Compression of Sensitivity Matrix

The two major obstacles to the solution of a large scale magnetic inversion problem are the large
amount of memory required for storing the sensitivity matrix and the CPU time required for
the application of the sensitivity matrix to model vectors. The GRAV3D v5.0 program library
overcomes these difficulties by forming a sparse representation of the sensitivity matrix using a
wavelet transform based on compactly supported, orthonormal wavelets. For more details, the
users are referred to Li and Oldenburg (2003, 2010). In the following, we give a brief description
of the method necessary for the use of the GRAV3D v5.0 library.
Each row of the sensitivity matrix in a 3D magnetic inversion can be treated as a 3D image
and a 3D wavelet transform can be applied to it. By the properties of the wavelet transform,
most transform coefficients are nearly or identically zero. When coefficients of small magnitudes
are discarded (the process of thresholding), the remaining coefficients still contain much of the
necessary information to reconstruct the sensitivity accurately. These retained coefficients form
a sparse representation of the sensitivity in the wavelet domain. The need to store only these
large coefficients means that the memory requirement is reduced. Further, the multiplication of
the sensitivity with a vector can be carried out by a sparse multiplication in the wavelet domain.
This greatly reduces the CPU time. Since the matrix-vector multiplication constitutes the core
computation of the inversion, the CPU time for the inverse solution is reduced accordingly. The
use of this approach increases the size of solvable problems by nearly two orders of magnitude.
Let G be the sensitivity matrix and W be the symbolic matrix-representation of the 3D wavelet
transform. Then applying the transform to each row of G and forming a new matrix consisting of
rows of transformed sensitivity is equivalent to the following operation:

e = GW T ,
G (11)
where G e is the transformed matrix. The thresholding is applied to individual rows of G by the
e S,
following rule to form the sparse representation G

(
s geij if |e
gij | ≥ δi
geij = , i = 1, . . . , N, (12)
0 if |e
gij | < δi
s are the elements of G
where δi is the threshold level, and geij and geij e and Ge S , respectively. The
threshold level δi are determined according to the allowable error of the reconstructed sensitivity,
which is measured by the ratio of norm of the error in each row to the norm of that row, ri (δi ). It
can be evaluated directly in the wavelet domain by the following expression:

v P
ge2
u
u |egij |<δi ij
u
ri (δi ) = u
t P 2 , i = 1, . . . , N, (13)
geij
j

Here the numerator is the norm of the discarded coefficients and the denominator is the norm of
all coefficients. The threshold level δio is calculated on a representative row, io . This threshold is

10
then used to define a relative threshold  = δio /max |e
gij |. The absolute threshold level for each row
j
is obtained by

δi = max |e
gij | , i = 1, . . . , N. (14)
j

The program that implements this compression procedure is GZSEN3D. The user is asked to
specify the relative error r∗ and the program will determine the relative threshold level δi . Usually
a value of a few percent is appropriate for r∗ . When both surface and borehole data are present,
two different relative threshold levels are calculated by choosing a representative row for surface
data and another for borehole data. For experienced users, the program also allows the direct input
of the relative threshold level.

11
3 Elements of the program GRAV3D

3.1 Introduction

The GRAV3D v5.0 program library consists of the programs:

1. GZFOR3D: performs forward modelling.


2. PFWEIGHTS: calculates depth weighting function.
3. GZSEN3D: calculates sensitivity for the inversion.
4. GZINV3D: performs 3D gravity inversion.
5. GZPRE3D: multiplies the sensitivity file by the model to get the predicted data. This rarely used
utility multiplies a model by the sensitivity matrix in gzinv3d.mtx to produce the predicted
data. This program is included so that users who are not familiar with the wavelet transform
and the structure of gzinv3d.mtx can utilize the available sensitivity matrix to carry out
model studies.

Each of the above programs requires input files and the specification of parameters in order to
run. However, some files are used by a number of programs. Before detailing the procedures for
running each of the above programs, we first present information about these general files.

3.2 General files for GRAV3D v5.0programs

There are seven general files which are used in GRAV3D v5.0. All are in ASCII text format.
Input files can have any user-defined name. Program output files have restricted file names that
will be over-written if already in the directory. Also the filename extensions are not important.
Many prefer to use the *.txt filename convention so that files are more easily read and edited in
the Windows environment. File and file locations can have spaces in the name or path, but it is
discouraged. The file name (absolute or relative path) must be 500 characters or less in length.
The files contain components of the inversion:

1. mesh: defines the discretization of the 3D model region.


2. topography: specifies the surface topography
3. location: specifies the data locations, and is typically used for forward modelling
4. observation: specifies the observation locations, observed gravity anomalies, and estimated
uncertainties, and is used for the inversion
5. model: model file structure for forward, initial, reference, upper bounds, lower bounds, and
recovered models
6. weighting: file that contains user-supplied 3D weighting functions
7. active: Contains information about active/inactive cells (same format as a model)

13
3.2.1 Mesh file

This file contains the 3D mesh, for example mesh.msh, which defines the model region. Mesh file
has the following structure:

NE NN NZ
Eo No Zo
∆E1 ∆E2 ··· ∆EN E
∆N1 ∆N2 ··· ∆NN N
∆Z1 ∆V2 ··· ∆ZN Z

NE Number of cells in the East direction.

NN Number of cells in the North direction

NZ Number of cells in the vertical direction

Eo No Zo Coordinates, in meters, of the southwest top corner, specified in (Easting, Northing, Eleva-
tion). The elevation can be relative to a reference elevation other than the sea level, but
it needs to be consistent with the elevation used to specify the locations, observations, and
topography files (see the relevant file descriptions).

∆En nth cell width in the easting direction (ordered W to E).

∆Nn nth cell width in the northing direction (ordered S to N).

∆Zn nth cell thickness (ordered top to bottom).

The mesh can be designed in accordance with the area of interest and the spacing of the data
available in the area. In general, the mesh consists of a core region which is directly beneath the
area of available data, and a padding zone surrounding this core mesh. Within the core mesh, the
size of the cells should be comparable with the spacing of the data. There is no restriction on the
relative position of data location and nodal points in horizontal direction. The cell width in this
area is usually uniform.
The maximum depth of the mesh used for inversion should be large enough so that no magnetic
material below that depth would produce a noticeable anomaly with the length scale covered by the
data area. A rule of thumb is that the maximum depth should be at least half of the longest side of
the data area. Based upon the user’s knowledge of the survey area, one may adjust the maximum
depth as necessary. The cell thickness in vertical direction usually increases slightly with depth.
In the shallow region, the ratio of thickness to width of about half is good, especially when surface
topography is present. At depth, a cell thickness close to the cell width is advisable. Once this
core mesh is designed, it can be extended laterally by padding with a few cells, possibly of variable
width. This padding is necessary when the extracted anomalies are close to the boundary of the core
mesh or if there are influences from anomalies outside the area which cannot be easily removed.
Problems with more than 1,000,000 model cells, and/or more than a few thousand data points

14
would be considered large, and can be expected to require a considerable amount of computing
memory and time.
The vertical position of the mesh is specified in elevation. This is to accommodate the inversion
of a data set acquired over a topographic surface. When there is strong topographic relief, which
the user wishes to incorporate it into the inversion, special care should be taken to design the mesh.
A conceptually simple approach is first to design a rectangular mesh whose top (specified by Zo )
is just below the highest elevation point, and then to strip off cells that are above the topographic
surface. This is the approach taken in GRAV3D v5.0. The number of cells to be stripped off in
each column is determined by the user-supplied topography file. Only the remaining cells will be
used in the forward modelling or included in the inversion as model parameters.

Example of mesh file

This example shows a mesh that consists of 26 cells in easting, 27 cells in the northing, and 23 cells
in the vertical directions. The top of the mesh is located at 0 m of elevation and the southwest
corner is at -350 m easting and -400 m northing. The cells in the core portion of the mesh are all
50 m × 50 m × 25 m. There are three cells in the padding zone in every direction except the top
of the core mesh.

26 27 23
-350 -400 0
200 100 50 21*50.0 50 100 200
200 100 50 20*50.0 50 100 200
20*25.0 50 100 200

3.2.2 Topography file

This optional file is used to define the surface topography of the 3D model by the elevation at
different locations. The topography file has the following structure:

! comment
npt
E1 N1 ELEV1
E2 N2 ELEV2
.
. .
. .
.
. . .
En Nn ELEVn

Parameter definitions:

! Top lines starting with ! are comments.

npt Number of points defining the topographic surface.

15
Ei Easting of the ith point on the surface.

Ni Northing of the ith point on the surface.

ELEVi Elevation of the ith point on the profile.

The lines in this file can be in any order as long as the total number is equal to npt. The topographic
data need not be supplied on a regular grid. GRAV3D v5.0 assumes a set of scattered points for
generality and uses triangulation-based interpolation to determine the surface elevation above each
column of cells. To ensure the accurate discretization of the topography, it is important that the
topographic data be supplied over the entire area above the model and that the supplied elevation
data points are not too sparse.

Example of topography file

The following is an example of a topography file:

2007
12300.00 9000.00 0.109411E+04
12300.00 9025.00 0.109545E+04
12300.00 9050.00 0.109805E+04
12300.00 9075.00 0.110147E+04
12300.00 9100.00 0.110555E+04
12300.00 9125.00 0.111011E+04
12300.00 9150.00 1114.9
12300.00 9175.00 0.111971E+04

NOTE: Only the cells completely below the topography surface are kept. The cells above the
topographic surface are removed from the model, although these must still be included in the
model file as if they are a part of the model. For input model files these cells can be assigned any
value. The recovered model produced by inversion program also includes the cells that are excluded
from the model, but these cells will have unrealistic values as an identifier (e.g. -100).

3.2.3 Locations file

This file is used to specify the observation locations specifically for the forward modelling of gravity
data. The following is the general file structure:

! comment
ndat
E1 N1 ELEV1
E2 N2 ELEV2
.
. .
. .
.
. . .
Endat Nndat ELEVndat

16
Parameter definitions:

! Lines starting with ! are comments.

ndat Number of observations.

En ,Nn ,Elevn Easting, northing and elevation of the observation, measured in meters. Elevation should be
above the topography for surface data, and below the topography for borehole data. The
observation locations can be listed in any order.

Easting, northing, and elevation information should be in the same coordinate system as defined
in the mesh.

Example of a locations file

An example file is provided below. The file is for calculating an anomaly at 441 stations. Although
this is all surface data, borehole data are incorporated by giving the x, y, z location.

! surface data
441 ! # of data
0.00 0.00 1.00
0.00 50.00 1.00
0.00 100.00 1.00
.
. .
. .
.
. . .
1000.00 900.00 1.00
1000.00 950.00 1.00
1000.00 1000.00 1.00

3.2.4 Observations file

This file is used to specify the observation locations and observed gravity anomalies with estimated
standard deviation. The output of the forward modelling program GZFOR3D has the same structure
except that the column of standard deviations for the error is omitted. The following is the file
structure of the observations file:

! comment
ndat
E1 N1 ELEV1 Grav1 Err1
E2 N2 ELEV2 Grav2 Err2
.
. .
. .
. .
. .
.
. . . . .
Endat Nndat ELEVndat Gravndat Errndat

Parameter definitions:

17
! Lines starting with ! are comments.

ndat Number of observations.

En ,Nn ,Elevn Easting, northing and elevation of the observation, measured in meters. Elevation should be
above the topography for surface data, and below the topography for borehole data. The
observation locations can be listed in any order.

Gravn Anomalous gravity data, measured in mGal.

Errn Standard deviation of Gravn . This represents the absolute error. It must be positive and
non-zero.

NOTE: It should be noted that the data are extracted anomalies which are derived by
removing the regional from the field measurements. Furthermore, the inversion program assumes
that the anomalies are produced by a density contrast distribution in g/cm3 with mesh cells in
meters. Therefore, it is crucial that the data be prepared in mGal.

Example of an observations file

The following are two examples of data files. The first example file specifies a set of total field
anomaly data, and the second example file provides a set of multi-component borehole data.

! surface data
144 !! Number of data
0.00 0.00 1.00 0.174732E+02 0.598678E+01
0.00 50.00 1.00 0.265550E+02 0.613890E+01
0.00 100.00 1.00 0.311366E+02 0.629117E+01
.
. .
. .
. .
. .
.
. . . . .
1000.00 900.00 1.00 -0.109595E+01 0.530682E+01
1000.00 950.00 1.00 -0.902209E+01 0.523738E+01
1000.00 1000.00 1.00 -0.397501E+01 0.518496E+01

3.2.5 Model file

This file contains the cell values of the density contrast model. The density contrast must have
values in g/cm3 units. The forward, initial, reference, lower bounds, and upper bounds models
must be in this format. Likewise, the recovered model files will be in this format. The following is
the file structure of the model file

18
ρ1,1,1
ρ1,1,2
.
.
.
ρ1,1,N Z
ρ1,2,1
.
.
.
ρ1,j,k
.
.
.
ρN N,N E,N Z

Each ρi,j,k is density contrast at the [i, j, k]th model cell.

ρi,j,k Density contrast in cell [i, j, k]. The density contrast is always in g/cm3 units. The property
is density contrast and therefore can be positive or negative.

[i, j, k] = [1, 1, 1] is defined as the cell at the top, south-west corner of the model. The total
number of lines in this file should equal N N × N E × N Z, where N N is the number of cells in the
north direction, N E is the number of cells in the east direction, and N Z is the number of cells in
the vertical direction. The model ordering is performed first in the z−direction (top-to-bottom),
then in the easting, and finally in the northing.

3.2.6 Weights file

This file supplies the user-based weights that acts upon the model objective function. Each set
of weights correspond to the functions (e.g., wx ) given in equation 5. For ease, the weights in
geographic coordinates are provided by the user. The following is the file structure is for the
weights file:

W.S1,1,1 ··· W.SN N,N E,N Z


W.E1,1,1 ··· W.EN N,N E−1,N Z
W.N1,1,1 ··· W.NN N −1,N E,N Z
W.Z1,1,1 ··· W.ZN N,N E,N Z−1

Parameter definitions:

W.Si,j,k Cell weights for the smallest model.

W.Ei,j,k Cell weights for the interface perpendicular to the easting direction.

W.Ni,j,k Cell weights for the interface perpendicular to the northing direction.

W.Zi,j,k Cell weights for the interface perpendicular to the vertical direction.

19
Within each part, the values are ordered in the same way as in model file, however, they can be
all on one line, or broken up over several lines. Since the weights for a derivative term are applied
to the boundary between cells, the weights have one fewer value in that direction. For instance,
the weights for the derivative in easting direction has (N E − 1) × N N × N Z values, whereas the
number of cells is N E × N N × N Z.
If the surface topography file is supplied, the cell weights above the surface will be ignored. It is
recommended that these weights be assigned a value of −1.0 to avoid confusion. If null is entered
instead of the weights file, then all of the cell weights will be set equal (1.0).

3.2.7 Active cells file

This file is optional. The active cells file contains information about the cells that will be incorpo-
rated into the inversion. It has exact same format as the model file, and thus must be the same
size, with one exception. Values of this file are restricted to either -1, 0 or 1. By default, all cells
below the earth’s surface are active (1) and incorporated into the inversion. Inactive cells are set
to the values of the reference model and influence the forward modelling. There are two kinds of
inactive cells: cells that do not influence the model objective (set to 0) and cells that do influence
the model objective function (set to -1). Cells that are defined as active and are solved for within
the inverison and are set to 1. The following is an example of an active cells file:

0
0 ! inactive cell
.
.
.
0
1 ! active cell
.
.
.
-1 ! inactive cell
.
.
.
1

20
4 Running the programs

The software package GRAV3D uses four general codes:

GZFOR3D performs forward modelling.

PFWEIGHT calculates the depth weighting function.

GZSEN3D calculates sensitivity.

GZINV3D performs 3D gravity inversion.

GZPRE3D multiplies the sensitivity file by the model to get the predicted data.

This section discusses the use of these codes individually using.

4.1 Introduction

All programs in the package can be executed under Windows or Linux environments. They can be
run by typing the program name followed by a control file in the “command prompt” (Windows)
or “terminal” (Linux). They can be executed directly on the command line or in a shell script or
batch file. When a program is executed without any arguments, it will print the usage to screen.

4.1.1 Execution on a single computer

The command format and the control, or input, file format on a single machine are described below.
Within the command prompt or terminal, any of the programs can be called using:

program arg1 [arg2 · · · argi ]

where:

program is the name of the executable

argi is a command line argument, which can be a name of corresponding required or optional file.
Typing -inp as the control file, serves as a help function and returns an example input file.
Some executables do not require control files and should be followed by multiple arguments
instead. This will be discussed in more detail later in this section. Optional command line
arguments are specified by brackets: [].

Each control file contains a formatted list of arguments, parameters and filenames in a combi-
nation and sequence specific for the executable, which requires this control file. Different control
file formats will be explained further in the document for each executable.

21
4.1.2 Execution on a local network or commodity cluster

The GRAV3D v5.0 program library’s main programs have been parallelized with Message Pass
Interface (MPI). This allows running these codes on more than one computer in parallel. MPI instal-
lation package can be downloaded from http://www.mcs.anl.gov/research/projects/mpich2/.
The following are the requirements for running an MPI job on a local network or cluster:

• An identical version of MPI must be installed on all participating machines


• The user must create an identical network account with matching “username” and “password”
on every machine
• Both the executable folder and the working directory should be “shared” and visible on every
participating computer
• Before the MPI job is executed, the firewall should be turned off on every participating
computer
• The path should be defined to the executable directory

The following is an example of a command line executing an MPI process:

C:\Program Files\MPICH2\bin\mpiexec.exe -machinefile machine.txt nproc -priority


0 gzinv3d

An explanation of the arguments used in this command line are:

PATH Properly defined path to the mpiexec.exe.


-machinefile The list of participating machines will be read from a “machine file.”
machine.txt Name of the machine file. This file lists the network names of the participating machines and
number of processors to be allocated for the MPI job for each machine. The following is an
example of a machine file:

machine01 16
machine02 16

In this simple example, there are two participating machines (named machine01 and machine02
and each is required to allocate 16 processors for the MPI job.
nproc The total number of allocated processors. This number should be equal to the sum of all
processors listed for all machines in the machine file.
-priority 0 Sets the priority of the process. Integer grades from -1 (lowest) to 4 (highest) follow. Higher
priority means that RAM and processing resources will be primarily allocated for this process,
at expense of lower priority processes. Generally, a large job should be assigned a lower
priority, as selective resource allocation may slow down other important processes on the
computer, including those needed for stable functioning of the operating system.

22
gzinv3d.exe The name of the executable. In our case it is assumed that there is an existing path to the
executable directory, otherwise proper path should be provided.

4.2 GZFOR3D

This program performs forward modelling. Command line usage:

gzfor3d mesh.msh obs.loc model.den [topo.dat]

and will create a gzfor3d.grv file.

4.2.1 Input files

All files are in ASCII text format - they can be read with any text editor. Input files can have any
name the user specifies. Details for the format of each file can be found in Section 3. The files
associated with gzfor3d are:

mesh.msh The 3D mesh.

obs.loc The observation locations.

model.den The density model.

topo.dat Surface topography (optional). If omitted, the surface will be treated as being flat and the
top of the 3D mesh.

4.2.2 Output file

The file created by GZFOR3D is gzfor3d.grv. The file format is that of the data file without the
associated standard deviations.

gzfor3d.grv The computed vertical gravity anomaly. Since the data in this file are accurate, the column
of the standard deviations for the error is not included.

4.3 PFWEIGHT

This program performs the depth weighting function calculation. This allows users the flexibility
to either use this code or their in-house code for the weighting calculation. Command line usage:

pfweight weights.inp [nThreads]

23
For a sample input file type: pfweight -inp
The argument nThreads specifying the number of CPU threads used in the OpenMP format is
optional. If this argument is not given to the program, pfweight chooses to use all of the CPU
threads on the machine. This argument allows the user to specify half, for example, of the threads
so that the program does not take all available RAM. Note that this option is not available in the
MPI-based code used for clusters.

4.3.1 Input files

Format of the control file weights.inp:

type ! input type: MAG | GRAV


mesh.msh ! mesh file
obs.grv ! observations file
topo.dat ! topography file | null
iwt ! weighting type
alpha, znot ! weighting parameters | null

The input parameters for the control file are:

type Use GRAV to input into gzsen3d.

mesh.msh Name of 3D mesh file.

obs.grv The data file that contains the observation locations and the observed vertical gravity anomaly
with estimated standard deviation.

topo.dat Surface topography (optional). If null is entered, the surface will be treated as being flat.

iwt An integer identifying the type of generalized depth weighting to use in the inversion.
=1 for depth weighting (not applicable to borehole data);
=2 for distance weighting.

alpha,znot Parameters defining the depth weighting function: When iwt=1, alpha and znot are used as
α and z0 to define the depth weighting according to equation 9.
When iwt=2, alpha and znot are used as α and (Ro ) to define the distance weighting according
to equation 10.
If null is entered on this line (line 6), then the program sets alpha=3 and calculates the value
of zo based upon the mesh and data location. This is true for iwt=1 or iwt=2.
For most inversions, however, setting this input line to null is recommended. The option for
inputing α and zo is provided for experienced users who would like to investigate the effect
of the generalized depth weighting for special purposes. The value of α should normally be
close to 2.0. Smaller values of give rise to weaker weighting as distance increases from the
observation locations.

24
Example of weights.inp

GRAV ! gravity data


mesh.msh ! mesh file
obs noise.grv ! data file
null ! topography | null
2 ! iwt=1 depth, =2 distance
null ! alpha, znot | null

4.3.2 Output files

The program PFWEIGHT outputs x weight.txt. A file in the model.den format, which contains
weights for each cell, based on equations 9 (x = “depth”) and 10 (x = “distance”). A log file is
also written.

4.4 GZSEN3D

This program performs the sensitivity calculation. Command line usage:

gzsen3d gzsen3d.inp [nThreads]

For a sample input file type: gzsen3d -inp


The argument nThreads specifying the number of CPU threads used in the OpenMP format
is optional. If this argument is not given to the program, gzsen3d chooses to use all of the CPU
threads on the machine. This argument allows the user to specify half, for example, of the threads
so that the program does not take all available RAM. Note that this option is not available in the
MPI-based code used for clusters.

4.4.1 Input files

Format of the control file gzsen3d.inp:

mesh.msh ! mesh file


obs.grv ! observations file
topo.dat ! topography file | null
distance weight.txt ! weights file
wvltx ! wavelet type: daubx | symmx | NONE
itol, eps ! wavelet parameters | null
Diag ! Diagnostic files (1 output | 0 none)

The input parameters for the control file are:

25
mesh.msh Name of 3D mesh file.

obs.grv The data file that contains the observation locations and observed vertical gravity anomaly
with estimated standard deviation.

topo.dat Surface topography (optional). If null is entered, the surface will be treated as being flat.

distance weight.txt A file (in the model file format) giving the sensitivity the weighting function. This can be
user-specific or generated from PFWEIGHT.

wvltx A five-character string identifying the type of wavelet used to compress the sensitivity ma-
trix. The types of wavelets available are Daubechies wavelet with 1 to 6 vanishing moments
(daub1, daub2, and so on) and Symmlets with 4 to 6 vanishing moments (symm4, symm5,
symm6). Note that daub1 is the Haar wavelet and daub2 is the Daubechies-4 wavelet. The
Daubechies-4 wavelet is suitable for most inversions, while the others are provided for users’
experimentation. If NONE is entered, the program does not use wavelet compression.

itol,eps An integer and a real number that specify how the wavelet threshold level is to be determined.
itol=1: program calculates the relative threshold and eps is the relative reconstruction error
of the sensitivity. A reconstruction error of 0.05 is usually adequate.
itol=2: the user defines the threshold level and eps is the relative threshold to be used. If
null is entered on this line, a default relative reconstruction error of 0.05 (e.g. 5%) is used
and the relative threshold level is calculated (i.e., itol=1, eps=0.05).
The detailed explanation of threshold level and reconstruction error can be found in Section
2.5 of this manual.

Diag Option to output Diag=1 or not output Diag=0 diagnostic files. These files are: (1) the
predicted data for a model of ρ = 0.1 with the wavelet compressed sensitivity, (2) the predicted
data for a model of ρ = 0.1 with the full sensitivity, (3) the averaged sensitivity in each cell
based on the wavelet compression. An extra line in the log file is also written giving the user
the achieved reconstruction error (e.g. eps when itol=1 from above).

Example of gzsen3d.inp control file

mesh.msh ! mesh file


obs noise.grv ! data file
null ! topography | null
distance weight.txt ! weighting file
daub2 ! wavelet type
1.0 0.05 ! itol, eps | null
0 ! Do not output diagnostic files

4.4.2 Output files

The program gzsen3d outputs three files. They are:

26
1. gzinv3d.mtx The sensitivity matrix file to be used in the inversion. This file contains the
sensitivity matrix, generalized depth weighting function, mesh, and discretized surface topog-
raphy. It is produced by the program and it’s name is not adjustable. It is very large and
may be deleted once the work is completed.

2. sensitivity.txt Output after running gzsen3d. It contains the average sensitivity for each cell.
This file can be used for depth of investigation analysis or for use in designing special model
objective function weighting.

3. Diagnostic files to examine the wavelet compression properties, if chosen.

4.5 GZINV3D

This program performs 3D gznetic inversion. Command line usage is:

gzinv3d gzinv3d.inp [nThreads]

For a sample input file type: gzinv3d -inp


The argument nThreads specifying the number of CPU threads used in the OpenMP format
is optional. If this argument is not given to the program, gzinv3d chooses to use all of the CPU
threads on the machine. This argument allows the user to specify half, for example, of the threads
so that the program does not take all available RAM. Note that this option is not available in the
MPI-based code used for clusters.

4.5.1 Input files

Input files can be any file name. If there are spaces in the path or file name, you MUST use quotes
around the entire path (including the filename).

1. obs.grv Mandatory observations file.

2. gzinv3d.mtx Mandatory sensitivity matrix from gzsen3d.

3. ini.den Optional initial model file; can be substituted by a value gzinv3d.inp control file.
Mandatory if and existing inversion is restarted after termination

4. ref.den Optional reference model file; can be substituted by a value in the gzinv3d.inp control
file.

5. active.txt Optional active model file

6. upperBound.den Optional upper bounds file

7. lowerBound.den Optional lower bounds file

8. w.dat Optional weighting files

27
9. gzinv3d.inp The control file used by gzinv3d.

Format of the control file gzinv3d.inp has been changed since previous version. Any numeric
entries beyond the model, trade-off parameter, and tolerance should be preceded by “VALUE”.
The input files has been modified as follows:

mode ! 1, 2, or 3
par,tolc
obs.grv
gzinv3d.mtx
initial model.den | VALUE [number] | null
ref.den | VALUE [number] | null
active.txt | null
lowerBounds.den | VALUE [bl ] | file
upperBounds.den | VALUE [bu ] | file
αs , αx , αy , αz | Le Ln Lz | null
SMOOTH MOD DIF | SMOOTH MOD
w.dat

The parameters within the control file are:

mode An integer specifying one of three choices for determining the trade-off parameter.

1. mode=1: the program chooses the trade off parameter by carrying out a line search so
that the target value of data misfit is achieved (e.g., φ∗d = N ).
2. mode=2: the user inputs the trade off parameter.
3. mode=3: the program calculates the trade off parameter by applying the GCV analysis
to the inversion without positivity.
par,tolc Two real numbers that are dependent upon the value of mode.
1. mode=1: the target misfit value is given by the product of par and the number of data N,
i.e.,. The second parameter, tolc, is the misfit tolerance. The target misfit is considered
to be achieved when the relative difference between the true and target misfits is less
than tolc. Normally, the value of par should be 1.0 if the correct standard deviation of
error is assigned to each datum. When tolc=0, the program assumes a default value of
tolc=0.02.
2. mode=2: par is the user-input value of trade off parameter. In this case, tolc is not used
by the program.
3. mode=3: none of the two input values are used by the program. However, this line of
input still needs to be there.
NOTE: When mode=1 both par and tolc are used. When mode=2 only par is used. When
mode=3, neither par nor tolc are used. However, the third line should always have two values.

28
obs.grv Input data file. The file must specify the standard deviations of the error. By definition these
values are greater than zero.

gz3d.mtx The binary file created by GZSEN3D.

initial model.den The initial density contrast model can be defined as a value for uniform models (e.g. VALUE
0.001), or by a filename.

ref.den The reference density contrast model can be defined as a value for uniform models (e.g.
VALUE 0.05), or by a filename (for non-uniform reference models).

active.txt The file containing which cells in the model are be defined as active (1) or inactive (brown-1
or brown0). This file must be fully compatible with the mesh.msh and ref.den. Use the null
option for all cells being active.

lowerBounds.den The lower bounds model can be defined as a value for uniform models (e.g., VALUE 0) or by
a filename.

upperBounds.den The upper bounds model can be defined as a value for uniform models (e.g., VALUE 0.1) or
by a filename.

αs , αx , αy , αz Coefficients for the each model component. α’s is the smallest model component. Coefficient
for the derivative in the easting direction. αy is the coefficient for the derivative in the
northing direction. The coefficient αz is for the derivative in the vertical direction.
If null is entered on this line, then the above four parameters take the following default values:
αs = 0.0001, αx = αy = αz = 1.0. None of the alpha’s can be negative and they cannot be
all equal to zero at the same time.
NOTE: The four coefficients αs , αx , αy and αz in line 9 of the control file can be substituted
for three corresponding length scales Lx , Ly and Lz . To understand the meaning of the length
scales, consider the ratios αx /αs , αy /αs and αz /αs . They generally define smoothness of the
recovered model in each direction. Larger ratios result in smoother models, smaller ratios
result in blockier models. The conversion from α’s to length scales can be done by:
r r r
αx αy αz
Lx = ; Ly = ; Lz = (15)
αs αs αs

where length scales are defined in meters. When user-defined, it is preferable to have length
scales exceed the corresponding cell dimensions.

SMOOTH MOD This option was not available in previous versions of the code and can be used to define the
reference model in and out of the derivative terms. The options are: SMOOTH MOD DIF
(reference model is defined in the derivative terms) and SMOOTH MOD (reference model is
defined in only the smallest term)

w.dat Name of the file containing weighting matrix. If null is entered, default values of unity are
used.

29
Example of gzinv3d.inp control file

Below is an example of a control file with comments:

1 ! mode
1.0 0.0 ! par, tolc
obs noise.grv ! observation file
gzinv3d.mtx ! sensitivity matrix file
VALUE 0.0 ! initial model
VALUE 0.0 ! reference model
NULL ! active cells file
VALUE -2.0 ! lower bound
upperBounds.den ! upper bound file
null ! αs , αx , αy , αz
SMOOTH MOD DIF ! reference model in the derivative terms
null ! weighting matrix

4.5.2 Output files

Five output files are created by the program gzinv3d. They are:

1. gzinv3d.log The log file containing the minimum information for each iteration and summary
of the inversion.

2. gzinv3d.out The “developers” log file containing the details of each iteration including the
model objective function values for each component, number of conjugate gradient iterations,
etc.

3. gzinv3d iter.den Density files output after each iteration (iter defines the iteration step).

4. gzinv3d iter.pre Predicted data files output after each iteration (iter defines the iteration
step).

4.6 GZPRE3D

This utility multiplies a model by the stored sensitivity matrix in gzinv3d.mtx to produce predicted
data. This program is included so that users who are not familiar with the wavelet transform and
the structure of gzinv3d.mtx could utilize the available sensitivity matrix to carry out modelling
exercises. The command line usage is:

gzpre3d gzinv3d.mtx obs.loc model.den

30
4.6.1 Input files

1. gzinv3d.mtx The sensitivity matrix file from GZSEN3D.

2. obs.loc The observation locations.

3. model.den The density contrast model.

4.6.2 Output file

The output file is in the same form as the observation file without the standard deviation and called
gzpre3d.grv, which is the predicted data file from the sensitivity calculated in gzsen3d. This file
can be used to reproduce output predicted files from gzinv3d.

31
5 Examples

5.1 Forward modelling

In this section we present synthetic examples to illustrate forward modelling and inversion capa-
bilities of GRAV3D v5.0. Important functionalities of GRAV3D v5.0 are parallelization, ability to
handle multi-component borehole data, increased freedom in design of the model objective function,
faster procedure for incorporating constraints (using projected gradients) and the ability to check
the accuracy of the wavelet compression for large scale problems. The synthetic examples described
below are constructed to show these features. They are based on a synthetic model, which consists
of a 500 meter dense cube of 0.7 g/cm3 in a half space (Figure 1), placed 300 m below the flat
surface.

Figure 1: The density model used to generate synthetic data in three vertical boreholes and on the
surface (locations shown in white). The anomalous block is 500 m3 and has a density contrast of
0.7 g/cm3 . First, the surface data alone will inverted. Then, data from the two boreholes outside
of the anomalous block will be added to the surface data and modelled and inverted. Finally, data
from all three boreholes as well as the surface data will be inverted.

The surface data set consists of 2,091 evenly gridded data 60 meters Easting by 75 meters
Northing. In order run gzfor3d to forward model the surface data, the following was typed into
the command line:

gzfor3d mesh.txt loc surf.txt model.den

We next simulated the borehole data. The borehole data are calculated in three vertical holes
located 500 meters apart (Figure 1) with an interval of 20 meters from 15 to 1,335 m below the
surface for a total of 198 data. The command was:

33
Figure 2: The true data generated by a 500 m3 block with a density contrast of 0.7 g/cm3 (left).
Gaussian noise with a floor of 0.05 mGal and 2% of the data was added to create the observed data
for the inversion (right).

gzfor3d mesh.txt loc bh.txt model.den

The borehole dataset has been contaminated with Gaussian noise with a standard deviation of
2% and a floor of 0.01 mGal. The noisy surface data are shown in the right panel of Figure 2.
Figure 3 shows the accurate and noisy borehole data. The two datasets are combined to create the
“observed” data for the inversion examples in the next section.

5.2 Inversion

5.2.1 Default parameters

We illustrate the inversion of the surface data and then joint inversion of surface and borehole
data. First, the distance weighting function is calculated with pfweight. Distance weighting was
is chosen for consistency between the surface only and surface and borehole inversion solutions
(borehole data require distance weighting). The input for the weighting function code is shown
below. An example of the created log file is presented in Figure 4.

GRAV ! MAG or GRAV


..\mesh.txt ! mesh file
obs surf.grv ! observations file
null ! topography file
2 ! weighting type
null ! alpha, znot

Next, the sensitivity matrix is calculated with gzsen3d. The default wavelet compression pa-
rameters are used (“daub2” with 5% reconstruction error). We also choose not to output diagnostic
parameters, although these are discussed in the “Wavelet diagnostic output” section. With this
scenario chosen, gzsen3d outputs gzsen3d.log and gzinv3d.mtx (these files will be over-written if

34
Figure 3: Synthetic borehole data used in the inversions with each panel representing a single
borehole. The black lines are true data and red dots are the noisy data.

35
Figure 4: The log file from pfweight. The information within this file reproduces the input file,
gives the number of cells in the mesh and below topography, the indices of borehole data within
the data file (if applicable), and the time it took for the program to run or any errors that occured.

36
the program has been run in the same folder more than once without re-naming them). The former
file gives the user information about the sensitivity calculation such as compression ratio with the
wavelet transform. The latter file will be required during the inversion process. The sensitivity will
only have to be re-run if the mesh or data locations are changed. Changing the standard deviations
does not require a next .mtx file. The log file from the sensitivity calculation is shown in Figure 5.
The the input file given to gzsen3d is shown below.

..\mesh.txt ! mesh file


obs surf.grv ! observations file
null ! topography file
depth weight.txt ! weighting file
null ! wavelet type
null ! wavelet parameters
0 ! do NOT output diagnostics

Once the matrix file is created, the inversion can be run by gzinv3d with a general input file.
The control file example is provided below. The bounds are set to -10 and 10.

1 ! mode (1, 2, or 3)
1.0 0.02 ! beta, tolerance
obs surf.grv ! data file
gzinv3d.mtx ! mtx file
VALUE 1.e-5 ! initial model
VALUE 0.0 ! reference model
null ! active cells
VALUE -10.0 ! lower bounds
VALUE 10.0 ! upper bounds
null ! Length scales
SMOOTH MOD ! Reference model only in the smallest component
null ! 3D weighting

The inversion converges in eight iterations. Figure 6 shows the convergence curve for the data
misfit versus the iteration number. The desired misfit is approximately 2100 and is achieved within
the tolerance given (±2%). The predicted data from the recovered model is shown on the right of
Figure 7 with the observed data on the right for comparison.
An example log file created by gzinv3d within this example set (surface data only) is shown in
Figure 8. The file gives the input parameters and general information for every iteration such as
the data misfit and iteration CPU time. A developers log (gzinv3d.out) is also written (Figure 9).
This file contains detailed information for every iteration including the beta parameter, data misfit,
model norm and its components, total objective function, number of conjugate gradient iterations,
and the number of truncated cells. The latter is the amount of cells that are at or beyond the
bounds and are not included in the minimization with the projected gradient. In this case, it would
be cells greater than or equal to 10.0 and less than or equal to -10.0.
A slice of the recovered model through the centre of the anomalous body is presented in Figure
10a. The anomaly has small amplitude and is smoothed. The two boreholes that do not intersect

37
Figure 5: The log file from gzsen3d. The top information gives the input file information and
version of the program. The bottom information describes how many cells are in the model after
topography, how many data will be inverted, and how well the wavelet transform compressed G.
Typical (and default) wavelet reconstruction error is 5% or 0.05 in the input file.

38
Figure 6: The convergence curve for gzinv3d for the inversion of surface data. The 0th iteration is
the initial misfit. The target misfit is approximately 2,100 where the inversion stops.

Figure 7: The observed surface data (left) and the surface data created from the recovered model
(right). The data are on the same colour scale.

39
Figure 8: The inversion log created by gzinv3d. As with the sensitivity log file, the top portion of
the file gives the input parameters so the results can be reproduced. The bottom gives details for
each iteration such as the trade-off parameter, data misfit, and CPU time.

40
Figure 9: The developer’s log created by gzinv3d (gzinv3d.out). The top portion shows the start
time and date and the details of the inversion at each iteration: beta, data misfit, model norm in
each direction, total objective function, CG iterations, and the number of truncated cells within
the projected gradient routine. The ending data and time is also written to file to be able to match
with the simplified log file.

the anomaly are then added. The data are inverted with the same parameters as previous given for
the surface-only example and achieves the appropriate data misfit. The recovered model is shown
in Figure 10b. The anomalous body is tighter and a bit more constrained with the addition of
subsurface data. Finally, the third borehole that intersects the anomaly is added to the observed
data. An interesting observation of the recovered model (Figure 10c) is the lack of magnetic
susceptibility where the borehole is physically located.
There are two different types of constraints that can be used in order to recover an anomalous
body near the borehole that physically intersects it. Those types are soft or hard constraints. Soft
constraints are applied through the model objective function and hard constraints are provided
through active and inactive cells, and bounds. The following two sections apply each one of these
types of constraints, respectively, in order to alleviate this problem.

5.2.2 Use of soft constraints

One type of constraints that can be used to connect the body for a more realistic interpretation is
soft constraints. We examine both the use of distance weighting and the reference model through
the model objective function (e.g. equation 5).

Distance weighting

Distance weighting is utilized to avoid placing susceptible cells near the observation locations where
the mesh has a higher sensitivity and can drive the final solution. We therefore manually change
the Ro (equation 10) in the pfweight input file. We change it from the default value of 1/4 of a
cell to 100 - much larger than what is needed. Since the values are then normalized, this will allow
susceptible material near the borehole locations. The α value should be 2.0 due to the field decay
to a squared power. The sensitivity and inversion input files stay the same. The weighting input
file for this example is

41
g/cm3
0 0.3

300 0.2

Depth (m)
600 0.1

900 0.0

1200 −0.1
(a)

g/cm3
0 0.3

300 0.2
Depth (m)

600 0.1

900 0.0

1200 −0.1
(b)

g/cm3
0 0.3

300 0.2
Depth (m)

600 0.1

900 0.0

1200 −0.1
500 1000 1500 2000 2500
Easting (m)
(c)

Figure 10: The recovered models from (a) surface only, (b) surface and the east and west boreholes,
and (c) surface and three boreholes. The addition of borehole data aids by increasing the amplitude
of the recovered anomaly and its compactness. The middle of the anomaly lacks density contrast
when the borehole that intersects the anomaly is used. We will further examine ways to alleviate
this problem, beginning with the distance weighting parameters.

42
g/cm3
0 0.7
0.6

300 0.5
0.4
Depth (m) 0.3
600
0.2
0.1
900 0.0
−0.1
1200 −0.2
500 1000 1500 2000 2500
Easting (m)

Figure 11: The recovered model after increasing the distance weighting function during the sensi-
tivity calculation. The Ro was increased to 100. The anomaly is much more compact, although the
anomaly reaches the surface to counter-act the strong negative below the true block that is being
dictated by the borehole data.

GRAV ! MAG or GRAV


..\mesh.txt ! mesh file
obs surf bh.grv ! observations file
null ! topography file
2 ! weighting type
2, 100 ! alpha, znot

The inversion is run with all three boreholes and surface data. A slice of the recovered model is
shown in Figure 11. The recovered model has a single anomaly as desired. The anomaly is near
the true density contrast (0.7 g/cm3) and has a block-like shape to it. A by-product of using this
weighting is that the algorithm is able to place susceptibility not only near the borehole locations,
but also near surface observations. To improve upon the results, we examine the use of the reference
model with this weighting in order to centralize the anomalous susceptibility.

Reference model

As previously discussed in Section 2.3, the reference model can either be incorporated into the
spatial derivatives or only the smallest model component of the model objective function. We use
the gzsen3d input file from distance weighting and examine the differences in the recovered model
with the addition of the reference model.
The centre borehole intersects the anomaly so we assume that we know the true model at the
location of those subsurface observations. The reference model is then designed so that everywhere
else it promotes a zero model. A cross section of the reference model is shown in Figure 12a. Only
the cells that the borehole intersects the anomaly are given as density contrasts above zero.

43
The input file for the inversion with the reference model throughout model objective function is
shown below. The initial model is the same as the reference model and the choice SMOOTH MOD DIF
is invoked in order to place the reference model in the spatial derivatives.

1 ! mode (1, 2, or 3)
1.0 0.02 ! beta, tolerance
..\obs surf bh.grv ! data file
gzinv3d.mtx ! mtx file
..\ref.den ! initial model
..\ref.den ! reference model
null ! active cells
VALUE -10.0 ! lower bounds
VALUE -10.0 ! upper bounds
null ! length scales
SMOOTH MOD DIF ! reference model in all components
null ! 3D weighting

The recovered model is found in Figure 12b. There is a single anomaly with the maximum amplitude
where the non-zero portion of the reference model influenced the solution. The surrounding part of
the body goes to zero to try to minimize the difference spatially leaving a strip where the non-zero
part of the reference model is located. In this light, the affects of the penalizing the derivatives
with the reference model included become apparent.
Next, the input file for the inversion is changed so that the option SMOOTH MOD is used in order to
place the reference model only in the smallest component of the model objective function. A cross
section of the recovered model with this option is presented in Figure 12c. This time the recovered
anomaly is much more homogeneous and is closer to the true model throughout the body, although
still smaller in amplitude. The solution is similar to just the distance weighting, though it recovers
higher density contrasts with a large negative anomaly below.

5.2.3 Use of hard constraints

The last section discussed the flexibility of the model objective function to influence the result of
gzinv3d. This section examines using hard constraints that strictly enforce a range of values rather
than promote the values mathematically. We first incorporate bound constraints and then set key
cells to be inactive within inversion.

Bounds cells

To be able to appropriate bound the model to reasonable values, we examine the susceptibility
given by the borehole information. The bound model file is two columns and requires a lower and
upper bound, respectively. For the lower bound, we set the model to zero everywhere but the
intersection of the anomaly with the centre borehole. The true model is observed here, so we set
the bounds in this region to 0.699 - just below the 0.7 g/cm3 of the anomalous body (Figure 13a).

44
g/cm3
0 0.7
0.6

300 0.5
0.4

Depth (m) 600


0.3
0.2
0.1
900 0.0
−0.1
1200 −0.2
(a)

g/cm3
0 0.7
0.6

300 0.5
0.4
Depth (m)

0.3
600
0.2
0.1
900 0.0
−0.1
1200 −0.2
(b)

g/cm3
0 0.7
0.6

300 0.5
0.4
Depth (m)

0.3
600
0.2
0.1
900 0.0
−0.1
1200 −0.2
500 1000 1500 2000 2500
Easting (m)
(c)

Figure 12: (a) The reference model used from prior information given in the boreholes. The
reference model can be utilized (b) throughout all derivatives of the model objective function
(equation 5) or (c) just in the smallest model component.

45
The upper bounds are 1 everywhere (e.g., positivity based on the borehole) but in the locations of
the zero density contrast found in the boreholes. This model can be found in Figure 13b. These
two models create the bounds file. We use the same reference model from the soft constraints
section. The reference model is is only incorporated in the smallest model component of the model
objective function. The input file for the inversion with bounds is

1 ! mode (1, 2, or 3)
1.0 0.02 ! beta, tolerance
obs surf bh.grv ! data file
gzinv3d.mtx ! mtx file
..\ref.den ! initial model
..\ref.den ! reference model
null ! active cells
lower.bnd ! lower bound
upper.bnd ! upper bound
null ! Length scales
SMOOTH MOD ! Reference model in Ws
null ! 3D weighting

and a cross section of the recovered model is found in Figure 13c. The bounds force the model
to the correct 0.7 g/cm3 values where the centre borehole intersects the anomalous body, to zero
where the boreholes do not intersect any anomalous density, and allows the rest of the model to
change as necessary at and above zero. The result is large values in the centre of the anomaly with
smoothly decaying amplitudes towards the outsides of the body. The shape is correctly recovered
at depth and the large negative anomaly disappears.

Active/inactive cells

An added functionality of gzinv3d is the ability to set cells to a prescribed value and not incorpo-
rated them directly into the inversion. For this example, the model cells in the boreholes are set to
inactive. This means they will be stay the value given in the initial model and will not be part of
the model objective function (they will contribute to the produced data of the solution). For this
example, we set the active cells with values of 1 near the boreholes where the inversion will solve
for density contrast. The cells intersecting the boreholes where the density is known is set to −1 in
order to influence the model objective function, yet set the cell values. The cells outside the region
of interest and that we know have no anomalous density contrast are set to 0 (also inactive) and
are not included within the inversion. Figure 14a is a cross section of the active cell model. The
reference model determines the cell values within the inactive region so the file reference.sus is
used. For this example, we keep positivity by simply using a lower bound of zero and an upper
bound of 1 g/cm3 . An initial model using the reference model is also set. The inversion input file
for this example is

46
g/cm3
0 0.7

0.6
300
0.5

Depth (m)
0.4
600
0.3

0.2
900
0.1

1200 0.0

(a)

g/cm3
0 0.7

0.6
300
0.5
Depth (m)

0.4
600
0.3

0.2
900
0.1

1200 0.0

(b)

g/cm3
0 0.7

0.6
300
0.5
Depth (m)

0.4
600
0.3

0.2
900
0.1

1200 0.0
500 1000 1500 2000 2500
Easting (m)
(c)

Figure 13: (a) The lower bounds are zero everywhere to enforce positivity, but the intersecting
section of the centre borehole. (b) The upper bounds are 0.0001 g/cm3 where no density contrast
was found in the boreholes, 0.701 g/cm3 in the centre borehole where the anomaly is, and 1 g/cm3
everywhere else in the model effectively enforcing only positivity. (c) The recovered model with
bounds and an initial model.

47
1 ! mode (1, 2, or 3)
1.0 0.02 ! beta, tolerance
..\obs surf bh.grv ! data file
gzinv3d.mtx ! mtx file
..\ref.den ! initial model
..\ref.den ! reference model
active.txt ! active cells
VALUE 0.0 ! lower bound
VALUE 1.0 ! upper bound
null ! length scales
SMOOTH MOD ! reference model in Ws
null ! 3D weighting

The recovered model is shown in Figure 14b. The centre of the anomaly has the expected value of
0.7 (it was not part of the inversion) and the surrounding density contrast expands to the region
of the true anomalous body continuously due to keeping the reference model in the smallest model
component of the model objective function. Active cells can improve the inversion when prior
information is available.

5.3 Wavelet diagnostic tests

In this section, we discuss two approaches to try to understand the influence of the wavelet com-
pression onto the recovered model. The diagnostic test output from gzsen3d is first examined.
Then, the combination of gzfor3d and gzpre3d is a seldom used, but useful tool in understanding
the data affected by the wavelet transform.

5.3.1 Running magsen3d diagnostic test tool

In order to run the diagnostic test via gzsen3d, a “1” is given on the bottom line of the input file.
The weighting code and run prior to the sensitivity and the sensitivity matrix output can be used
(as if the test was not run) in gzinv3d. It should be noted that the testing can require up to twice
the CPU time than running the sensitivity matrix calculation alone. Once the diagnostic testing
begins, the user may decide to stop the code. In that case, the testing files are not output yet the
matrix file has been written and the inversion process can proceed. An example input file for the
sensitivity calculation with testing is

..\mesh.txt ! mesh file


..\obs surf bh.grv ! observations file
null ! topography file
distance weight.txt ! weighting file
null ! wavelet type
null ! wavelet parameters
1 ! output diagnostics

48
g/cm3
0 1

300
Depth (m)

600 0

900

1200 −1

(a)

g/cm3
0 0.7

0.6
300
0.5
Depth (m)

0.4
600
0.3

0.2
900
0.1

1200 0.0
500 1000 1500 2000 2500
Easting (m)
(b)

Figure 14: (a) The inactive (-1 and 0) and active (1) cells that are incorporated into the inversion.
The reference model sets the values of the inactive cells. The inactive cells set to -1 influence the
model objective function. (b) A cross section of the recovered model given the inactive cells with
the true density values.

49
The standard outputs of running mgzsen3d are the sensitivity matrix file (gzinv3d.mtx), the
average sensitivity for each cell (sensitivity.txt), and the log file (gzsen3d.log). The average
sensitivity for each cell is a model file and can be viewed in meshTools3D. The average sensitivity
is calculated from the full, non-compressed sensitivity. Running the diagnostic test performs this
calculation on the compresses sensitivity and outputs the file sensitivity compressed.txt. The
true compression error is also given in the log file with this setting to be able to compare to the
given compression error (e.g., 0.05).
Examining how the two average sensitivity models differ can give insight on how well the wavelet
compression has performed. The general shape should be the same, but large jumps in cell size can
create large differences, which will be observed with the two outputs. Figure 15a shows a cross-
section of the uncompressed sensitivity average for the block example given in this manual. The
same cross-section for the compressed average sensitivity for a 5% reconstruction error is presented
in Figure 15b. In general, the compression shows good accuracy. The difference between the two
models is given in Figure 15c for reference. All of the pictures are shown in log scale.
The data from the compressed and uncompressed sensitivity given a constant model of 0.01 is
also written, aptly named “data compressed.txt” and “data uncompressed.txt” respectively. This
also gives insight to the differences in column-based integration of the compressed and uncompressed
sensitivity matrix. However, the model output is much more intuitive.

5.3.2 Recovered model-based diagnostic test

Users of the grav3d package often are curious how the wavelet transform is affecting the predicted
data. Although the diagnostic test does this calculation on a constant model of 0.1, this test
is actually easy to perform once the inversion code has a solution. The gzinv3d iter.pre is
the predicted data for the compressed sensitivity and can also be calculated with the gzpre3d
code given a .mtx file and a recovered model. To obtain the predicted data for an uncompressed
sensitivity matrix, run gzfor3d on the recovered model, gzinv3d iter.sus. The difference between
the generated data sets will show how the wavelet compression is affecting the final data. Large
discrepancies in the data may suggest the use of a smaller reconstruction error given on the eps
line of the sensitivity input file. An example is shown using the surface-only data set. The two
data sets for the uncompressed, compressed sensitivity matrix, and their difference is respectively
shown in Figures 16b-16c. The maximum difference between the two data sets less than is 0.01
mGal.

50
log(ΣG)
0 −8.0

300

600

Depth (m)
900 −8.5

1200

1500
−9.0
500 1000 1500 2000 2500
Easting (m)
(a)

log(ΣG)
0 −8.0

300

600
Depth (m)

900 −8.5

1200

1500
−9.0
500 1000 1500 2000 2500
Easting (m)
(b)

log diff
0 −4

300

600 −6
Depth (m)

900

−8
1200

1500
−10
500 1000 1500 2000 2500
Easting (m)
(c)

Figure 15: (a) The log of average sensitivity for each cell prior to compression. (b) the log of
average sensitivity for each cell after compression with a 95% reconstruction accuracy. (c) The
difference between (a) and (b) on a log scale.

51
mGal mGal
3000 1.750 3000 1.750

1.575 1.575
2500 2500
1.400 1.400

1.225 1.225
2000 2000
1.050 1.050
Northing (m)

Northing (m)
1500 0.875 1500 0.875

0.700 0.700
1000 1000
0.525 0.525

0.350 0.350
500 500
0.175 0.175

0 0.000 0 0.000
0 500 1000 1500 2000 2500 3000 0 500 1000 1500 2000 2500 3000
Easting (m) Easting (m)

(a) (b)

mGal
3000 0.010

2500

0.005

2000
Northing (m)

1500 0.000

1000

−0.005

500

0 −0.010
0 500 1000 1500 2000 2500 3000
Easting (m)

(c)

Figure 16: (a) The predicted data from the uncompressed sensitivity matrix by using gzfor3d
on the recovered model. (b) The predicted data from the compressed sensitivity matrix given by
gzinv3d or calculated by gzpre3d given the recovered model. (c) The difference of the two data
sets is less than 0.01 mGal. Data locations are denoted by the white dots.

52
6 References
Calamai, P. H., and J. J. Moré, 1987, Projected gradient methods for linearly constrained problems:
Mathematical programming, 39, 96–116.
Haáz, I. B., 1953, Relations between the potential of the attraction of the mass contained in a finite
rectangular prism and its first and second derivatives: Geofizikai Közlemenyek, 2, 57–66. (in
Hungarian).
Hansen, P. C., 2000, The L-curve and its use in the numerical treatment of inverse problems: WIT
Press.
Li, Y., and D. W. Oldenburg, 1998, 3-D inversion of gravity data: Geophysics, 63, no. 1, 109–119.
——–, 2003, Fast inversion of large-scale magnetic data using wavelet transforms and a logarithmic
barrier method: Geophysics Journal International, 152, 251–265.
——–, 2010, Rapid construction of equivalent sources using wavelets: Geophysics, 75, no. 3, L51–
L59.
Nagy, D., 1966, The gravitational attraction of a right rectangular prism: Geophysics, 31, 361–371.
Nocedal, J., and S. J. Wright, 1999, Numerical optimatization: Springer Science.
Vogel, C. R., 2002, Computational Methods for Inverse Problems (Frontiers in Applied Mathemat-
ics): Society for Industrial Mathematics.
Wright, S. J., 1997, Primal-dual interior-point methods: SIAM.

53

You might also like