from geoscilabs.inversion.LinearInversionDirect import LinearInversionDirectApp
from ipywidgets import interact, FloatSlider, ToggleButtons, IntSlider, FloatText, IntText
app = LinearInversionDirectApp()
Linear Inversion App¶
This app is based upon the inversion tutorial: "INVERSION FOR APPLIED GEOPHYSICS" by Oldenburg and Li (2005).
Douglas W. Oldenburg and Yaoguo Li (2005) 5. Inversion for Applied Geophysics: A Tutorial. Near-Surface Geophysics: pp. 89-150. eISBN: 978-1-56080-171-9 print ISBN: 978-1-56080-130-6 https://doi.org/10.1190/1.9781560801719.ch5
Purpose¶
By using a simple decaying and oscillating kernel function, which emulates the physics of electromagnetic (EM) survey, we understand basic concepts of inverting data. Three items that we are going to explore are:
- Step1: Create a model ()
- Step2: Generate a sensitivity kernel (or matrix),
- Step3: Simulate data ()
- Step4: All three steps together
- Step5: Invert the data, and explore inversion results
Forward problem¶
Let denote the kernel function for th datum. With a given model , th datum can be computed by solving following integral equation:
where
By discretizing we obtain
where
- : th row vector for the sensitivty matrix ()
- : model location ()
- : decaying constant (<0)
- : oscillating constant (>0)
By stacking multiple rows of , we obtain sensitivity matrix, :
Here, the size of the matrix is . Finally data, , can be written as a linear equation:
where is an inversion model; this is a column vector ().
In real measurments, there will be various noises source, and hence observation, , can be written as
Step1: Create a model, ¶
The model is a function defined on the interval (-2,2). Here we generate a model that is the sum of a: (a) background , (b) box car and (c) Gaussian . The box car is defined by
m$_{background}$
: amplitude of the backgroundm1
: amplitude$m1_{center}$
: center$m1_{width}$
: width the Gaussian is defined bym2
: amplitude$m2_{center}$
: center$m2_{sigma}$
: width of Gaussian (as defined by a standard deviation)M
: # of model parameters
Q_model = app.interact_plot_model()
Step2: Generate a sensitivity kernel (or matrix), ¶
By using the following app, we explore each row vector of the sensitivity matrix, . Parameters of the apps are:
M
: # of model parametersN
: # of datap
: decaying constant (<0)q
: oscillating constant (>0)ymin
: maximum limit for y-axisymax
: minimum limit for y-axisshow_singular
: show singualr values
Q_kernel = app.interact_plot_G()
Step3: Simulate data¶
The -th datum is the inner product of the -th kernel and the model . In discrete form it can be written as the dot product of the vector and the model vector .
Adding Noise¶
Observational data are always contaminated with noise. Here we add Gaussian noise (zero mean and standard deviation ). Here we choose
Q_data = app.interact_plot_data()
Step4: All three steps together¶
app.interact_plot_all_three_together()
Inverse Problem¶
In the inverse problem we attempt to find the model that gave rise to the observational data . The inverse problem is formulated as an optimization problem:
where
- : data misfit
- : model regularization
- : trade-off (or Tikhonov) parameter
Data misfit is defined as
where is an estimate of the standard deviation of the th datum.
The model regularization term, , can be written as
The first term is referred to as the "smallness" term. Minimizing this generates a model that is close to a reference model . The second term penalizes roughness of the model. It is generically referred to as a "flattest" or "smoothness" term.
Step5: Invert the data, and explore inversion results¶
In the inverse problem we define parameters needed to evaluate the data misfit and the model regularization terms. We then deal with parameters associated with the inversion.
Parameters¶
mode
:Run
orExplore
Run
: Each click of the app, will runn_beta
times of inversionExplore
: Not running inversions, but explore result of the inversions
noise option
:error contaminated
orclean data
Misfit¶
percent
: percentage of the uncertainty (%)floor
: floor of the uncertainty (%)chifact
: chi factor for stopping criteria (whenchifact=1
)
Model norm¶
mref
: reference modelalpha_s
: for smallnessalpha_x
: for smoothness
Beta¶
beta_min
: minimumbeta_max
: maximumn_beta
: the number of
Plotting options¶
data
:obs & pred
ornormalized misfit
obs & pred
: show observed and predicted datanormalized misfit
: show normalized misfit
tikhonov
:phi_d & phi_m
orphi_d vs phi_m
phi_d & phi_m
: show and as a function ofphi_d vs phi_m
: show tikhonov curve
i_beta
: i-th valuescale
:linear
orlog
linear
: linear scale for plotting the third panellog
: log scale for plotting the third panel
app.interact_plot_inversion()
- Oldenburg, D. W., & Li, Y. (2005). 5. Inversion for Applied Geophysics: A Tutorial. In Near-Surface Geophysics (pp. 89–150). Society of Exploration Geophysicists. 10.1190/1.9781560801719.ch5