<jupyter_start><jupyter_text>Horizontal Current Loop over a Sphere (time domain)<jupyter_code>%pylab inline
from IPython.display import display
from geoscilabs.em.TDEMHorizontalLoopCylWidget import TDEMHorizontalLoopCylWidget
APP = TDEMHorizontalLoopCylWidget()
from matplotlib import rcParams
rcParams['font.size'] = 16<jupyter_output><empty_output><jupyter_text>IntroductionHere, we show the transient fields and fluxes that result from placing a vertical magnetic dipole (VMD) source over an Earth model containing a spherical structure and an overburden layer. The transient response in this case refers to the fields and fluxes that are produced once a long-standing primary magnetic field is removed.There are [two commonly used models](https://em.geosci.xyz/content/maxwell1_fundamentals/dipole_sources_in_homogeneous_media/magnetic_dipole_time/index.html) for describing the VMD source that produces a transient response: 1) as an infinitessimally small bar magnet that experiences a long-standing vertical magnetization which is then instantaneously removed at $t=0$, and 2) as an infinitessimally small horizontal loop of wire carrying a constant current which is then instantaneously shut off at $t=0$ (step-off current waveform).True dipole sources do not exist in nature however they can be approximated in practice. For geophysical applications, we use small current loops to approximate transient VMD sources. These EM sources may be placed on the Earth's surface (ground-based surveys) or flown through the air (airborne surveys). According to the Biot-Savart law, a primary magnetic field is produced whenever there is current in the loop. When the current is shut-off, the sudden change in magnetic flux induces anomalous currents in the Earth which propagate and diffuse over time. The distribution and propagation of the induced currents depends on the subsurface conductivity distribution and how much time has passed since the current in the VMD source was shut off. The induced currents ultimately produce secondary magnetic fields which can be measured by a receiver.In this app, we explore the following:- How do the fields and currents produced by the transient VMD source change over time?- For our geological model, how does changing the dimensions and conductivity of the layer and sphere impact the fields and currents produced by the transient VMD source?- How do the secondary fields measured above the Earth's surface change over time?- For our geological model, how does changing the dimensions and conductivity of the layer and sphere impact secondary fields measured above the Earth's surface?  SetupThe geological scenario being modeled is shown in the figure below. Here, the Earth is comprised of a spherical structure and overburden layer within a homogeneous background. Each of the three geological units has its own conductivity ($\sigma$). However, a constant magnetic susceptibility ($\chi$) is used for all units; where $\mu_0$ is the magnetic permeability of free space and $\mu = \mu_0 (1 +\chi)$. The depth to the layer is given by $d_1$ and $h$.In this case, a transient VMD source (*Tx*) is used to excite the Earth, and the Earth's TEM response (secondary magnetic field) is measured by a receiver (*Rx*). In practice, the transmitter and receiver may be placed near the Earth's surface or in the air. The receiver may also measure secondary fields at a variety of times after the source is shut off.To understand the fields and currents resulting from a transient VMD source we have two apps:- **Fields app:** Models the fields and currents everywhere at a particular time after shutoff- **Data app:** Models the secondary magnetic field observed by the receiver as a function of off-time  Exercise**Follow the exercise in a linear fashion. Some questions may use parameters set in a previous question.**- **Q1:** Set $\sigma_b$, $\sigma_1$ and $\sigma_2$ to arbitrary conductivity values. Based on the geometry of the problem, which components (x, y, z) of each field (E, B, Bsec or J) are zero? Run the *Fields app* and set *AmpDir* to *None*. Next, try different combinations of *Field* and *Comp*. Does the simulation match what you initially thought?- **Q2:** Re-run the *Fields app* to set parameters back to default. Note that $\sigma_b = \sigma_1 = 0.01$ S/m and $\sigma_2 = 1$ S/m. While increasing *time index* starting from 1, answer the following:    1. Does the EM signal propagate faster in the background medium or in the conductor?    2. Does the EM signal diffuse slower in the background medium or in the conductor?- **Q3:** Re-run the *Fields app* to set parameters back to default. Set *Field = J*. While increasing *time index* starting from 1, answer the following:    1. At very early times (*time index* < 3), where is the highest concentration of currents?    2. At late times, where is the highest concentration of currents?- **Q4:** Re-run the *Fields app* to set parameters back to default. Now set the layer conductivity to $\sigma_1 = 1$ S/m. Increase the *time index* starting at 1 and answer the following:    1. Is the EM signal able to effectively penetrate the surface layer? Why/why not?    2. At late time, where is the highest concentration of current density?    3. If the conductivity of the surface layer is high enough, will we be able to see the conductive sphere?- **Q5:** Re-run the *Fields app* to set parameters back to default. Set *Field = B*, *AmpDir = Direction* and *Comp = z*. While increasing *time index* starting from 1, answer the following:    1. At very early times (*time index* < 3), where is the magnetic field the strongest?    2. At late times, where is the magnetic field the strongest?    3. How do your answers for 1 and 2 in Q5 correlate with your answers to 1 and 2 in Q3? (i.e. are the induced current and secondary magnetic fields strongest in the same place?)    4. *BONUS:* What would you expect to happen if the layer conductivity was set to $\sigma_1 = 1$ S/m.  Fields appWe use this app to simulate the fields and currents everywhere due to a transient VMD source. The fields and induced currents depend on time and the subsurface conductivity distribution. You will use the app to change various parameters in the model and see how the fields and currents change. Parameters:- **Update:** If *True* is selected, the simulation is re-run as parameters are being changed. If *False* is selected, the simulation will not be re-fun as parameters are being changed.- **Field:** Type of EM fields ("E": electric field, "B": total magnetic flux density, "dBdt": time-derivative of the magnetic flux density, "J": current density and "Model": conductivity model)- **AmpDir:** If *None* is selected, then the *x*, *y* or *z* component chosen on the next line is plotted. If *Direction* is chosen, a vector plot is plotted (only possible for B and dB/dt)- **Comp.:** If *None* is selected on the previous line, the user chooses whether the *x*, *y* or *z* component is plotted.     - $\boldsymbol{\sigma_0}$: Conductivity above z=0m (leave as 1e-8) in S/m- $\boldsymbol{\sigma_b}$: Background conductivity below z = 0 m in S/m- $\boldsymbol{\sigma_1}$: Conductivity of the layer in S/m- $\boldsymbol{\sigma_2}$: Conductivity of the sphere in S/m- $\boldsymbol{\chi}$: Susceptibility below z = 0 m in SI- $\boldsymbol{d_1}$: Depth to the top of the layer- $\boldsymbol{h_1}$: Thickness of the layer- $\boldsymbol{d_2}$: Depth to the centre of the sphere- $\boldsymbol{R}$: Radius of the sphere- **Scale:** Plot data values on *log-scale* or *linear-scale*- $\boldsymbol{\Delta x}$ (m): Horizontal separation distance between the transmitter and receiver- $\boldsymbol{\Delta z}$ (m): Height of the transmitter and receiver above the Earth's surface- **Time index:** Time index for the set of frequencies models by this app<jupyter_code>Q1 = APP.InteractivePlane_Sphere()
display(Q1)<jupyter_output><empty_output><jupyter_text>Data appUsing this app, we show how the fields observed at the receiver location depend on the parameters set in the previous app. *Note that if you want to see changes in the data due to changes in the model, you MUST* re-run the previous app.  Parameters:- **Field:** Type of EM fields ("E": electric field, "B": magnetic flux density, "dBdt": time-derivative of the magnetic flux density)- **Comp.:** Direction of EM field at Rx locations        - **Scale:** Scale of y-axis values ("log" or "linear")<jupyter_code>Q2 = APP.InteractiveData_Sphere()
display(Q2)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07378777231201687, 'fraction_numerical': 0.007730147575544624, 'mean_word_length': 4.700267022696929, 'pattern_counts': {'":': 8, '<': 15, '<?xml version=': 0, '>': 13, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '537675', 'license': 'MIT', 'n_tokens_mistral': 2211, 'n_tokens_neox': 2072, 'n_words': 1264, 'path': 'notebooks/em/TDEM_HorizontalLoop_Sphere.ipynb', 'repo_name': 'simpeg/geosci-labs', 'size': '8538'}