.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "content/examples/20-published/plot_effective_medium_theory.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_content_examples_20-published_plot_effective_medium_theory.py: Effective Medium Theory Mapping =============================== This example uses Self Consistent Effective Medium Theory to estimate the electrical conductivity of a mixture of two phases of materials. Given the electrical conductivity of each of the phases (:math:`\sigma_0`, :math:`\sigma_1`), the :class:`simpeg.maps.SelfConsistentEffectiveMedium` map takes the concentration of phase-1 (:math:`\phi_1`) and maps this to an electrical conductivity. This mapping is used in chapter 2 of: Heagy, Lindsey J.(2018, in prep) *Electromagnetic methods for imaging subsurface injections.* University of British Columbia :author: `@lheagy `_ .. GENERATED FROM PYTHON SOURCE LINES 20-28 .. code-block:: Python import numpy as np import matplotlib.pyplot as plt from simpeg import maps from matplotlib import rcParams rcParams["font.size"] = 12 .. GENERATED FROM PYTHON SOURCE LINES 29-35 Conductivities --------------- Here we consider a mixture composed of fluid (3 S/m) and conductive particles which we will vary the conductivity of. .. GENERATED FROM PYTHON SOURCE LINES 35-40 .. code-block:: Python sigma_fluid = 3 sigma1 = np.logspace(1, 5, 5) # look at a range of particle conductivities phi = np.linspace(0.0, 1, 1000) # vary the volume of particles .. GENERATED FROM PYTHON SOURCE LINES 41-48 Construct the Mapping --------------------- We set the conductivity of the phase-0 material to the conductivity of the fluid. The mapping will then take a concentration (by volume), of phase-1 material and compute the effective conductivity .. GENERATED FROM PYTHON SOURCE LINES 48-51 .. code-block:: Python scemt = maps.SelfConsistentEffectiveMedium(sigma0=sigma_fluid, sigma1=1) .. GENERATED FROM PYTHON SOURCE LINES 52-58 Loop over a range of particle conductivities -------------------------------------------- We loop over the values defined as `sigma1` and compute the effective conductivity of the mixture for each concentration in the `phi` vector .. GENERATED FROM PYTHON SOURCE LINES 58-65 .. code-block:: Python sige = np.zeros([phi.size, sigma1.size]) for i, s in enumerate(sigma1): scemt.sigma1 = s sige[:, i] = scemt * phi .. rst-class:: sphx-glr-script-out .. code-block:: none /home/vsts/work/1/s/simpeg/maps/_property_maps.py:1456: UserWarning: Maximum number of iterations reached .. GENERATED FROM PYTHON SOURCE LINES 66-73 Plot the effective conductivity ------------------------------- The plot shows the effective conductivity of 5 difference mixtures. In all cases, the conductivity of the fluid, :math:`\sigma_0`, is 3 S/m. The conductivity of the particles is indicated in the legend .. GENERATED FROM PYTHON SOURCE LINES 73-83 .. code-block:: Python fig, ax = plt.subplots(1, 1, figsize=(7, 4), dpi=350) ax.semilogy(phi, sige) ax.grid(which="both", alpha=0.4) ax.legend(["{:1.0e} S/m".format(s) for s in sigma1]) ax.set_xlabel(r"Volume fraction of proppant $\phi$") ax.set_ylabel("Effective conductivity (S/m)") plt.tight_layout() .. image-sg:: /content/examples/20-published/images/sphx_glr_plot_effective_medium_theory_001.png :alt: plot effective medium theory :srcset: /content/examples/20-published/images/sphx_glr_plot_effective_medium_theory_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 2.027 seconds) **Estimated memory usage:** 9 MB .. _sphx_glr_download_content_examples_20-published_plot_effective_medium_theory.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_effective_medium_theory.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_effective_medium_theory.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_