.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/fdomain/dipole_vs_bipole.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_fdomain_dipole_vs_bipole.py: Point dipole vs finite length dipole ==================================== Comparison of the Eₓₓ-fields (in-line electric x-directed field generated by an electric x-directed source) between a - 800 m long bipole source, and a - infinitesimal small (point) dipole source, where the latter is located at the center of the former. A common rule of thumb `¹`_ is that a finite length bipole can be approximated by an infinitesimal small dipole, if the receivers are further away than five times the bipole length. In this case, this would be from 4 km onwards (five times 800 m). -------- _`¹` See, e.g., page 288 of **Spies, B. R., and F. C. Frischknecht**, 1991, *Electromagnetic sounding*: SEG, Investigations in Geophysics, No. 3, 5, 285-425; `DOI 10.1190/1.9781560802686 `_. There it was used to approximate a loop as a magnetic point dipole, but similar approximations are used for finite vs point electric dipoles. .. GENERATED FROM PYTHON SOURCE LINES 28-33 .. code-block:: Python import empymod import numpy as np import matplotlib.pyplot as plt plt.style.use('ggplot') .. GENERATED FROM PYTHON SOURCE LINES 35-37 Define models ------------- .. GENERATED FROM PYTHON SOURCE LINES 37-43 .. code-block:: Python depth = [0, -300, -1000, -1200] # Layer boundaries res_tg = [2e14, 0.3, 1, 50, 1] # Anomaly resistivities res_bg = [2e14, 0.3, 1, 1, 1] # Background resistivities aniso = [1, 1, 1.5, 1.5, 1.5] # Layer anisotropies (same for entire model) .. GENERATED FROM PYTHON SOURCE LINES 44-46 Plot models ~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 46-67 .. code-block:: Python p_depth = np.repeat(np.r_[100, depth, 2*depth[-1]], 2)[1:-1] # Create figure fig, (ax1, ax2) = plt.subplots(1, 2, constrained_layout=True, sharey=True) fig.suptitle("Model", fontsize=16) # Plot Resistivities ax1.semilogx(np.repeat(res_tg, 2), p_depth, 'C0') ax1.semilogx(np.repeat(res_bg, 2), p_depth, 'k') ax1.set_xlim([0.08, 500]) ax1.set_ylim([-1800, 100]) ax1.set_ylabel('Depth (m)') ax1.set_xlabel('Resistivity ρₕ (Ωm)') # Plot anisotropies ax2.plot(np.repeat(aniso, 2), p_depth, 'k') ax2.set_xlim([0, 2]) ax2.set_xlabel('Anisotropy λ (-)') ax2.yaxis.tick_right() .. image-sg:: /gallery/fdomain/images/sphx_glr_dipole_vs_bipole_001.png :alt: Model :srcset: /gallery/fdomain/images/sphx_glr_dipole_vs_bipole_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 68-73 Frequency response for f = 1 Hz ------------------------------- Compute ~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 73-101 .. code-block:: Python # Spatial parameters srcz = -250 # Source depth recz = -300 # Receiver depth recx = np.arange(5, 101)*100 # Receiver offsets in x-direction recy = np.zeros(96) # Receiver offsets in y-direction # General input inpdat = { 'rec': [recx, recy, recz, 0, 0], 'depth': depth, 'freqtime': 1, # 1 Hz 'aniso': aniso, 'htarg': {'pts_per_dec': -1}, # Faster computation 'verb': 2, # Verbosity } # Dipole Source [x, y, z, azm, dip] inpdat['src'] = [0, 0, srcz, 0, 0] dip_tg = empymod.bipole(res=res_tg, **inpdat) dip_bg = empymod.bipole(res=res_bg, **inpdat) # Bipole Source [ x0, x1, y0, y1, z0, z1] inpdat['src'] = [-400, 400, 0, 0, srcz, srcz] inpdat['srcpts'] = 10 # Bipole computed with 10 dipoles bip_tg = empymod.bipole(res=res_tg, **inpdat) bip_bg = empymod.bipole(res=res_bg, **inpdat) .. rst-class:: sphx-glr-script-out .. code-block:: none :: empymod END; runtime = 0:00:15.800870 :: 1 kernel call(s) :: empymod END; runtime = 0:00:00.001235 :: 1 kernel call(s) :: empymod END; runtime = 0:00:00.006054 :: 10 kernel call(s) :: empymod END; runtime = 0:00:00.005451 :: 10 kernel call(s) .. GENERATED FROM PYTHON SOURCE LINES 102-104 Plot ~~~~ .. GENERATED FROM PYTHON SOURCE LINES 104-125 .. code-block:: Python fig, (ax1, ax2) = plt.subplots(2, 1, sharex=True, constrained_layout=True) ax1.set_title("Eₓₓ; f = 1 Hz") # Plot Amplitude ax1.semilogy(recx/1000, dip_bg.amp()) ax1.semilogy(recx/1000, dip_tg.amp()) ax1.semilogy(recx/1000, bip_bg.amp(), '--') ax1.semilogy(recx/1000, bip_tg.amp(), '--') ax1.set_ylabel('Amplitude (V/(Am²))') # Plot Phase ax2.plot(recx/1000, dip_bg.pha(deg=True), label='Dipole: background') ax2.plot(recx/1000, dip_tg.pha(deg=True), label='Dipole: anomaly') ax2.plot(recx/1000, bip_bg.pha(deg=True), '--', label='Bipole: background') ax2.plot(recx/1000, bip_tg.pha(deg=True), '--', label='Bipole: target') ax2.set_xlabel('Offset (km)') ax2.set_ylabel('Phase (°)') ax2.legend(ncols=2, loc='upper center') .. image-sg:: /gallery/fdomain/images/sphx_glr_dipole_vs_bipole_002.png :alt: Eₓₓ; f = 1 Hz :srcset: /gallery/fdomain/images/sphx_glr_dipole_vs_bipole_002.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 126-127 .. code-block:: Python empymod.Report() .. raw:: html
Sat Jan 17 19:14:43 2026 UTC
OS Linux (Ubuntu 22.04) CPU(s) 2 Machine x86_64
Architecture 64bit RAM 7.6 GiB Environment Python
File system ext4
Python 3.11.12 (main, May 6 2025, 10:45:53) [GCC 11.4.0]
numpy 2.3.5 scipy 1.17.0 numba 0.63.1
empymod 2.5.4.dev4+g4866dc83a libdlf 0.3.0 IPython 9.9.0
matplotlib 3.10.8


.. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 16.993 seconds) **Estimated memory usage:** 414 MB .. _sphx_glr_download_gallery_fdomain_dipole_vs_bipole.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: dipole_vs_bipole.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: dipole_vs_bipole.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: dipole_vs_bipole.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_