# DC 2 layer foundation

- [**Questions**](https://www.dropbox.com/s/uizpgz3eyt3urim/DC-2-layer-foundation.pdf?dl=0) 

In this notebook, we use widgets to explore the physical principals governing DC resistivity. For a half-space and a 2-layer resistivity model, we will learn about the behavior of the *currents*, *electric fields* and *electric potentials* that are produced when electric currents are injected into the Earth.

In the DC resistivity experiment, we measure the different in electric potential between two locations; also known as a *voltage*. Using these voltage measurements, we can get information about the resistivity of the Earth. Here, be begin to understand how these measurements depend on the electrode locations.



**DC resistivity over a 2 layered Earth**


## Background: Computing Apparent Resistivity

In practice we cannot measure the electric potentials everywhere. We are instead limited to a set of locations where we have placed potential electrodes. For each source (current electrode pair) many potential differences are measured between M and N electrode pairs to characterize the overall distribution of potentials. The widget below allows you to visualize the potentials, electric fields, and current densities from a dipole source in a simple model with 2 layers. For different electrode configurations you can measure the potential differences and see the calculated apparent resistivities. 

In a uniform halfspace the potential differences can be computed by summing up the potentials at each measurement point from the different current sources based on the following equations:

\begin{align}
    V_M = \frac{\rho I}{2 \pi} \left[ \frac{1}{AM} - \frac{1}{MB} \right] \\
    V_N = \frac{\rho I}{2 \pi} \left[ \frac{1}{AN} - \frac{1}{NB} \right] 
\end{align} 
where $AM$, $MB$, $AN$, and $NB$ are the distances between the corresponding electrodes. 

The potential difference $\Delta V_{MN}$ in a dipole-dipole survey can therefore be expressed as follows,

\begin{equation}
    \Delta V_{MN} = V_M - V_N = \rho I \underbrace{\frac{1}{2 \pi} \left[ \frac{1}{AM} - \frac{1}{MB} - \frac{1}{AN} + \frac{1}{NB} \right]}_{G}
\end{equation}

and the resistivity of the halfspace $\rho$ is equal to,

$$
    \rho = \frac{\Delta V_{MN}}{IG}
$$

In this equation $G$ is often referred to as the geometric factor. 

In the case where we are not in a uniform halfspace the above equation is used to compute the apparent resistivity ($\rho_a$) which is the resistivity of the uniform halfspace which best reproduces the measured potential difference.

In the top plot the location of the A electrode is marked by the red +, the B electrode is marked by the blue -, and the M/N potential electrodes are marked by the black dots. The $V_M$ and $V_N$ potentials are printed just above and to the right of the black dots. The calculted apparent resistivity is shown in the grey box to the right. The bottom plot can show the resistivity model, the electric fields (e), potentials, or current densities (j) depending on which toggle button is selected. Some patience may be required for the plots to update after parameters have been changed.

## Import Packages


```python
from utils import DCLayers
from IPython.display import display
%matplotlib inline
from matplotlib import rcParams
rcParams['font.size'] = 14
```

## User Defined Parameters for the App

Below are the parameters that can be changed by the user:

 - **A**: (+) Current electrode location
 - **B**: (-) Current electrode location
 - **M**: (+) Potential electrode location
 - **N**: (-) Potential electrode location
 - **$\rho_1$**: Resistivity of the first layer
 - **$\rho_2$**: Resistivity of the second layer
 - **h**: Thickness of the first layer
 - **Plot**: Choice of 2D plot (Model, Potential, Electric field, Currents)

## Run the App


```python
out = DCLayers.plot_layer_potentials_app()
display(out)
```


    MyApp(children=(ToggleButtons(description='survey', options=('Dipole-Dipole', 'Dipole-Pole', 'Pole-Dipole', 'P…



```python

```

0692e58e79064e76a8c0f862dcf92a7d1b6c7da9
ipynb
Jupyter Notebook
notebooks/DC-2-layer-foundation-app.ipynb
ravisha229/gwb-dc-inversions
1b6133458c9eb83a408b16b7466ca00312310c20
MIT
2020-07-22T09:08:40.000Z
2022-03-01T12:30:00.000Z
notebooks/DC-2-layer-foundation-app.ipynb
ravisha229/gwb-dc-inversions
1b6133458c9eb83a408b16b7466ca00312310c20
MIT
2020-01-31T05:59:13.000Z
2020-05-14T16:19:20.000Z
notebooks/DC-2-layer-foundation-app.ipynb
ravisha229/gwb-dc-inversions
1b6133458c9eb83a408b16b7466ca00312310c20
MIT
2020-02-24T06:04:33.000Z
2021-09-13T16:20:11.000Z
Qwen/Qwen-72B
1. YES
2. YES