```python
from geoscilabs.dcip import DCLayers
from IPython.display import display
%matplotlib inline
```


```python
from matplotlib import rcParams
rcParams['font.size'] = 14
```

# Purpose

## Investigating DC Resistivity Data 

Using the widgets contained in this notebook we will explore the physical principals governing DC resistivity including the behavior of currents, electric field, electric potentials in a two layer earth. 

The measured data in a DC experiment are potential differences, we will demonstrate how these  provide information about subsurface physical properties. 

### Background: Computing Apparent Resistivity

In practice we cannot measure the potentials everywhere, we are limited to those locations where we place 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.

# LayeredEarth app

## Parameters:

 - **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)



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


    MyApp(children=(FloatSlider(value=-30.0, continuous_update=False, description='A', max=40.0, min=-40.0, step=1…



```python

```

ca417bde9a8585ff9408f595e54fbbf1c1f67a0e
ipynb
Jupyter Notebook
notebooks/dcip/DC_LayeredEarth.ipynb
jcapriot/geosci-labs
044a73432b9cb1187924f7761942ab329259d875
MIT
2018-08-14T01:38:20.000Z
2022-03-22T01:32:21.000Z
notebooks/dcip/DC_LayeredEarth.ipynb
jcapriot/geosci-labs
044a73432b9cb1187924f7761942ab329259d875
MIT
2018-07-17T01:12:16.000Z
2022-01-20T02:56:00.000Z
notebooks/dcip/DC_LayeredEarth.ipynb
jcapriot/geosci-labs
044a73432b9cb1187924f7761942ab329259d875
MIT
2018-08-28T14:26:50.000Z
2021-11-08T16:19:41.000Z
Qwen/Qwen-72B
1. YES
2. YES