from em_examples.LinearInversion import *
from ipywidgets import interact, FloatSlider, ToggleButtons, IntSlider, FloatText, IntText
app = LinearInversionApp()
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
By using a simple decaying and oscillating kernel function, which emulates physics of electromagnetic (EM) survey, we understand basic concepts of inverting EM data. Three main action items that we are going to explore are:
In order to emulate EM data, which are often decaying and oscillating, we consider a kernel, $g_j(x)$, for $j$th datum. With a given model $m(x)$, $j$th datum can be computed by solving following integral equation:
$$ d_j = \int_a^{b} g_j(x) m(x) dx $$
where
$$ g_j(x) = e^{jpx} cos (2 \pi jqx) $$By discretizing $g_j(x)$ we obtain
where
By stacking multiple rows of $\mathbf{g}_j$, we obtain sensitivity matrix, $\mathbf{G}$:
\begin{align} \mathbf{G} = \begin{bmatrix} \mathbf{g}_0\\ \vdots\\ \mathbf{g}_{N-1} \end{bmatrix} \end{align}Here, the size of the matrix $\mathbf{G}$ is $(N \times M)$. Finally data, $\mathbf{d}$, can be written as a linear equation:
$$ \mathbf{d} = \mathbf{G}\mathbf{m}$$where $\mathbf{m}$ is an inversion model; this is a column vector ($M \times 1$).
In real measurments, there will be various noises source, and hence observation, $\mathbf{d}^{obs}$, can be written as
$$ \mathbf{d}^{obs} = \mathbf{G}\mathbf{m} + \mathbf{noise}$$By using the following app, we explore each row vector of the sensitivity matrix, $\mathbf{g}_j$. Parameters of the apps are:
Q1 = app.interact_plot_G()
Failed to display Jupyter Widget of type interactive
.
If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean that the widgets JavaScript is still loading. If this message persists, it likely means that the widgets JavaScript library is either not installed or not enabled. See the Jupyter Widgets Documentation for setup instructions.
If you're reading this message in another frontend (for example, a static rendering on GitHub or NBViewer), it may mean that your frontend doesn't currently support widgets.
By using the kernel function, we can generate synthetic data. At $j$th datum it can be written as
If there are $N$ number of data, these data can be written as a columnvector, $\mathbf{d}$:
\begin{align} \mathbf{d} = \mathbf{G}\mathbf{m} = \begin{bmatrix} d_0\\ \vdots\\ d_{N-1} \end{bmatrix} \end{align}Q2 = app.interact_plot_model()
Failed to display Jupyter Widget of type interactive
.
If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean that the widgets JavaScript is still loading. If this message persists, it likely means that the widgets JavaScript library is either not installed or not enabled. See the Jupyter Widgets Documentation for setup instructions.
If you're reading this message in another frontend (for example, a static rendering on GitHub or NBViewer), it may mean that your frontend doesn't currently support widgets.
In this turn, we consider an opposite problem called inverse problem: converting observed data ($\mathbf{d}^{obs}$) to a model ($\mathbf{m}$). This inverse problem is often formulated as
$$\text{minimize} \ \ \ \phi(\mathbf{m}) = \phi_d(\mathbf{m}) + \beta \phi_m(\mathbf{m}) $$where
Data misfit is defined as
$$ \phi_d = \Sigma_{j=0}^{N-1}\Big(\frac{\mathbf{g}_j\mathbf{m}-d^{obs}_j}{\epsilon_j}\Big)^2$$where uncertainty at $j$th datum, $\epsilon_j$ is:
$$ \epsilon_j = \% |d^{obs}_j| + \text{floor} $$Using Tikhnov-style regularization, model regularization term, $\phi_m$, can be written as
$$ \phi_m(\mathbf{m}) = \alpha_s \int (\mathbf{m}-\mathbf{m}_{ref}) dx + \alpha_x \int (\frac{d \mathbf{m}}{dx}) dx$$The first and second terms are called smallness (or flateness) and smoothness, repectively.
Q3 = app.interact_plot_inversion()
Failed to display Jupyter Widget of type interactive
.
If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean that the widgets JavaScript is still loading. If this message persists, it likely means that the widgets JavaScript library is either not installed or not enabled. See the Jupyter Widgets Documentation for setup instructions.
If you're reading this message in another frontend (for example, a static rendering on GitHub or NBViewer), it may mean that your frontend doesn't currently support widgets.